您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
点击一键挂课,全部专题后台自动挂到80分钟。也可自定义分钟数。
当前为
// ==UserScript== // @name 形势与政策-GS 2.0 // @namespace http://tampermonkey.net/ // @version 2.1 // @description 点击一键挂课,全部专题后台自动挂到80分钟。也可自定义分钟数。 // @author yu47 // @match http://xsyzc.gzcc.cn/* // @grant none /* globals jQuery, $, waitForKeyElements */ // ==/UserScript== var count = 0; (function () { 'use strict'; function x_y() { var x = Math.random() * 1000; var y = Math.random() * 1000; x = parseInt(x).toString(); y = parseInt(y).toString(); $("#xID").attr("value", x); $("#yID").attr("value", y); // console.log("X坐标:" + $("#xID").attr("value")); // console.log("Y坐标:" + $("#yID").attr("value")); var flag = document.querySelectorAll(".nav-item .dropdown-menu li a")[count] if (!flag) { alert("恭喜全部课程已刷成功!!!") return true; } setTimeout(() => { x_y() }, 5000) } function reload() { $('#win').window('close'); count += 2; if (count == 8) { alert("恭喜全部课程已刷成功!!!") return true; } document.querySelectorAll(".nav-item .dropdown-menu li a")[count].click(); setTimeout(() => { reload(); }, need_time(count)); // console.log('第' + (count / 2 + 1) + '完成!!!'); } function stop() { $('#win').window('close'); document.querySelectorAll(".nav-item .dropdown-menu li a")[count].click(); } function start() { document.querySelectorAll(".nav-item .dropdown-menu li a")[count].click(); setTimeout(() => { stop(); }, 2000) // console.log('第' + (count / 2 + 1) + '完成!!!'); setTimeout(() => { reload(); }, need_time(count)) // console.log('第' + (count / 2 + 1) + '完成!!!'); setTimeout(() => { x_y() }, 5000) } function need_time(count) { console.log("#timeCount_" + (118 + (count / 2 + 1)).toString()) var src = document.querySelector("#timeCount_" + (118 + (count / 2 + 1)).toString()).textContent; if (!src){ return times } var bbb = /[0-9]+/g var ccc = src.match(bbb) var feng = ccc[0] var miao = ccc[1] var all = (parseInt(feng) * 60 + parseInt(miao)) * 1000; var need = times - all; // console.log(feng + " " + miao); // console.log(all + " " + need); if (need < 0) { // console.log("error"); return 5000; } return need } const info = $(" <div\n" + " class='alert alert-success'\n" + " style='\n" + " border-color: transparent transparent #cccccc;\n"+ " height: 80px;\n" + " width: 250px;\n" + " border-radius: 19px;\n" + " position: absolute;\n" + " right: 550px;\n" + " top: 65px;\n" + " margin-bottom: 0;\n" + " '\n" + " >\n" + " <button type='button' class='close' data-dismiss='alert'>×</button>\n" + " <strong style='display: block; margin-bottom: 5px; text-align: center'>提示!</strong>\n" + " <div>因为服务器原因,页面显示的时间是错误的,不影响正常挂机。</div>\n" + " <div style='text-align: center'><button class='btn btn-info start'>一键挂课</button> <button class='btn btn-info start2'>自定义时间</button></div>\n" + " </div>") $("html").append(info) var access = document.querySelector(".page-title .icon-dashboard"); if (access){ var msg = "本插件所提供的信息,只供参考学习交流。特此申明!\n由此引起的一切后果均须自行承担责任,与插件无关。\n 请问是否继续~"; } if (confirm(msg)==true){ }else{ alert("退出成功") } $(".start").click(() => { start(); }) $(".start2").click(() => { var times=prompt("请输入所观看时间(单位:分钟)"); if (times <= 0 && times == null){ return alert("时间输入错误!!!"); } else{ times = times*60*1000 + 30000; start();} }) })();