AHK Help please

Ask gaming related questions
Hunterwor
Posts: 3
Joined: 09 Dec 2017, 15:45

AHK Help please

Post by Hunterwor » 09 Dec 2017, 15:54

I have written a script to have key number one spam and still be able to use modifiers but i want to be able to push number 1 and it start and push again to stop can some1 help me please also needs to run at 130 ms

This is what i have so far
#ifWinActive World of Warcraft
{
$1::
$^1::
$+1::
$!1::
Loop
{
if not GetKeyState("1", "P")
break
if GetKeyState("LCtrl", "P")
Send ^1
else if GetKeyState("LShift", "P")
Send +1
else if GetKeyState("LAlt", "P")
Send !1
else
Send 1
sleep 135
}
return
}
Rohwedder
Posts: 1357
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: AHK Help please

Post by Rohwedder » 10 Dec 2017, 02:32

Hallo,
see https://autohotkey.com/docs/commands/Send.htm#blind
and try:

Code: Select all

*1:: ;On/Off with key 1
	1active := !1active
	If 1active
		SetTimer 1, 130
	Else
		SetTimer 1, Off
Return
1:
    Send, {blind}1
Return
or shorter with Ternary operator https://autohotkey.com/docs/Variables.htm#ternary:

Code: Select all

*1::SetTimer 1,% 1active:=1active="130"?"Off":"130"
1:
    Send, {blind}1
Return
Post Reply

Return to “Gaming”