Pixel Search and Click

Ask gaming related questions (AHK v1.1 and older)
acura
Posts: 2
Joined: 26 Apr 2024, 13:29

Pixel Search and Click

Post by acura » 26 Apr 2024, 14:20

Good Day All,

I'm new in this AHK and want to learn. I want to make a script where if I press Ctrl+R it will start/stop searching for a specific pixel color on a window, it will keep searching until it finds the color and click on it then repeat the process. Is it also possible to press Ctrl+T every 30 seconds while searching for the pixel?

It will be a great help for me to start learning from here and experiment more once i learn how to do my own scrip. :)

Thank you.
acura
Posts: 2
Joined: 26 Apr 2024, 13:29

Re: Pixel Search and Click

Post by acura » 26 Apr 2024, 22:41

I tried this but it\s not doing anything on the selected program :(

Code: Select all

F9::
WinActivate, SMC
Sleep, 333
Loop
{
    CoordMode, Pixel, Window
    PixelSearch, FoundX, FoundY, -16, -16, 1259, 711, 0xA52921, 0, Fast RGB
    If ErrorLevel = 0
    	Click, %FoundX%, %FoundY% Left, 1
}
Until ErrorLevel = 0
If (ErrorLevel = 0)
{
}
Esc::ExitApp

[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]
Post Reply

Return to “Gaming Help (v1)”