Good day AHKers,
how to make a script like this
If i hold the Z key, it will search and click the desired pixel for example red only near the cursor
pixel searched near cursor
Re: pixel searched near cursor
Adjust as needed.
Code: Select all
#Requires AutoHotkey v2.0
red := 0xFF0000
rgb := 0xFFFFFF
rgb := red
z:: {
Static tolerance := 50
CoordMode 'Pixel'
CoordMode 'Mouse'
MouseGetPos &x1, &y1
If PixelSearch(&x2, &y2, x1 - tolerance, y1 - tolerance, x1 + tolerance, y1 + tolerance, rgb)
MouseClick , x2, y2
}