123 and ctrl and alt keys getting stuck

Ask gaming related questions (AHK v1.1 and older)
jojothemojo
Posts: 1
Joined: 20 Feb 2020, 16:41

123 and ctrl and alt keys getting stuck

20 Feb 2020, 16:54

I'm having issues with this spam clicker getting stuck and not letting go of either the ctrl key, or alt key, and sometimes just completely stuck pressing a number and it'll only stop when I press the number again. Is there a way to make this smoothier?


I have this set up but for the MMO I'm playing, I also do ctrl+1, ctrl +2, ctrl +3, and alt+1, alt+2, alt+3. Can anyone lend some knowledge, I'm new to this. To clarify, I also want it to be able to spam the 123 keys with the alt and ctrl activated but I don't want it to get stuck.

Code: Select all

*1::
Loop
{
GetKeyState, state, 1, p
if state = U
break
; Otherwise:
Send, {1}
Sleep, 30
}

*2::
Loop
{
GetKeyState, state, 2, p
if state = U
break
; Otherwise:
Send, {2}
Sleep, 30
}

*3::
Loop
{
GetKeyState, state, 3, p
if state = U
break
; Otherwise:
Send, {3}
Sleep, 30
}
[Mod edit: [code][/code] tags added]
Rohwedder
Posts: 7739
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: 123 and ctrl and alt keys getting stuck

29 Feb 2020, 10:05

Hallo,
try:

Code: Select all

$*1::
Loop
{
	GetKeyState, state, 1, p
	if state = U
		break
	; Otherwise:
	Send, {Blind}{1}
	Sleep, 30
}
Return
$*2::
Loop
{
	GetKeyState, state, 2, p
	if state = U
		break
	; Otherwise:
	Send, {Blind}{2}
	Sleep, 30
}
Return
$*3::
Loop
{
	GetKeyState, state, 3, p
	if state = U
		break
	; Otherwise:
	Send, {Blind}{3}
	Sleep, 30
}
Return
or shorter:

Code: Select all

$*1::
$*2::
$*3::
Key := SubStr(A_ThisHotkey, 0)
While, GetKeyState(Key, "P")
{
	Send, {Blind}{%Key%}
	Sleep, 30
}
Return

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 24 guests