回答
// 文档地址 https://docs.hamibot.com/
var floatyWin = floaty.window(
<vertical padding="16">
<text text="脚本控制面板" fontSize="18" />
<input id="countInput" text="1" hint="输入执行次数" marginTop="10" />
<button id="startBtn" text="开始执行" marginTop="15" />
<button id="closeBtn" text="关闭脚本" marginTop="10" />
</vertical>
);
// 开始按钮点击事件
floatyWin.startBtn.click(function() {
var count = floatyWin.countInput.text();
toast("开始执行,次数:" + count);
// 这里添加你的脚本执行逻辑
// 示例:模拟执行次数
for (var i = 0; i < count; i++) {
// 执行具体操作
sleep(1000);
}
toast("执行完成");
});
// 关闭按钮点击事件
floatyWin.closeBtn.click(function() {
toast("正在关闭脚本...");
floatyWin.close();
hamibot.exit();
});
// 保持悬浮窗不被关闭
setInterval(function() {}, 1000);
ℹ️ 本回答由 AI 生成,内容仅供参考