Choose which one you want. If you need to modify it, see "Helpful links" below.
Please try changing stuff yourself before asking. We appreciate any effort.
1. Press-and-Hold: Send or click while a button or key is held down
Code: Select all
setKeyDelay, 50, 50
setMouseDelay, 50
$~lbutton::
while (getKeyState("lbutton", "P"))
{
send, {lbutton}
sleep, 100
}
return
Code: Select all
#maxThreadsPerHotkey, 2
setKeyDelay, 50, 50
setMouseDelay, 50
banana:=0
$f1::
; banana:=!banana .... This assigns banana to the value of NOT (!) banana. so lets
; say banana starts out FALSE (0). you then turn banana to NOT FALSE. which is
; TRUE (1). so now banana is set to TRUE. and then lets say you toggle it again.
; you set banana to NOT TRUE, which is FALSE. banana is now set to FALSE.
; .... 1 is true, 0 is false. ! is NOT.
banana:=!banana
while (banana=1)
{
send, hello{space}
sleep, 100
}
return
1. Don't know how to use these? READ THIS: https://autohotkey.com/docs/Tutorial.htm
2. AHK not working in your game/program? READ THIS: https://autohotkey.com/boards/viewtopic.php?f=7&t=11084
3. List of keys to use as HOTKEYS (the line with "::"): https://autohotkey.com/docs/KeyList.htm
4. List of special keys (like {Enter}) to use with SEND: https://autohotkey.com/docs/commands/Send.htm
5. How to click the MOUSE: https://autohotkey.com/docs/commands/MouseClick.htm
6. Addition spamming methods, such as "cycle" and "settimer": https://autohotkey.com/board/topic/6457 ... re-thread/
Keywords (to help boost search results for those who searched):
autofire auto fire rapidfire rapid fire toggle spam spamkey fps shooter cast spell
auto shoot autoshoot cheat hack press key spam key spamkey burst pewpew pew press while held
press to toggle rapid press game start stop activate deactivate