Page 1 of 1

I have a script, but i need this script have a "on/off button"

Posted: 11 May 2024, 22:02
by Luan_86

Code: Select all

~$LButton::
    KeyWait LButton, T0
    If ErrorLevel
        While GetKeyState("LButton", "P"){
            Click
            Sleep 25
        }

[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]

Re: I have a script, but i need this script have a "on/off button"

Posted: 11 May 2024, 22:25
by mikeyww
Welcome to this AutoHotkey forum!

Code: Select all

#Requires AutoHotkey v1.1.33.11

F3::
on := !on
SoundBeep 1000 + 500 * on
Return

#If on
~LButton::
KeyWait LButton, T.2
If ErrorLevel
 While GetKeyState("LButton", "P") {
  Click
  Sleep 25
 }
Return
#If
If you are new to AHK, I recommend using its current version, which is v2, instead of this older deprecated version that is no longer developed.