anyways Posted July 2, 2007 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
Toady Posted July 2, 2007 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
anyways Posted July 2, 2007 Author Posted July 2, 2007 i read it, didnt help, cant you jsut type in the code? :/
searchresult Posted July 2, 2007 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
anyways Posted July 2, 2007 Author 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
Valuater Posted July 2, 2007 Posted July 2, 2007 If Not _IsPressed ( "1B" , 'user32.dll' ) .... Then ???? 8)
searchresult Posted July 2, 2007 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
anyways Posted July 2, 2007 Author 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
searchresult Posted July 2, 2007 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
Valuater Posted July 2, 2007 Posted July 2, 2007 I didn't realize i would also need to indicate an "endif" ... anyways, glad you guys got there 8)
Toady Posted July 2, 2007 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
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