Liens Posted August 31, 2009 Posted August 31, 2009 (edited) 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 August 31, 2009 by Liens
jvanegmond Posted August 31, 2009 Posted August 31, 2009 (edited) 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 August 31, 2009 by Manadar github.com/jvanegmond
Belfigor Posted August 31, 2009 Posted August 31, 2009 Opt("MouseClickDelay",0) [size="1"]My bear is so cute asleep in the closet, not even drinking vodka. My nuclear bomb name is Natasha.[/size]
jvanegmond Posted August 31, 2009 Posted August 31, 2009 Belfigor, thank you for your insights. MouseClickDelay sets the delay for the mouse click, as the name suggests, and not the mouse move. github.com/jvanegmond
Belfigor Posted August 31, 2009 Posted August 31, 2009 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 [size="1"]My bear is so cute asleep in the closet, not even drinking vodka. My nuclear bomb name is Natasha.[/size]
Liens Posted August 31, 2009 Author Posted August 31, 2009 (edited) 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 August 31, 2009 by Liens
jvanegmond Posted August 31, 2009 Posted August 31, 2009 I find it a strange thing for them to leave out though (setting the default value for something).It's simply because you can do it yourself. : ) If they need to add a option for every default value then they're going to a lot of opt flags!! github.com/jvanegmond
Liens Posted August 31, 2009 Author Posted August 31, 2009 (edited) 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 August 31, 2009 by Liens
jvanegmond Posted August 31, 2009 Posted August 31, 2009 Updated post above. Try again, if you please. github.com/jvanegmond
Liens Posted August 31, 2009 Author Posted August 31, 2009 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.
jvanegmond Posted August 31, 2009 Posted August 31, 2009 Ok, last attempt. Search for: (MouseMove\(.*,.*)\) I misplaced a \ causing it to escape the wrong ) github.com/jvanegmond
Liens Posted August 31, 2009 Author Posted August 31, 2009 Ok, last attempt. Search for: (MouseMove\(.*,.*)\) I misplaced a \ causing it to escape the wrong ) Thanks, works perfect!
jvanegmond Posted August 31, 2009 Posted August 31, 2009 That's great. Glad I could help. github.com/jvanegmond
learningautoit Posted August 10, 2010 Posted August 10, 2010 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 ---
learningautoit Posted August 10, 2010 Posted August 10, 2010 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 ---
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