Jump to content

Rapid fire mouse click


Recommended Posts

I'm making a script that rapidfire/loop the mouse click while the left mouse button is help down.

But,I dont know what to add to my script to do so. Right now it's more of a on and off toggle. I want it to stop clicking when the button is up. TY

#include <Misc.au3>

$hDll = DllOpen("user32.dll")

MsgBox(0, "Info", 'Press "Left Click" key for rapid fire')

While 1
    If _IsPressed("01", $hDll) Then
        Do
            MouseDown ( "left" )
            sleep(38)
            MouseUp("left")
            sleep(38)
        Until _IsPressed("01", $hDll) = 1
    EndIf
    Sleep(100)
WEnd

Func OnAutoItExit()
    DllClose($hDll)
EndFunc
Link to comment
Share on other sites

Here you go.

#include <Misc.au3>

$hDll = DllOpen("user32.dll")

MsgBox(0, "Info", 'Press "Left Click" key for rapid fire')

While 1
_IsPressed("01", $hDll)
            MouseClick("left")
            sleep(38)
     ;  Until _IsPressed("01", $hDll) = 1
    Sleep(100)
WEnd

Func OnAutoItExit()
    DllClose($hDll)
EndFunc
Edited by IKilledBambi
Link to comment
Share on other sites

I think an update might have been made idk I don't see anything about it in the change log, it used to be that if _ispressed would be called repeatedly. Ok I think I see..

This presses mouse click until you come up.

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    If _IsPressed("02", $dll) Then
        MouseClick("left")
    EndIf
WEnd
DllClose($dll)

I guess the mouseup event is unclicking your mouse. You're gonna need a new key.

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    If _IsPressed("01", $dll) Then
        MouseClick("left")
    EndIf
WEnd
DllClose($dll)
Edited by IKilledBambi
Link to comment
Share on other sites

This works but it bugs out a little sometimes. Try raising the sleep to make it bug out less.

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    Sleep(100)
    If _IsPressed("01", $dll) Then
        MouseClick("left")
        MouseDown("left")
    EndIf
WEnd
DllClose($dll)
Link to comment
Share on other sites

  • 2 years later...

This seems extremely basic, but I couldn't make it work, either. The first several attempts just fail and obviously weren't tested. The last two work, kind of. When the key is pressed, the auto fire starts. When it's pressed again it stops. A "rapid fire" button fires rapidly while pressed and stops when unpressed. An "auto fire" button fires rapidly when pressed until pressed again.

I tried this:

#include <Misc.au3> $dll = DllOpen("user32.dll") While 1     Sleep(100)     While _IsPressed("01", $dll) Then         MouseClick("left")         MouseDown("left")     WEnd WEnd DllClose($dll)

Didn't change the result, though.

Link to comment
Share on other sites

You know, I'm actually having trouble with sending a mouse click only two times. I've been browsing the forums for a while, now. I can send a line of text, but I can't send mouse clicks without getting a "rapid mouse click" problem. :D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...