Auto Clicker Topic is solved

Ask gaming related questions
Te Waffles
Posts: 31
Joined: 01 Jul 2016, 21:31

Auto Clicker

02 Jul 2016, 23:05

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.
neomulemi6
Posts: 216
Joined: 30 Jun 2016, 06:01

Re: Auto Clicker  Topic is solved

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
Te Waffles
Posts: 31
Joined: 01 Jul 2016, 21:31

Re: Auto Clicker

04 Jul 2016, 23:52

Thx neomulemi6. It works perfectly!
budboradjong

Re: Auto Clicker

06 Jan 2018, 21:09

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.
F0RSAKEN

Re: Auto Clicker

20 Jan 2018, 02:57

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
MOPixels
Posts: 5
Joined: 25 Jan 2018, 18:13

Re: Auto Clicker

25 Jan 2018, 18:23

^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
GreatGazoo
Posts: 69
Joined: 28 Dec 2017, 02:53

Re: Auto Clicker

25 Jan 2018, 21:38

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
MOPixels
Posts: 5
Joined: 25 Jan 2018, 18:13

Re: Auto Clicker

26 Jan 2018, 22:29

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?
User avatar
gregster
Posts: 1428
Joined: 30 Sep 2013, 06:48

Re: Auto Clicker

26 Jan 2018, 22:52

"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...
GreatGazoo
Posts: 69
Joined: 28 Dec 2017, 02:53

Re: Auto Clicker

26 Jan 2018, 22:56

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
MOPixels
Posts: 5
Joined: 25 Jan 2018, 18:13

Re: Auto Clicker

29 Jan 2018, 13:49

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?
MOPixels
Posts: 5
Joined: 25 Jan 2018, 18:13

Re: Auto Clicker

29 Jan 2018, 13:52

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?
MOPixels
Posts: 5
Joined: 25 Jan 2018, 18:13

Re: Auto Clicker

29 Jan 2018, 14:01

^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.

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 16 guests