Locates a pixel color code
After locating, it jumps to a random location between a set of coordinates among that pixel color patch and clicks
I am wondering, how do I get it to skip a command if the specified color code is not found on the screen, so that it eventually skips enough commands to where it can get get to a part of the script where proper function can resume.
Currently, although the color code I am searching for will not be on the screen, the mouse will move to the area where the color code should be and click on a coordinate everytime anyways.
Code: Select all
PixelSearch, Px, Py, 12, 356, 510, 36, 0x00FF00, 1, Fast
mousemove %px%, %py%
Random, x, 6, 8
Random, y, -4, -6
MouseMove, %x%, %y%, 0, R
sleep 600
click
random,rand, 5500, 7000
sleep rand
THanks for Your time