Jump to content
Sign in to follow this  
Guest drei3

simultaneous mouseclicks

Recommended Posts

Guest drei3

*edit* It is very important that I can get the fastest method possible so any suggestions for code changes to improve what is shown will be greatly appreciated.

I need a mouseclick in two different locations at the same time. I know everything has an order in how it is processed, so I'm asking if there is a way to get two mouseclicks in different locations one after another with no delay using autoit. Here's what I've tried and haven't quite got the results I'm hoping for. If there is no way to improve my scripts, please suggest the one that will be closest to simultaneous. Thanks:

Opt("MouseClickDelay", 0)
Opt("MouseClickDownDelay", 1)

HotKeySet("^z", "action")
HotKeySet("^q", "quit")

$z = 0
$x = 100
$y = 200
$x2 = 300
$y2 = 400

Do
Sleep(10)
Until $z = 1

Func action()
mouseclick ("left", $x, $y, 1, 0)
mouseclick ("left", $x2, $y2, 1, 0)
EndFunc

Func quit()
$z = 1
EndFunc

With this one, I set the mouse directly over the first click position before executing and changed the coordinates from variables to constants to see if it would reduce delay. I still didn't get the results I'm looking for.

Opt("MouseClickDelay", 0)
Opt("MouseClickDownDelay", 1)

HotKeySet("^z", "action")
HotKeySet("^w", "setposition")
HotKeySet("^q", "quit")

$z = 0

Do
Sleep(10)
Until $z = 1

Func setposition()
mousemove (100, 200, 1)
EndFunc

Func action()
mouseclick ("left", 100, 200, 1, 0)
mouseclick ("left", 300, 400, 1, 0)
EndFunc

Func quit()
$z = 1
EndFunc

The last thing I tried was to run 2 separate scripts each with the same hotkey, but with the 2 different mouseclick locations. When I pressed the hotkey combo, the first script would execute, but the second would not even click. So Is there a way to make the simultaneous scripts work or make my clicks faster in my code? Also, I was doing all testing with compiled scripts. Does this change the speed at all? Thank you for your help.

Edited by drei3

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  

×
×
  • Create New...