Simulating clicks then differentiate between real clicks and simulated clicks

Posts 1–9 of 9 · Page 1 of 1
Simulating clicks then differentiate between real clicks and simulated clicks
I am making a rapid fire script, which simulates a click every (x) milliseconds, but only when mousedown (Held). And it should stop when mouseup occurs, but because its simulating clicks it cannot differentiate between real clicks and simulated ones, meaning that it doesn't detect the real mouseup. Here is my current code:

Code:
Public Class Form1
    Private Declare Function GetKeyPress Lib "user32" Alias "GetAsyncKeyState" (ByVal key As Integer) As Integer
    Private Declare Sub mouse_event Lib "user32" (ByVal dwflags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cbuttons As Integer, ByVal dwextrainfo As Integer)
    Private Const mouseclickup = 4
    Private Const mouseclickdown = 2

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Timer1.Enabled = True
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Timer1.Enabled = False
    End Sub

    Private Sub NumericUpDown1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NumericUpDown1.ValueChanged
        Timer1.Interval = NumericUpDown1.Value
    End Sub

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

    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        If GetKeyPress(1) = 0 Then
            'Mouseup
            Timer1.Enabled = False
        Else
            'Mousedown
            Timer1.Enabled = True
        End If
    End Sub
End Class
Bump. Still no solution.
What're you asking for exactly?
Quote Originally Posted by DawgiiStylz View Post
What're you asking for exactly?
He has the same problem I'm having (link). If you try to make a rapid fire clicking it will start a loop of infinite clicking. Thus, needing to detect the actual mouse up is needed to stop the clicking.
Well, unless it's really important to have the Left mouse click as the trigger, use MB3 (scroll click).
Quote Originally Posted by Raow View Post
Well, unless it's really important to have the Left mouse click as the trigger, use MB3 (scroll click).
Most people have that as their leathal/knife, so its quite inconvenient. I know you can do it, someone who posted a rapid fire in the black ops 2 section does it.
Quote Originally Posted by RE4CTIVE View Post
Most people have that as their leathal/knife, so its quite inconvenient. I know you can do it, someone who posted a rapid fire in the black ops 2 section does it.
Ah, i see. Well, i'm not too sure then.
And also, i'd suggest removing the middleman suggestion in your signature, Middlemanning as a MPGH member can result in a ban.
Quote Originally Posted by Raow View Post
Ah, i see. Well, i'm not too sure then.
And also, i'd suggest removing the middleman suggestion in your signature, Middlemanning as a MPGH member can result in a ban.
Hm, thats interesting that it would result in a ban
Anyway thank you, ill remove that now
Quote Originally Posted by RE4CTIVE View Post
Hm, thats interesting that it would result in a ban
Anyway thank you, ill remove that now
When you solve/fix the problem, can you inform me?
I'm interested as well, i wouldn't mind the code for a pistol auto clicker.
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?