如何在AutoHotkey中添加等待时间?

时间:2013-07-27 16:55:48

标签: autohotkey

我有一个游戏脚本

  

~Rbutton& M :: SendInput t您有权保持沉默。   你所说的任何话都可以并将在最高法院对你使用   San Andreas,2nd District。{enter} t遵守San的法律   安德烈亚斯,你有权与律师交谈。{enter} t如果你   我买不起律师,会为你指定一名律师。{enter} t do   您是否了解这些权利,因为它们已经被您阅读了?{enter}

我希望我的脚本在每个enter之后等待2秒,然后再发送下一行。我怎样才能做到这一点?

1 个答案:

答案 0 :(得分:5)

如果您要发送标签字符,则需要更改t `t

因此,将热键的代码更改为块而不是单行(通过不将命令全部放在一行上,并在其末尾添加return来执行此操作)。然后,您可以使用sleep(使用毫秒)来延迟2秒。

~Rbutton & M:: 
    SendInput, t You have the right to remain silent. Anything you say can and will be used against you in the Supreme Court of San Andreas, 2nd District.{enter} 
    sleep, 2000
    SendInput, t As by the laws of San Andreas,you have the right to speak to an attorney.{enter} t If you cannot afford an attorney, one will be appointed for you.{enter}
    sleep, 2000
    SendInput, t Do you understand these rights as they have been read to you?{enter}
return
相关问题