How do you PAUSE a loop and resume again?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ktbjx
Posts: 71
Joined: 11 Jul 2015, 23:53

How do you PAUSE a loop and resume again?

16 Sep 2021, 20:08

First of I am sorry for this stupid question.
but how do you pause a loop and the resume again to there it paused?

i tried googling for answers but it gets complicated every search!
I just want to pause my loop and then resume it with a keypress(like toggle)
like this:

Code: Select all

#Persistent
#SingleInstance, Force
#NoEnv
q:=0
Stopper = FALSE
$F1::
Loop, 10
{
If STOPPER = FALSE
{
	ToolTip, %q%
	Sleep, 250
	ToolTip	
	q++
	Sleep 1000
}
ELSE If STOPPER = TRUE
{	
}

}
Return

$F2::
if toggle := !toggle 
	{
	STOPPER = TRUE
	ToolTip, OFF
	Sleep, 250
	ToolTip	
}
else 
{

STOPPER = FALSE
	ToolTip, ON
	Sleep, 250
	ToolTip	
}
Return
F1 is to turn on the loop
F2 is the pause/play thingy

but if i press F2, it does pause the loop, but doesnt resume it.
again im sorry for this stupid question, im just frustrated lol
User avatar
boiler
Posts: 16926
Joined: 21 Dec 2014, 02:44

Re: How do you PAUSE a loop and resume again?

16 Sep 2021, 20:12

See Pause. Assign it to a hotkey. No variables and checking of those variables needed. You won’t need a ToolTip because you already have an indicator in the script’s tray icon turning red when paused.
ktbjx
Posts: 71
Joined: 11 Jul 2015, 23:53

Re: How do you PAUSE a loop and resume again?

16 Sep 2021, 22:33

boiler wrote:
16 Sep 2021, 20:12
See Pause. Assign it to a hotkey. No variables and checking of those variables needed. You won’t need a ToolTip because you already have an indicator in the script’s tray icon turning red when paused.
that simple? OMG im so stupid! lol thank sir!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, Fredrik F, maxkill, RandomBoy, ShatterCoder and 371 guests