STAEDTLER Posted January 21, 2009 Posted January 21, 2009 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
IKilledBambi Posted January 21, 2009 Posted January 21, 2009 (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 January 21, 2009 by IKilledBambi
STAEDTLER Posted January 21, 2009 Author Posted January 21, 2009 the code you give me continues to rapidfire/loop/keep clicking even if I stop holding the left click....
zac23 Posted January 21, 2009 Posted January 21, 2009 hey im new to autoit but shouldnt the mouse up command come after the 'untill' keyword
IKilledBambi Posted January 21, 2009 Posted January 21, 2009 (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 January 21, 2009 by IKilledBambi
STAEDTLER Posted January 21, 2009 Author Posted January 21, 2009 Can't I use key 01?? Is there a way to use it instead of useing a different key ?
IKilledBambi Posted January 21, 2009 Posted January 21, 2009 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)
Fohsap Posted December 8, 2011 Posted December 8, 2011 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.
Fohsap Posted December 8, 2011 Posted December 8, 2011 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now