Add pause?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Greeny

Add pause?

11 May 2017, 10:52

Hello guys!
How can I add a pause to this script:

Code: Select all

*Space::

Loop

{

GetKeyState, state, space, P

if State = U ; The button has been released, so stop the loop.

break

; Otherwise:

Send, {SPACE}

Sleep, 1 ; i.e. 26 ms delay between clicks. Adjust this value as needed.

}

return
I want, if I press the button O that the script pauses and if I press O again, that it unpauses.

Much greetings :)
Rohwedder
Posts: 7744
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Add pause?

11 May 2017, 11:57

Hallo,
add:

Code: Select all

o:: ;Key o toggles script on/off
	Suspend
	Pause,,1
Return
Greeny

Re: Add pause?

11 May 2017, 12:29

Rohwedder wrote:Hallo,
add:

Code: Select all

o:: ;Key o toggles script on/off
	Suspend
	Pause,,1
Return
Helped me! Thank you very much!
zopfan
Posts: 8
Joined: 03 Jan 2020, 08:44

Re: Add pause?

28 Jan 2022, 09:27

Can you pls explain the 2 commas and "1" after it?
That is, the 2nd line in the below given script.

Pause:: Suspend
Pause,,1
return </kbd>
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Add pause?

28 Jan 2022, 09:30

zopfan wrote:
28 Jan 2022, 09:27
Can you pls explain the 2 commas and "1" after it?
That is, the 2nd line in the below given script.

Pause:: Suspend
Pause,,1
return </kbd>
Simply click the 'Pause' command in the above forum code box for further details!
More info about AHK's command parameters: https://www.autohotkey.com/docs/Concepts.htm#functions

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Spawnova and 228 guests