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

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Luan_86
Posts: 1
Joined: 11 May 2024, 21:55
Contact:

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

Post by Luan_86 » 11 May 2024, 22:02

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.]
User avatar
mikeyww
Posts: 27192
Joined: 09 Sep 2014, 18:38

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

Post by mikeyww » 11 May 2024, 22:25

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.
Post Reply

Return to “Ask for Help (v1)”