yogesh87 Posted August 18, 2013 Share Posted August 18, 2013 (edited) Hi All I am very new to autoit programming started my script just today, i have successfully created a program of my own with the help n forums, it works perfectly fine But i want to repeat the operation after 3 hrs for which i will use sleep but while it is sleeping i want it to switch to other operations, i am not finding a script for this please help me with this Sorry for my bad english Regards, Yogesh PS: srry if i posted in wrong section feel free to move the thread n leave a reply so that i can post my question there Edited August 18, 2013 by yogesh87 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 18, 2013 Moderators Share Posted August 18, 2013 (edited) yogesh87,Welcome to the AutoIt forum. As you have discovered, Sleep pauses the script completely. I suggest you look at TimerInit/TimerDiff in the Help file - using them will allow your script stay active and still react after the correct time period. Give it a go yourself - you know where we are if you run into difficulties. M23P.S. And I moved your thread into the correct place. Edited August 18, 2013 by Melba23 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...
yogesh87 Posted August 18, 2013 Author Share Posted August 18, 2013 Thx for the fast reply i actually dont get how it works, can you please explain how it works would also like to know how i could incorporate internet explorer to my program so that i can run my program even if it is minimized and is there is a command where I could pause the script and resume it where it was paused srry if i asked too many questions, since i am new have lots of doubts will try to find answers myself or post here Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 18, 2013 Moderators Share Posted August 18, 2013 yogesh87,This should explain how to use TimerInit/TimerDiff: #include <GUIConstantsEx.au3> #include <Constants.au3> $hGUI = GUICreate("Test", 500, 500) $cButton = GUICtrlCreateButton("Test", 10, 10, 80, 30) GUISetState() ; Run the timed function _Timed_Function() ; Get a timestamp $nBegin = TimerInit() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cButton ; The button will still be active while you wait MsgBox($MB_SYSTEMMODAL, "Hello", "I work all the time!") EndSwitch ; Check the timestamp and see if the required time has elapsed If TimerDiff($nBegin) > 1000 * 10 Then ; This is a 10 sec delay ; Run the timed function _Timed_Function() ; Reset the timestamp $nBegin = TimerInit() EndIf WEnd Func _Timed_Function() MsgBox($MB_SYSTEMMODAL, "Hi!", "Timed function") EndFuncAs for your other questions: - 1. Look at the IE Management functions in the Help file - they let you control IE from your script. - 2. Pause and Resume - this has been asked (and answered) many, many times on the forum. Use the Search facilty at top right and you will soon see how it is done. 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