I am trying to setup up a auto clicker that basically click on a green square when ever it appears

Ask gaming related questions (AHK v1.1 and older)
Memestealer1
Posts: 3
Joined: 17 Apr 2021, 09:27

I am trying to setup up a auto clicker that basically click on a green square when ever it appears

Post by Memestealer1 » 17 Apr 2021, 09:36

I am trying to setup up a auto clicker that basically click on a green square when ever it appears.

Like in this image, I want to click the dark green box. It will appear anywhere in the grid at any random time.

https://imgur.com/vFJUgRX

I also want the option to make the grid bigger or smaller and change the color.
Attachments
image.png
image.png (8.87 KiB) Viewed 492 times

Memestealer1
Posts: 3
Joined: 17 Apr 2021, 09:27

Re: I am trying to setup up a auto clicker that basically click on a green square when ever it appears

Post by Memestealer1 » 17 Apr 2021, 09:59

I found this script but it isnt working can anyone help me modify it.

Code: Select all

#MaxThreadsPerHotkey 2
F2:: ; Change this to any hotkey you prefer
Toggle := !Toggle
Loop {
PixelSearch, X, Y, 0, 0, A_ScreenWidth, A_ScreenHeight, 0x7A70F1 , , Fast
If ErrorLevel {

}
else {
MouseMove, %X%, %y%
Click, left 
}
Sleep 100 ; Less sleep = do more often. More sleep = do less often. edit this to any value you prefer
If not Toggle 
	break
}
return

^esc:: ExitApp ; Change this to any hotkey you prefer
[Mod edit: [code][/code] tags added.]


User avatar
mikeyww
Posts: 26944
Joined: 09 Sep 2014, 18:38

Re: I am trying to setup up a auto clicker that basically click on a green square when ever it appears

Post by mikeyww » 18 Apr 2021, 05:55

Here is a way to get started.

Code: Select all

#MaxThreadsPerHotkey 2
F2::
CoordMode, Pixel
CoordMode, Mouse
on := !on
While on {
 Sleep, 500
 PixelSearch, x, y, 0, 0, A_ScreenWidth, A_ScreenHeight, 0x4F7A29,, Fast ; Blue, green, red
 If !ErrorLevel & on
  MouseClick,, x, y
}
Return

Post Reply

Return to “Gaming Help (v1)”