hackster Posted May 23, 2007 Share Posted May 23, 2007 I want my simple script to continue running from the beginning when it reaches the end. A never ending loop that keeps cycling thru until I cancel the process. I've searched help for some time but didn't come across what I thought would do this. Is there a command I can put at the end to get it to start over again? Obviously just learning and need a small bit of help. Thanks. #NoTrayIcon sleep(7000) winActivate("blah blah") sleep(5000) MouseClick("right", 850, 550) sleep(120000) Send("s", 1) MouseClick("right", 850, 550) sleep(120000) Send("w", 1) Link to comment Share on other sites More sharing options...
cryn Posted May 23, 2007 Share Posted May 23, 2007 $i = 0 do "your code here" until $i = 1 Link to comment Share on other sites More sharing options...
tAKTelapis Posted May 23, 2007 Share Posted May 23, 2007 Cryn's idea will work you could also go with a While ... WEnd loop #NoTrayIcon ; Set a hotkey to exit: HotKeySet("{ESC}", "Terminate") While 1 ; start the loop sleep(7000) winActivate("blah blah") sleep(5000) MouseClick("right", 850, 550) sleep(120000) Send("s", 1) MouseClick("right", 850, 550) sleep(120000) Send("w", 1) WEnd ; end the loop ; Function that the HotKey calls to: Func _MyExit() exit EndFunc ;==> _MyExit() Cheers /tAK Link to comment Share on other sites More sharing options...
i542 Posted May 24, 2007 Share Posted May 24, 2007 (edited) #NoTrayIcon HotKeySet("{ESC}", "Terminate") $times = InputBox("Times","How many times you want script repeat?","1") If @error then exit For $i = 1 to $times sleep(7000) winActivate("blah blah") sleep(5000) MouseClick("right", 850, 550) sleep(120000) Send("s", 1) MouseClick("right", 850, 550) sleep(120000) Send("w", 1) next Func Terminate() Exit EndFunc Use this for defined times to run the loop. i542 Edited May 24, 2007 by i542 I can do signature me. 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