Page 1 of 2

Auto Clicker

Posted: 02 Jul 2016, 23:05
by Te Waffles
Hello. I need an auto clicker script that clicks about 12 cps and is toggled using ctrl+z. Also I want the auto clicker to work even if my mouse is hovering over a game screen. For example, Minecraft or Roblox.
I have looked in the forums and have found lots of auto clickers, but the hotkeys aren't suited for the games I am playing or my browser.

Re: Auto Clicker  Topic is solved

Posted: 03 Jul 2016, 11:58
by neomulemi6
This will click 12 times/second, toggled on/off with ctrl + z.

Code: Select all

#MaxThreadsPerHotkey 3

^z::
Toggle := !Toggle
Loop
{
	If (!Toggle)
		Break
	Click
	Sleep 83 ; Make this number higher for slower clicks, lower for faster.
}
Return

Re: Auto Clicker

Posted: 04 Jul 2016, 23:52
by Te Waffles
Thx neomulemi6. It works perfectly!

Re: Auto Clicker

Posted: 06 Jan 2018, 21:09
by budboradjong
hi, can you please give me a script where it clicks the button automatically(without touching anything) and using F1 as start stop button.

Thank you.

Re: Auto Clicker

Posted: 20 Jan 2018, 02:57
by F0RSAKEN
budboradjong wrote:Hi, can you please give me a script where it clicks the button automatically(without touching anything) and using F1 as a start-stop button.

Thank you.

The last one I posted had a bug with pausing it so here is the improved one just copy paste it to one of your own. :)

~LButton::
Loop
{
GetKeyState, LButtonState, LButton, P
if LButtonState = U

MouseClick, Left

Sleep 10

}
return
*F1::
Suspend
Pause, 1
return

*F2::
ExitApp
return

Re: Auto Clicker

Posted: 25 Jan 2018, 18:23
by MOPixels
^z::
Toggle := !Toggle
Loop
{
If (!Toggle)
Break
Click
Sleep 83 ; Make this number higher for slower clicks, lower for faster.
}
Return

What's the point of including the Toggle := !toggle
and If (!Toggle) ?
break

Re: Auto Clicker

Posted: 25 Jan 2018, 21:38
by GreatGazoo
MOPixels wrote:^z::
Toggle := !Toggle
Loop
{
If (!Toggle)
Break
Click
Sleep 83 ; Make this number higher for slower clicks, lower for faster.
}
Return

What's the point of including the Toggle := !toggle
and If (!Toggle) ?
break
it's how to break the loop that would run continuously , or else it will run out of control with no way to turn it off

Re: Auto Clicker

Posted: 26 Jan 2018, 22:29
by MOPixels
Hm, I still don't really understand it. What I'm confused about, is really what Toggle := !Toggle is. Is Toggle a variable being asigned to !Toggle? But then wouldn't !Toggle also be a variable? And moreover, how would the computer know what !Toggle is, if it is to be a variable with no input?

Re: Auto Clicker

Posted: 26 Jan 2018, 22:52
by gregster
"Toggle" is the only variable in this line. ! on the other hand, works as the logical "NOT" operator. (See ! and NOT here: https://autohotkey.com/docs/Variables.htm#operators.)
Now, the statement Toggle := !Toggle changes the contents of Toggle fromtrue to false and vice versa. Thus, a toggle...

Re: Auto Clicker

Posted: 26 Jan 2018, 22:56
by GreatGazoo
MOPixels wrote:Hm, I still don't really understand it. What I'm confused about, is really what Toggle := !Toggle is. Is Toggle a variable being asigned to !Toggle? But then wouldn't !Toggle also be a variable? And moreover, how would the computer know what !Toggle is, if it is to be a variable with no input?
The exclamation point just means "Not", so !Toggle being "not toggle" and in the script !toggle does something

https://autohotkey.com/docs/Variables.htm
Logical-not (!): If the operand is blank or 0, the result of applying logical-not is 1, which means "true". Otherwise, the result is 0 (false). For example: !x or !(y and z). Note: The word NOT is synonymous with ! except that ! has a higher precedence. [v1.0.46+]: Consecutive unary operators such as !!Var are allowed because they are evaluated in right-to-left order.

Code: Select all

#maxThreadsPerHotkey, 2
setKeyDelay, 50, 50
setMouseDelay, 50
banana:=0

$f1::
	; banana:=!banana .... This assigns banana to the value of NOT (!) banana. so lets
	; say banana starts out FALSE (0). you then turn banana to NOT FALSE. which is
	; TRUE (1). so now banana is set to TRUE. and then lets say you toggle it again.
	; you set banana to NOT TRUE, which is FALSE. banana is now set to FALSE. 
	; .... 1 is true, 0 is false. ! is NOT.
	banana:=!banana
	
	while (banana=1)
	{
		send, hello{space}
		sleep, 100
	}
return

Re: Auto Clicker

Posted: 29 Jan 2018, 13:49
by MOPixels
Okay, I am slowly getting it. However, in the autoclicker script, it says, "If (!Toggle)
break
So I assume that everytime you activate the hotkey, it will change the property of Toggle to True/False, which will then break it? What I don't get is if ! changes a variable to a qualitative or quantitative toggle?

When toggling the hotkey, will it change Toggle to True/False, or change the variable into 1/0?

Re: Auto Clicker

Posted: 29 Jan 2018, 13:52
by MOPixels
What I also want to question is that on the autoclicker script, it doesn't mention whether Toggle is set to True, or False. So do all variable start off as false?

Re: Auto Clicker

Posted: 29 Jan 2018, 14:01
by MOPixels

Code: Select all

^q::

toggle := !toggle

loop
{
	If (!toggle)
		break

	loop, 23
	{
	send, q
	Sleep 200
	}
		
	send, {Shift Down}
	Sleep 9000
	send, {Shift Up}
}
			
Return
This is my script, I think if you see this it will be easier to identify what is going on.

Re: Auto Clicker

Posted: 25 Dec 2018, 19:26
by Mrcrazypants2
just hit = to start or stop it

Code: Select all

Pause ON

loop
{
click
}

=::Pause

Re: Auto Clicker

Posted: 03 May 2020, 02:31
by bigchill055
hello im new to this whole scripting thing.. i just want a clicker for ingame where it just clicks automatically every 2 or so seconds that will stay on constantly till turned off.

Re: Auto Clicker

Posted: 04 May 2020, 12:28
by snnail
neomulemi6 wrote:
03 Jul 2016, 11:58
This will click 12 times/second, toggled on/off with ctrl + z.

Code: Select all

#MaxThreadsPerHotkey 3

^z::
Toggle := !Toggle
Loop
{
	If (!Toggle)
		Break
	Click
	Sleep 83 ; Make this number higher for slower clicks, lower for faster.
}
Return
NEw to this what should i do to change to right click?TIA

Re: Auto Clicker

Posted: 14 May 2020, 02:15
by ButterZ
snnail wrote:
04 May 2020, 12:28
neomulemi6 wrote:
03 Jul 2016, 11:58
This will click 12 times/second, toggled on/off with ctrl + z.

Code: Select all

#MaxThreadsPerHotkey 3

^z::
Toggle := !Toggle
Loop
{
	If (!Toggle)
		Break
	Click
	Sleep 83 ; Make this number higher for slower clicks, lower for faster.
}
Return
NEw to this what should i do to change to right click?TIA
You would change "click" to what ever button you want instead-

Re: Auto Clicker

Posted: 07 Jun 2020, 03:39
by JustArtemis
can someone please find me a script that just presses a button until I turn it off the button can be G and the start button is =

Auto Clicker

Posted: 21 Oct 2020, 07:40
by Shivaansh
Can someone please tell me the codes to make an autoclicker which works on a particular window?
Like I am doing stuff on internet and it is working on a chosen window without interfering?

Re: Auto Clicker

Posted: 03 Feb 2021, 00:18
by kathyalex
First of all thank you for the thread. I'm a Roblox fan and I want to make an auto clicker for Roblox anyone can guide me on how can I make Roblox Broken Link for safety auto clicker? One more thing is that it should not ban the Roblox account. Thanks