您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Notice that your action is done
当前为
// ==UserScript== // @name Aincrad Notification // @namespace https://itiscaleb.com/ // @version 1.0 // @description Notice that your action is done // @author ItisCaleb // @match https://ourfloatingcastle.com/* // @grant none // ==/UserScript== (function() { 'use strict'; var timeComplete; var completed = false; 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 }); } function checkDone(){ var done = document.getElementsByClassName("css-1nwj029")[0].innerText if(done == '閒置' || completed) { timeComplete = null completed = false }else if(done != '閒置' && !timeComplete ){ 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) return let timeleft = timeComplete-Date.now() console.log(timeleft) if(timeleft<=0){ new Notification('你的浮游城已經完成動作!') completed = true } },2000) })();