回答
你可以使用 floaty.window
创建一个悬浮窗,并通过按钮点击事件来实现退出功能。以下是一个简单的示例代码:
// 创建悬浮窗
var floatyWin = floaty.window(
<vertical>
<button id="exitBtn" text="退出" />
</vertical>
);
// 退出按钮点击事件监听
floatyWin.exitBtn.click(function () {
toast("退出脚本");
floatyWin.close(); // 关闭悬浮窗
hamibot.exit(); // 退出脚本
});
这段代码会在悬浮窗中创建一个“退出”按钮,点击该按钮后会关闭悬浮窗并退出脚本。
ℹ️ 本回答由 AI 生成,内容仅供参考