Shift Spam

Ask gaming related questions (AHK v1.1 and older)
redapplapple
Posts: 3
Joined: 25 Apr 2017, 23:02

Shift Spam

25 Apr 2017, 23:12

I'm currently trying to make it so that whenever I hold down LShift, it will spam LShift every 20ms.

The code I'm currently using is:

Code: Select all

;--------------------------------------------------------------------
; autofire (keyspam) section
;--------------------------------------------------------------------
$LShift
DoKeyAutoFire:
	Suspend, Permit
	afkey := A_LShift
	StringRight,afkey,afkey,1
	spamsleep = 20 
	
	while (GetKeyState(afkey,"p")) 
	{	Send, %afkey% 
		Sleep, %spamsleep% 
	}
	return
Am I doing it right? I'm very new at this and help would be greatly appreciated.
Thanks!
redapplapple
Posts: 3
Joined: 25 Apr 2017, 23:02

Re: Shift Spam

25 Apr 2017, 23:14

Also: I'm using work from another person helping someone else with the same want. eventhorizon's work, for the most part.
Rohwedder
Posts: 7630
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Shift Spam

26 Apr 2017, 05:05

Hallo,
there are several errors!
Hotkey without two colon, A_LShift, "StringRight, afkey, afkey, 1" makes no sense here, "Send, %afkey% " needs curly braces if LShift inside afkey
Try:

Code: Select all

$LShift::
	While (GetKeyState("LShift","P")) 
	{
		Send, {LShift}
		Sleep, 20
	}
Return
Escairex
Posts: 1
Joined: 05 Oct 2021, 20:28

Re: Shift Spam

05 Oct 2021, 20:30

Rohwedder wrote:
26 Apr 2017, 05:05
Hallo,
there are several errors!
Hotkey without two colon, A_LShift, "StringRight, afkey, afkey, 1" makes no sense here, "Send, %afkey% " needs curly braces if LShift inside afkey
Try:

Code: Select all

$LShift::
	While (GetKeyState("LShift","P")) 
	{
		Send, {LShift}
		Sleep, 20
	}
Return
Gracias!

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: Shoobis and 66 guests