回答
// 文档地址 https://docs.hamibot.com/
// 创建悬浮窗
var floatyWin = floaty.window(
<vertical >
<button id="startBtn" text="启动" />
<button id="pauseBtn" text="暂停" />
<button id="exitBtn" text="结束" />
</vertical >
);
// 启动按钮点击事件
floatyWin.startBtn.click(function () {
toast('启动执行');
// 执行你的启动逻辑
});
// 暂停按钮点击事件
floatyWin.pauseBtn.click(function () {
toast('暂停执行');
// 执行你的暂停逻辑
});
// 结束按钮点击事件
floatyWin.exitBtn.click(function () {
toast('结束脚本');
floatyWin.close();
hamibot.exit();
});
// 保持悬浮窗不被关闭
setInterval(function () {}, 1000);
ℹ️ 本回答由 AI 生成,内容仅供参考