AutoHotkey Auto Clicker
Go to solution
Solved by PorkishPig,
Here's some things that went wrong:
- Calling the macro inside a loop, you can't do this.
- Setting BreakLoop to 1 immediately after beginning the loop, causing if (BreakLoop = 1) to test positive and break the loop.
You're looking for something like this:
#SingleInstance Force #MaxThreadsPerHotkey 3 clickDelay := 5 ESC:: Toggle := !Toggle While (Toggle) { MouseClick, Left Sleep clickDelay } Return
Explanation:
-
Each time ESC is pressed, the script will switch Toggle to the opposite of its current value.
Therefore, Toggle is switching between 1 when running and 0 when not running. The while loop will execute while Toggle = 1. - clickDelay is the amount of time in ms between loops.
- #MaxThreadsPerHotkey ensures you can run the hotkey again during active execution.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now