Jump to content

Default MouseMove Delay


Liens
 Share

Recommended Posts

Hello,

Is there a way to change the default mouse move speed? Similar to Opt("SendKeyDelay", 0)?

I'm using AU3Record and I want the finished script to run as fast as possible.

I also don't want to go through and put ",0)" on the end of every MouseMove() because there are a quite a lot of them..

It's strange that I wasn't able to find an Opt() for it, it seems just as important as (also the mouse equivalent of) SendKeyDelay.

Edited by Liens
Link to comment
Share on other sites

If there is a parameter for it on the function, then it's not in an option, and vice versa.

You need to add ",0)" to the end of every MouseMove. To make this simpler, get a text editor that can replace by regular expression (Notepad++).

Enter search string:

(MouseMove\(.*,.*)\)

Replace by:

\1, $delay)
Edited by Manadar
Link to comment
Share on other sites

Belfigor, thank you for your insights. MouseClickDelay sets the delay for the mouse click, as the name suggests, and not the mouse move.

I want the finished script to run as fast as possible.

never mind :D

[size="1"]My bear is so cute asleep in the closet, not even drinking vodka. My nuclear bomb name is Natasha.[/size]

Link to comment
Share on other sites

Enter search string: (MouseMove\(.*, .*)\)

Replace by: \1, $delay)

Oh yeah I have Notepad++, didn't know it could do that, thanks!

I find it a strange thing for them to leave out though (setting the default value for something).

Edited by Liens
Link to comment
Share on other sites

Hmm I tried your search expression but it did not find anything.. I don't know the syntax of regular expressions, so I don't know what the problem is.

I tried (MouseMove\(.*, .*\)) and MouseMove\(.*, .*\) and (MouseMove\(.*, .*)\) and MouseMove(.*, .*)

None of them worked

Edited by Liens
Link to comment
Share on other sites

Updated post above. Try again, if you please.

This is what it changes to:

MouseMove(248,227), $delay)

I looked for the regular expression syntax but I can't find how to do -1 character from what is copied.

Link to comment
Share on other sites

  • 11 months later...

Thanks, works perfect!

Hi there:

I trying to place a mouse movement delay and/or click delay in a script that I created with Au3Record. I was reading your post but was not able to get this done. Just wondering if you can provide me with some advise.

Thanks.

This is the script:

#region ---Au3Recorder generated code Start ---

Opt("WinWaitDelay",100)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

_WinWaitActivate("Program Manager","")

MouseClick("left",31,475,1)

MouseClick("left",31,475,2)

MouseUp("left")

_WinWaitActivate("Microsoft Excel - Document Name","")

MouseClick("left",209,752,1)

MouseMove(410,52)

MouseDown("left")

MouseMove(411,52)

MouseUp("left")

_WinWaitActivate("Microsoft Office Security Options","")

MouseClick("left",52,202,1)

MouseClick("left",330,407,1)

_WinWaitActivate("Microsoft Office Excel","")

Send("{ENTER}")

#region --- Internal functions Au3Recorder Start ---

Func _WinWaitActivate($title,$text,$timeout=0)

WinWait($title,$text,$timeout)

If Not WinActive($title,$text) Then WinActivate($title,$text)

WinWaitActive($title,$text,$timeout)

EndFunc

#endregion --- Internal functions Au3Recorder End ---

#endregion --- Au3Recorder generated code End ---

Link to comment
Share on other sites

That's great. Glad I could help.

Hi there:

I trying to place a mouse movement delay and/or click delay in a script that I created with Au3Record. I was reading your post but was not able to get this done. Just wondering if you can provide me with some advise.

Thanks.

This is the script:

#region ---Au3Recorder generated code Start ---

Opt("WinWaitDelay",100)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

_WinWaitActivate("Program Manager","")

MouseClick("left",31,475,1)

MouseClick("left",31,475,2)

MouseUp("left")

_WinWaitActivate("Microsoft Excel - Document Name","")

MouseClick("left",209,752,1)

MouseMove(410,52)

MouseDown("left")

MouseMove(411,52)

MouseUp("left")

_WinWaitActivate("Microsoft Office Security Options","")

MouseClick("left",52,202,1)

MouseClick("left",330,407,1)

_WinWaitActivate("Microsoft Office Excel","")

Send("{ENTER}")

#region --- Internal functions Au3Recorder Start ---

Func _WinWaitActivate($title,$text,$timeout=0)

WinWait($title,$text,$timeout)

If Not WinActive($title,$text) Then WinActivate($title,$text)

WinWaitActive($title,$text,$timeout)

EndFunc

#endregion --- Internal functions Au3Recorder End ---

#endregion --- Au3Recorder generated code End ---

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...