b212 Posted December 25, 2004 Share Posted December 25, 2004 (edited) I want to make advanced loop, example: My simple program in Notepad must write "q" 500 times. But at 100, 200, 300, 400 and 500 time I want to write "b". How make it? Run("notepad.exe") WinWaitActive("Untitled - Notepad") For $i = 1 to 500 send("q"); sleep(2000); Next It must looks like that: qqqq(...)bqqq(...)bqqq(...)bqqq(...)bqqq(...)b Thanks for any help, and sorry about my language ;P Edited December 25, 2004 by b212 Link to comment Share on other sites More sharing options...
Insolence Posted December 25, 2004 Share Posted December 25, 2004 If isInt($i/100) Then send("b") EndIf Basically how that works is if the number is divisible by 100 then it will be true. I think, not sure about the returns and stuff, or even if the math is right (never could remember exactly what order to put it in ) but that's the basics. "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
b212 Posted December 25, 2004 Author Share Posted December 25, 2004 I was tryin that: Run("notepad.exe") WinWaitActive("Bez tytułu - Notatnik") For $i = 1 to 50 send("q "); sleep(200); Next If isInt($i/10) Then send("b") EndIf And script just make 50 times "q"... Link to comment Share on other sites More sharing options...
Insolence Posted December 25, 2004 Share Posted December 25, 2004 100... you're using a 10? "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
Developers Jos Posted December 25, 2004 Developers Share Posted December 25, 2004 Run("notepad.exe") WinWaitActive("Untitled - Notepad") For $y = 1 To 5 For $i = 1 To 100 Send("q"); Sleep(2000); Next Send("b"); Next SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Insolence Posted December 25, 2004 Share Posted December 25, 2004 Ah, that is probably faster. Good call JdeB "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. 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