Feb 11, 2016 06:55 PM
(This post was last modified: Feb 12, 2016 04:55 PM by NinjaLeaks.)
Hey HackForums! Today I got a simple tutorial on how to make a easy Click Bot in Visual Studio.
What you will need:
*Visual Studio 2012+
*A little knowledge in visual basic
That's about it :D I will provide the code and all the steps :)
Step 1: You need to download and install Visual Studio onto your computer, Here is the link to the official website.
>>> https://www.visualstudio.com/en-us/visua...ge-vs.aspx
Step 2: After installing and opening Visual Studio select File>New>Project
Should look something like this:
![[Image: zDGzpXB.png]](https://imgur.com/zDGzpXB.png)
Step 3: Make sure that Visual basic is selected and make sure that Windows Forms Application is selected as well.
Then name your project however you please.
Should look like this:
![[Image: WbwbVyT.png]](https://imgur.com/WbwbVyT.png)
Click Ok
Step 4: Now when the page loads you want to drag 3 buttons, a label, a timer and a trackbar onto the form.
You can get all of these on the left side bar as shown bellow:
![[Image: TMrTmND.png]](https://imgur.com/TMrTmND.png)
Step 5: Now rename the buttons by clicking on a button and going to the bottom right hand side, scrolling through the different button properties and changing the box the says "text".
Should look like:
![[Image: EzvxZw2.png]](https://imgur.com/EzvxZw2.png)
Change button1 to "Start"
Change button2 to "Stop"
Change button3 to "Test"
Change label1 to "0"
Lastly change the trackbar min value to 1 and max to 100
So what we want the program to do is when we click button1 or "Start" the auto clicker will start at whatever rate our slider is on. When we click button2 or "Stop" we want the program to stop the auto clicking, and lastly we want when we click the "Test" button the label will show the number of times it was clicked.
Step 6: So now that we got all that set up lets jump into the code! Double click the "Start" button and lets start the timer and set so the speed of the timer depends on the trackbar. So to start the timer we will type to set the speed we will do
overall the code for Button1 should look as follows:
![[Image: OcqXq2L.png]](https://imgur.com/OcqXq2L.png)
Step 7: Before I get too ahead we need to define some variables at the top of the code. Right underneath Public
Class Form1 copy and past the following:
All this does is declares the mouse event that we will be using to make the clicks.
For the next variable we need to define mouseclickup and mouseclickdown these could be called anything but I am using mouseclickup/down just for simplicity.
Underneath the mouse_event we just created write:
and for the mouseclickdown we will put
The last thing bit of code we need to define is a integer which will be used to measure the number of times the test button is clicked.
To do this simply type
we are just defining "Test" as a new integer.
All the code for the top definitions should look like:
![[Image: DNaoMge.png]](https://imgur.com/DNaoMge.png)
Step 8: Now go back to the design screen and double click the "Stop" button, we will put one simple line of code here that will stop the timer.
Simply put: this stops the timer.
Step 9: Go back to the design screen again and this time double click on the "Test" button, here we will make the button add 1 to the score every time its clicked.
To do this we will type:
This line says that the integer we created "Test" is going to equal itself plus one. So every time the buttons clicked the integer will go up by one.
Next we will make the label display the integer "Test" every time the button is clicked.
The code for that is:
simple isn't it?
All the code for button3 should end up looking like this:
![[Image: ks9lllc.png]](https://imgur.com/ks9lllc.png)
Step 10: For the last chunk of code we will be writing the actual script that makes the mouse auto click.
To start off go back to the design screen and at the bottom you should see a small box that says timer1 at the bottom of the screen:
![[Image: Bfd8NKo.png]](https://imgur.com/Bfd8NKo.png)
double click that and it will bring you to its code. What we will be doing here is writing the code for every time the timer ticks which will then execute. We need to set the cursors position and drawing point first so type:
Next we will set the 'mouse_event' that we declared in the beginning to mouseclickdown and to mouseclickup.
To do this for mouseclickdown type:
and for mouseclickup we would do
That code should look like this
![[Image: hVJ8ddp.png]](https://i.imgur.com/hVJ8ddp.png)
Congrats! You finished writing all the code! 🤗
Here is a picture of what all the code should look like if you are having any troubles:
![[Image: NX0P1wY.png]](https://i.imgur.com/NX0P1wY.png)
The last thing that you would want to do is just make the design look more fancy or user friendly, however you like it :)
Just click the green "play" looking button at the top of the screen to run your auto clicker!
If anyone would like the source code here is a direct link> 🎉
Thanks for reading! I hope you benifited from my tutorial, took a while to write! 😝
If you have any questions, concerns please feel free to ask either bellow or in pm.
Have fun and stay safe!
-NinjaLeaks
What you will need:
*Visual Studio 2012+
*A little knowledge in visual basic
That's about it :D I will provide the code and all the steps :)
Step 1: You need to download and install Visual Studio onto your computer, Here is the link to the official website.
>>> https://www.visualstudio.com/en-us/visua...ge-vs.aspx
Step 2: After installing and opening Visual Studio select File>New>Project
Should look something like this:
![[Image: zDGzpXB.png]](https://imgur.com/zDGzpXB.png)
Step 3: Make sure that Visual basic is selected and make sure that Windows Forms Application is selected as well.
Then name your project however you please.
Should look like this:
![[Image: WbwbVyT.png]](https://imgur.com/WbwbVyT.png)
Click Ok
Step 4: Now when the page loads you want to drag 3 buttons, a label, a timer and a trackbar onto the form.
You can get all of these on the left side bar as shown bellow:
![[Image: TMrTmND.png]](https://imgur.com/TMrTmND.png)
Step 5: Now rename the buttons by clicking on a button and going to the bottom right hand side, scrolling through the different button properties and changing the box the says "text".
Should look like:
![[Image: EzvxZw2.png]](https://imgur.com/EzvxZw2.png)
Change button1 to "Start"
Change button2 to "Stop"
Change button3 to "Test"
Change label1 to "0"
Lastly change the trackbar min value to 1 and max to 100
So what we want the program to do is when we click button1 or "Start" the auto clicker will start at whatever rate our slider is on. When we click button2 or "Stop" we want the program to stop the auto clicking, and lastly we want when we click the "Test" button the label will show the number of times it was clicked.
Step 6: So now that we got all that set up lets jump into the code! Double click the "Start" button and lets start the timer and set so the speed of the timer depends on the trackbar. So to start the timer we will type
Code
Timer1.StartCode
Timer1.Interval = TrackBar1.Valueoverall the code for Button1 should look as follows:
![[Image: OcqXq2L.png]](https://imgur.com/OcqXq2L.png)
Step 7: Before I get too ahead we need to define some variables at the top of the code. Right underneath Public
Class Form1 copy and past the following:
Code
Declare Sub mouse_event Lib "user32.dll" Alias "mouse_event" (ByVal dwFlags As Int32, ByVal dx As Int32, ByVal dy As Int32, ByVal cButtons As Int32, ByVal dwExtraInfo As Int32)For the next variable we need to define mouseclickup and mouseclickdown these could be called anything but I am using mouseclickup/down just for simplicity.
Underneath the mouse_event we just created write:
Code
Private mouseclickup = 4and for the mouseclickdown we will put
Code
Private mouseclickdown = 2The last thing bit of code we need to define is a integer which will be used to measure the number of times the test button is clicked.
To do this simply type
Code
Dim Test As IntegerAll the code for the top definitions should look like:
![[Image: DNaoMge.png]](https://imgur.com/DNaoMge.png)
Step 8: Now go back to the design screen and double click the "Stop" button, we will put one simple line of code here that will stop the timer.
Simply put:
Code
Timer1.Stop()Step 9: Go back to the design screen again and this time double click on the "Test" button, here we will make the button add 1 to the score every time its clicked.
To do this we will type:
Code
Test = Test + 1Next we will make the label display the integer "Test" every time the button is clicked.
The code for that is:
Code
Label1.Text = Testsimple isn't it?
All the code for button3 should end up looking like this:
![[Image: ks9lllc.png]](https://imgur.com/ks9lllc.png)
Step 10: For the last chunk of code we will be writing the actual script that makes the mouse auto click.
To start off go back to the design screen and at the bottom you should see a small box that says timer1 at the bottom of the screen:
![[Image: Bfd8NKo.png]](https://imgur.com/Bfd8NKo.png)
double click that and it will bring you to its code. What we will be doing here is writing the code for every time the timer ticks which will then execute. We need to set the cursors position and drawing point first so type:
Code
Windows.Forms.Cursor.Position = New System.Drawing.Point(Windows.Forms.Cursor.Position)Next we will set the 'mouse_event' that we declared in the beginning to mouseclickdown and to mouseclickup.
To do this for mouseclickdown type:
Code
mouse_event(mouseclickdown, 0, 0, 0, 1)and for mouseclickup we would do
Code
mouse_event(mouseclickup, 0, 0, 0, 1)That code should look like this
![[Image: hVJ8ddp.png]](https://i.imgur.com/hVJ8ddp.png)
Congrats! You finished writing all the code! 🤗
Here is a picture of what all the code should look like if you are having any troubles:
![[Image: NX0P1wY.png]](https://i.imgur.com/NX0P1wY.png)
The last thing that you would want to do is just make the design look more fancy or user friendly, however you like it :)
Just click the green "play" looking button at the top of the screen to run your auto clicker!
If anyone would like the source code here is a direct link> 🎉
Thanks for reading! I hope you benifited from my tutorial, took a while to write! 😝
If you have any questions, concerns please feel free to ask either bellow or in pm.
Have fun and stay safe!
-NinjaLeaks
<3




