Fishao

Ask gaming related questions (AHK v1.1 and older)
Trance-Man
Posts: 1
Joined: 16 Dec 2017, 18:23

Fishao

16 Dec 2017, 18:40

Online game: FishAO
Website: http://www.fishao.com

Create automation to move keyboard keys, (left and right arrow keys) depends on which way I need to move left and right keyboard keys to keep my target in the middle of these two images. Once catching a fish... the fish pulls from left to right on screen, I need to move to keep the blue (on top and bottom of image attached) icon/indicator towards the middle.

Some help would be very much appreciated.
Attachments
R.jpg
Edited Image
R.jpg (12.08 KiB) Viewed 791 times
L.jpg
Edited Image
L.jpg (11.96 KiB) Viewed 791 times
Untitled.png
How it looks when catching a fish, blue indicator moves from left to right and vice versa.
Untitled.png (38.08 KiB) Viewed 791 times
TygerByte
Posts: 96
Joined: 12 Aug 2016, 05:22

Re: Fishao

18 Dec 2017, 07:28

I had a similar mini game before, but it was vertical. Speed was always a problem and I could never make it 100% accurate. You can take a look at the code and hopefully you or someone else can provide a better fix.

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
SetBatchLines, -1

; Middle := 464 ; Unused location for the Middle. I just put this here for reference.
x1SearchBox := (1109)
y1SearchBox := (405)
x2SearchBox := (x1SearchBox+0)
y2SearchBox := (y1SearchBox+96)

#MaxThreadsPerHotkey 2
F9::
Toggle := !Toggle
If Toggle = 1
	ToolTip, On
	SetTimer, RemoveToolTip, 5000
While Toggle
{
	PixelSearch, OutputVarX, OutputVarY, %x1SearchBox%, %y1SearchBox%, %x2SearchBox%, %y2SearchBox%, 0xE7E8EB, 22
	If ErrorLevel=0
	{
		If (OutputVarY <= 454)
		{
			Send, {S Down}
			Sleep, 50
			Send, {S Up}
			Sleep, 50
			Send, {S Down}
			Sleep, 50
			Send, {S Up}
			Sleep, 50
			Send, {S Down}
			Sleep, 50
			Send, {S Up}
			Sleep, 50
			Send, {W Down}
			Sleep, 50
			Send, {W Up}
		}
		If (OutputVarY >= 474)
		{
			Send, {W Down}
			Sleep, 50
			Send, {W Up}
			Sleep, 50
			Send, {W Down}
			Sleep, 50
			Send, {W Up}
			Sleep, 50
			Send, {W Down}
			Sleep, 50
			Send, {W Up}
			Sleep, 50
			Send, {S Down}
			Sleep, 50
			Send, {S Up}
	}
	Sleep, 25
}
Return

RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return

F12::Reload

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: Rohwedder and 65 guests