razer_anthom Posted September 4, 2005 Share Posted September 4, 2005 (edited) Hello All... I am making a script to send clicks to a window. Well, I am using MouseClick like this: Func cliclar($m, $x, $y) MouseClick($m, $x, $y, 1, 1) EndFunc $m is the button ("right") $x and $y are calculated. Well, this code are sending more than one CLICK to that position. I tried This code too: Func cliclar($m, $x, $y) MouseMove($x, $y, 0) Sleep(200) MouseDown($m) MouseUp($m) EndFunc and the same effect There are a peace of code like this: clicar("right", 50, 700) Sleep(5000) And in this Sleep, it continues to click Do you have some suggestion? Thanks for your attention. Razer PS.: I put this code on top of script: AutoItSetOption("MouseClickDelay", 3) AutoItSetOption("MouseClickDownDelay", 2) Edited September 4, 2005 by razer_anthom Link to comment Share on other sites More sharing options...
infernothebest Posted September 4, 2005 Share Posted September 4, 2005 make a loop While 1 clicar("right", 50, 700) Sleep(5000) WEnd Apple Keybord shortcuts for XP Link to comment Share on other sites More sharing options...
razer_anthom Posted September 4, 2005 Author Share Posted September 4, 2005 make a loopWhile 1 clicar("right", 50, 700) Sleep(5000) WEnd<{POST_SNAPBACK}> But I want just one click at that position... and with my code, I taking more . Link to comment Share on other sites More sharing options...
themax90 Posted September 4, 2005 Share Posted September 4, 2005 (edited) You have an invalid or too fast MouseDelay option. If it's to fast, then it recycles but if it's in a valid time parameter, then it's fine. I'm sure that 3 miliseconds is no difference then 10:; ---------------------------------------------------------------------------- ; AutoIt Version: 3.1.1 Stable ; Author: AutoIt Smith ; Script Function: ; MouseClick Experimentation ; ---------------------------------------------------------------------------- AutoItSetOption("MouseClickDelay", 10) MClick("Left", 50, 700) Sleep(5000) Func MClick($button, $x, $y) MouseClick($button, $x, $y, 1, 0) EndFunc #cs For the mouse then down up.... Func MClick($button, $x, $y) MouseMove($x, $y, 0) Sleep(100) MouseDown($button) MouseUp($button) EndFunc #ce Enjoy! AutoIt Smith P.S. It's all timing dude! Edited September 4, 2005 by AutoIt Smith 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