为什么 new_duration 打印出空白,不允许我循环到 运行?

How come new_duration prints out as blank not allowing my loop to run?

我正在使用 AutoHotKey 的最新版本 v1.1

我从命令行向程序传递了 3 个参数: keydurationwindow 分别保存在 %1%%2%%3% 中。

使用 MsgBox, %1% %2% %3% 打印密钥持续时间和 window 时 在这种情况下,我得到了让我们说的正确值 a 5 Untitled

duration := %2%
new_duration := (duration * 1000)

MsgBox, %new_duration%

while (A_TickCount - start <= new_duration)
{
    ControlSend,,{Blind}{%1% down}{Blind}{%1% up},%3%
    sleep 50
}

当上面的代码被执行时,它不会打印任何内容,不允许我的循环到 运行。 为什么?

我仔细阅读了文档,发现 A_Args[index]

完成代码:

key := A_Args[1]
duration := (A_Args[2] * 1000)
window := A_Args[3]


while (A_TickCount - start <= duration)
{
    ControlSend,,{Blind}{%key% down}{Blind}{%key% up},%window%
    sleep 50
}