How to make script stop string? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
crimson4649
Posts: 18
Joined: 23 Jul 2017, 06:04

How to make script stop string?

21 Dec 2019, 08:37

Sorry for the bad topic, but I couldn't find a better way to describe it.

What I want is for the script to completely stop at what its doing when I let go of LShift
Not for it to complete the cycle, then stop.

*LShift::
send {4 down}
While, GetKeyState("lshift","P")
{
Send {1}
Sleep 5
Send {2}
Sleep 5
Send {3}
Sleep 5000
}
send {4 up}
return


How do I go about this?

Thanks in advanced.

//Best regards.
Rohwedder
Posts: 7768
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: How to make script stop string?  Topic is solved

21 Dec 2019, 09:57

Hallo,
try:

Code: Select all

*LShift::
send {4 down}
Loop
{
	Send {1}
	Sleep 5
	Send {2}
	Sleep 5
	Send {3}
	Sleep 5000
}
Return
*LShift Up::
send {4 up}
Reload
Return
Or with Timer:

Code: Select all

*LShift::
send {4 down}
SetTimer, 123, 5000
Gosub, 123
KeyWait, LShift
SetTimer, 123, Off
send {4 up}
Return
123:
	Send {1}
	Sleep 5
	Send {2}
	Sleep 5
	Send {3}
Return
crimson4649
Posts: 18
Joined: 23 Jul 2017, 06:04

Re: How to make script stop string?

21 Dec 2019, 10:32

Rohwedder wrote:
21 Dec 2019, 09:57
Hallo,
try:

Code: Select all

*LShift::
send {4 down}
Loop
{
	Send {1}
	Sleep 5
	Send {2}
	Sleep 5
	Send {3}
	Sleep 5000
}
Return
*LShift Up::
send {4 up}
Reload
Return
thanks, that worked.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Kodakku and 369 guests