一、软件介绍
主要通过浏览器+油猴的脚本的方式实现辅助U校园自动答题挂时长
完全模拟人工操作,自动答题,刷时长
软件下载:https://wukongstudio.lanzoui.com/b01hix05a
二、实现步骤
1.下载火狐浏览器安装油猴插件
2. 添加新脚本,然后粘贴下面代码然后保存即可
setting = { 'utoken': '', 'isinput': 1, 'istest': 1, 'isagree': 1, 'timeout': '1000', 'score': '', 'notice': '', 'show': '1', 'showb': '2', 'testurl': '', 'fromurl': '', 'testdata': '', 'url1' : 'https://ucontent.unipus.cn', 'is_time':0, // 默认0不开启刷时长,1开启刷时长 cache: { count: 0, type: 0, mouse_x: -1, mouse_y: -1 } }, time_settings = { // 每个页面持续时长为[0.5*jump_interval, jump_interval]之间随机分钟 jump_interval: 3, // 单位分钟默认3,切换一次页面的时长,可以是小数 jump_type: 3, // 跳转页面类型 1:按小章节(chapter)切换;2:按版块(section)切换;3:按练习(tab)切换,一般不用改 is_loop: 1, // 整本书到最后一单元是否回到开头持续循环,1开启循环,0关闭循环 is_range: 1, //is_range为1开启时,循环指定单元参数rangeS和rangeE才能生效;同时开启is_loop和is_range,可以循环刷指定单元 rangeS: 1, //rangeS起始单元,闭区间默认[1,8]一般整本书8个单元,例如[2,6]代表从第二单元的第一小节(2-1)刷至第六单元的最后一小节(6-7) rangeE: 8, //rangeE是终止单元(unit,1-8),不能小于rangeS,如果等于,例如[2,2]代表只刷第二单元 }, view = {};var time_index = { startIndex : (time_settings.rangeS - 1) * 7, endIndex : time_settings.rangeE * 7 - 1, startUnit:-1}function initView() { view.top = $( '<div id="box" style="border-radius: 1em;position: fixed;border: 1px double rgb(0,0,0); width: 300px; top: 30px; left: 1%; z-index: 999999; font-size: 15px; background-color: rgb(255,255,255); color: #000000;">' + //'<div style="height: 1px;"><button name="show" style="float:right;border-radius:0 0em 0 0;overflow:hidden;border: 1px dashed rgb(0,0,0);background-color: rgb(0,0,0);width:4px;height: 6px;margin-top: 5px;margin-right: 10px;">隐藏</button></div>'+ '<div><button name="show" style="float:right;border-radius:0 1em 0 0;overflow:hidden;border: 0px double rgb(0,0,0);background-color: rgb(255,255,255);">隐藏</button></div>' + '<div style="height: 25px; margin-top: 10px; text-align: center; font-size: x-large;">Uer Help</div>' + '<div style="" id="div_main">' + '<div style="margin: 0 5px; font-size: 15px;" id="info"></div>' + '<hr>' + '<div id="answerContent" style="margin: 10px; color: orange; font-size: medium; overflow-y: auto; max-height: 400px"></div>' + '<hr>' + '<div style="margin-left: 10px;margin-top: 5px;margin-bottom: 5px;text-align: left; color: rgb(114,188,114);">积分: <input onfocus="this.blur()" style="border:none;width: 55px;color: rgb(114,188,114);" id="score" name="score">' + '<button id="showscore" name="showscore" style="float:right;margin-right: 10px;border-radius:0em;overflow:hidden;border: 1px double rgb(0,0,0);background-color: rgb(255,255,255);">刷新</button></div>' + '<hr>' + '<div><button name="showb" style="float:right;border-radius:1em;overflow:hidden;border: 0px double rgb(0,0,0);background-color: rgb(255,255,255);">隐藏</button></div>' + '<form style="margin: 0 5px;">' + '<div style="" id="div_foot">' + '<div style="color: red;margin-left: 70px;">参数修改后自动保存</div>' + '<div>' + '<label style="margin-left: 60px;float:center;"fo7="utoken">key(自动生成刷新即可):   </label>' + '<input disabled="true" style="width: 70%;margin-left: 40px;margin-top: 5px;" id="utoken" name="utoken" placeholder="自动生成刷新即可">' + '</div>' + '<div>' + '<label style="margin-left: 50px;float:left;margin-top: 5px;" for="timeout">答题延迟:   </label>' + '<input id="timeout" name="timeout" type="number" min="500" style="margin-top: 5px;width: 55px; text-align: center;">' + '<label for="timeout" style="margin-right: 15px;"> 毫秒</label>' + '<div style="margin-top: 5px;overflow-y: auto;">' + //<button name="dtbutton" style="margin-right: 10px;float:right;border-radius:0em;border: 1px double rgb(0,0,0);background-color: rgb(255,255,255);">关闭普通自动答题</button>' + '<button name="dtbutton" id="dt_but" style="margin-left: 10px;float:left;border-radius:0em;overflow:hidden;border: 1px double rgb(0,0,0);background-color: rgb(255,255,255);">关闭普通自动答题</button>' + '<button id="cleanlog" name="cleanlog" style="margin-left: 10px;float:left;border-radius:0em;overflow:hidden;border: 1px double rgb(0,0,0);background-color: rgb(255,255,255);">清空日志</button>'+ '<button id="copykey" name="copykey" style="margin-top: 5px;margin-left: 20px;float:left;border-radius:0em;overflow:hidden;border: 1px double rgb(0,0,0);background-color: rgb(255,255,255);">复制KEY</button>' + '<button id="changekey" name="changekey" style="margin-top: 5px;margin-left: 20px;float:left;border-radius:0em;overflow:hidden;border: 1px double rgb(0,0,0);background-color: rgb(255,255,255);">修改KEY</button>' + '<button name="jsindex" style="margin-top: 5px;margin-left: 20px;float:left;border-radius:0em;overflow:hidden;border: 1px double rgb(0,0,0);background-color: rgb(255,255,255);">脚本主页</button>' + '<button name="timebutton" id="time_but" style="margin-left: 10px;float:left;border-radius:0em;overflow:hidden;border: 1px double rgb(0,0,0);background-color: rgb(255,255,255);margin-top: 3px;">开启时长挂机</button>' + '</div>' + '</form><br>' + //<a style="text-align: center;" href=\"https://greasyfork.org/zh-CN/scripts/397517\" target="_blank\">[脚本主页]</a> '<hr>' + '<div id="answer_log" style="margin-left: 5px; max-height: 300px; overflow-y: auto;"></div>' + '</div>' + '</div>' ); view.answerView = view.top.find('#answerContent'); view.info = view.top.find('#info'); view.div_main = view.top.find('#div_main'); view.showb = view.top.find('#div_foot'); view.top.appendTo('body').delegate('input', 'input change', function (event) { if (this.value.match(/^\*+$/)) return; let name = $(this).attr('name'); GM_setValue(name, this.value); setting[name] = this.value; console.log("修改完毕", GM_getValue(name, this.value), event.type) getscore(); if (event.type == 'change') msg('配置保存成功,即时生效'); }).delegate('[name=utoken]', 'focus blur', function (event) { $('#utoken').val(''); this.value = setting.utoken.replace(/(\S)/g, event.type == 'focusin' ? '$1' : '*'); }).delegate('button', 'click', function (e) { e.stopImmediatePropagation(); e.stopPropagation(); e.preventDefault(); let name = $(this).attr('name'); if (name == 'cleanlog'){ $('#answer_log').html(''); layer.tips('清除完毕', '#cleanlog'); } if (name == 'show') { setting.show = GM_getValue('show'); $(this).html(setting.show ? '隐藏' : '显示'); setting.show ? GM_setValue('show', 0) : GM_setValue('show', 1); view.answerView.slideToggle(); view.showb.slideToggle(); } if (name == 'showb') { setting.show = GM_getValue('showb'); $(this).html(setting.show ? '隐藏' : '显示'); setting.show ? GM_setValue('showb', 0) : GM_setValue('showb', 1); view.showb.slideToggle(); } if (name == 'jsindex') { window.open("https://greasyfork.org/zh-CN/scripts/397517", "_blank"); } if (name == 'changekey') { $('#utoken').attr("disabled",false); layer.tips('已解除锁定', '#utoken'); } if (name == 'copykey') { copyToClipboard(GM_getValue('utoken')) layer.tips('复制成功', '#copykey'); } if (name == 'dtbutton') { setting.isinput ? GM_setValue('isinput', 0) : GM_setValue('isinput', 1); setting.isinput = GM_getValue('isinput'); $(this).html(setting.isinput ? '关闭普通自动答题' : '开启普通自动答题'); let new_text1 = setting.isinput ? '关闭普通自动答题' : '开启普通自动答题' document.getElementById("dt_but").innerHTML=new_text1; location.reload(); } if (name == 'timebutton') { setting.is_time ? GM_setValue('is_time', 0) : GM_setValue('is_time', 1); setting.is_time = GM_getValue('is_time'); $(this).html(setting.is_time ? '关闭时长挂机' : '开启时长挂机'); let new_text = setting.is_time ? '关闭时长挂机' : '开启时长挂机' document.getElementById("time_but").innerHTML=new_text; location.reload(); } if (name == 'cz') { let key = GM_getValue('utoken'); url = _self.location.href; if (url.indexOf("u.unipus.cn") != -1) { if(key){ layer.open({ title: '温馨提示' ,content: '你的KEY是否为:<br>'+GM_getValue('utoken') ,time: 2000 ,end: function(){ window.open("http://tp.ljtion.work/?token=" + setting.utoken, "_blank"); } }); }else{ layer.open({ title: '温馨提示' ,content: 'Key错误,请勿擅自更改,如无KEY请清空后刷新加载' ,btnAlign: 'c' ,yes: function(){ $('#utoken').html(''); GM_setValue('utoken',''); window.location.reload(); } }); } } else { alert("请不要在题目中点击,去教材主页点击") } //window.open("http://uspay.hurric.cn/?token=" + setting.utoken, "_blank"); } if (name == 'showscore') { getscore(); layer.tips('积分信息更新成功', '#showscore'); //msg("积分信息更新成功"); } }).find('input').each(function () { let type = $(this).attr('type'), name = $(this).attr('name'); if (type == 'radio') { this.checked = setting[name] == this.value; } else if (name == 'score') { this.value = setting[name] } else if (name == 'utoken') { this.value = setting[name].replace(/\S/g, '*'); } else { this.value = setting[name]; } }); //getxtoekn(); msg('<a href="http://op.ljtion.work/" title="打开链接" style="color:red">官网公告/常见问题</a>','red') if (setting.utoken) { msg('Key载入成功,脚本正常运行'); } else { console.log(setting.utoken); getxtoken(); msg('欢迎使用脚本<br \>答案将在页面加载五秒后出现<br \><a href=\"https://greasyfork.org/zh-CN/scripts/397517\" target="_blank\">【脚本描述】</a><br \>', 'red'); } showNotice(); addTimes(); checkVal(setting.isinput,'dt_but','关闭普通自动答题', '开启普通自动答题'); delAlert(); addViewMouseListener()}