Erwtas Posted April 7, 2006 Share Posted April 7, 2006 Hello to all... I have a little problem here and i need your help... I ve made an autoclicking script with the support of HotKeys... HotKeySet ("{INS}", "autoclick") Func autoclick() Opt("MouseClickDelay", 1000) $pos = MouseGetPos() MouseClick ("left", $pos[0], $pos[1], 99999) EndFunc Well my problem is when i press INSERT the script starts... but i don't know how to make a function to stop it... I can't reduce the clicks cause i want them unlimited Also i don't want to use Exit... As i can imagine i need a code here to stop all the mouse activities when i press the hotkey i ll set for it... Right? Why i can't find such code then?? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 7, 2006 Moderators Share Posted April 7, 2006 (edited) Global $NoPause HotKeySet ("{INS}", "autoclick") HotKeySet('{PAUSE}', 'StopClick') While 1 Sleep(5000) WEnd Func autoclick() Opt("MouseClickDelay", 1000) $NoPause = 1 Local $pos = MouseGetPos() While $NoPause = 1 MouseClick ("left", $pos[0], $pos[1], 1) Sleep(10) WEnd EndFunc Func StopClick() $NoPause = 0 EndFuncUses the Pause Key to stop the clicks. With the loop will click until you pause it. Edited April 7, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Erwtas Posted April 7, 2006 Author Share Posted April 7, 2006 (edited) Well that's what i was looking for thnx a lot... but there is still a little prob.. i just tried what u told me... the script works and stops fine but i can't move my mouse while clicking cause the script center the mouse at the coordinates it started to click OoCan we fix that cause i need to move wherever i want the mouse while the script is clicking???Ok wrong i found it out... i just have to move the MouseGetPos inside the While Anyway thnx a lot guys i just finished with that script Edited April 7, 2006 by Erwtas Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 7, 2006 Moderators Share Posted April 7, 2006 Well, ask yourself this, what gives the mouse click the position to click... then look at the mouse click inside the loop, what is missing if you want to move the mouse? The thing that gives it the position right?Global $NoPause HotKeySet ("{INS}", "autoclick") HotKeySet('{PAUSE}', 'StopClick') While 1 Sleep(5000) WEnd Func autoclick() Opt("MouseClickDelay", 1000) $NoPause = 1 While $NoPause = 1 Local $pos = MouseGetPos() MouseClick ("left", $pos[0], $pos[1], 1) Sleep(10) WEnd EndFunc Func StopClick() $NoPause = 0 EndFunc Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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