需要帮助尝试创建一个简单的脚本

时间:2013-02-09 21:14:19

标签: autohotkey

所以我不知道我在做什么,但我需要一个非常简单的脚本帮助。

基本思路是每秒按一次键,例如k,四次,然后重复,直到用命令(Alt-x)关闭脚本。

我正在使用Autohotkey脚本编辑器。

1 个答案:

答案 0 :(得分:2)

您可以使用Timers

示例代码:

F1::                          ;key that launches this code
    SetTimer, SendKeyK,250    ;set timer to repeat every 250 miliseconds
return                        ;end

F2::
    SetTimer, SendKeyK,Off    ;turn of the timer
return


SendKeyK:
    Send, {k}    ;timer sends (presses) the key k
return

如您所见,无需退出脚本。