Kurto2021 Posted August 13, 2011 Share Posted August 13, 2011 Hey Melba is there any way to pause is a program other than sleep? I have a program where I have to send a key command to the program at least 1 time per hour or it will time out. If I use sleep then I can't exit out of the program. I was going to use a loop but figured that would overload the CPU. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted August 13, 2011 Share Posted August 13, 2011 Kurto2021 - you shouldn't hijack a thread to ask an unrelated question.. Start a new topic. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Developers Jos Posted August 13, 2011 Developers Share Posted August 13, 2011 topic split. 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. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 13, 2011 Moderators Share Posted August 13, 2011 Kurto2021,You might like to look at AdlibRegister - this will let you run a function after a specified delay and sounds like just what you need: HotKeySet("{ESC}", "On_Exit") ; Press ESC to exit AdlibRegister("Func_1", 1000) ; Run the function every second While 1 Sleep(10) WEnd Func Func_1() ; Write to the SciTE console ConsoleWrite("Adlib running at " & @SEC & @CRLF) EndFunc Func On_Exit() Exit EndFuncBut as you can see you still need a loop to keep the script active - and you still need a Sleep(10) in there to save your CPU! 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...
Kurto2021 Posted August 14, 2011 Author Share Posted August 14, 2011 (edited) Okay maybe I am not getting this but here is what I have. If $duration > 3600000 Then $duration = $duration - 3600000 WinActivate("Sirius XM") Send("{Space}") Else Sleep ($duration) $duration = 0 WinClose("Sirius XM") EndIf Essentially I calculated how many minutes a program is to record...I have to send a space bar ever hour to keep it from timing out. I put in the Adlibregister but I am not sure how to say run it for an hour then exit out of it. Edited August 15, 2011 by Kurto2021 Link to comment Share on other sites More sharing options...
MvGulik Posted August 14, 2011 Share Posted August 14, 2011 Suggest you read the documentation on the AdlibRegister() function, and report back with what you (specifically) don't get about the AdlibRegister() function use. (unless you like to wait for Mel, which might take a while though.) O. And how about starting to use the forum or [autoit] tags to post your code in those nice code boxes. "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
Kurto2021 Posted August 15, 2011 Author Share Posted August 15, 2011 Suggest you read the documentation on the AdlibRegister() function, and report back with what you (specifically) don't get about the AdlibRegister() function use. (unless you like to wait for Mel, which might take a while though.) O. And how about starting to use the forum or [autoit] tags to post your code in those nice code boxes. You don't think I have spent some time reading it? I get into the adlib code but I don't know how to get out of it. Link to comment Share on other sites More sharing options...
MvGulik Posted August 15, 2011 Share Posted August 15, 2011 You don't think I have spent some time reading it?Something like that yes. I get into the adlib code but I don't know how to get out of it.And I still do, as you seem to have missed the item that is listed under the Related section of AdlibRegister. As that item seems directly related to the problem of not knowing how to Stop a Started Adlib process. AdlibRegister() AdlibUnRegister() "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
Kurto2021 Posted August 15, 2011 Author Share Posted August 15, 2011 Something like that yes. And I still do, as you seem to have missed the item that is listed under the Related section of AdlibRegister. As that item seems directly related to the problem of not knowing how to Stop a Started Adlib process. AdlibRegister() AdlibUnRegister() I have unregistered but then the code just hangs.... PS try helping Link to comment Share on other sites More sharing options...
MvGulik Posted August 15, 2011 Share Posted August 15, 2011 I have unregistered but then the code just hangs....And what code might that be ... PS try helpingI'm trying to help you. By trying to get you to post more information, so its less of a trial and error process or guessing game in trying to figure out what it is your missing in your knowledge in relation to coding and AutoIt.(And I do that in my own way. Suggest you wait for Mel, or other forum users, if you don't like my way. And you know what. The moment you start providing more useful information about your problem you seriously increase the change some other forum users will jump in.)So ... Do you like me to make a other suggestion about what you might like to do in your next post. Or do you think you can figure that one out on your own.... And if you still don't know how to post code into code boxes (as so far I have not seen any hints or proof otherwise) ... Consider asking, instead of just ignoring the request.GL. As I think I'm taking a break from you until I see some improvements. "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 15, 2011 Moderators Share Posted August 15, 2011 Kurto2021,I put in the AdlibregisterSo where is your code setting AdlibRegister to run a function? We help you develop your own code, not write it for you. So over to you to show what you have got so far and why you think it does not do what you want. 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...
Kurto2021 Posted August 15, 2011 Author Share Posted August 15, 2011 I was able to get it to work with a simple message box that just says the script is paused. Hit ok to cancel. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 15, 2011 Moderators Share Posted August 15, 2011 Kurto2021, Delighted you got it working to your satisfaction. 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...
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