anyways Posted July 2, 2007 Share Posted July 2, 2007 (edited) A friend told me that this code (below) will let me repeat a script indefinitly. Now he is unavailable, so i was asking myself what should i add to this code so the script repeats itself only 30 times. #Include <Misc.au3> #Include <Date.au3> While Not _IsPressed ( "1B" , 'user32.dll' ) ; My script ConsoleWrite(@CRLF&_Now()) WEnd thanks Edited July 2, 2007 by anyways Link to comment Share on other sites More sharing options...
Toady Posted July 2, 2007 Share Posted July 2, 2007 Look n help file... "For.. Next" www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding Link to comment Share on other sites More sharing options...
anyways Posted July 2, 2007 Author Share Posted July 2, 2007 i read it, didnt help, cant you jsut type in the code? :/ Link to comment Share on other sites More sharing options...
searchresult Posted July 2, 2007 Share Posted July 2, 2007 A friend told me that this code (below) will let me repeat a script indefinitly. Now he is unavailable, so i was asking myself what should i add to this code so the script repeats itself only 30 times. #Include <Misc.au3> #Include <Date.au3> While Not _IsPressed ( "1B" , 'user32.dll' ) ; My script ConsoleWrite(@CRLF&_Now()) WEnd thanks try this #Include <Misc.au3> #Include <Date.au3> For $i = 0 To 30 If Not _IsPressed ( "1B" , 'user32.dll' ) ; My script ConsoleWrite(@CRLF&_Now()) Next Link to comment Share on other sites More sharing options...
anyways Posted July 2, 2007 Author Share Posted July 2, 2007 (edited) cool, lets hope its working ill try with 2 first, for testing and ill let u know Edited July 2, 2007 by anyways Link to comment Share on other sites More sharing options...
Valuater Posted July 2, 2007 Share Posted July 2, 2007 If Not _IsPressed ( "1B" , 'user32.dll' ) .... Then ???? 8) Link to comment Share on other sites More sharing options...
searchresult Posted July 2, 2007 Share Posted July 2, 2007 (edited) If Not _IsPressed ( "1B" , 'user32.dll' ) .... Then ???? 8) you are right i forgot #Include <Misc.au3> #Include <Date.au3> For $i = 0 To 30 If Not _IsPressed ( "1B" , 'user32.dll' ) Then ; My script ConsoleWrite(@CRLF&_Now()) Next Edited July 2, 2007 by searchresult Link to comment Share on other sites More sharing options...
anyways Posted July 2, 2007 Author Share Posted July 2, 2007 (edited) now i am having the error: "next" statement with no matching "for" i am trying your code with the example msgbox that comes with autoit #Include <Misc.au3> #Include <Date.au3> For $i = 0 To 2 If Not _IsPressed ( "1B" , 'user32.dll' ) Then MsgBox(0, "AutoIt Example", "This is line 1" & @CRLF & "This is line 2" & @CRLF & "This is line 3") ConsoleWrite(@CRLF&_Now()) Next Edited July 2, 2007 by anyways Link to comment Share on other sites More sharing options...
searchresult Posted July 2, 2007 Share Posted July 2, 2007 now i am having the error: "next" statement with no matching "for" i am trying your code with the example msgbox that comes with autoit #Include <Misc.au3> #Include <Date.au3> For $i = 0 To 2 If Not _IsPressed ( "1B" , 'user32.dll' ) Then MsgBox(0, "AutoIt Example", "This is line 1" & @CRLF & "This is line 2" & @CRLF & "This is line 3") ConsoleWrite(@CRLF&_Now()) Next you need endif here is working version #Include <Misc.au3> #Include <Date.au3> For $i = 0 To 2 If Not _IsPressed ( "1B" , 'user32.dll' ) Then MsgBox(0, "AutoIt Example", "This is line 1" & @CRLF & "This is line 2" & @CRLF & "This is line 3") ConsoleWrite(@CRLF&_Now()) EndIf Next Link to comment Share on other sites More sharing options...
anyways Posted July 2, 2007 Author Share Posted July 2, 2007 ok, searchresult owns, thanks man Link to comment Share on other sites More sharing options...
Valuater Posted July 2, 2007 Share Posted July 2, 2007 I didn't realize i would also need to indicate an "endif" ... anyways, glad you guys got there 8) Link to comment Share on other sites More sharing options...
Toady Posted July 2, 2007 Share Posted July 2, 2007 i read it, didnt help, cant you jsut type in the code? :/lol www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding 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