您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
try to take over the world!
当前为
// ==UserScript== // @name 咕咕镇进度变动 // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author ikarosf // @match https://www.guguzhen.com/fyg_pk.php // @grant GM_xmlhttpRequest // ==/UserScript== (function() { 'use strict'; var audio = new Audio("https://cdnringhlt.shoujiduoduo.com/ringres/user/a24/564/9246564.aac"); audio.load(); var time = 10; var myrank = -100; function read_rank(){ if(--time!=0){ document.getElementsByClassName('panel-heading')[0].innerText = "刷新进度倒计时 "+time; }else{ document.getElementsByClassName('panel-heading')[0].innerText = "刷新进度倒计时 "+0; time = 10; GM_xmlhttpRequest({ method: 'POST', url: `https://www.guguzhen.com/fyg_read.php`, headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}, data: 'f=12', onload: response => { let newrank = parseInt(response.responseText.match(/class="fyg_colpz02" style="font-size:32px;font-weight:900;">[0-9]+%</)[0].match(/[0-9]+%/)[0]); if(myrank == -100){ myrank = newrank; } else if(newrank != myrank){ document.getElementsByClassName('fyg_colpz02')[0].innerText = newrank; myrank = newrank; audio.play(); var my_url = location.href; var newwin = window.open(my_url, '进度变动', 'resizable=no') } console.log(newrank); /* else{ document.getElementsByClassName('fyg_colpz02')[0].innerText = newrank; }*/ } }); } } setInterval(read_rank,"1000"); // Your code here... })();