Hi there guys. I'm new to AHK and I tried to make a script by myself but I just can't comprehend it.
I am looking for script for pressing a button down so it spams until i release it.
I want to make it for binds like 1,2,3,4,5,q,e,r (each seperate).
I would also like to turn it on and off with one button like F5 for example.
Thanks for your time and help.
Cheers,
Jacob.
World of Warcraft hold until release
Re: World of Warcraft hold until release
Code: Select all
#NoEnv
#UseHook
SendMode, Input
1::
2::
3::
4::
5::
q::
e::
r::Spaminator(A_ThisHotkey)
F5::Suspend
Spaminator(K)
{
While GetKeyState(K,"P")
{
Send % K
Sleep 10
}
}
Re: World of Warcraft hold until release
Doesn't work
Re: World of Warcraft hold until release
You should probably try this tool first to see what kinds of Send types are supported or blocked by your application and act accordingly:
https://autohotkey.com/board/topic/9565 ... -tool-v41/
For example, some games ignore SendInput and only accept SendEvent.
https://autohotkey.com/board/topic/9565 ... -tool-v41/
For example, some games ignore SendInput and only accept SendEvent.
YOU'RE NOT ALEXANDER
Re: World of Warcraft hold until release
These keys are bound in game so you will want to use ~ prefix.
I added down sleep up for each spammed keystroke even though you probably don't need it.
Code: Select all
#NoEnv
SendMode, Input
~1::
~2::
~3::
~4::
~5::
~q::
~e::
~r::Spaminator(SubStr(A_ThisHotkey, 0))
F5::Suspend
Spaminator(K)
{
While GetKeyState(K,"P")
{
Send, {%K% Down}
Sleep 20
Send, {%K% Up}
}
}
Re: World of Warcraft hold until release
Thank you for your help works amazing!!!!!
Can you explain what sleep means in this? and #NoEnv? and if I want to put keybind "shift+1" or "alt+1" should I add like that or it looks different?
Can you explain what sleep means in this? and #NoEnv? and if I want to put keybind "shift+1" or "alt+1" should I add like that or it looks different?
Re: World of Warcraft hold until release
#NoEnv
Avoids checking empty variables to see if they are environment variables (recommended for all new scripts).
It not really needed for this script.
Sleep
Waits the specified amount of time before continuing.
To spam shift1 or alt1 it could be done like this:
blind-mode Send
When {Blind} is the first item in the string, the program avoids releasing Alt/Control/Shift/Win if they started out in the down position.
HTH
Avoids checking empty variables to see if they are environment variables (recommended for all new scripts).
It not really needed for this script.
Sleep
Waits the specified amount of time before continuing.
To spam shift1 or alt1 it could be done like this:
Code: Select all
#NoEnv
SendMode, Input
~!1:: ; Alt 1 hotkey
~+1:: ; Shift 1 hotkey
~1::
~2::
~3::
~4::
~5::
~q::
~e::
~r::Spaminator(SubStr(A_ThisHotkey, 0))
F5::Suspend
Spaminator(K)
{
While GetKeyState(K,"P")
{
Send, {Blind}{%K% Down}
Sleep 20
Send, {Blind}{%K% Up}
}
}
When {Blind} is the first item in the string, the program avoids releasing Alt/Control/Shift/Win if they started out in the down position.
HTH
Who is online
Users browsing this forum: No registered users and 42 guests