Shonnie Posted July 1, 2007 Share Posted July 1, 2007 $coord = PixelSearch(590, 530, 600, 540, 0x948064, 2) If Not @error Then While 1 Sleep(1000) PixelSearch(590, 530, 600, 540, 0x948064, 2) If @error Then ExitLoop EndIf WEnd Else rest of the code.... want this snippet to test for a color (or 2 shade variations) and then exit the loop and continue the code if it doesnt find the color it sleeps for 1 second and then searches for the color again any help? Link to comment Share on other sites More sharing options...
footswitch Posted July 1, 2007 Share Posted July 1, 2007 you can remove the first line. and then a simple modification. The error occurs when no color is found. So the "If" is used in the opposite way. While 1 PixelSearch(590, 530, 600, 540, 0x948064, 2) If @error Then Sleep(1000) Else ExitLoop EndIf WEnd rest of the code.... Link to comment Share on other sites More sharing options...
Shonnie Posted July 1, 2007 Author Share Posted July 1, 2007 HA ! Flawless ! Thanks much Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now