Dracconus 0 Posted July 21, 2011 (edited) Okay, so I'll admit that I'm fairly new to autoit, and so far I'm loving it, but I'm trying to get something to work, and it won't. What I'm trying to do is make a script repeat, but ONLY if a button isn't hit. The basic idea of the script is this: F9 activates the script, then it goes through it's functions, and when it's done with the "loop" it loads a sound file and then displays a prompt box. If you hit OK in the prompt box, it wil stop, and if nothing is pressed, after the sound finishes, the script will resume. Can anyone help me with this please. This is my script : expandcollapse popup$CurrentDir = @TempDir & "\" ;~ Include files for the executable IncludeFiles() Global $Pause HotKeySet("{F10}", "Stop") HotKeySet("{F9}", "Function") Func IncludeFiles() ;~ Include music fileInstall("Complete.mp3", @TempDir & "Complete.mp3") EndFunc ;~ Delete temporary files Func Clear() fileDelete(@TempDir & "Complete.mp3") EndFunc While 1 WinWaitActive("Application","") WEnd Func Function() While 1 ;~ Begin start Button Sequence Sleep(Random(1000, 3000, 1)) Sleep(50) Send("{ENTER}") SoundPlay(@TempDir & "Complete.mp3") $iResponse = MsgBox(1, "Complete", "Do you want the script to close?") If $iResponse = 1 Then EndIf Func Stop() EndFunc Wend Else MsgBox(16, "Repeat", "Alright, the script will continue") WEnd and these are my errors. C:\Users\Dracconus\mehfuck.au3(38,1) : ERROR: missing Wend. Func ^ C:\Users\Dracconus\mehfuck.au3(29,2) : REF: missing Wend. While ^ C:\Users\Dracconus\mehfuck.au3(38,1) : ERROR: syntax error Func ^ C:\Users\Dracconus\mehfuck.au3(11,26) : ERROR: Stop(): undefined function. HotKeySet("{F10}", "Stop") ~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\Dracconus\mehfuck.au3 - 3 error(s), 0 warning(s) >Exit code: 2 Time: 0.213 Thanks for any help you can provide PS, the example on the msgbox wiki is confusing as hell Edited July 21, 2011 by Dracconus Share this post Link to post Share on other sites
Dracconus 0 Posted July 21, 2011 Why hasn't this even had any Views? I'm sure it's a simple solution that I'm just looking over...Someone, please help me, I've been up for 4 hours longer than I wanted to be. Share this post Link to post Share on other sites
JohnOne 1,603 Posted July 21, 2011 Why hasn't this even had any Views? I'm sure it's a simple solution that I'm just looking over...Someone, please help me, I've been up for 4 hours longer than I wanted to be.Actually It had been viewed, the forum dosent refresh that value in real time.I had viewed it, and made an example, to show you.I just accidently deleted it, and cant be bothered to do it again.But good luck with your script, and your self importance. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
Dracconus 0 Posted July 21, 2011 (edited) Yes, well judging from the level of sheer ferocity in your little reply that meant absolutely dick as I'd already assumed the refresh value of the forums that didn't really help to state the obvious. I'm also assuming you didn't delete it on "accident." As for my "Sense of self importance" it was nothing like that. It's good to see that you have such a great level of intelligence that you can interpret what I'm thinking through a screen though; that's always nice to have. regardless I just came to an agreement that I would do it another way because I'm tired of reading these half ass written tutorials that are indicative to making things as complicated as possible even for an experienced coder, so I didn't really need your help anyways. And honestly judging from your self proclaiming attitude,I wouldn't want it anyways. Edited July 21, 2011 by Dracconus Share this post Link to post Share on other sites
Xandy 425 Posted July 21, 2011 Wow, that was rough. I instantly became lost as to what the begin end block were intended to be (while, if, func, ect). I don't know enough about what you are trying to do. I recommend always ending your blocks right after you start them. example: you type a while statement you end a while statment right after, to close the block and maintain structure so it goes like this: while wend func endfunc do loop ect... Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Share this post Link to post Share on other sites
Xandy 425 Posted July 21, 2011 what a prick. Can I say that? Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Share this post Link to post Share on other sites
JohnOne 1,603 Posted July 21, 2011 Yes, well judging from the level of sheer ferocity in your little reply that meant absolutely dick as I'd already assumed the refresh value of the forums that didn't really help to state the obvious. I'm also assuming you didn't delete it on "accident." As for my "Sense of self importance" it was nothing like that. It's good to see that you have such a great level of intelligence that you can interpret what I'm thinking through a screen though; that's always nice to have. regardless I just came to an agreement that I would do it another way because I'm tired of reading these half ass written tutorials that are indicative to making things as complicated as possible even for an experienced coder, so I didn't really need your help anyways. And honestly judging from your self proclaiming attitude,I wouldn't want it anyways.You're welcome. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
Dracconus 0 Posted July 21, 2011 The only means of helping me that you performed John boy were the same methods in which I learned all that I know; teaching myself. I appreciate the level of sarcasm you're attempting to show by exaggerating your "epeen" however, I fear that it's in severe vain. As stated, i've solved my problem, and I've got everything working just fine, so no other "assistance" especially from you Farmer John, is necessary. Share this post Link to post Share on other sites
JohnOne 1,603 Posted July 21, 2011 The only means of helping me that you performed John boy were the same methods in which I learned all that I know; teaching myself. I appreciate the level of sarcasm you're attempting to show by exaggerating your "epeen" however, I fear that it's in severe vain.As stated, i've solved my problem, and I've got everything working just fine, so no other "assistance" especially from you Farmer John, is necessary.Great.Everyones a winner then. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
JoHanatCent 13 Posted July 21, 2011 and these are my errors. C:\Users\Dracconus\mehfuck.au3(38,1) : ERROR: missing Wend. Func ^ C:\Users\Dracconus\mehfuck.au3(29,2) : REF: missing Wend. While ^ C:\Users\Dracconus\mehfuck.au3(38,1) : ERROR: syntax error Func ^ C:\Users\Dracconus\mehfuck.au3(11,26) : ERROR: Stop(): undefined function. HotKeySet("{F10}", "Stop") ~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\Dracconus\mehfuck.au3 - 3 error(s), 0 warning(s) >Exit code: 2 Time: 0.213 .... msgbox wiki is confusing as hell Maybe the problem was the file name = " mehfuck " ? Wonder if it goes well with Gracconus? Share this post Link to post Share on other sites
Shaggi 25 Posted July 21, 2011 You have a lot of syntactical errors in your script. You should read up on statement blocks. Also, you cannot define functions inside functions.I would like to help you, but honestly i cant figure out what the script should do Oh, and:Actually It had been viewed, the forum dosent refresh that value in real time.I had viewed it, and made an example, to show you.I just accidently deleted it, and cant be bothered to do it again.But good luck with your script, and your self importance.Idiot. Ever wanted to call functions in another process? ProcessCall UDFConsole stuff: Console UDFC Preprocessor for AutoIt OMG Share this post Link to post Share on other sites
monoscout999 10 Posted July 21, 2011 (edited) I will help you but stop of figth with JhonOne He got my respect and if he asnwer you that way is for something. You should read the Forum Rules and The wiki FAQ before anything, you cannot bump your own thread before 24 hs. Now On-Topic Start from the beggining. Set The Hotkey Set The Function with the Loop Set some functions inside the loop Set the sound set a sleep Create a new GUI with a button and a timer If the timer reach some value then delete the new GUI The loop will continue Or if some button is pressed then set a function for that button outside the loop.. If you don`t understand anything ask for that. I recomend use an easy example for learning how you have to set every things. Sorry my bad english and loose a little of attitude here... If someone thrat you someway bad then ASK why. Edited July 21, 2011 by monoscout999 Share this post Link to post Share on other sites
Bert 1,430 Posted July 22, 2011 Dracconus, You may be best served by taking AutoIt 1 2 3 class. It is located in the Examples section of the forum. The question you are posing is how to do a loop. If you take the class your question will be answered as well as you will gain a better understanding of basic coding. Second, the forum is volunteer based. I can tell you from experience I have posted many things over the years and never got any response at all. In other post I have had hundreds of replies on a thread. What is important to remember is to provide the basic information only and be patient on waiting for a response. Also learn how to use the search feature in the forum. it is extremely likely the question you may be asking has been asked by someone else already and has been answered. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Share this post Link to post Share on other sites