Jump to content
Sign in to follow this  
continyu

Can't Exit Loop (Stop Script)

Recommended Posts

continyu

Hi there,

it's me again :blink:

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 ;)

#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

Share this post


Link to post
Share on other sites
PsaltyDS

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

:blink:


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

Share this post


Link to post
Share on other sites
Melba23

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: :blink:

#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   ;==>Stop

Does 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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
PsaltyDS

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.

:blink:


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

Share this post


Link to post
Share on other sites
ajit

#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 by ajit

Share this post


Link to post
Share on other sites
continyu

Inside the loop, you need to be checking an outside condition, like a global flag

:blink:

Thank 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 ;)

Share this post


Link to post
Share on other sites
continyu

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: :blink:

code was here :

Does it help? ;)

M23

Thank you for your answer too :P

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...

Share this post


Link to post
Share on other sites
continyu

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 :blink:

Share this post


Link to post
Share on other sites
Melba23

continyu,

i don't know what is the function of consolewrite function

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. :blink:

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 statements

You do not have to! :P 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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
continyu

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. :blink:

Try running this in SciTE and look in the lower pane:

ConsoleWrite("Hi continyu - this is ConsoleWrite working" & @CRLF)

You do not have to! :P 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

Share this post


Link to post
Share on other sites
Melba23

continyu,

I will be waiting - although please excuse me if I do not hold my breath! :blink:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
continyu

Hi there again!

Melba we lost something important... I can easly pause the countdown in the script. BUT how to Resume :P

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 :blink:

So how to resume this silly script ;)

Share this post


Link to post
Share on other sites
Melba23

continyu,

Ah, I can start breathing again! :P

we lost something important... I can easly pause the countdown in the script. BUT how to Resume

Just 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? :blink:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
continyu

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. :P it was my mistake...

All Clear :blink:

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×