nishi Posted October 11, 2007 Share Posted October 11, 2007 Hello, I'm new in this forums and with AutoIt I want to create a loop that repeats the same function every 10 minutes, during the existence of a Window and, when the window be closed, stop the loop. ¿This is posible? I tried doing this, but don't work If WinExists("WindowName, """) Then $window = 1 Else $window = 0 EndIf While $window = 1 Sleep(600000) MouseClick("left", 93, 350, 1, 15) WEnd Thanks, and sorry for my bad english. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 11, 2007 Moderators Share Posted October 11, 2007 Start here to learn AutoIt and how to use their functions:http://www.autoitscript.com/forum/index.ph...c=19434&hl=http://www.autoitscript.com/forum/index.php?showtopic=21048 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Nahuel Posted October 11, 2007 Share Posted October 11, 2007 Hello, I'm new in this forums and with AutoIt I want to create a loop that repeats the same function every 10 minutes, during the existence of a Window and, when the window be closed, stop the loop. ¿This is posible? I tried doing this, but don't work If WinExists("WindowName, """) Then $window = 1 Else $window = 0 EndIf While $window = 1 Sleep(600000) MouseClick("left", 93, 350, 1, 15) WEnd Thanks, and sorry for my bad english.You got an infinite loop there. You see, you are not modifying the value of $window inside the loop. Your script could be reduced to this: While WinExists("WindowName") Sleep(600000) MouseClick("left", 93, 350, 1, 15) WEnd Or.. AdlibEnable("_CheckWindow",600000) While 1 Sleep(100) WEnd Func _CheckWindow If WinExists("WindowName") Then MouseClick("left", 93, 350, 1, 15) EndIf WEnd You should totally follow Smoke's advice. Autoit 1-2-3 is awesome. Link to comment Share on other sites More sharing options...
nishi Posted October 11, 2007 Author Share Posted October 11, 2007 Works, thanks a lot for the code and the two links, I go to read it now. Thanks 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