Jump to content

Recommended Posts

I'm not to sure that i'm posting in the right section but just let me know if I'm not.

My question / problem :

I'm making this hotkey to enable / toggle pause on the script... but not for a specific amount of time, but just until i decide to press the hotkey again to resume . So far i think I've written it correctly but I'm missing something and I'm not to sure what it is.

Take in mind that I'm still not that great writing functions this is my first Hotkey function that I'm doing, and i appreciate all the help i get.

The function works great to start it, but it doesn't work to pause it. In other words the Hotkey function works fine when i press numberpad 0 the script Starts, but if i want to pause it i press it again and it doesn't pause.

Here is what i got.

Global $pause = "pause"


$start = GUICtrlCreateButton("Start", 120, 85, 50,30)
$pause = GuiCtrlCreateButton("Pause", 180, 85, 50,30)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $Start
   GUICtrlSetState($Combo1, $GUI_DISABLE)
   GUICtrlSetState($Combo2, $GUI_DISABLE)
   GUICtrlSetState($Combo3, $GUI_DISABLE)
   GUICtrlSetState($start, $GUI_DISABLE)
   GUICtrlSetState($pause, $GUI_DISABLE)

Func pause()
If $pause= "Stop= 'Pause'" Then
    GUICtrlSetState ( $start, $GUI_ENABLE )
    GUICtrlSetState ( $pause, $GUI_ENABLE )
     if $start=("Start") Then
ElseIf $start= "Start" Then
   GUICtrlSetData($pause,"Stop= 'Pause'")
    GUICtrlSetState ( $start, $GUI_DISABLE )
    GUICtrlSetState ( $pause, $GUI_DISABLE  )
     if $pause=("Pause") Then
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...