AutoHotKey 击键中断循环 [英] AutoHotKey keystroke break loop

查看:64
本文介绍了AutoHotKey 击键中断循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 AutoHotKey,我有一个相当简单的循环脚本,我希望能够通过敲击来打破它.我从网站上尝试了一些不同的代码,但似乎不起作用.

Using AutoHotKey, I have a rather simple loop script that I want to be able to break by the stroke of a key. I tried a few different codes from websites but it doesn't seem to work.

代码如下:

#g::
Loop 20
{
    MouseClick, left,  142,  542
    Sleep, 1000
    MouseClick, left,  138,  567
    Sleep, 1500
    MouseClick, left,  97,  538 
    Sleep, 1000
}

推荐答案

使用全局变量 (keepCycling) 并切换它以打破循环.全局变量应该在脚本的开头声明.

Use a global variable (keepCycling) and toggle it to break the loop. Global variables should be declared in the beginning of a script.

这篇关于AutoHotKey 击键中断循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆