|
-
Oct 16th, 2006, 03:11 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Macro In VB
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
-
Oct 16th, 2006, 03:13 PM
#2
Re: Macro In VB
 Originally Posted by Gunner54
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 out
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
Oct 16th, 2006, 03:16 PM
#3
Thread Starter
Addicted Member
Re: Macro In VB
thats... hard to understand what hes on about sorry =(
i just want the click left mouse click every 2 seconds
-
Oct 16th, 2006, 03:22 PM
#4
Re: Macro In VB
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.
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
Oct 16th, 2006, 03:23 PM
#5
Thread Starter
Addicted Member
Re: Macro In VB
yes i do write vb codes, but NEVER had tryed this before so... :S im new to mouse macro
-
Oct 16th, 2006, 03:37 PM
#6
Re: Macro In VB
I didn't ask if you have written code before, I was asking if you have done relative to your question?
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
Oct 16th, 2006, 03:41 PM
#7
Thread Starter
Addicted Member
Re: Macro In VB
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)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|