Warning Posted January 13, 2011 Share Posted January 13, 2011 Hello, I tried to do a universal AutoClicker but I can finish It Current Source: #include <Misc.au3> Local $hDll = DllOpen("user32.dll"), $iPaused = False HotKeySet("{ESC}", "_Terminate") While 1 Sleep(10) If $iPaused <> True And _IsPressed("01", $hDll) Then $pos = MouseGetPos() MouseClick("left", $pos[0], $pos[1]) Sleep(50) EndIf WEnd Func _Terminate() Exit 0 EndFunc But it isn't working. I think it's cuz this line: $pos = MouseGetPos() MouseClick("left", $pos[0], $pos[1]) Sleep(50) It presses once when i press the Lmouse. But I need a continously loop until I hold my hand on the Lmouse. I tried While 1 / WEnd but then the Loop will be infinite. Any idea? Link to comment Share on other sites More sharing options...
pedmacedo Posted January 14, 2011 Share Posted January 14, 2011 Hello, I tried to do a universal AutoClicker but I can finish It Current Source: #include <Misc.au3> Local $hDll = DllOpen("user32.dll"), $iPaused = False HotKeySet("{ESC}", "_Terminate") While 1 Sleep(10) If $iPaused <> True And _IsPressed("01", $hDll) Then $pos = MouseGetPos() MouseClick("left", $pos[0], $pos[1]) Sleep(50) EndIf WEnd Func _Terminate() Exit 0 EndFunc But it isn't working. I think it's cuz this line: $pos = MouseGetPos() MouseClick("left", $pos[0], $pos[1]) Sleep(50) It presses once when i press the Lmouse. But I need a continously loop until I hold my hand on the Lmouse. I tried While 1 / WEnd but then the Loop will be infinite. Any idea? If you use While 1 like you did, the loop will be infinite, but you will be able to terminate the script by pressing ESC. About the script, you don't need to get the mouse position if you are going to click where the mouse is poiting to. All you have to do is use the MouseClick function with only the first parameter. Link to comment Share on other sites More sharing options...
Newb Posted January 14, 2011 Share Posted January 14, 2011 (edited) this can be one #include <Misc.au3> While 1 If _IsPressed("01", "user32.dll") Then MouseClick("left",100,200,100,10); Set your click coordinates here, check helpfile to set the desired click Else Sleep ( 10 ) EndIf WEnd Not exactly what you need, but i can't find a way to register the event of "Mouse hold down" with _IsPressed or with any other method. try to take a look at this post: geosoft might have done it. And also this one for other infos: Always use search function. Edited January 14, 2011 by Newb I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it. 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