hck7h60vrmn72 Posted June 2, 2010 Share Posted June 2, 2010 (edited) hello, I'm new to autoit and I need your help. I have a script that waits for a red button to become blue, then clicks it. Do Sleep(1000) Until PixelGetColor(491, 425) = 0x1871A5 but sometimes the webpage freezes and I'd like to add a func that counts time and if the button does not becomes red in like 60 seconds, it reloads the page, clicks some menus to get to the button and starts watching it again. goto would be perfect, maybe I need to use switch and case funcs? Edited June 2, 2010 by hck7h60vrmn72 Link to comment Share on other sites More sharing options...
403forbidden Posted June 2, 2010 Share Posted June 2, 2010 (edited) hello, I'm new to autoit and I need your help. I have a script that waits for a red button to become blue, then clicks it. Do Sleep(1000) Until PixelGetColor(491, 425) = 0x1871A5 but sometimes the webpage freezes and I'd like to add a func that counts time and if the button does not becomes red in like 60 seconds, it reloads the page, clicks some menus to get to the button and starts watching it again. goto would be perfect, maybe I need to use switch and case funcs? Do something like this. Global $Seconds = 0 Do Sleep(1000) $Seconds += 1 If $Seconds >= 60 Then DoWhateverToGetItGoingAgain $Seconds = 0 Endif Until PixelGetColor(491, 425) = 0x1871A5 If I'm understanding you correctly, that should work. Edited June 2, 2010 by 403forbidden Link to comment Share on other sites More sharing options...
hck7h60vrmn72 Posted June 2, 2010 Author Share Posted June 2, 2010 thanks a lot I will workaround the issue of relaunching script by installing an old version of autoit, where the "goto" is available. By now I can't imagine a better way. Link to comment Share on other sites More sharing options...
GEOSoft Posted June 2, 2010 Share Posted June 2, 2010 GoTo went with the dinosuar age. Just create what you want in a function and then call that function as often as you have to. Similar to using the old GoSub, from the same era as GoTo. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
hck7h60vrmn72 Posted June 2, 2010 Author Share Posted June 2, 2010 GoTo went with the dinosuar age. Just create what you want in a function and then call that function as often as you have to. Similar to using the old GoSub, from the same era as GoTo.i'll try this. thanks 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