在没有显式 Sleep() 语句的情况下减慢 AutoIt 的速度

发布于 2024-10-08 22:01:12 字数 71 浏览 0 评论 0原文

我正在尝试探索 AutoIt 的自动化。有没有办法增加执行时间(等待)而不是在每个语法/命令之后使用 Sleep(3000) ?

I am trying to explore AutoIt for automation. Is there a way to increase execution time (wait) rather than use Sleep(3000) after each syntax/command?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

驱逐舰岛风号 2024-10-15 22:01:12

按键和鼠标单击之间的间隔可以通过 AutoItSetOption 设置,参数分别为“MouseClickDownDelay”和“SendKeyDelay”。这将导致脚本总体速度减慢,而不需要 Sleep 语句。

样本:

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 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."
如痴如狂 2024-10-15 22:01:12

Sleep() 函数暂停脚本执行。当您说“增加执行时间”时,听起来像是您在等待某些事情,而不仅仅是尝试暂停脚本。

查看 AutoIt 帮助中的以下函数:

  • ProcessWait()
  • RunWait()
  • ShellExecuteWait()
  • WinWait()
  • WinWaitActivate()
  • WinWaitClose()
  • WinWaitDelay (这是一个选项,不是函数)
  • WinWaitNotActive( )

也许其中之一会帮助您完成您想要做的事情。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文