// ==UserScript== // @name 形势与政策 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 鸡你太美!!! // @author dwb // @match http://xsyzc.gzcc.cn/index.php?m=member&c=index // @icon https://www.google.com/s2/favicons?sz=64&domain=0.1 // @grant none // @require https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js // @downloadURL none // ==/UserScript== (function() { 'use strict'; // Your code here... var flag=false var second=0 var catidArr=[134,135,136,137] var currIndex=0 var onlineLearn = setInterval(()=>{ if(flag==false&&second<=4800){ $.ajax({ url: "/index.php?m=member&c=study&a=enter", dataType: "json", type: "get", data: { catid: catidArr[currIndex], }, success: function (res) { second=res.seconded if(res.onlining=="1"){ $.ajax({ url: "/index.php?m=member&c=study&a=close", dataType: "json", type: "get", data: { catid: catidArr[currIndex], second: second }, success: function () { loadRecord(catidArr[currIndex]) } }); } flag=true } }); }else if(second>4800){ $.ajax({ url: "/index.php?m=member&c=study&a=close", dataType: "json", type: "get", data: { catid: catidArr[currIndex], second: second }, success: function () { loadRecord(catidArr[currIndex]) } }); currIndex++; flag=false; second=0; } else if(currIndex==4){ //清除定时 clearInterval(onlineLearn) alert("全部看完了!") } else{ second++; } console.log("当前秒数:"+second) },1000) })();