Left click macro

Ask gaming related questions (AHK v1.1 and older)
Size12Belt
Posts: 1
Joined: 23 Mar 2021, 20:37

Left click macro

23 Mar 2021, 20:42

Hello, can someone make a simple macro for autohotkey that clicks the left click button once every x amount of seconds, as long as I am holding down the left click button? Help will be much appreciated, thanks in advance.
Rohwedder
Posts: 7630
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Left click macro

24 Mar 2021, 05:49

Hallo,
either (only Clicks):

Code: Select all

*LButton::
SetTimer, TClick, 2000 ;every 2 seconds
TClick:
Click
Return
*LButton Up::SetTimer, TClick, Off
or (Hold + Clicks)

Code: Select all

~*LButton::SetTimer, TClick, 2000 ;every 2 seconds
TClick:
Click
Return
~*LButton Up::SetTimer, TClick, Off
skley
Posts: 3
Joined: 05 Mar 2021, 18:09

07 Apr 2021, 14:59

is there a way to turn it off?
Rohwedder
Posts: 7630
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Left click macro

08 Apr 2021, 01:24

Then:

Code: Select all

~*LButton::SetTimer, TClick, 2000 ;every 2 seconds
TClick:
IF GetKeyState("F2","T") ;On/Off with F2
	Click
Return
~*LButton Up::SetTimer, TClick, Off
or shorter:

Code: Select all

~*LButton::SetTimer, ~LButton & ~F2, 2000 ;every 2 seconds
~LButton & ~F2::Click,% GetKeyState("F2","T") ;On/Off with F2
~*LButton Up::SetTimer, ~LButton & ~F2, Off
For the very first switch-on F2 sometimes must be tapped twice.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: Google [Bot], jameswrightesq and 112 guests