PcExpert Posted March 11, 2006 Share Posted March 11, 2006 (edited) Hello, How can I let the program restart from a point when the script has finished? For example: Your program writes a document in Word and if it has finished with it it starts over, but it only repeats the commands between /1 and /1 Thanks Edited March 11, 2006 by PcExpert Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 11, 2006 Moderators Share Posted March 11, 2006 Hello,How can I let the program restart from a point when the script has finished? For example: Your program writes a document in Word and if it has finished with it it starts over, but it only repeats the commands between /1 and /1ThanksMake it a conditional statement... If something is True Then Do Commands ... If it isn't true then it will just continue the loop. 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...
Lord_Doominik Posted March 11, 2006 Share Posted March 11, 2006 @smoke_n an if-case isn't a loop a loop is sth like while-wend or for-next! @pcexpert for what do you exactly use the loo? there are some loops: - the while-loop, which repeats while it has a special value for example. - the for-loop, which repeats until a special value for a variable has reached - and the do-loop, which conditions are like the one from the for: Do...Until -------------------------------------------------------------------------------- Loop based on an expression. Do statements ... Until <expression> Parameters expression The statements in between Do and Until are executed until the expression is true. Remarks Do...Until statements may be nested. The expression is tested after the loop is executed, so the loop will be executed one or more times.For...Next -------------------------------------------------------------------------------- Loop based on an expression. For <variable> = <start> To <stop> [step <stepval>] statements ... Next Parameters variable The variable used for the count. start The initial numeric value of the variable. stop The final numeric value of the variable. stepval [optional] The numeric value (possibly fractional) that the count is increased by each loop. Default is 1. While...WEnd -------------------------------------------------------------------------------- Loop based on an expression. While <expression> statements ... WEnd Parameters expression If the expression is true the following statements up to the WEnd statement are executed. This loop continues until the expression is false. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 11, 2006 Moderators Share Posted March 11, 2006 @smoke_n an if-case isn't a loop a loop is sth like while-wend or for-next!@pcexpert for what do you exactly use the loo? there are some loops:- the while-loop, which repeats while it has a special value for example.- the for-loop, which repeats until a special value for a variable has reached- and the do-loop, which conditions are like the one from the for:No kidding? Wow... Thanks for the lesson... next time read and try to comprehend it a bit.I said use the If / Then in a loop! 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...
Lord_Doominik Posted March 11, 2006 Share Posted March 11, 2006 yes, but actually his question wasHow can I let the program restart from a point when the script has finished? For example: Your program writes a document in Word and if it has finished with it it starts over, but it only repeats the commands between /1 and /1and this is not answered with saying him he should use a if case... read more carefully the questions and answer then only -.-*. he asks for the loops and not for if cases and wen you say him he could solve it with an ifcase and a loop he couldn't know which loop and how and so on, cause he exactly asks for it...it's the same if you ask "how could i make a gui"and you say you could make an ifcase if the gui should created and create one. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 11, 2006 Moderators Share Posted March 11, 2006 yes, but actually his question wasand this is not answered with saying him he should use a if case... read more carefully the questions and answer then only -.-*. he asks for the loops and not for if cases and wen you say him he could solve it with an ifcase and a loop he couldn't know which loop and how and so on, cause he exactly asks for it...it's the same if you ask "how could i make a gui"and you say you could make an ifcase if the gui should created and create one.Hello,How can I let the program restart from a point when the script has finished? For example: Your program writes a document in Word and if it has finished with it it starts over, but it only repeats the commands between /1 and /1ThanksBUUUUUUUUUUUUUUUUT........ONLY REPEATS SOMETHING SPECIFIC!!!!!IF SITUATION IS TRUE THEN DO SOMETHING / IN THE LOOP!!!!If you have him just putting it in a loop (THAT HE ALREADY HAS!!), then he will REPEAT EVERYTHING!! 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...
Valuater Posted March 11, 2006 Share Posted March 11, 2006 not to create problems... i agree with SmOke 8) Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted March 11, 2006 Share Posted March 11, 2006 (edited) maybe post your script so we can show you so that um smoke doesnt have a heart attack or something Edited March 11, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 11, 2006 Moderators Share Posted March 11, 2006 maybe post your script so we can show you so that um smoke doesnt have a heart attack or something It's not that, and I really want to say what I think of one of the posters, but I'm trying to keep my forum etiquette in tact. 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...
Thatsgreat2345 Posted March 11, 2006 Share Posted March 11, 2006 It's not that, and I really want to say what I think of one of the posters, but I'm trying to keep my forum etiquette in tact. just saying cuz u could just show him up and im pretty sure proving him wrong would shut him up Link to comment Share on other sites More sharing options...
PcExpert Posted March 11, 2006 Author Share Posted March 11, 2006 This is the script: Run("C:\Program Files\Microsoft Office\OFFICE11\POWERPNT.exe") WinWaitActive("Microsoft PowerPoint - [Presentatie1]") MouseClick("left", 61, 34) MouseClick("left", 60, 80) MouseClick("left", 507, 204) MouseClick("left", 360, 222) MouseClick("left", 353, 435) WinWaitActive("Microsoft PowerPoint - [presentatie]") send("{F5}") Sleep(272000) Send("{SPACE}") Send("{SPACE}") Sleep(1000) send("{F5}") Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted March 11, 2006 Share Posted March 11, 2006 which parts do u want to repeat after the script gets to the end? Link to comment Share on other sites More sharing options...
PcExpert Posted March 12, 2006 Author Share Posted March 12, 2006 (edited) The codes between WinWaitActive("Microsoft PowerPoint - [presentatie]") and the last send("{F5}") Edited March 12, 2006 by PcExpert Link to comment Share on other sites More sharing options...
BigDod Posted March 12, 2006 Share Posted March 12, 2006 The codes between WinWaitActive("Microsoft PowerPoint - [presentatie]") and the last send("{F5}")This will loop the part you want Run("C:\Program Files\Microsoft Office\OFFICE\POWERPNT.exe") While 1 WinWaitActive("Microsoft PowerPoint - [Presentatie1]") MouseClick("left", 61, 34) MouseClick("left", 60, 80) MouseClick("left", 507, 204) MouseClick("left", 360, 222) MouseClick("left", 353, 435) WinWaitActive("Microsoft PowerPoint - [Presentatie1]") send("{F5}") Sleep(2000) Send("{SPACE}") Send("{SPACE}") Sleep(1000) send("{F5}") WEnd Remember to put in a hotkey to exit the program or it will loop forever. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
Lord_Doominik Posted March 12, 2006 Share Posted March 12, 2006 BUUUUUUUUUUUUUUUUT........ONLY REPEATS SOMETHING SPECIFIC!!!!!IF SITUATION IS TRUE THEN DO SOMETHING / IN THE LOOP!!!!If you have him just putting it in a loop (THAT HE ALREADY HAS!!), then he will REPEAT EVERYTHING!!lol, he has never said that he only wants to repeat sth specific... don't know where you read that... he just asked for a repeat, not for repeating sth special. don't know why you should use at his script an ifcase... -.- Link to comment Share on other sites More sharing options...
LovinItAll Posted March 12, 2006 Share Posted March 12, 2006 (edited) "Winning an online argument is like winning the special olympics....in the end, you are still retarded" - Anonymous Edited March 12, 2006 by LovinItAll Link to comment Share on other sites More sharing options...
herewasplato Posted March 12, 2006 Share Posted March 12, 2006 lol, he has never said that he only wants to repeat sth specific... don't know where you read that...Yep, it is pretty funny that you and PcExpert understand the same level of grammar. I also interpreted the OP to say that help was needed to construct a conditional statement on the order of an If/Then line or two.Enjoy your - ?victory? - it has won you a special place in hearts of many forum members. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted March 12, 2006 Share Posted March 12, 2006 @lord doomick yeah he said he wanted it to go through once then only repeat part of the script but was this ever solved? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 12, 2006 Moderators Share Posted March 12, 2006 My ebonics must be off if he wants to repeat the entire thing?let the program restart from a point when the script has finished 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...
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