自动触发按钮

时间:2011-12-09 12:45:54

标签: autoit

我是AutoIt的新手。我想在不按下或按下调用MsgBox时出现的“确定”按钮的情况下运行我的代码。

我的代码如下:

$val = 10
For $i = 1 To 59
     $doubled = MyDouble($val)
     sleep(100)
     MsgBox(0, "", $val & " doubled is " & $doubled )
     $val = $doubled
Next
    MsgBox(0,"the value  ","The final vaule is as  " & $val)
Exit
Func MyDouble($value)
     $value = $value * 2
     Return $value       
 EndFunc

1 个答案:

答案 0 :(得分:1)

您可以在MsgBox上使用超时。

来自AutoIt帮助...

MsgBox ( flag, "title", "text" [, timeout [, hwnd]] )

所以你可以这样做1秒超时:

MsgBox(0, "", $val & " doubled is " & $doubled, 1)