Pixel search help
Posted: 01 Jul 2022, 18:12
i have the components for my script, i just don't know how to put it together. All i need to do is when this pixel is on the screen (0x46ED2A) Send D.
Let's help each other out
https://www.autohotkey.com/boards/
https://www.autohotkey.com/boards/viewtopic.php?f=18&t=105982
Code: Select all
#Persistent
bgr := 0x2AED46
CoordMode, Pixel
CoordMode, Mouse
Loop {
SoundBeep, 1900
PixelSearch, x, y, 0, 0, A_ScreenWidth, A_ScreenHeight, %bgr%,, Fast
} Until !ErrorLevel
Send d
MouseMove, x, y
MsgBox, 64, Done, Done!
Edit:briebelle wrote: ↑02 Jul 2022, 10:42Thank for the response! I realize now pixel search is not what im looking for. But thats how you learn. would a loop or WaitPixelColor work for this?
I changed it, it works but not exactly as intended. I would like whenever the desired color comes up to do said action.
;PixelGetColor, OutputVar, X, Y
PixelGetColor,Color,3710,238
If Color=0x826589
{
MsgBox it works
}
Code: Select all
Loop{
PixelGetColor,Color,1135, 1014
If (Color=0x2dAED46){
sleep 500
Send {D}
sleep 10
}
}