Simple Loop with Colour

Ask gaming related questions (AHK v1.1 and older)
Seandyt
Posts: 2
Joined: 19 Jun 2021, 15:41

Simple Loop with Colour

19 Jun 2021, 15:52

Hi,

i just stumble on this AHK and love the idea of it..i have 0 programing skill so its a bit dificult for me to write the code.

i need help with simple logic:

If area on my computer(mouse cursor) x, y is not green 0x36E182 > left click mouse > then if colour green 0x36E182 show > left click mouse > wait 2 sec > loop from start

anyone can help ?
User avatar
mikeyww
Posts: 26882
Joined: 09 Sep 2014, 18:38

Re: Simple Loop with Colour

19 Jun 2021, 16:06

This is a bit confusing. If the color is not green, then how will it then be green immediately after that?
Seandyt
Posts: 2
Joined: 19 Jun 2021, 15:41

Re: Simple Loop with Colour

19 Jun 2021, 16:15

so its for fishing thing, i need to click some "area" on the screen to throw the fishing rod...and wait until the click same "area" to turn green to click again immediately
User avatar
mikeyww
Posts: 26882
Joined: 09 Sep 2014, 18:38

Re: Simple Loop with Colour

19 Jun 2021, 18:24

Possibly something like this.

Code: Select all

target := "0x82E136", on := False
F3::SetTimer, Check
Check:
MouseGetPos, x, y
PixelGetColor, color, x, y
ToolTip, %on% %color%
If (on ^ (color = target))
 Return
Click
SoundBeep, 1000 + 500 * on
Sleep, 1750 * on
on := !on
Return

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 94 guests