Pausing a script

Posts 17 of 7 · Page 1 of 1
Pausing a script
Hi everyone, I'm trying to suspend a script with a label.

I've created two strings and the following hotkeys in the beginning of my script:

PauseStatus := "None"
PauseStatus2 := "Enabled"
Test2Label := "f2"
Test1Label := "f1"



Followed by the following labels:
Test2Label :
PauseStatus := "Test2"

Test1Label:
PauseStatus := "Test1"



And when I hit a hotkey, it goes to the label, etc etc.
key_pause_script := "NumpadSub"
HotKey, *%key_pause_script%, pause_script




Everything above works perfectly, minus some misc code that I've excluded to keep this short and simple. The problem is with the following script. With I hit NumpadSub to pause the script, the script successfully pauses but displays the wrong tooltip. Instead of displaying "Paused" it'll display Test2. I also can't get the script to unpause.
Here is the label:

pause_script:
if PauseStatus2 := "Working"
{
PauseStatus2 := "Paused"
Tooltip, Paused
SetTimer, ResetTooltip, -500
}

if PauseStatus2 := "Paused" and if PauseStatus := "Test1"
{
PauseStatus2 := "Working"
Tooltip, Test1
SetTimer, ResetTooltip, -500
}

if PauseStatus2 := "Paused" and if PauseStatus := "Test2"
{
PauseStatus2 := "Working"
Tooltip, Test2
SetTimer, ResetTooltip, -500
}

Suspend
return





Anyone have any ideas?
@lolikols

#p::Pause ; Pressing Win+P once will pause the script. Pressing it again will unpause.
Toggle suspend
f1::suspend
Close the script
f2::exitapp
Reload the script
f3::reload
Edit the script
f4::edit

Pause::

Suspend

Pause,,1

return

Hope this helps you

- - - Updated - - -
@Hunter this should be solved
Quote Originally Posted by Ally View Post
@lolikols

#p::Pause ; Pressing Win+P once will pause the script. Pressing it again will unpause.
Toggle suspend
f1::suspend
Close the script
f2::exitapp
Reload the script
f3::reload
Edit the script
f4::edit

Pause::

Suspend

Pause,,1

return

Hope this helps you

- - - Updated - - -
@Hunter this should be solved
Well the intent here is to display a tooltip so that I know when its paused and when its not. So your suggestion wouldn't work
Quote Originally Posted by lolikols View Post
Well the intent here is to display a tooltip so that I know when its paused and when its not. So your suggestion wouldn't work
f12::
Suspend
ToolTip,% a_isSuspended?"On":"Off", 1000, 100
return

Here i didnt understand what you meant at first but here you go
Can you put full code like

Code:
this?
That's perfect, thank you!
/Solved & closed.
Posts 17 of 7 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?