I am trying to exp开发者_运维问答lore AutoIt for automation. Is there a way to increase execution time (wait) rather than use Sleep(3000) after each syntax/command?
The interval between key presses and mouse clicks can be set with AutoItSetOption, with parameters "MouseClickDownDelay" and "SendKeyDelay", respectively. This will cause a general slowdown of the script without requiring Sleep
statements.
Sample:
AutoItSetOption("MouseClickDownDelay", 200) ; Unit: ms. "Alters the length a click is held
; down before release."
AutoItSetOption("SendKeyDelay", 100) ; Unit: ms. "Alters the length of the brief pause in
; between sent keystrokes. A value of 0 removes
; the delay completely."
The Sleep()
function pauses script execution. When you say "increase execution time", it sounds like you are waiting on something instead of just trying to pause the script.
Check out the following functions in the AutoIt help:
ProcessWait()
RunWait()
ShellExecuteWait()
WinWait()
WinWaitActivate()
WinWaitClose()
WinWaitDelay
(this is an option, not a function)WinWaitNotActive()
Maybe one of these will help you with what you're trying to do.
精彩评论