Jmjl Posted August 15, 2004 Share Posted August 15, 2004 I'm trying to make a program that when I click it waits 1 minute and 40 seconds, and then clicks two (2) things and then repeats that over and over. How can I have this loop work? Link to comment Share on other sites More sharing options...
pekster Posted August 15, 2004 Share Posted August 15, 2004 Have a look at:While and WEndSleep()HotKeySet() (to provide a nice way to exit, see also FAQ #12)ControlClick()MouseClick()That should get you started. [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
Jmjl Posted August 15, 2004 Author Share Posted August 15, 2004 I don't understand how to ake it loop though. Link to comment Share on other sites More sharing options...
pekster Posted August 15, 2004 Share Posted August 15, 2004 I don't understand how to ake it loop though. <{POST_SNAPBACK}>There are several examples in the helpfile... Since I'm feeling a little bit on the nice side, how about I give you some links to the online documentation. I don't suppose you tried a search for the word "loop" in the helpfile? Kinda handy how a lot of this same stuff pops up Loop Statements from the Language Reference section of the helpfileFAQ #4 showing an endless loop syntax [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
JuggaloZeke Posted August 16, 2004 Share Posted August 16, 2004 While 1 ;Commands you want loops WEnd Link to comment Share on other sites More sharing options...
Nutster Posted August 18, 2004 Share Posted August 18, 2004 Another way of looking at this is to use an AdLib function with the timer set for 100 seconds. Put a sleep for several seconds inside a loop. Take a look in the documentation index for AbLib. David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd... Link to comment Share on other sites More sharing options...
SlimShady Posted August 18, 2004 Share Posted August 18, 2004 (edited) Another way of looking at this is to use an AdLib function with the timer set for 100 seconds. Put a sleep for several seconds inside a loop. Take a look in the documentation index for AbLib. <{POST_SNAPBACK}>A question: When you have an AdLib func' running... And the function it runs contains a sleep command that pauses longer than the interval AdLib repeats the function... What happens? Edited August 18, 2004 by SlimShady Link to comment Share on other sites More sharing options...
Developers Jos Posted August 18, 2004 Developers Share Posted August 18, 2004 A question: When you have an AdLib func' running... And the function it runs contains a sleep command that pauses longer than the interval AdLib repeats the function... What happens? <{POST_SNAPBACK}>The adlib function will be called during the sleep... just try to demo it: $A = 1 AdlibEnable("test") sleep(10000) Exit Func Test() SplashTextOn("test",$a) $a=$a+1 EndFunc 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...
pekster Posted August 18, 2004 Share Posted August 18, 2004 A question: When you have an AdLib func' running... And the function it runs contains a sleep command that pauses longer than the interval AdLib repeats the function... What happens? <{POST_SNAPBACK}>I created a test script to find out. It would seem that the AdLib function is allowed to complete itself without interruption, but that it does not allow the code where it left to run the adlib anymore. In effect, you will create an endless loop of the AdLib function. I can't think of why you would want this effect, but I suppose someone might find an interesting way to use it. The code: MsgBox(64, "Text Script", "To exit the test, please press alt-q") HotKeySet("!q", "quit") AdLibEnable("function", 4000) Global $executed_main = 0 While 1 $executed_main = 1 ToolTip("main loop text", 0, 0) Sleep(1000) WEnd Func Quit() Exit EndFunc Func function() If $executed_main = 1 Then ToolTip("Running AdLib from main loop code", 0, 0) Sleep(1000) EndIf $executed_main = 0 For $i = 1 To 6 ToolTip("AdLib tooltip number " & $i, 0, 0) Sleep(1000) Next EndFunc [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
pekster Posted August 18, 2004 Share Posted August 18, 2004 The adlib function will be called during the sleep... just try to demo it: ... <{POST_SNAPBACK}>I think his question was regarding the AdLib itself. See my example above for what I think he was refering to. [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. 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