kjpolker Posted October 28, 2009 Share Posted October 28, 2009 I have a small easy script I threw together in about a half hour and I have a main start button that I performs a list of actions in 11 seconds, I want this lottle list of actions to loop forever until I stop, but after about 3-4 loops I want it to do a special action, than repeat. So here is an example of waht I am looking for: While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button6 WinActivate('[TITLE:Untitled - Notepad]') WinWaitActive('[TITLE:Untitled - Notepad]') Sleep(500) Send("{F1}") Sleep(2000) Send("{F2}") Sleep(2000) Send("{F3}") Sleep(2000) Send("{F4}") Sleep(2000) Send("{F5}") Sleep(2000) EndSwitch WEnd Now I want that script to loop forever until I clsoe program or hit "stop" AND I after it loops 3 times I want it to "Send("{F6}") and than go back to actions until another 3 loops. possible? Hope so! Link to comment Share on other sites More sharing options...
JohnOne Posted October 28, 2009 Share Posted October 28, 2009 Put a "For To Next" loop in your "While" loop 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...
omikron48 Posted October 28, 2009 Share Posted October 28, 2009 $count = 0 While 1 If $count == 3 Then ;action Else $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button6 WinActivate('[TITLE:Untitled - Notepad]') WinWaitActive('[TITLE:Untitled - Notepad]') Sleep(500) Send("{F1}") Sleep(2000) Send("{F2}") Sleep(2000) Send("{F3}") Sleep(2000) Send("{F4}") Sleep(2000) Send("{F5}") Sleep(2000) EndSwitch EndIf $count = Mod($count + 1, 4) WEnd 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