Auto-Clicker Help pl0x?
Okaay. so i was making an AutoClicker, and i encountered some problems.
i got it to work, with hotkeys too!
F1 - starts the clicking,
F2 - Is supposed to end it, but it doesnt ?
heres the code
i got it to work, with hotkeys too!
F1 - starts the clicking,
F2 - Is supposed to end it, but it doesnt ?
heres the code
Code:
Public Class Form1
Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.F1 Then
Timer1.Start()
Else
If e.KeyCode = Keys.F2 Then
Timer1.Stop()
End If
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
KeyPreview = True
End Sub
Private Sub MyMethod()
Windows.Forms.Cursor.Position = New System.Drawing.Point(Windows.Forms.Cursor.Position)
mouse_event(&H2, 0, 0, 0, 1) 'cursor will go down (like a click)
mouse_event(&H4, 0, 0, 0, 1) ' cursor goes up again
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
MyMethod()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Start()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Stop()
End Sub
End Class
