Sign in to follow this  
Followers 0
address

What is the mechanism behind mouseclick?

4 posts in this topic

Mouseclick takes so much more processor load than mousemove, even with 100x times more sleep. What is the mechanism behind mouseclick?

HotKeySet("{ESC}", "ExitApp")

for $i = 1 to 100
Mouseclick("left", 144, 303, 1, 0)
Sleep (100)
Mouseclick("left",606, 303, 1, 0)
Sleep (100)

next

Func ExitApp()
    Exit
EndFunc

HotKeySet("{ESC}", "ExitApp")

for $i = 1 to 100
Mousemove(144, 303, 0)
Sleep (1)
Mousemove(606, 303, 0)
Sleep (1)

next

Func ExitApp()
    Exit
EndFunc

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

It uses mouse_event function. Not sure what you mean though. I get the same cpu values for both scripts. I also swapped sleep values, re-ran and got the same outcome.

Edit: I should say it used to use mouse_event. That might have changed.

Edited by Beege

Share this post


Link to post
Share on other sites

It uses mouse_event function. Not sure what you mean though. I get the same cpu values for both scripts. I also swapped sleep values, re-ran and got the same outcome.

Edit: I should say it used to use mouse_event. That might have changed.

Why such terrible effect on my computer from mouseclicks? Autoit and machine are up to date

Share this post


Link to post
Share on other sites

Be careful with Sleep(1), that can be confusing. 1-9 still take 10 ms as you can see by timing it.

$iTotal = 0
For $iX = 1 To 100
    $iTimer = TimerInit()
    Sleep(1)
    $iTotal += TimerDiff($iTimer)
Next

ConsoleWrite("Average is " & $iTotal/ ($iX - 1) & " ms" & @LF)

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