Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#IfWinActive StarCraft II
; Blink macro
LButton::
if (CheckSC2Active("LButton")) {
send q ; Set this line to your blink hotkey
Send {LButton}
}
Return
; Need to be able to left click, since we re bound LButton
$MButton::
if (CheckSC2Active("MButton Down")) {
Send {LButton Down}
}
Return
$MButton Up::
if (CheckSC2Active("MButton Up")) {
Send {LButton Up}
}
Return
; Hold RMB for blink spam
RButton::
delay = 20 ; delay between clicks, modify as desired
While GetKeyState("RButton","P") {
IfWinActive StarCraft II
{
Click Right
}
Sleep delay
}
Return
; ~~ FUNCTIONS ~~
; Returns 1 if SC2 is active, 0 otherwise
IsSC2Active() {
IfWinActive StarCraft II
{
Return 1
}
Return 0
}
; Presses the given key if SC2 is not the active window
; Returns 1 if SC2 is active, 0 otherwise
CheckSC2Active(key) {
if (!IsSC2Active()) {
Send %key%
Return 0
}
Return 1
}
Is there anything here that would cause the right button spam to continue even after right mouse button release?
Thanks in advance!
Mod edit: Added code tags.