1号
setScreenMetrics(720, 1280);
var window = floaty.window(
<frame>
<button id="action" text="开始运行" w="70" h="40" bg="#FF80AB"/>
</frame>
);
window.exitOnClose();
var execution = null;
window.action.click(() => {
threads.start(function() {
onClick();
});
});
window.action.longClick(() => {
window.setAdjustEnabled(!window.isAdjustEnabled());
return true;
});
setInterval(() => {}, 1000);
function onClick() {
toast("运行")
threads.start(function() {
var id = setInterval(function() {
press(323, 642, 1)
}, 500);
//20分钟后取消循环
setTimeout(function() {
clearInterval(id);
}, 60 * 1000 * 20);
});
threads.start(function() {
var id = setInterval(function() {
swipe(155, 1138, 600, 1138, 200)
}, 500);
//20分钟后取消循环
setTimeout(function() {
clearInterval(id);
}, 60 * 1000 * 20);
});
};