Sign in to follow this  
Followers 0
andrews600

Simple problem

4 posts in this topic

#1 ·  Posted (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:

CODE

Opt("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:

CODE

Opt("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 by andrews600

Share this post


Link to post
Share on other sites



What's wrong with Sleep()s?

Share this post


Link to post
Share on other sites

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 ?

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0