Exclamation[HELP] Fast Mouse Click Code[Solved]

Posts 1–7 of 7 · Page 1 of 1
[HELP] Fast Mouse Click Code[Solved]
Public Class Form1
Private Declare Sub mouse_event Lib "user32" (ByVal dvflags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cbuttons As Long, ByVal dvextrainfo As Long) Private Const mousclickup = 4 Private Const mousclickdown = 2
Private Const mouseclickup = 4
Private Const mouseclickdown = 2
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
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

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
mouse_event(mouseclickdown, 0, 0, 0, 0)
mouse_event(mouseclickup, 0, 0, 0, 0)
End Sub

Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Dim hotkey As Boolean
hotkey = GetasynckeyState(Keys.F9)
If hotkey = True Then Timer1.Start()
Dim hotkey1 As Boolean
hotkey1 = GetasynckeyState(Keys.F10)
If hotkey1 = True Then Timer1.Stop()
End Sub
End Class








Could anyone help me with this???? im confused
Why do you have the hotkeys on a timer event? Also, you never start timer2 so it will never tick.

EDIT: And what, specifically, is your problem? I just tried it and it clicks a **** ton of times which is what its supposed to do. Right?

EDIT the EDIT: If it's the hotkeys not working, you haven't started timer2 so it will never tick and the hotkeys won't work. Just add:
Code:
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer2.Start()
    End Sub
and it should work fine with the hotkeys.
Alright, well you told me that it didn't click at all when you tried it. I have:

[php]Public Class Form1
'Declare mouseclick
Private Declare Sub mouse_event Lib "user32" (ByVal dvflags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cbuttons As Long, ByVal dvextrainfo As Long)
Private Const mouseclickup = 4
Private Const mouseclickdown = 2
'Get hotkeys
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Timer start on button1 click
Timer1.Start()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'Timer stop on button2 click
Timer1.Stop()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
'When timer ticks, click mouse
mouse_event(mouseclickdown, 0, 0, 0, 0)
mouse_event(mouseclickup, 0, 0, 0, 0)
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
'Declare hotkeys
Dim hotkey As Boolean
'Key F9 starts timer1
hotkey = GetAsyncKeyState(Keys.F9)
If hotkey = True Then Timer1.Start()
'Key F10 stops timer1
Dim hotkey1 As Boolean
hotkey1 = GetAsyncKeyState(Keys.F10)
If hotkey1 = True Then Timer1.Stop()
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer2.Start()
End Sub
End Class[/php]

Now I see that you have:
Code:
Private Const mousclickup = 4 Private Const mousclickdown = 2
Private Const mouseclickup = 4
Private Const mouseclickdown = 2
twice on it. Try what I have written. Works fine for me.
C&P doesn't work.
This is leeched form crossfire isn't it?
This should be closed. It's already been solved since he released a fast clicker already.
put PHP/Code tags please.
Edit: Shark don't double post.
Posts 1–7 of 7 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?