Hello, i would like to know how to make the mouse click every 2 seconds.
doset matter about co-ordinates i dont need to bother about that
Printable View
Hello, i would like to know how to make the mouse click every 2 seconds.
doset matter about co-ordinates i dont need to bother about that
Check this post outQuote:
Originally Posted by Gunner54
thats... hard to understand what hes on about sorry =(
i just want the click left mouse click every 2 seconds
Have you written any code yet? Most people here will assist you in your endeavors but they areen't going to write the code for you without seeing that you are attempting to solve your own problem.
yes i do write vb codes, but NEVER had tryed this before so... :S im new to mouse macro
I didn't ask if you have written code before, I was asking if you have done relative to your question?
NVM I just got the hang of it ;)
Make two buttons and add a timer
Module #1
VB Code:
Declare Function GetCursorPos& Lib "user32" (lpPoint As PointAPI) Type PointAPI x As Long y As Long End Type Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long) Public Const MOUSEEVENTF_LEFTDOWN = &H2 Public Const MOUSEEVENTF_LEFTUP = &H4 Sub MouseMove(xP As Long, yP As Long) Dim move move = SetCursorPos(xP, yP) End Sub Sub LeftClick(xP As Long, yP As Long) mouse_event MOUSEEVENTF_LEFTDOWN, xP, yP, 0, 0 mouse_event MOUSEEVENTF_LEFTUP, xP, yP, 0, 0 End Sub
add this code to your project
VB Code:
Private Sub Command1_Click() Timer2.Enabled = True End Sub Private Sub Command2_Click() Timer2.Enabled = False End Sub Private Sub Timer1_Timer() Dim xP As Long Dim yP As Long Dim move As Long LeftClick (xP), (yP) End Sub
now you have a clicker =) (change the timer settings to change how fast it clicks)