Auto clicker script that constantly changes

Ask gaming related questions (AHK v1.1 and older)
shush12345
Posts: 33
Joined: 26 Jun 2021, 07:29

Auto clicker script that constantly changes

27 Jul 2021, 11:19

I need an auto clicker script that auto clicks at a range 8-10 clicks per second. I dont want it to be the same amount of clicks per second the whole time. I want it changing like every second so the clicks are not constantly 10 clicks per second. I want this to happen when I hold down left click.

I know this is confusing but I need a scipt for this asap. In short, I need a script that auto clicks at a range of 8-10 clicks per second. I dont want the clicks to be constantly the same speed. The speed of the clicks need to be changing the whole time as long as its between 8-10 clicks per second.
User avatar
mikeyww
Posts: 26880
Joined: 09 Sep 2014, 18:38

Re: Auto clicker script that constantly changes

27 Jul 2021, 11:59

Code: Select all

LButton::
SetMouseDelay, 0
start := A_TickCount, n := 0
While GetKeyState(A_ThisHotkey, "P") {
 Click
 n++
 Random, wait, 100, 125
 Sleep, wait ; Not precise, adjust as needed
}
end := A_TickCount
MsgBox, 64, CPS, % Round(1000 * n / (end - start))
Return
shush12345
Posts: 33
Joined: 26 Jun 2021, 07:29

Re: Auto clicker script that constantly changes

27 Jul 2021, 14:47

mikeyww wrote:
27 Jul 2021, 11:59

Code: Select all

LButton::
SetMouseDelay, 0
start := A_TickCount, n := 0
While GetKeyState(A_ThisHotkey, "P") {
 Click
 n++
 Random, wait, 100, 125
 Sleep, wait ; Not precise, adjust as needed
}
end := A_TickCount
MsgBox, 64, CPS, % Round(1000 * n / (end - start))
Return
when i use that it freezes my pc and i have to end ahk by using ctrl+alt+del then going on task manager and this comes up:
Attachments
sdfsdfds.PNG
sdfsdfds.PNG (3.27 KiB) Viewed 3753 times
AutoGiraffe
Posts: 4
Joined: 27 Jul 2021, 14:30

Re: Auto clicker script that constantly changes

27 Jul 2021, 14:53

It's working fine for me. The message box at the end shows the clicks per second done while the left mouse button was held down. Note that holding down the left click button spams it, so maybe that's why it looked like your PC froze.
shush12345
Posts: 33
Joined: 26 Jun 2021, 07:29

Re: Auto clicker script that constantly changes

27 Jul 2021, 14:58

is there a way to remove the message box?
shush12345
Posts: 33
Joined: 26 Jun 2021, 07:29

Re: Auto clicker script that constantly changes

27 Jul 2021, 15:03

mikeyww wrote:
27 Jul 2021, 11:59

Code: Select all

LButton::
SetMouseDelay, 0
start := A_TickCount, n := 0
While GetKeyState(A_ThisHotkey, "P") {
 Click
 n++
 Random, wait, 100, 125
 Sleep, wait ; Not precise, adjust as needed
}
end := A_TickCount
MsgBox, 64, CPS, % Round(1000 * n / (end - start))
Return
I used it but its only staying between 8.33 and 8.67 cps. https://streamable.com/ne4gef I want it so it clicks at 8cps for 1 second then switches to 9cps for 1 second then switches to 10cps 1 second then repeat.
AutoGiraffe
Posts: 4
Joined: 27 Jul 2021, 14:30

Re: Auto clicker script that constantly changes

27 Jul 2021, 15:04

Code: Select all

LButton::
SetMouseDelay, 0
While GetKeyState(A_ThisHotkey, "P") {
 Click
 n++
 Random, wait, 100, 125
 Sleep, wait ; Not precise, adjust as needed
}
Return
Here is @mikeyww's revised code.
User avatar
mikeyww
Posts: 26880
Joined: 09 Sep 2014, 18:38

Re: Auto clicker script that constantly changes

27 Jul 2021, 15:22

Thanks for that. Regarding the CPS adjustment, see the line marked, "adjust as needed" (can actually change the "random" command parameters if needed). It's just a demo. An alternative is to run one or more SetTimers that send the needed sequences with the right timing. You can have a start timer and a stop timer that stops the other timer and starts the next one. Releasing the mouse button would then stop the active timer.
AutoGiraffe
Posts: 4
Joined: 27 Jul 2021, 14:30

Re: Auto clicker script that constantly changes

27 Jul 2021, 15:24

shush12345 wrote:
27 Jul 2021, 15:03
I want it so it clicks at 8cps for 1 second then switches to 9cps for 1 second then switches to 10cps 1 second then repeat.
That's actually the purpose of the message box, so you can fine tune the min-max ranges of the random values. The random values dictate how long the script will wait until the next click; lower values = faster clicks. The provided code is designed to be random, so it won't by 8 cps in one moment, then 9, then 10, then 8 again. Anyway, try these new ranges out. If it's too fast or too slow, then edit the values in the Random line.

Code: Select all

LButton::
SetMouseDelay, 0
While GetKeyState(A_ThisHotkey, "P") {
 Click
 n++
 Random, wait, 65, 130
 Sleep, wait ; Not precise, adjust as needed
}
Return
User avatar
mikeyww
Posts: 26880
Joined: 09 Sep 2014, 18:38

Re: Auto clicker script that constantly changes

27 Jul 2021, 16:45

I agree, and confirm accommodation with the initial post:
I dont want the clicks to be constantly the same speed. The speed of the clicks need to be changing the whole time as long as its between 8-10 clicks per second.
shush12345
Posts: 33
Joined: 26 Jun 2021, 07:29

Re: Auto clicker script that constantly changes

27 Jul 2021, 17:42

Im using the script:

Code: Select all

LButton::
SetMouseDelay, 0
While GetKeyState(A_ThisHotkey, "P") {
 Click
 n++
 Random, wait, 50, 200
 Sleep, wait ; Not precise, adjust as needed
}
Return
[Mod edit: [code][/code] tags added.]

Can someone add to it to make right mouse button= normal single left click and middle mouse button=normal right click ty
User avatar
mikeyww
Posts: 26880
Joined: 09 Sep 2014, 18:38

Re: Auto clicker script that constantly changes

27 Jul 2021, 17:50

Code: Select all

RButton::Click
MButton::Click, R
LButton::
SetMouseDelay, 0
While GetKeyState(A_ThisHotkey, "P") {
 Click
 Random, wait, 50, 200
 Sleep, wait ; Not precise, adjust as needed
}
Return
shush12345
Posts: 33
Joined: 26 Jun 2021, 07:29

Re: Auto clicker script that constantly changes

27 Jul 2021, 18:01

@mikeyww

Thanks everything works but I want right click to function exactly as left click. I cant select multiple stuff when i hold down right click and drag across
User avatar
mikeyww
Posts: 26880
Joined: 09 Sep 2014, 18:38

Re: Auto clicker script that constantly changes

27 Jul 2021, 19:54

You can use instead:

Code: Select all

RButton::LButton
rhythm5
Posts: 4
Joined: 28 Aug 2022, 02:59

Re: Auto clicker script that constantly changes

28 Aug 2022, 03:07

Hey, how can we change the code so that it Clicks Right click instead of left click
i need it instant!
ty in advance!
User avatar
mikeyww
Posts: 26880
Joined: 09 Sep 2014, 18:38

Re: Auto clicker script that constantly changes

28 Aug 2022, 05:48

You can delete that line to restore the native right button. It works right away.

Something like this can auto-click.

Code: Select all

RButton::
While GetKeyState("RButton", "P")
 Click, R
Return
It may need adjustment, depending on what you are trying to do.
rhythm5
Posts: 4
Joined: 28 Aug 2022, 02:59

Re: Auto clicker script that constantly changes

29 Aug 2022, 06:05

So can You send the entire script which can click 14 cps constantly and it should start when i right click and it should right click
i need it for minecraft
sry if im disturbing you but i am not actually a programmer
User avatar
mikeyww
Posts: 26880
Joined: 09 Sep 2014, 18:38

Re: Auto clicker script that constantly changes

29 Aug 2022, 08:21

Below is an example that you can modify if needed. You can click on a posted command to learn more about it. Good luck with victory!

Code: Select all

cps = 14
RButton::
start := A_TickCount, cliks := 0
While GetKeyState("RButton", "P") {
 Click, R
 Sleep, start - A_TickCount + 1000 * ++cliks / cps
 ToolTip, % "CPS = " Round(1000 * cliks / (A_TickCount - start))
}
SoundBeep, 1500
Return
rhythm5
Posts: 4
Joined: 28 Aug 2022, 02:59

Re: Auto clicker script that constantly changes

31 Aug 2022, 02:36

@mikeyww
Hey, The Script Works Perfectly Good!
Just the only Thing that minds me is that wherever I click it shows the amount of cps there.. it peeps in Minecraft and disturbs...
So can You by any chance remove that?
Sorry if I am disturbing you but again I am not a programmer..
Thank You Again!
User avatar
mikeyww
Posts: 26880
Joined: 09 Sep 2014, 18:38

Re: Auto clicker script that constantly changes

31 Aug 2022, 05:00

The ToolTip line is cosmetic; you can remove it.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: Google [Bot], prototype_zero and 31 guests