Start/stop spam key for WOW

Ask gaming related questions (AHK v1.1 and older)
stonemelts
Posts: 4
Joined: 28 Jul 2017, 16:31

Start/stop spam key for WOW

17 Mar 2018, 13:25

I am very bad at this coding as of now i am having a script for a one button key which spams pretty fine for a single key... but i need a start/stop spammer for multiple hotkeys

say for example this script

OneToggle=0
#IfWinActive World of Warcraft
; to force the hotkey only to Wow
1::
if (OneToggle := !OneToggle)
SetTimer, timer, -1
return
#ifWinActive
; to end the WoW key binding
timer:
While (OneToggle)
{ Send 1
sleep 100
}
Return

spams very good for numkey1 if i press it once it starts to spam and if i press it again it stops spamming this way i need script for other keys like 2 and 3 as well on a single script

i want the script should be like if i press num1 once it should spam 1 and if i press 1 again it should stop spamming 1 and same way for num2 press once to start spamming 2 and if i press 2 again it should stop spamming 2
can some one help me with this kind of script and i don't want this script

$2::
Loop
{
if not GetKeyState("2", "P")
break
Send 2
sleep 50
}
return
}
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Start/stop spam key for WOW

17 Mar 2018, 13:45

Code: Select all

Toggle := 0

$2::
Toggle := !Toggle
If Toggle {
Loop
{
if not GetKeyState("2", "P")
break
Send 2
sleep 50
}
}
return
Use a if variable.
Try to imitate what I did with your example script, but for the second and third hotkey use toggle2 instead of toggle. So there will be
Toggle := 0
Toggle2 := 0
Toggle3 := 0

at the top, and inside the hotkeys there will be

Toggle := !Toggle,
Toggle2 := !Toggle2 and
Toggle3 := !Toggle3

And, if Toggle, if Toggle2 and if Toggle 3 respectively under each hotkey.

If you weren't able to figure it out feel free to post the entire script and we will help with it.
I am your average ahk newbie. Just.. a tat more cute. ;)
stonemelts
Posts: 4
Joined: 28 Jul 2017, 16:31

Re: Start/stop spam key for WOW

17 Mar 2018, 13:58

bro thanks for the help... but i am not good with scripts.... can u please post it as a single script for num key 1 and num key 2 so that i can copy and paste it for use... its not that i am lazy... its that my lack of knowledge on this part... please help
stonemelts
Posts: 4
Joined: 28 Jul 2017, 16:31

Re: Start/stop spam key for WOW

17 Mar 2018, 14:05

and i tried to paste it like this but its not working

OneToggle=0
#IfWinActive World of Warcraft
; to force the hotkey only to Wow

1::
if (OneToggle := !OneToggle)
SetTimer, timer, -1
return

#ifWinActive
; to end the WoW key binding

timer:
While (OneToggle)
{ Send 1
sleep 100
}
Return

Toggle := 0

$2::
Toggle := !Toggle
If Toggle {
Loop
{
if not GetKeyState("2", "P")
break
Send 2
sleep 50
}
}
return
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Start/stop spam key for WOW

18 Mar 2018, 11:50

stonemelts wrote:and i tried to paste it like this but its not working

OneToggle=0
#IfWinActive World of Warcraft
; to force the hotkey only to Wow

1::
if (OneToggle := !OneToggle)
SetTimer, timer, -1
return

#ifWinActive
; to end the WoW key binding

timer:
While (OneToggle)
{ Send 1
sleep 100
}
Return

Toggle := 0

$2::
Toggle := !Toggle
If Toggle {
Loop
{
if not GetKeyState("2", "P")
break
Send 2
sleep 50
}
}
return
Please give me the entire script without your modifications and I'll try to help. ;) The reason I didn't in the first place because you didn't give the script! You gave an example so I was forced to assume you would make sense out of what I do to the example. I think I understand that you edited in the while toggles, but for good measure I want you to give me the script because you might have edited out something else as well.
I am your average ahk newbie. Just.. a tat more cute. ;)
stonemelts
Posts: 4
Joined: 28 Jul 2017, 16:31

Re: Start/stop spam key for WOW

18 Mar 2018, 12:53

this is the script i am having right now

OneToggle=0
#IfWinActive World of Warcraft
; to force the hotkey only to Wow

1::
if (OneToggle := !OneToggle)
SetTimer, timer, -1
return

#ifWinActive
; to end the WoW key binding

timer:
While (OneToggle)
{ Send 1
sleep 100
}
Return


the above script works for number( 1 ) the above script works like if i press number 1 once it starts spamming and if i press it again it stops , now i need script for two buttons like if i press number 2 it needs to spamm the number 2 key and once i press it again it need to stop and bothe the numbers have to be in same scrit
sitrus
Posts: 1
Joined: 19 Aug 2020, 02:23

Re: Start/stop spam key for WOW

19 Aug 2020, 02:29

i know this is old topic, i need answer for this too, how do i edit that script to make 2 toggable

E:

its work now

OneToggle=0
#IfWinActive World of Warcraft
; to force the hotkey only to Wow

1::
if (OneToggle := !OneToggle)
SetTimer, timer, -1
return

#ifWinActive
; to end the WoW key binding

timer:
While (OneToggle)
{ Send 1
sleep 100
}
Return


Onetoggle = 0
#MaxThreadsPerHotkey 2
#ifWinActive World of Warcraft
{
2::
Toggle := !Toggle
While Toggle{
Send {2}
sleep 60
}
return
}

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 76 guests