Help fixing right click script

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
HardBread
Posts: 2
Joined: 20 Aug 2017, 22:29

Help fixing right click script

20 Aug 2017, 22:38

#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!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], Joey5, just me and 236 guests