![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jul 2005
Posts: 2
Rep Power: 0
![]() |
Help with autoclicker...
I really want to program an autoclicker for myself. the part i need is how to get the program to actually "click"...but i dont know how to go about coding that...could anyone help me out?
|
|
|
|
|
|
#2 |
|
Expert Programmer
|
The simplest way is the mouse_event win32 routine, as far as I can tell it emulates at hardware level.
Put this in a module and set startup to sub main. It'll click 50 times each second, so keep the cursor away from that self destruct button ![]() Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As MouseEventFlags, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Enum MouseEventFlags
MOUSEEVENTF_LEFTDOWN = &H2
MOUSEEVENTF_LEFTUP = &H4
MOUSEEVENTF_MIDDLEDOWN = &H20
MOUSEEVENTF_MIDDLEUP = &H40
MOUSEEVENTF_MOVE = &H1
MOUSEEVENTF_ABSOLUTE = &H8000
MOUSEEVENTF_RIGHTDOWN = &H8
MOUSEEVENTF_RIGHTUP = &H10
End Enum
Public Sub Main()
For Clickeeeee = 1 To 50
Dim mouseButtons As Long ' Pointer to mouse button struct - unused
Dim dwEI As Long ' Pointer to Extra Info struct - unused
' N.B. A mouse "click" is Down then Up
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0&, 0&, mouseButtons, dwEI
NoFreezeSleep 1
Next
End Sub
Private Sub NoFreezeSleep(ByVal NumSecs As Long)
Dim EntryTime As Long
EntryTime = Timer
Do
DoEvents
Loop While (Timer - EntryTime) < NumSecs
End Sub |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Jul 2005
Posts: 2
Rep Power: 0
![]() |
wow...thanks
![]() |
|
|
|
|
|
#4 |
|
Expert Programmer
|
No probs! For an RPG stat roller or something?
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|