jusefarabi Posted November 2, 2005 Share Posted November 2, 2005 Hi, i was wondering if, and if yes, How i would go about creating a loop with multiple functions? While 1 MouseClick ("left") AutoitSetOption ("MouseClickDelay" , 4500) Wend But add something like this into it while not interferring with the Mouseclick Loop Send ("F1") Opt("SendKeyDelay" , 36000000) So that the F1 key will be pressed at 45 minute intervals, while the Left Mouse clicking will continue to function without any interferrence. At first ive tried to combine the Send command into the While 1 Wend brackets, but that made the script not function anymore, i believe it is because the script pauses for 45 minutes while waiting to press the F1 key beofre continuing with the rest of the script. What i am aiming to do is create a script with multiple functions inside loops, so that the Mouse will continue to click at 4500 millisecond intervals, and the F1 keystroke will be sent at 45 minute intervals and loop these functions forever, using the While 1 loop brackets. Thank you for any and all help. I just want to apologize for my obvious and blatantly covered questions, the Autoit Help file doesnt really tell me much, it just gives me an example and the variables and a few other pieces of knowledge that dont explain to me the proper function and scripting sequences for the direction i am aiming to get. I dont mean to sound like a whiner, but its true, Im just a complete novice at AutoIt, and the Help file explains things to me as if i were a completely informed intermediate user. Im sure i skipped over some parts in the beginning, novices usually do that(true story), but if anyone knows a website ora section in the help file that explains scripting and proper script sequencing in a user friendly step by step guide, that would be great. Thanks again. Hope to hear from you. Link to comment Share on other sites More sharing options...
Nuffilein805 Posted November 2, 2005 Share Posted November 2, 2005 $a = 0 while 1 $a = $a + 1 mouseclick ("left") sleep (4500) if $a = 600 then send ("{f1}") $a = 0 endif wend send your click every 4.5 secs and the f1 every 45 min my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
LxP Posted November 3, 2005 Share Posted November 3, 2005 I like Nuffilein's approach -- much cleaner than the approach that I was going to take with TimerInit() and TimerDiff().Here's a small improvement on Nuffilein's idea (hopefully the logic is a bit clearer):; Declare your variables! Local $I ; Loop indefinitely While 1 Send('{F1}') ; Loop 600 times (45m ÷ 4.5s = 600) For $I = 1 To 600 MouseClick('Left') ; Pause for 4.5s Sleep(4.5 * 1000) Next WEnd Link to comment Share on other sites More sharing options...
jusefarabi Posted November 3, 2005 Author Share Posted November 3, 2005 Thank you for your quick responses, Nuffilein and LxP. Just a quick follow up question. Do all keystrokes have to be contained into quotes like {} in order for them to be recognized. And also, does Nuffileins version loop indefinetly, or does LxP's only loop in definetly. Also, Local $I What is this value? Link to comment Share on other sites More sharing options...
LxP Posted November 3, 2005 Share Posted November 3, 2005 (edited) Certain keystrokes need to be surrounded by braces to be recognised. They are listed in the help file under Send(). All other keys can be written as normal.Both scripts loop indefinitely, so that's not a problem.Local $I simply says 'I intend to use a variable called $I somewhere'. It's not necessary to do (Nuffilein does not do it for his/her $a) but it's very good programming practice to declare your variables. Edited November 3, 2005 by LxP Link to comment Share on other sites More sharing options...
jusefarabi Posted November 3, 2005 Author Share Posted November 3, 2005 Thank you for clarifying that for me. I appreciate all the help. I will read the help file some more before returning to ask questions. Thanks again. Link to comment Share on other sites More sharing options...
Nuffilein805 Posted November 3, 2005 Share Posted November 3, 2005 i'm just way too lazy to declare my variables in such a short script (well, in the big 1s i don't do it either ) thx lxp, i'm glad you like my little script my little chatmy little encryption toolmy little hidermy unsafe clickbot 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