Sign in to follow this  
Followers 0
STAEDTLER

Rapid fire mouse click

9 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

the code you give me continues to rapidfire/loop/keep clicking even if I stop holding the left click....

Share this post


Link to post
Share on other sites

hey im new to autoit but shouldnt the mouse up command come after the 'untill' keyword


Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Can't I use key 01?? Is there a way to use it instead of useing a different key ?

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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

Share this post


Link to post
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
Sign in to follow this  
Followers 0