How to Create an AutoClicker

Norvik

Retired Staff
Contributor
Jul 18, 2015
635
588
157
Thats my private AutoClicker, which was made to glitch some money on ArmA III :D
b444fa78fa.png


Requirements
-
basic knowledge of VB.net or just enough skills to copy & paste everything

Step 1
Add 2 Buttons, 1 Timer, 1 NumericUpDown and 2 Labels to your form. Set the text of Label1 to "AutoClicker =" and place the Label2 next to it like you get "AutoClicker = Label2". Now double click on your form so you can edit the Form1_load section. Add the following code in this section.
Code:
Label2.Text = "Disabled"
Label2.ForeColor = Color.Red
Your Form should look like this
b5d6be5f0c.png


Step 2
Double click the timer, add the following code and set the timer interval to 1.
Code:
mouse_event(mouseclickup, 0, 0, 0, 0)
mouse_event(mouseclickdown, 0, 0, 0, 0)

Step 3
Now set the text of one button to start and the other one to stop. Double click on the start button and add the following Code.
Code:
Timer1.Interval = (NumericUpDown1.Value)
Timer1.Enabled = True
Label2.Text = "Enabled"
Label2.ForeColor = Color.Green

Step 4
Now double click the "stop" button add this code.
Code:
Timer1.Enabled = False
Label2.Text = "Disabled"
Label2.ForeColor = Color.Red
mouse_event(mouseclickup, 0, 0, 0, 0)

Step 5
Go to the properties of your NumericUpDown and set the lowest possible value to 1, that means that the autoclicker can make 1 click every millisecond.

Congratz you've made your own AutoClicker :D

Be shure that the value of NumericUpDown1 isn't below 1 because your programm will crash because it can't click every 0 milliseconds (we could prevent this crash but it will require more code :D maybe i'll add it later)

Now i'll show you a method to create hotkeys. You'll need them because it's a really big problem to stop the autoclicker if it clicks every millisecond, it will open everything on your desktop multiple times if you swipe across it to click on the close button of your programm :D To prevent this, we'll add some hotkeys to turn the autoclicker off. I'll use F1 and F2.

Step 1

Go to your Form1_Load section and register 2 new hotkeys. You can edit the Keys by changing the Keys.F1 to Keys.A Keys.B Keys.C... i think you know how that works.
Code:
RegisterHotKey(Me.Handle, 1, Key_NONE, Keys.F1)
RegisterHotKey(Me.Handle, 2, Key_NONE, Keys.F2)

Step 2
Add the following code to the Form1_FormClosing Event to unregister the registered hotkeys if you close your programm.
Code:
UnregisterHotKey(Me.Handle, 1)
UnregisterHotKey(Me.Handle, 2)

Step 3
Paste the following into your form.
Code:
  Private Declare Function RegisterHotKey Lib "user32" (ByVal hWnd As IntPtr, ByVal id As Integer, ByVal fsModifier As Integer, ByVal vk As Integer) As Integer
  Private Declare Sub UnregisterHotKey Lib "user32" (ByVal hWnd As IntPtr, ByVal id As Integer)
  Private Const Key_NONE As Integer = &H0
  Private Const WM_HOTKEY As Integer = &H312
  Protected Overrides Sub WndProc(ByRef m As Message)
  If m.Msg = WM_HOTKEY Then
  Select Case m.WParam
  Case 1
  Timer1.Interval = (NumericUpDown1.Value)
  Timer1.Enabled = True
  Label2.Text = "Enabled"
  Label2.ForeColor = Color.Green
  Case 2
  Timer1.Interval = (NumericUpDown1.Value)
  Timer1.Enabled = False
  Label2.Text = "Disabled"
  Label2.ForeColor = Color.Red
  mouse_event(mouseclickup, 0, 0, 0, 0)
  End Select
  End If
  MyBase.WndProc(m)
  End Sub
 
Top