BeautifulWar Posted July 25, 2011 Share Posted July 25, 2011 How do you restart a while loop after an adlibregister function activates. The main code activates(infinite loop), however when the adlibregister actives (error check), I need the while code to start from the beginning. So how do i exit the current while loop, and restart it? Link to comment Share on other sites More sharing options...
JohnOne Posted July 25, 2011 Share Posted July 25, 2011 (edited) If $Conditon1 Then While 1 ;stuff If $Condition2 Then ExitLoop EndIf EndIf Edited July 25, 2011 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
BeautifulWar Posted July 25, 2011 Author Share Posted July 25, 2011 (edited) If $Conditon1 ThenWhile 1;stuffIf $Condition2 ThenExitLoopEndIfEndIf Sorry, but that isn't very helpful. I want the adlibregister to restart or exit the loop Edited July 25, 2011 by BeautifulWar Link to comment Share on other sites More sharing options...
smartee Posted July 25, 2011 Share Posted July 25, 2011 Post the code you have so far (regardless of how little it may be) so we can be more helpful, as of now the best advice is that you look in the help-file for ExitLoop and maybe ContinueLoop. Link to comment Share on other sites More sharing options...
JohnOne Posted July 25, 2011 Share Posted July 25, 2011 AdlibRegister("_MyFunc") Global $Condition1 = True While 1 $Timer = TimerInit() If $Condition1 Then ConsoleWrite("Working" & @CRLF) Sleep(2000) EndIf WEnd Func _MyFunc() $Condition1 = Not $Condition1 If $Condition1 Then ConsoleWrite("Sleeping 1000" & @CRLF) EndIf EndFunc You have to add your own logic of course. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
BeautifulWar Posted July 25, 2011 Author Share Posted July 25, 2011 The while loops works perfectly, but after the adlibregister checks for the error, it pauses the loop, i want it to exit it instead of resuming where it left off. AdlibRegister("errorcheck", 1000) Func errorcheck() If $errorcheck1 <> 0 Then Sleep(5000) $start = 0 $errorcheck2 = PixelSearch(350, 305, 690, 500, 0xf5e9a4, 0) If $errorcheck2 <> 0 Then MouseClick("left", 520, 480, 1) $start = 1 EndIf EndIf EndFunc Func runprogram() $guicheck1 = PixelSearch(350, 305, 690, 500, 0xC94336, 0) While $check = 1 While 1 = 1 MouseClick("left", 100, 680, 1) Send($trans) MouseClick("left", 280, 740, 1) WEnd WEnd EndFunc 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