Isso fará o truque:
#ifWinActive Guild Wars 2
shift:: ; Shift to toggle auto-spammer
hotkey, ifWinActive, Guild Wars 2
hotkey, $1, shift_1, on
loop {
input, keystroke, l1 v, {LControl}{RControl}{LAlt}{RAlt}{LShift}{RShift}{LWin}{RWin}{AppsKey}{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{Left}{Right}{Up}{Down}{Home}{End}{PgUp}{PgDn}{Del}{Ins}{BS}{Capslock}{Numlock}{PrintScreen}{Pause}
if keystroke not contains 1
break
}
hotkey, $1, off
return
shift_1:
send 1
sleep 500
send y
return
Alternativamente, se você quer que o comando Shift altere X
teclas de atalho de 1 - 9 :
#ifWinActive Guild Wars 2
X = 9 ; Set this to the number of keys you want to be auto-spammable
loop %X% { ; Create hotkeys 0-X
hotkey, ifWinActive, Guild Wars 2
hotkey, $%a_index%, autoSpammer
}
shift:: ; Shift to toggle auto-spammer
autoSpam = on
loop {
input, keystroke, l1 v, {LControl}{RControl}{LAlt}{RAlt}{LShift}{RShift}{LWin}{RWin}{AppsKey}{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{Left}{Right}{Up}{Down}{Home}{End}{PgUp}{PgDn}{Del}{Ins}{BS}{Capslock}{Numlock}{PrintScreen}{Pause}
if regExMatch(keystroke, "[^0-9]")
break
}
autoSpam = off
return
autoSpammer:
thisHotkey := regExReplace(a_thisHotkey, "[^0-9]")
if autoSpam = on
{
sendInput %thisHotkey%
sleep 500
sendInput y
}
else
send %thisHotkey%
return