continyu Posted July 2, 2010 Share Posted July 2, 2010 Hi there, it's me again I have this problem since i started autoit. It is kind of general problem of mine. But at this script i have to solve this problem. I'm using For-to-step-next function for countdown... but i want to stop of pause the countdown i must wait the function to finish countdown. So it's meanless... I can't find the solution. Waiting for help expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <IE.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <file.au3> #RequireAdmin #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= Opt("TrayMenuMode",1) Opt("GUIOnEventMode", 1) Global $sTitle = " DiskSakla - by Kontinyu" Global $sWidth = 312 Global $sHeight = 392 Global $sX = Default Global $sY = Default $SteamWin = GUICreate($sTitle, $sWidth, $sHeight, $sX, $sY , $WS_SYSMENU + $WS_POPUP) GUISetBkColor(0x464646) $Bar = GUICtrlCreateLabel($sTitle , 0 , 0 , $sWidth -18, 18 , $SS_NOTIFY , $GUI_WS_EX_PARENTDRAG) GUICtrlSetFont(-1, 10, 400, 0, "Arial") GUICtrlSetColor(-1, 0xD8DED3) GUICtrlSetBkColor(-1, 0x5A6A50) $Exit = GUICtrlCreateLabel("X" , $sWidth -18 , 0 , 18 , 18 , $SS_CENTER) GUICtrlSetFont(-1, 10, 800, 0, "Arial Black") GUICtrlSetColor(-1, 0xD8DED3) GUICtrlSetBkColor(-1, 0x5A6A50) GUISetOnEvent($GUI_EVENT_CLOSE, "Ex") GUICtrlSetOnEvent($Exit,"Ex") $Label1 = GUICtrlCreateLabel("GeriSay!", 4, 32, 292, 25) GUICtrlSetFont(-1, 11, 400, 0, "Arial Black") $Label2 = GUICtrlCreateLabel("İşlem;", 10, 129, 250, 17) $Input1 = GUICtrlCreateInput("Saat", 40, 88, 68, 25) $updown1 = GUICtrlCreateUpdown($Input1) $Label3 = GUICtrlCreateLabel("GeriSay:", 8, 64, 44, 17) $Label4 = GUICtrlCreateLabel("Saat:", 8, 93, 29, 17) $Label5 = GUICtrlCreateLabel("Dakika:", 112, 93, 41, 17) $Input2 = GUICtrlCreateInput("Dakika", 160, 88, 68, 25) $updown2 = GUICtrlCreateUpdown($Input2) $Radio1 = GUICtrlCreateRadio("Oturmu Kapat", 16, 160, 113, 17) $Radio2 = GUICtrlCreateRadio("Bilgisayarı Kapat", 16, 184, 113, 17) $Radio3 = GUICtrlCreateRadio("Yeniden Başlat", 16, 208, 113, 17) $Radio4 = GUICtrlCreateRadio("Uyku Moduna Al", 16, 232, 113, 17) $Radio5 = GUICtrlCreateRadio("Hazırda Beklet", 16, 256, 113, 17) $Checkbox1 = GUICtrlCreateCheckbox("Zorla !", 16, 288, 97, 17) $Button1 = GUICtrlCreateButton("Başlat", 100, 320, 68, 25, $WS_GROUP) GUICtrlSetOnEvent($Button1, "Start") $Button3 = GUICtrlCreateButton("Çıkış", 238, 320, 68, 25, $WS_GROUP) GUICtrlSetOnEvent($Button3, "Stop") HotKeySet("{ESC}","Ex") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd Func Ex() Exit EndFunc Func Start() $hour = GUICtrlRead($Input1) $min = GUICtrlRead($Input2) $second1 = $min*60 $second2 = $hour*3600 Global $time = $second1+$second2 $logoff = GUICtrlRead($Radio1) $shutdown = GUICtrlRead($Radio2) $reboot = GUICtrlRead($Radio3) $standby = GUICtrlRead($Radio4) $hibernate = GUICtrlRead($Radio5) $force = GUICtrlRead($Checkbox1) For $time = $second1+$second2 to 0 Step -1 Sleep(1000) Next If $logoff = 1 Then If $force = 1 Then Shutdown(20) Else Shutdown(0) EndIf EndIf If $shutdown = 1 Then If $force = 1 Then Shutdown(21) Else Shutdown(1) EndIf EndIf If $reboot = 1 Then If $force = 1 Then Shutdown(22) Else Shutdown(2) EndIf EndIf If $standby = 1 Then If $force = 1 Then Shutdown(32) Else Shutdown(32) EndIf EndIf If $hibernate = 1 Then If $force = 1 Then Shutdown(64) Else Shutdown(64) EndIf EndIf EndFunc Func Stop() Exit 0 EndFunc Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 2, 2010 Share Posted July 2, 2010 Inside the loop, you need to be checking an outside condition, like a global flag: Global $f_Break = False Global $f_Pause = False ; ... For $time = $second1+$second2 to 0 Step -1 ; Check for pause While $f_Pause Sleep(10) WEnd ; check for break If $f_Break Then $f_Break = False ExitLoop EndIf Sleep(1000) Next Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 2, 2010 Moderators Share Posted July 2, 2010 continyu,You can only break into running functions with HotKeys, not other controls on the GUI - AutoIt just queues those and waits until the running function ends.Here is aversion of your script with 2 HotKeys to Pause/End your timer - the results are shown in the SciTE console: expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <IE.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <file.au3> #RequireAdmin #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= Opt("TrayMenuMode", 1) Opt("GUIOnEventMode", 1) Global $sTitle = " DiskSakla - by Kontinyu" Global $sWidth = 312 Global $sHeight = 392 Global $sX = Default Global $sY = Default Global $fPause = False, $fEnd = False HotKeySet("{ESC}", "Ex") HotKeySet("{PAUSE}", "_Pause") HotKeySet("{END}", "_End") $SteamWin = GUICreate($sTitle, $sWidth, $sHeight, $sX, $sY, $WS_SYSMENU + $WS_POPUP) GUISetBkColor(0x464646) $Bar = GUICtrlCreateLabel($sTitle, 0, 0, $sWidth - 18, 18, $SS_NOTIFY, $GUI_WS_EX_PARENTDRAG) GUICtrlSetFont(-1, 10, 400, 0, "Arial") GUICtrlSetColor(-1, 0xD8DED3) GUICtrlSetBkColor(-1, 0x5A6A50) $Exit = GUICtrlCreateLabel("X", $sWidth - 18, 0, 18, 18, $SS_CENTER) GUICtrlSetFont(-1, 10, 800, 0, "Arial Black") GUICtrlSetColor(-1, 0xD8DED3) GUICtrlSetBkColor(-1, 0x5A6A50) GUISetOnEvent($GUI_EVENT_CLOSE, "Ex") GUICtrlSetOnEvent($Exit, "Ex") $Label1 = GUICtrlCreateLabel("GeriSay!", 4, 32, 292, 25) GUICtrlSetFont(-1, 11, 400, 0, "Arial Black") $Label2 = GUICtrlCreateLabel("Islem;", 10, 129, 250, 17) $Input1 = GUICtrlCreateInput("Saat", 40, 88, 68, 25) $updown1 = GUICtrlCreateUpdown($Input1) $Label3 = GUICtrlCreateLabel("GeriSay:", 8, 64, 44, 17) $Label4 = GUICtrlCreateLabel("Saat:", 8, 93, 29, 17) $Label5 = GUICtrlCreateLabel("Dakika:", 112, 93, 41, 17) $Input2 = GUICtrlCreateInput("Dakika", 160, 88, 68, 25) $updown2 = GUICtrlCreateUpdown($Input2) $Radio1 = GUICtrlCreateRadio("Oturmu Kapat", 16, 160, 113, 17) $Radio2 = GUICtrlCreateRadio("Bilgisayari Kapat", 16, 184, 113, 17) $Radio3 = GUICtrlCreateRadio("Yeniden Baslat", 16, 208, 113, 17) $Radio4 = GUICtrlCreateRadio("Uyku Moduna Al", 16, 232, 113, 17) $Radio5 = GUICtrlCreateRadio("Hazirda Beklet", 16, 256, 113, 17) $Checkbox1 = GUICtrlCreateCheckbox("Zorla !", 16, 288, 97, 17) $Button1 = GUICtrlCreateButton("Baslat", 100, 320, 68, 25, $WS_GROUP) GUICtrlSetOnEvent($Button1, "Start") $Button3 = GUICtrlCreateButton("Çikis", 238, 320, 68, 25, $WS_GROUP) GUICtrlSetOnEvent($Button3, "Stop") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Sleep(10) WEnd Func Ex() Exit EndFunc ;==>Ex Func _Pause() $fPause = Not $fPause ConsoleWrite("Pause = " & $fPause & @CRLF) EndFunc Func _End() $fEnd = True ConsoleWrite("End has been set" & @CRLF) EndFunc Func Start() $hour = GUICtrlRead($Input1) $min = GUICtrlRead($Input2) $second1 = $min * 60 $second2 = $hour * 3600 Global $time = $second1 + $second2 $logoff = GUICtrlRead($Radio1) $shutdown = GUICtrlRead($Radio2) $reboot = GUICtrlRead($Radio3) $standby = GUICtrlRead($Radio4) $hibernate = GUICtrlRead($Radio5) $force = GUICtrlRead($Checkbox1) $iBegin = TimerInit() While TimerDiff($iBegin) < ($second1 + $second2) * 1000 ConsoleWrite(@SEC & @CRLF) While $fPause = True Sleep(10) WEnd If $fEnd Then $fEnd = False Return EndIf Sleep(1000) WEnd If $logoff = 1 Then If $force = 1 Then Shutdown(20) Else Shutdown(0) EndIf EndIf If $shutdown = 1 Then If $force = 1 Then Shutdown(21) Else Shutdown(1) EndIf EndIf If $reboot = 1 Then If $force = 1 Then Shutdown(22) Else Shutdown(2) EndIf EndIf If $standby = 1 Then If $force = 1 Then Shutdown(32) Else Shutdown(32) EndIf EndIf If $hibernate = 1 Then If $force = 1 Then Shutdown(64) Else Shutdown(64) EndIf EndIf EndFunc ;==>Start Func Stop() Exit 0 EndFunc ;==>StopDoes it help? 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...
PsaltyDS Posted July 2, 2010 Share Posted July 2, 2010 It's just bad design to have an event handler that takes that long. Period. The only reason other GUI events are blocked is because you are already doing long slow work in another event function. Your Start() should make a short, quick change to the environment (i.e. set a flag, change a value) and return. The main loop should see that change and act on it. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
ajit Posted July 2, 2010 Share Posted July 2, 2010 (edited) expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <IE.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <file.au3> #RequireAdmin #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Date.au3> #Region ### START Koda GUI section ### Form= Opt("TrayMenuMode",1) Opt("GUIOnEventMode", 1) Global $sTitle = " DiskSakla - by Kontinyu" Global $sWidth = 312 Global $sHeight = 392 Global $sX = Default Global $sY = Default Global $shutdown_time $SteamWin = GUICreate($sTitle, $sWidth, $sHeight, $sX, $sY , $WS_SYSMENU + $WS_POPUP) ;GUISetBkColor(0x464646) $Bar = GUICtrlCreateLabel($sTitle , 0 , 0 , $sWidth -18, 18 , $SS_NOTIFY , $GUI_WS_EX_PARENTDRAG) GUICtrlSetFont(-1, 10, 400, 0, "Arial") GUICtrlSetColor(-1, 0xD8DED3) GUICtrlSetBkColor(-1, 0x5A6A50) $Exit = GUICtrlCreateLabel("X" , $sWidth -18 , 0 , 18 , 18 , $SS_CENTER) GUICtrlSetFont(-1, 10, 800, 0, "Arial Black") GUICtrlSetColor(-1, 0xD8DED3) GUICtrlSetBkColor(-1, 0x5A6A50) GUISetOnEvent($GUI_EVENT_CLOSE, "Ex") GUICtrlSetOnEvent($Exit,"Ex") $Label1 = GUICtrlCreateLabel("GeriSay!", 4, 32, 292, 25) GUICtrlSetFont(-1, 11, 400, 0, "Arial Black") $Label2 = GUICtrlCreateLabel("Islem;", 10, 129, 250, 17) $Input1 = GUICtrlCreateInput("Saat", 40, 88, 68, 25) $updown1 = GUICtrlCreateUpdown($Input1) $Label3 = GUICtrlCreateLabel("GeriSay:", 8, 64, 44, 17) $Label4 = GUICtrlCreateLabel("Saat:", 8, 93, 29, 17) $Label5 = GUICtrlCreateLabel("Dakika:", 112, 93, 41, 17) $Input2 = GUICtrlCreateInput("Dakika", 160, 88, 68, 25) $updown2 = GUICtrlCreateUpdown($Input2) $Radio1 = GUICtrlCreateRadio("Oturmu Kapat", 16, 160, 113, 17) $Radio2 = GUICtrlCreateRadio("Bilgisayari Kapat", 16, 184, 113, 17) $Radio3 = GUICtrlCreateRadio("Yeniden Baslat", 16, 208, 113, 17) $Radio4 = GUICtrlCreateRadio("Uyku Moduna Al", 16, 232, 113, 17) $Radio5 = GUICtrlCreateRadio("Hazirda Beklet", 16, 256, 113, 17) $Checkbox1 = GUICtrlCreateCheckbox("Zorla !", 16, 288, 97, 17) $Button1 = GUICtrlCreateButton("Baslat", 100, 320, 68, 25, $WS_GROUP) GUICtrlSetOnEvent($Button1, "Start") $Button3 = GUICtrlCreateButton("Çikis", 238, 320, 68, 25, $WS_GROUP) GUICtrlSetOnEvent($Button3, "Stop") HotKeySet("{ESC}","Ex") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) If _DateAdd( 's',0,_NowCalc()) = $shutdown_time Then Execute_Shutdown() WEnd Func Ex() Exit EndFunc Func Start() $hour = GUICtrlRead($Input1) $min = GUICtrlRead($Input2) $second1 = $min*60 $second2 = $hour*3600 Global $time = $second1+$second2 $time = $second1+$second2 $shutdown_time = _DateAdd( 's',$time,_NowCalc()) EndFunc Func Execute_shutdown() $logoff = GUICtrlRead($Radio1) $shutdown = GUICtrlRead($Radio2) $reboot = GUICtrlRead($Radio3) $standby = GUICtrlRead($Radio4) $hibernate = GUICtrlRead($Radio5) $force = GUICtrlRead($Checkbox1) If $logoff = 1 Then If $force = 1 Then Shutdown(20) Else Shutdown(0) EndIf EndIf If $shutdown = 1 Then If $force = 1 Then Shutdown(21) Else Shutdown(1) EndIf EndIf If $reboot = 1 Then If $force = 1 Then Shutdown(22) Else Shutdown(2) EndIf EndIf If $standby = 1 Then If $force = 1 Then Shutdown(32) Else Shutdown(32) EndIf EndIf If $hibernate = 1 Then If $force = 1 Then Shutdown(64) Else Shutdown(64) EndIf EndIf EndFunc Func Stop() Exit 0 EndFunc continyu, See if this works fine. Ajit Edited July 2, 2010 by ajit Link to comment Share on other sites More sharing options...
continyu Posted July 2, 2010 Author Share Posted July 2, 2010 Inside the loop, you need to be checking an outside condition, like a global flagThank you for your answer.But my main problem is how to set this outside condition while a loop in my function is still working...For your other advice (Start func. changes some flag or variable which my loop checks it.) i got the main idea but i can't apply it to my code in practice Link to comment Share on other sites More sharing options...
continyu Posted July 2, 2010 Author Share Posted July 2, 2010 continyu, You can only break into running functions with HotKeys, not other controls on the GUI - AutoIt just queues those and waits until the running function ends. Here is aversion of your script with 2 HotKeys to Pause/End your timer - the results are shown in the SciTE console: code was here : Does it help? M23 Thank you for your answer too BUT i don't know what is the function of consolewrite function. (i read the help file but still can't get it.) Also i couldn't find a way to put my IF statement in this While .. Wend statements. (But i can be overlooked it. i will try to figure it out )(i used For-to-next for put IF statements.) Still thank you very much. It's not your first help to me... Link to comment Share on other sites More sharing options...
continyu Posted July 2, 2010 Author Share Posted July 2, 2010 code was here continyu, See if this works fine. Ajit hi Ajit, thank you for your concern... BUT if i'm not mistaken (i can be with very high probability:) ) there is nothing about making the script pause or stop while working. also i like the usage of _Date functions anyway Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 2, 2010 Moderators Share Posted July 2, 2010 continyu, i don't know what is the function of consolewrite functionWhen you run your script in the SciTE editor, ConsoleWrite writes to the lower area of the editor window. It is often used to get information from th script as it runs - like the state of variables as was the case in the code I posted. The Help file covers other uses which, for the moment, you can safely ignore. Try running this in SciTE and look in the lower pane: ConsoleWrite("Hi continyu - this is ConsoleWrite working" & @CRLF) i couldn't find a way to put my IF statement in this While .. Wend statementsYou do not have to! Once the While...WEnd loop is finished (ie the timer ends) you move directly to the If statements. Or do you want to go to the If statements when you press "END"? In that case just change the code slightly: ; In place of this: If $fEnd Then $fEnd = False Return EndIf ; Just put this: If $fEnd Then ExitLoop Now pressing "END" will break out of the While...WEnd loop and start your If statements before the timer ends. Is that what you were looking for? 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...
continyu Posted July 2, 2010 Author Share Posted July 2, 2010 continyu, When you run your script in the SciTE editor, ConsoleWrite writes to the lower area of the editor window. It is often used to get information from th script as it runs - like the state of variables as was the case in the code I posted. The Help file covers other uses which, for the moment, you can safely ignore. Try running this in SciTE and look in the lower pane: ConsoleWrite("Hi continyu - this is ConsoleWrite working" & @CRLF) You do not have to! Once the While...WEnd loop is finished (ie the timer ends) you move directly to the If statements. Or do you want to go to the If statements when you press "END"? In that case just change the code slightly: ; In place of this: If $fEnd Then $fEnd = False Return EndIf ; Just put this: If $fEnd Then ExitLoop Now pressing "END" will break out of the While...WEnd loop and start your If statements before the timer ends. Is that what you were looking for? M23 ConsoleWrite("Hi Melba23 - Thank you for everytihng, all my problems solved! (I won't stop study on auto it so probably we will talk again:)) See ya!" & @CRLF) :-D Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 2, 2010 Moderators Share Posted July 2, 2010 continyu, I will be waiting - although please excuse me if I do not hold my breath! 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...
continyu Posted July 3, 2010 Author Share Posted July 3, 2010 Hi there again! Melba we lost something important... I can easly pause the countdown in the script. BUT how to Resume I tried to add "IF $fPause = False Then ExitLoop" in the while loop. Then set a hotkey to function which changes $fpause to False... But it didn't work So how to resume this silly script Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 3, 2010 Moderators Share Posted July 3, 2010 continyu, Ah, I can start breathing again! we lost something important... I can easly pause the countdown in the script. BUT how to ResumeJust press "Pause" again. Look at the code associated with the "Pause" HotKey: Func _Pause() $fPause = Not $fPause ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ConsoleWrite("Pause = " & $fPause & @CRLF) EndFunc Every time you run it, you toggle the value of $fPause - that is what Not does to Boolean (True/False) values. So to pause the countdown, press "Pause" : $fPause = True , the countdowm pauses. To resume, press "Pause" again : $fPause = False , the countdown resumes. All clear? 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...
continyu Posted July 3, 2010 Author Share Posted July 3, 2010 Sorry to bother you i used a Tooltip function to test toggle pause func. so when script is not paused my tooltip was still on the screen. it was my mistake... All Clear 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