Cypharr Posted January 31 Share Posted January 31 Disclaimer: this is not for a game Global $ASleep ; Declare a variable - to store the random numbers Global $BSleep ; Declare a variable - to store the random numbers A() B() Func A() While 1 ;loop indefinitely $ASleep = Random(4800, 6000,1) ControlSend("","","","z",1) Sleep($ASleep) WEnd EndFunc Func B() While 1 ;loop indefinitely $BSleep = Random(4800, 6000,1) ControlSend("","","","a",1) Sleep($BSleep) WEnd EndFunc Fun B() does nothing I don't know why. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 31 Moderators Share Posted January 31 Cypharr, Quote this is not for a game You get the benefit of the doubt this time. Function A() has in infinite loop from which you never escape - hence no other code is actioned. You need to add some form of escape from that loop - and the same goes for function B(). M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Cypharr Posted January 31 Author Share Posted January 31 I'm trying to learn the language. Due to the rules and regulations of the forum I had to seek a different project to use in the learning process. Thank you for giving me the benefit of the doubt. So do I just put an Exit after the sleep function or an ExitLoop? I'm reading on both Link to comment Share on other sites More sharing options...
Cypharr Posted January 31 Author Share Posted January 31 My BSc Certificate That's my BSc certificate, I studied computer games development that's why my default projects are usually games. However I had to seek alternative so I can learn AutoIt. YouTube is helpful but not quite hands on as I see the forum to be. Link to comment Share on other sites More sharing options...
Solution Cypharr Posted January 31 Author Solution Share Posted January 31 Global $ASleep ; Declare a variable - to store the random numbers Global $BSleep ; Declare a variable - to store the random numbers While 1 ;loop indefinitely A() B() WEnd Func A() $ASleep = Random(4800, 6000,1) ControlSend("","","","z",1) Sleep($ASleep) EndFunc Func B() $BSleep = Random(4800, 6000,1) ControlSend("","","","a",1) Sleep($BSleep) EndFunc I was able to use some tutorials on YT to get this far. Seems to be okay for now until I get better and know of better ways to write the code. 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