您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
當動作完成時給你一個ㄊㄓ
// ==UserScript== // @name 我們的浮游城 ㄊㄓ // @namespace https://itiscaleb.com/ // @version 1.2 // @description 當動作完成時給你一個ㄊㄓ // @author ItisCaleb // @match https://ourfloatingcastle.com/* // @grant none // ==/UserScript== (function() { 'use strict'; var timeComplete var completed = true var token = window.localStorage.getItem('token2') function calTime(){ fetch("https://api.ourfloatingcastle.com/api/profile", { "headers": { "token": token }, "referrer": "https://ourfloatingcastle.com/", "body": null, "method": "GET", }) .then(res=>res.json()) .then(data=>{ timeComplete = data.actionUntil completed=false }); } function checkDone(){ var done = document.getElementsByClassName("css-1nwj029")[0].innerText if(done=='閒置' || done.includes('完成') || done.includes('抵達') || done=='已死亡'){ return } else if(completed) { calTime() } } function init(){ if (Notification.permission === 'default' || Notification.permission === 'undefined') { Notification.requestPermission(); } if (Notification.permission === 'denied'){ console.log("請開啟通知才能作用") return } checkDone() } setTimeout(init,2000) setInterval(()=>{ checkDone() if(!timeComplete || completed) return let timeLeft = timeComplete-Date.now() console.log(timeComplete) if(timeLeft<=0){ new Notification('你的浮游城已經完成動作!') completed = true } },2000) })();