l00pDR Posted March 26, 2021 Posted March 26, 2021 Hi guys i was wondering what is the best approach to make it so that after the loop has played between 50 and 100 times it sends an other key with randomized interval without interupting the current loop. this is my current script: Local $Paused HotKeySet("{=}", "TogglePause") While 1 Sleep(Random(90000, 100000)) Send("{o}") WEnd Func TogglePause() $Paused = NOT $Paused While $Paused ; WEnd EndFunc
Nine Posted March 26, 2021 Posted March 26, 2021 What application are you trying to automate this way ? Seems to me that it is for a game, right ? Please read forum rules first, so you know it is not allowed to discuss such matter here. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
l00pDR Posted March 27, 2021 Author Posted March 27, 2021 9 hours ago, Nine said: What application are you trying to automate this way ? Seems to me that it is for a game, right ? Please read forum rules first, so you know it is not allowed to discuss such matter here. its just a random example for me to understand functions🤕
argumentum Posted March 27, 2021 Posted March 27, 2021 you can also use the given examples ( https://www.autoitscript.com/autoit3/docs/functions/HotKeySet.htm ) Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
Developers Jos Posted March 27, 2021 Developers Posted March 27, 2021 6 hours ago, l00pDR said: ts just a random example for me to understand functions🤕 Je meent het... 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.
l00pDR Posted March 27, 2021 Author Posted March 27, 2021 6 hours ago, Jos said: Je meent het... ik meen het🙂 I've looked into case and make it a count between 1 and 50 but it doesnt work the way i wanted. And when counting in a while loop i couldnt get a second loop to merge with the first one I was just wondering if its possible in any way to make a loop run x(random) ammount of times between a fixed ammount and when the random number is met perform a single action and repeat the loop.
Developers Jos Posted March 27, 2021 Developers Posted March 27, 2021 1 minute ago, l00pDR said: ik meen het🙂 Not really as... 1 minute ago, l00pDR said: I've looked into case and make it a count between 1 and 50 but it doesn't work the way i wanted. This is an pretty specific statement so you do have an fixed goal here..... so care to share what it really is? 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.
l00pDR Posted March 28, 2021 Author Posted March 28, 2021 20 hours ago, Jos said: Not really as... This is an pretty specific statement so you do have an fixed goal here..... so care to share what it really is? When im done filling a form i must wait a minute for filling the next, but it becomes rather tethious after a while so i need a second different sound to play after a random amount of times the first sound played so i can decide to stop or continue for the day
Nine Posted March 28, 2021 Posted March 28, 2021 Can you show an image of the form you are filling ? While you are there, use Au3Info.exe tool on element of the form to see if we can get Control IDs from the application. Show the result of the tool here. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Developers Jos Posted March 28, 2021 Developers Posted March 28, 2021 6 hours ago, l00pDR said: When im done filling a form i must wait a minute for filling the next, but it becomes rather tethious after a while so i need a second different sound to play after a random amount of times the first sound played so i can decide to stop or continue for the day ... so as expected we went from "just a random example" to an real life automation challenge but you insist to remain vague and still want support without any real details. Sorry to be so hars here, but simply be clear about what you want, with a clear definition of what you want that isn't working or else just don't bother posting. ( Ik hou graag van duidelijkheid ) Jos 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.
l00pDR Posted March 29, 2021 Author Posted March 29, 2021 (edited) On 3/28/2021 at 9:21 PM, Jos said: ... so as expected we went from "just a random example" to an real life automation challenge but you insist to remain vague and still want support without any real details. Sorry to be so hars here, but simply be clear about what you want, with a clear definition of what you want that isn't working or else just don't bother posting. ( Ik hou graag van duidelijkheid ) Jos i dont know why this doesnt work: $xR = Random(50, 100, 1) $xN = 0 Do Sleep(Random(90000, 100000)) Send("{o}") $xN += 1 Until $xN = $xR Also im sorry if i'm being unclear i'm not that good with words😊 Edited March 30, 2021 by l00pDR
Nine Posted March 29, 2021 Posted March 29, 2021 You did not provide what I asked you in my previous post. Please answer to the requested info if you want help “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
l00pDR Posted March 30, 2021 Author Posted March 30, 2021 19 hours ago, Nine said: You did not provide what I asked you in my previous post. Please answer to the requested info if you want help Are you trying to hook the script into the aplication?
Nine Posted March 30, 2021 Posted March 30, 2021 Nope. Need to see the form with the info tool on its elements. Wonder why you refuse to provide this information. It is the third time I ask you the same, hope this is the last... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Moderators Melba23 Posted March 30, 2021 Moderators Posted March 30, 2021 100pDR, OK, enough of this pussy-footing around. if you want help we want to see an image of this form and the text of what the Au3Info tool tells you about it. No image and info = no help. I hope I making myself quite clear here. M23 P.S. And just to be absolutely clear - this is the Mod team determining the legality of the thread, so everyone else please keep out. 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
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