Autohotkey 为什么新的持续时间打印为空白,不允许我的循环运行?
我正在使用AutoHotKey的最新版本v1.1 我从命令行向程序传递3个参数:Autohotkey 为什么新的持续时间打印为空白,不允许我的循环运行?,autohotkey,Autohotkey,我正在使用AutoHotKey的最新版本v1.1 我从命令行向程序传递3个参数: 键、持续时间和窗口分别保存在%1%、%2%和%3%中 使用MsgBox打印密钥持续时间和窗口时,%1%%2%%3% 我得到了正确的值,比如在本例中,a5无标题 duration := %2% new_duration := (duration * 1000) MsgBox, %new_duration% while (A_TickCount - start <= new_duration) { C
键
、持续时间
和窗口
分别保存在%1%
、%2%
和%3%
中
使用MsgBox打印密钥持续时间和窗口时,%1%%2%%3%
我得到了正确的值,比如在本例中,a5无标题
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
}
持续时间:=%2%
新建时长:=(时长*1000)
MsgBox,%new\u持续时间%
虽然(A_TickCount-start我更仔细地阅读了文档,发现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
}
key:=A_参数[1]
持续时间:=(A_参数[2]*1000)
窗口:=A_参数[3]
while(A_TickCount-开始)