How to make a Mouse Macro
Posted: Sat Mar 12, 2011 6:44 am
Hello Everyone,
I haven't wrote any tutorial lately but here is one. This is a tutorial about how to make a mouse macro. In this application, you simply enter the co-ordinates to move the mouse to and also it's speed. Just follow the tutorial and the results will be amazing. You can even use this technique to make a mouse macro in which you can enter multiple values using a timer. I found this project today when I was cleaning my computer. I got a PM by Scottie and he gave me the link to the site from whom I got this project a while ago. He gave a simple tutorial and I followed it and made an application out of it. Now I found it today and didn't knew who made it so here are the credits:
Article: http://www.sythe.org/showthread.php?t=160151
Author: slashshot007
---------------------------------------------------------------------------
First of all, open Visual Basic 2008, create a new project, choose Windows Forms Application, type in the textbox Mouse Macro and press the OK button. As soon as you have done this, the Form1 will appear on the screen on which we will design our application and code it.
First we will do the designing and then the coding. So now we will change the Form1's properties to make it look good. Change the Form1's Text property to Mouse Macro. Change it's StartPosition property to CenterScreen. Change it's MaximizeBox and MinimizeBox property to False.
Now add the following things to the form:
(1)_ 4 Labels. Change Label1's Text property to anything as long as it shows you the thing to do. Change Label2's Text property to X, Label3's to Y and Label4's to S or Speed.
(2)_ 3 TextBoxes. Place the first one below X, second one below Y and third one below S.
(3)_ 1 Button. Change it's Text property to "Move".
Now is the time to code Form1 and it's components. So right-click on the form in the Solution Explorer and click View Code.
Type the following code after the Public Class Form1:
---------------------------------------------------------------------------
Great Job! You have just completed making a Mouse Macro. Now debug and run it by pressing the Start Debugging button located at the main toolstrip. Test it, if it works fine then its SAVING time. You can save your project by going to File -> Save All and then pressing Save.
And there! You have your project and application that works. If you have any problem or can't understand something, please feel free to ask by either a comment or by PM. I have also attached a screenshot.
Please use the Give Thanks button and the Reputation System to appreciate my hard work. I have wrote this tutorial while making a Mouse Macro project myself so you can download the source file in the attachments.
Thank you.
![Image]()
I haven't wrote any tutorial lately but here is one. This is a tutorial about how to make a mouse macro. In this application, you simply enter the co-ordinates to move the mouse to and also it's speed. Just follow the tutorial and the results will be amazing. You can even use this technique to make a mouse macro in which you can enter multiple values using a timer. I found this project today when I was cleaning my computer. I got a PM by Scottie and he gave me the link to the site from whom I got this project a while ago. He gave a simple tutorial and I followed it and made an application out of it. Now I found it today and didn't knew who made it so here are the credits:
Article: http://www.sythe.org/showthread.php?t=160151
Author: slashshot007
---------------------------------------------------------------------------
First of all, open Visual Basic 2008, create a new project, choose Windows Forms Application, type in the textbox Mouse Macro and press the OK button. As soon as you have done this, the Form1 will appear on the screen on which we will design our application and code it.
First we will do the designing and then the coding. So now we will change the Form1's properties to make it look good. Change the Form1's Text property to Mouse Macro. Change it's StartPosition property to CenterScreen. Change it's MaximizeBox and MinimizeBox property to False.
Now add the following things to the form:
(1)_ 4 Labels. Change Label1's Text property to anything as long as it shows you the thing to do. Change Label2's Text property to X, Label3's to Y and Label4's to S or Speed.
(2)_ 3 TextBoxes. Place the first one below X, second one below Y and third one below S.
(3)_ 1 Button. Change it's Text property to "Move".
Now is the time to code Form1 and it's components. So right-click on the form in the Solution Explorer and click View Code.
Type the following code after the Public Class Form1:
Code: Select all
Add the following code to Button1 by double-clicking it:
Sub movemousesmooth(ByVal x As Integer, ByVal y As Integer, ByVal speed As Integer)
Dim currentlocationx As Integer, currentlocationy As Integer, random As Integer
currentlocationx = Windows.Forms.Cursor.Position.X
currentlocationy = Windows.Forms.Cursor.Position.Y
Do Until currentlocationx = x And currentlocationy = y
If speed = 1 Then
random = 1
Else
random = CStr(Int(Rnd() * speed))
If random = 0 Then random = CStr(Int(Rnd() * speed))
End If
If currentlocationx > x Then currentlocationx = currentlocationx - random
If currentlocationx < x Then currentlocationx = currentlocationx + random
If currentlocationy > y Then currentlocationy = currentlocationy - random
If currentlocationy < y Then currentlocationy = currentlocationy + random
Windows.Forms.Cursor.Position = New Point(currentlocationx, currentlocationy)
Wait(0.5)
Loop
End Sub
Public Declare Function timeGetTime Lib "winmm.dll" () As Long
Public Sub Wait(ByVal TimeOut As Long)
Dim CurrentTime As Long
CurrentTime = timeGetTime()
Do
System.Windows.Forms.Application.DoEvents()
Loop While CurrentTime + TimeOut > timeGetTime()
End Sub
Code: Select all
This code "movemousesmooth" is the thing which will do the thing, if that makes sense lol.movemousesmooth(TextBox1.Text, TextBox2.Text, TextBox3.text)
---------------------------------------------------------------------------
Great Job! You have just completed making a Mouse Macro. Now debug and run it by pressing the Start Debugging button located at the main toolstrip. Test it, if it works fine then its SAVING time. You can save your project by going to File -> Save All and then pressing Save.
And there! You have your project and application that works. If you have any problem or can't understand something, please feel free to ask by either a comment or by PM. I have also attached a screenshot.
Please use the Give Thanks button and the Reputation System to appreciate my hard work. I have wrote this tutorial while making a Mouse Macro project myself so you can download the source file in the attachments.
Thank you.
