andrews600 Posted December 11, 2008 Share Posted December 11, 2008 (edited) I'm writing a really simple clicking script.Problem is, that maybe due to the nature of the software or maybe my computer, not all the clicks are registered when run by script. I've increased the "opt" options, so that the mouse click is pressed for longer but it didnt help.Lets say apiece of my code looks like this:CODEOpt("MouseClickDownDelay", 40)opt("MouseClickDelay", 40)opt("MouseClickDragDelay", 40)Opt("WinWaitDelay", 950)MouseMove(543,643)MouseDown("left")MouseMove(1065,804)MouseDown("left")MouseUp("left")MouseMove(544,641)MouseDown("left")but as I said not all the clicks are registered. They follow each other too rapidly.So I did:CODEOpt("MouseClickDownDelay", 40)opt("MouseClickDelay", 40)opt("MouseClickDragDelay", 40)Opt("WinWaitDelay", 950)MouseMove(543,643)MouseDown("left")Sleep(100)MouseMove(1065,804)MouseDown("left")Sleep(100)MouseUp("left")Sleep(100)MouseMove(544,641)MouseDown("left")Sleep(100)And it works like a charm. But this is mundane solution as the code is much longer then this sample. I've looked through the documentation but cant find a simple way to do exactly what those Sleep(100)'s do after each click, but in a global and automated fasion.Please advise.Thank you. Edited December 11, 2008 by andrews600 Link to comment Share on other sites More sharing options...
Richard Robertson Posted December 11, 2008 Share Posted December 11, 2008 What's wrong with Sleep()s? Link to comment Share on other sites More sharing options...
andrews600 Posted December 12, 2008 Author Share Posted December 12, 2008 Having to manually put it there every time after a click makes my work 80% longer, especially if a big chunk of my script is created using the AU3Recorder. So I have to manually edit the sleeps into the code. This is doable, but I'm sure theres a way to config that behaviour into my script ? Link to comment Share on other sites More sharing options...
Skruge Posted December 12, 2008 Share Posted December 12, 2008 Having to manually put it there every time after a click makes my work 80% longer, especially if a big chunk of my script is created using the AU3Recorder. So I have to manually edit the sleeps into the code. This is doable, but I'm sure theres a way to config that behaviour into my script ?If you're only using AU3Recorder, you'll still need to edit the code (search/replace should do). Opt("MouseClickDownDelay", 40) opt("MouseClickDelay", 40) opt("MouseClickDragDelay", 40) Opt("WinWaitDelay", 950) _DelayedClick(543, 643) _DelayedClick(1065, 804) _DelayedClick(1065, 804 _DelayedClick(544, 641) Func _DelayedClick($i_X, $i_Y, $s_Btn="left", $i_Delay=100) MouseClick($i_X, $i_Y, $s_Btn) Sleep($i_Delay) EndFunc Another alternative would be to change the way you record the clicks... Try writing a utility with a hotkey that records the mouse position and adds the required lines to your script. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] 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