Autohotkey 自动热键启动/停止同一按键
此脚本假定在按下键时启动/停止。我希望那是同一把钥匙。例如,我按F3键开始,然后再次按F3键停止。它将从0000缓慢计数到9999,并在停止循环时记住您所在的位置。出于某种原因,它会启动,但当我再次按F3时,它不会停止。遵循这个例子 我做错了什么Autohotkey 自动热键启动/停止同一按键,autohotkey,Autohotkey,此脚本假定在按下键时启动/停止。我希望那是同一把钥匙。例如,我按F3键开始,然后再次按F3键停止。它将从0000缓慢计数到9999,并在停止循环时记住您所在的位置。出于某种原因,它会启动,但当我再次按F3时,它不会停止。遵循这个例子 我做错了什么 #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
start = 0000
Run = false
F3::
SetFormat, Float, 04.0
current = %start%
if Run {
Run := false
return
}
Run := true
Loop, 9999{
Send e
Sleep, 760
TrayTip, PinCode BruteForce, %current%, , 16
Send %current%
current += 1.0
start += 1.0
Sleep, 700
if(current = 10000){
Break
}
if (not Run){
Break
}
}
Run := false
return
您缺少了可以在您发布的链接中找到的。它的默认值是1,所以一旦按下F3,它就不能再被触发。增加它,这样热键就可以按您希望的方式中断自身
以下是阻止操作执行的其他三种方法:
- 使用替代循环并切换其状态
- 使用命令
- 使用命令