AutoClicker Holding Down Left Click AND a Toggle Button

Ask gaming related questions (AHK v1.1 and older)
The_Jetcraft
Posts: 2
Joined: 05 Nov 2017, 15:35

AutoClicker Holding Down Left Click AND a Toggle Button

05 Nov 2017, 15:50

I have a script that just simply spams left click while holding left click. I would like this script to be toggled on and off with the letter "K", so that I can have a normal mouse without having to get out of the game, click the arrow until it finally stays up, right click and close the script. I would like to just hit "K" to toggle it on, hold down my left mouse button to spam the mouse, it stop spamming when I release the left mouse button, and hitting "K" will toggle it back off so when I hold down left click it only clicks once, as a regular mouse. Here is the script I have that does the spamming when I hold left click, it works great :bravo:

Code: Select all

$LButton::
Loop
{
if not GetKeyState("LButton", "P")
break
Click
}
return


But the "K" button toggling it on and of would be AMAZING :superhappy:
Rohwedder
Posts: 7895
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: AutoClicker Holding Down Left Click AND a Toggle Button

06 Nov 2017, 11:58

Hallo,
try:

Code: Select all

$LButton::
While, GetKeyState("LButton", "P")
	Click
Return
k::Suspend
Lhea
Posts: 1
Joined: 02 Feb 2022, 22:58

Re: AutoClicker Holding Down Left Click AND a Toggle Button

02 Feb 2022, 23:03

Hey, i know im pretty late here
but if u can just do one thing for me please?
so that autoclicker works perfectly but it has 23cps which is a bit too much can you do something so it will be 15 cps? please
Rohwedder
Posts: 7895
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: AutoClicker Holding Down Left Click AND a Toggle Button

03 Feb 2022, 04:51

Then,
try:

Code: Select all

$LButton::
SetMouseDelay, 33
;10 + (1000/15 - 1000/23) = 33.188
While, GetKeyState("LButton", "P")
	Click
Return
k::Suspend
User avatar
dude0x
Posts: 3
Joined: 06 Jan 2023, 05:29

Re: AutoClicker Holding Down Left Click AND a Toggle Button

06 Jan 2023, 06:26

Code: Select all

$LButton::
{
While GetKeyState("LButton", "P")
	Click
Return
}
Esc::ExitApp
hello, dude . I have some doubts here . when I execute this code with V1,it work,but when i ues v2 is do not work.use v2 my Left button is Keep clicking ,complete loss of control,so i add exitapp to exit it
Rohwedder
Posts: 7895
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: AutoClicker Holding Down Left Click AND a Toggle Button

06 Jan 2023, 07:16

Hallo, no problems here with:

Code: Select all

#Requires AutoHotkey v2.0-
$LButton::
{
	While GetKeyState("LButton", "P")
		Click
}
#SuspendExempt
k::Suspend
Esc::ExitApp
#SuspendExempt False
User avatar
dude0x
Posts: 3
Joined: 06 Jan 2023, 05:29

Re: AutoClicker Holding Down Left Click AND a Toggle Button

06 Jan 2023, 07:36

Rohwedder wrote:
06 Jan 2023, 07:16
Hallo, no problems here with:

Code: Select all

#Requires AutoHotkey v2.0-
$LButton::
{
	While GetKeyState("LButton", "P")
		Click
}
#SuspendExempt
k::Suspend
Esc::ExitApp
#SuspendExempt False
oh man, thanks to reply ,but i just have tried you give this scrip , problem is still same ,oh man ,have you tried it ? the left button is keeping click , out of control. mybe is my problem , I will restart my pc.and try it again.
Pacifista
Posts: 46
Joined: 17 Jan 2022, 16:17

Re: AutoClicker Holding Down Left Click AND a Toggle Button

07 Jan 2023, 09:56

So is it possible to change the script into this?

when i press and hold middle button to shoot something



first it will press "t" key once
then will keep holding left click
and when i lift my finger on the middle click it will click the t key once and done execution.

Code: Select all

shootSec = 2
waitSec  = 1
MButton Up::on := False
MButton::
on := True
While on {
 end := A_TickCount + 240 * shootSec
 While (A_TickCount < end && on)
  Click
 Loop, % 2 * waitSec
  Sleep, 150 * on
}
Return
[Mod edit: [code][/code] tags added.]

i have this but cant edit cuz couldnt get it to work with my edit.
Rohwedder
Posts: 7895
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: AutoClicker Holding Down Left Click AND a Toggle Button

07 Jan 2023, 10:28

To check timed sequences, I like to insert 3 different short Beeps.
For demonstration I have added them to your script. Maybe it will help you to reach your goal:

Code: Select all

shootSec = 2
waitSec = 1
MButton Up::on := False
MButton::
on := True
While on
{
	end := A_TickCount + 240 * shootSec
	While (A_TickCount < end && on)
	{
		Click
		SoundBeep, 4000, 20 ;high Beep
	}
	Loop, % 2 * waitSec
		Sleep, 150 * on
	SoundBeep, 2000, 20 ;medium Beep
}
SoundBeep, 1000, 20 ;low Beep
Return
Pacifista
Posts: 46
Joined: 17 Jan 2022, 16:17

Re: AutoClicker Holding Down Left Click AND a Toggle Button

07 Jan 2023, 17:36

didnt work i will start another thread.
User avatar
dude0x
Posts: 3
Joined: 06 Jan 2023, 05:29

Re: AutoClicker Holding Down Left Click AND a Toggle Button

20 Jan 2023, 08:00

dude0x wrote:
06 Jan 2023, 07:36
Rohwedder wrote:
06 Jan 2023, 07:16
Hallo, no problems here with:

Code: Select all

#Requires AutoHotkey v2.0-
$LButton::
{
	While GetKeyState("LButton", "P")
		Click
}
#SuspendExempt
k::Suspend
Esc::ExitApp
#SuspendExempt False
oh man, thanks to reply ,but i just have tried you give this scrip , problem is still same ,oh man ,have you tried it ? the left button is keeping click , out of control. mybe is my problem , I will restart my pc.and try it again.

Code: Select all

~LButton::
{
While GetKeyState("LButton")
	Click
Return
}
f2::ExitApp
I'v changed code , it works by v1 and v2 now.but , i still dont understand why previous code does not work
Storm
Posts: 6
Joined: 04 Feb 2023, 05:16

Re: AutoClicker Holding Down Left Click AND a Toggle Button

04 Feb 2023, 05:19

Rohwedder wrote:
06 Nov 2017, 11:58
Hallo,
try:

Code: Select all

$LButton::
While, GetKeyState("LButton", "P")
	Click
Return
k::Suspend

How Can i get this to click 12-13 cps?
Rohwedder
Posts: 7895
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: AutoClicker Holding Down Left Click AND a Toggle Button

04 Feb 2023, 06:03

This clicks 12.8 CPS here:

Code: Select all

#NoEnv
SetBatchLines, -1
SetMouseDelay, -1
$LButton::
While, GetKeyState("LButton", "P")
{
	Click
	Sleep 80
}
Return
k::Suspend
Adjust your CPS with the Sleep.
I use for CPS measurement:
ClickMe4.ahk
(538 Bytes) Downloaded 155 times
Rename it to ClickMe4.html
Reset averaging with F5 during measurement.
Storm
Posts: 6
Joined: 04 Feb 2023, 05:16

Re: AutoClicker Holding Down Left Click AND a Toggle Button

04 Feb 2023, 07:43

Rohwedder wrote:
04 Feb 2023, 06:03
This clicks 12.8 CPS here:

Code: Select all

#NoEnv
SetBatchLines, -1
SetMouseDelay, -1
$LButton::
While, GetKeyState("LButton", "P")
{
	Click
	Sleep 80
}
Return
k::Suspend
Adjust your CPS with the Sleep.
I use for CPS measurement:ClickMe4.ahk
Rename it to ClickMe4.html
Reset averaging with F5 during measurement.
Thanks for that but i had a question, do you know any softwares that hold autoclick click like that? I tried one named speedautoclicker it worked exactly how i wanted but unfortunately that was a virus.
Rohwedder
Posts: 7895
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: AutoClicker Holding Down Left Click AND a Toggle Button

04 Feb 2023, 08:48

No, I have never looked for such software.
(I am not a gamer.)
Storm
Posts: 6
Joined: 04 Feb 2023, 05:16

Re: AutoClicker Holding Down Left Click AND a Toggle Button

04 Feb 2023, 08:49

Rohwedder wrote:
04 Feb 2023, 08:48
No, I have never looked for such software.
(I am not a gamer.)

Oh i see, thanks for the reply.
Storm
Posts: 6
Joined: 04 Feb 2023, 05:16

Re: AutoClicker Holding Down Left Click AND a Toggle Button

04 Feb 2023, 12:15

Rohwedder wrote:
04 Feb 2023, 08:48
No, I have never looked for such software.
(I am not a gamer.)

Another question, can i set my shift key as the toggle key?
Rohwedder
Posts: 7895
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: AutoClicker Holding Down Left Click AND a Toggle Button

05 Feb 2023, 06:18

Try it out.
https://www.autohotkey.com/docs/v1/KeyList.htm#modifier
If you use the right shift for this, the left one keeps its actual function.
Storm
Posts: 6
Joined: 04 Feb 2023, 05:16

Re: AutoClicker Holding Down Left Click AND a Toggle Button

23 Feb 2023, 02:56

Rohwedder wrote:
04 Feb 2023, 06:03
This clicks 12.8 CPS here:

Code: Select all

#NoEnv
SetBatchLines, -1
SetMouseDelay, -1
$LButton::
While, GetKeyState("LButton", "P")
{
	Click
	Sleep 80
}
Return
k::Suspend
Adjust your CPS with the Sleep.
I use for CPS measurement:ClickMe4.ahk
Rename it to ClickMe4.html
Reset averaging with F5 during measurement.
Can I get it to click exact 12 cps?

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 31 guests