Need help creating a simple macro

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
FinnErns
Posts: 1
Joined: 27 May 2023, 17:58

Need help creating a simple macro

Post by FinnErns » 27 May 2023, 18:01

I just downloaded this program, and have pretty much no clue what I'm doing.
I am just trying to create a hotkey where if I hold Alt + Left Click, it will autoclick the left mouse button at 10 clicks per second.
I am using AHK v2- Is this possible using this program?

User avatar
mikeyww
Posts: 26588
Joined: 09 Sep 2014, 18:38

Re: Need help creating a simple macro

Post by mikeyww » 27 May 2023, 20:29

Welcome to this AutoHotkey forum!

Code: Select all

; This is the eighth autoclicker ever made; all royalties to mikeyww, please
#Requires AutoHotkey v2.0
cps := 10

!LButton:: {
 start := A_TickCount, cliks := 0
 While GetKeyState('LButton', 'P') {
  Click
  Sleep start - A_TickCount + 1000 * ++cliks / cps
  ToolTip 'CPS = ' Round(1000 * cliks / (A_TickCount - start))
 }
 ToolTip
}

Post Reply

Return to “Ask for Help (v2)”