Code: Select all
Numpad1::
Pxc1 = 0
Loop {
PixelGetColor, Pxc1, 906, 284, RGB
;if Pxc1% = 0xB0FEFF
if Pxc1 = 0xFF0000
{
Msgbox, 4096, , Pixel is now at the right color
Break
}
}
return
This works. I have used pure red (FF0000) because I think it's a good way to test the script. Your colour is commented out here.
That's how I found out I have to put 'RGB' in the PixelGetColor code. Because if it was BGR (default) my FF0000 would be pure blue.
I also suggest to look at your coordinates for the pixel, because default it's in the Active Window. Use Window Spy or the command MouseGetPos to find your exact x and y.
I don't know why (also a beginner) the MsgBox in your code was only very shortly visible and it dissapeared to the background.
MsgBox option 4096 is to keep it on top.