Getting "pause" to work better Topic is solved

Ask gaming related questions (AHK v1.1 and older)
Phigl
Posts: 4
Joined: 17 Nov 2019, 02:52

Getting "pause" to work better

02 Jul 2020, 12:03

Hi,

I have the following script which does what I need it to do, but hitting ctrl-z to pause only works sometimes. It's as if I have to be in the exact right part of the loop for it to work.

What can I change to make the "pause" function better?

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

Pause On

Loop
{
Send,S 
sleep 75
Send,R  
sleep 75
Send,S  
sleep 150
Send,S  
sleep 75
Send,0  
sleep 75
}

ExitApp

^z::Pause
^x::ExitApp
Last edited by BoBo on 02 Jul 2020, 12:12, edited 1 time in total.
Reason: Moved to Gaming section.
Rohwedder
Posts: 7630
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Getting "pause" to work better  Topic is solved

02 Jul 2020, 12:58

Hallo,
I recommend the Pause key.
Single press: Pause off/on
Double press: ExitApp

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
Pause On
Loop
{
	Send,S
	sleep 75
	Send,R
	sleep 75
	Send,S
	sleep 150
	Send,S
	sleep 75
	Send,0
	sleep 75
}
ExitApp

*Pause::
Pause,,1
IF (A_PriorHotkey = A_ThisHotkey And A_TimeSincePriorHotkey < 400)
	ExitApp
Return
Phigl
Posts: 4
Joined: 17 Nov 2019, 02:52

Re: Getting "pause" to work better

02 Jul 2020, 14:55

Rohwedder wrote:
02 Jul 2020, 12:58
Hallo,
I recommend the Pause key.
Single press: Pause off/on
Double press: ExitApp

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
Pause On
Loop
{
	Send,S
	sleep 75
	Send,R
	sleep 75
	Send,S
	sleep 150
	Send,S
	sleep 75
	Send,0
	sleep 75
}
ExitApp

*Pause::
Pause,,1
IF (A_PriorHotkey = A_ThisHotkey And A_TimeSincePriorHotkey < 400)
	ExitApp
Return
Simple, thank you!

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 128 guests