forumghost Posted April 3, 2008 Share Posted April 3, 2008 #Include <Misc.au3> $dll = DllOpen("user32.dll") Dim $Enabled HotKeySet("x", "Quit"); Func Quit() Exit EndFunc While 1 if _IsPressed(01, $dll) then $Enabled = 1 tooltip ("Enabled!") Else $Enabled = 0 tooltip("Disabled!") Endif If $Enabled = 1 then MouseClick ( "left") Endif sleep(10) Wend DllClose($dll) ;quit This code is for an autoclicker I tried making, while holding down the left mouse button it should simply continue autoclicking the LMB superfast, and when I release it, it should stop clicking. But it doesn't work, ispressed only gets the event once and disables evrything right after. I need help :/ Link to comment Share on other sites More sharing options...
MDCT Posted April 3, 2008 Share Posted April 3, 2008 Hi, Usually I use: If _IsPressed('01') then Tooltip("Active") While _IsPressed('01') Do ur script..... WEnd Tooltip("") EndIf Hope it helps. Link to comment Share on other sites More sharing options...
forumghost Posted April 3, 2008 Author Share Posted April 3, 2008 Hi, Usually I use: If _IsPressed('01') then Tooltip("Active") While _IsPressed('01') Do ur script..... WEnd Tooltip("") EndIf Hope it helps. #Include <Misc.au3> $dll = DllOpen("user32.dll") Dim $Enabled HotKeySet("x", "Quit"); Func Quit() Exit EndFunc While 1 While _IsPressed(46, $dll) tooltip ("Autoclicking...") MouseClick("left") sleep(10) Wend sleep(10) Wend DllClose($dll) ;quit This one works fine for pressing F now. But I want it to work with LMB....but when I put in "01"(thats LMB) then it will register only once and not send any clicks Link to comment Share on other sites More sharing options...
MDCT Posted April 3, 2008 Share Posted April 3, 2008 (edited) So, basically you want to press and hold the LMB, then the script would click repetitively? Maybe this? #Include <Misc.au3> While _IsPressed('01') MouseClick("left") sleep(20) WEnd I never use mouseclick though, so I do not really know the result. But this should work fine. And I suggest not to put tooltip in the while loop, because it would take unnecessary CPU time for creating the tooltip all the time while the button is pressed. EDIT: You might need to use MouseClickDelay also. Not sure though. Hope someone more expert on mouseclick could help you better. Good luck. Edited April 3, 2008 by MDCT Link to comment Share on other sites More sharing options...
forumghost Posted April 3, 2008 Author Share Posted April 3, 2008 So, basically you want to press and hold the LMB, then the script would click repetitively? Maybe this? #Include <Misc.au3> While _IsPressed('01') MouseClick("left") sleep(20) WEnd I never use mouseclick though, so I do not really know the result. But this should work fine. And I suggest not to put tooltip in the while loop, because it would take unnecessary CPU time for creating the tooltip all the time while the button is pressed. EDIT: You might need to use MouseClickDelay also. Not sure though. Hope someone more expert on mouseclick could help you better. Good luck. And exactly that doesn't work for some strange reason... Link to comment Share on other sites More sharing options...
Richard Robertson Posted April 3, 2008 Share Posted April 3, 2008 When you are holding the physical mouse button, you'd just get conflicting values. Trying to simulate letting go of a button and holding the button will almost always cause a problem. Try a keyboard key instead. Link to comment Share on other sites More sharing options...
forumghost Posted April 3, 2008 Author Share Posted April 3, 2008 When you are holding the physical mouse button, you'd just get conflicting values. Trying to simulate letting go of a button and holding the button will almost always cause a problem. Try a keyboard key instead.A keyboard key works fine, but its not what I really want, isnt there a workaround? Link to comment Share on other sites More sharing options...
Tvern Posted April 3, 2008 Share Posted April 3, 2008 A keyboard key works fine, but its not what I really want, isnt there a workaround?I can't think of anything myself. Would it be good enough if it worked on pushing one of the other mousebuttons instead? that would be quite easy. Link to comment Share on other sites More sharing options...
Richard Robertson Posted April 3, 2008 Share Posted April 3, 2008 Yeah, just use the middle button or one of the X buttons if you have them. The right button may cause problems if you use that one. Link to comment Share on other sites More sharing options...
Siao Posted April 4, 2008 Share Posted April 4, 2008 Try ControlClick instead of MouseClick. "be smart, drink your wine" Link to comment Share on other sites More sharing options...
Richard Robertson Posted April 4, 2008 Share Posted April 4, 2008 He wants it at the mouse location. Link to comment Share on other sites More sharing options...
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