Hello! I am using PixelSearch in conjunction with MouseClick to click a color. Here is my garbage code:
Code: Select all
outer:
Loop
{
Loop
{
PixelSearch, x, y, 105, 25, 2000, 400, 0x4BB8F0, 2, Fast
If ErrorLevel
break
else
MouseClick, L, %x%, %y%
MouseClick, L, 755, 450
Sleep, 5
}
Loop
{
PixelSearch, x, y, 100, 100, 9999, 9999, 0x255C78, 2, Fast
If ErrorLevel
break
else
continue_outer:
Sleep, 50
}
Loop
{
PixelSearch, x, y, 1063, 327, 9999, 9999, 0x0D8D0D, 2, Fast
If ErrorLevel
break
else
MouseClick, L, %x%, %y%
Sleep, 50
}
Loop
{
PixelSearch, x, y, 1110, 387, 9999, 9999, 0x00FF00, 3, Fast
If ErrorLevel
break
else
MouseClick, L, %x%, %y%
Sleep, 50
}
}
;
$Enter::
ExitApp
return
If you look at the first PixelSearch - 0x4BB8F0. It just doesn't work. Like, it returns a value and breaks the loop. But the color is on the screen, and in the search area. I am 100% certain. All of the other ones work, (well, I haven't tested 0x255C78 and it is in the same area, so it may fall to the same issue). Please help!