Pixel search help
Pixel search help
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.
Re: Pixel search help
Welcome to this AutoHotkey forum!
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!
- Attachments
-
- BGR 0x2AED46
- 2AED46.png (321 Bytes) Viewed 810 times
Re: Pixel search help
Thank 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
}
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
}
Re: Pixel search help
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
}
I added a loop. it works, but it will not work within the application.
Code: Select all
Loop{
PixelGetColor,Color,1135, 1014
If (Color=0x2dAED46){
sleep 500
Send {D}
sleep 10
}
}
Last edited by BoBo on 02 Jul 2022, 12:07, edited 1 time in total.
Reason: Added [code][/code]-tags.
Reason: Added [code][/code]-tags.
Re: Pixel search help
MouseMove to your coordinate to confirm it. Add sleep before the pixel check. Display the color that is found.
Re: Pixel search help
So the script works as is. but there is one flaw, when i put other inputs, specifically a right click. it will break that cycle of the loop. any suggestions on fix? so far all ive tried is changing the send modes.