jonathan2133 Posted October 18, 2005 Share Posted October 18, 2005 i have the following code: $checksum = PixelChecksum(235, 432, 241, 446) While $checksum = PixelChecksum(235, 432, 241, 446) Sleep(100) WEnd It waits until the pixels in the selected area changes then continues. The problem is im using this for a macro on a website and sometimes the server goes faster or slower than expected, and the pixels it finds to watch to change are already changed. This is not a problem 90% of the time, but that remaining 10% is a pain. How can i make it continue after a set amount of seconds has gone bye? I was thinking somthing along these lines: $a = 100000 $checksum = PixelChecksum(235, 432, 241, 446) While $checksum = PixelChecksum(235, 432, 241, 446) $a = $a - 1 if $a = 1 (this is where i would use goto but its gone... i loved goto and totally object to its removal... but thats a new rant all together) Sleep(100) WEnd I cant use goto and i tried a few other things but it seems the if statment will stop the while statment. How do i get around this? Link to comment Share on other sites More sharing options...
Valuater Posted October 18, 2005 Share Posted October 18, 2005 (edited) Maybe like this $begin = TimerInit() $checksum = PixelChecksum(235, 432, 241, 446) While $checksum = PixelChecksum(235, 432, 241, 446) $dif = TimerDiff($begin) If $dif > 3000 Then ExitLoop Sleep(100) WEnd Note; 1000 = 1 second 8) Edited October 18, 2005 by Valuater 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