您的位置:首页 > 其它

智慧树刷课软件插件脚本使用方法

2020-08-12 11:57 113 查看

已测可用

正式教程:

打包下载,已配置好。登录直接可用

下载链接:http://33h.co/gbsS

使用暴力猴插件管理器,添加下列脚本,实现自动刷课

第一步:查看说明(重点)

第二步:解压插件

第三步:在浏览器上安装 

========================================================================

运行效果图:

1.打开拓展程序

 

2.添加代码

3.代码

[code]setting.div = $(
'<div style="border: 2px dashed rgb(0, 85, 68); width: 330px; position: fixed; top: 0; right: 0; z-index: 99999; background-color: rgba(70, 196, 38, 0.6); overflow-x: auto;">' +
'<span style="font-size: medium;"></span>' +
'<div style="font-size: medium;">正在搜索答案...</div>' +
'<button style="margin-right: 10px;">暂停答题</button>' +
'<button style="margin-right: 10px;' + (setting.jump ? '' : ' display: none;') + '">点击停止本次切换</button>' +
'<button style="margin-right: 10px;">重新查询</button>' +
'<button style="margin-right: 10px; display: none;">复制答案</button>' +
'<button>答题详情</button>' +
'<div style="max-height: 200px; overflow-y: auto;">' +
'<table border="1" style="font-size: 12px;">' +
'<thead>' +
'<tr>' +
'<th colspan="2">' + ($('#randomOptions').val() == 'false' ? '' : '<font color="red">本次考试的选项为乱序 脚本会选择正确的选项</font>') + '</th>' +
'</tr>' +
'<tr>' +
'<th style="width: 60%; min-width: 130px;">题目(点击可复制)</th>' +
'<th style="min-width: 130px;">答案(点击可复制)</th>' +
'</tr>' +
'</thead>' +
'<tfoot style="' + (setting.jump ? ' display: none;' : '') + '">' +
'<tr>' +
'<th colspan="2">已关闭 本次自动切换</th>' +
'</tr>' +
'</tfoot>' +
'<tbody>' +
'<tr>' +
'<td colspan="2" style="display: none;"></td>' +
'</tr>' +
'</tbody>' +
'</table>' +
'</div>' +
'</div>'
).appendTo('body').on('click', 'button, td', function() {
var num = setting.$btn.index(this);
if (num == -1) {
GM_setClipboard($(this).text());
} else if (num === 0) {
if (setting.loop) {
clearInterval(setting.loop);
delete setting.loop;
num = ['已暂停搜索', '继续答题'];
} else {
setting.loop = setInterval(findTiMu, setting.time);
num = ['正在搜索答案...', '暂停答题'];
}
setting.$div.html(function() {
return $(this).data('html') || num[0];
}).removeData('html');
$(this).html(num[1]);
} else if (num == 1) {
setting.jump = 0;
setting.$div.html(function() {
return arguments[1].replace('即将切换下一题', '未开启自动切换');
});
setting.div.find('tfoot').add(this).toggle();
} else if (num == 2) {
location.reload();
} else if (num == 3) {
GM_setClipboard(setting.div.find('td:last').text());
} else if (num == 4) {
($('.leftCard .saveYl')[0] || $()).click();
}
}).detach(setting.hide ? '*' : 'html');
setting.$btn = setting.div.children('button');
setting.$div = setting.div.children('div:eq(0)');

$(document).keydown(function(event) {
if (event.keyCode == 38) {
setting.div.detach();
} else if (event.keyCode == 40) {
setting.div.appendTo('body');
}
});

if (setting.scale) _self.UEDITOR_CONFIG.scaleEnabled = false;
$.each(UE.instants, function() {
var key = this.key;
this.ready(function() {
this.destroy();
UE.getEditor(key);
});
});
setting.loop = setInterval(findTiMu, setting.time);

function findTiMu() {
GM_xmlhttpRequest({
method: 'POST',
url: 'http://mooc.forestpolice.org/cxk/' + (setting.token || 0) + '/' + encodeURIComponent(setting.TiMu[0]),
headers: {
'Content-type': 'application/x-www-form-urlencoded'
},
data: 'question=' + encodeURIComponent(setting.TiMu[0]) + '&type=' + setting.TiMu[1],
timeout: setting.time,
onload: function(xhr) {
if (!setting.loop) {
} else if (xhr.status == 200) {
var obj = $.parseJSON(xhr.responseText) || {};
if (obj.code) {
var data = String(obj.data).replace(/&/g, '&amp;').replace(/<(?!img)/g, '&lt;'),
que = setting.TiMu[0].match('<img') ? setting.TiMu[0] : setting.TiMu[0].replace(/&/g, '&amp;').replace(/</g, '&lt');
obj.data = /^http/.test(data) ? '<img src="' + obj.data + '">' : obj.data;
setting.div.find('tbody').append(
'<tr>' +
'<td title="点击可复制">' + que + '</td>' +
'<td title="点击可复制">' + (/^http/.test(data) ? obj.data : '') + data + '</td>' +
'</tr>'
);
setting.copy && GM_setClipboard(obj.data);
setting.$btn.eq(3).show();
fillAnswer(obj);
} else {
setting.$div.html(obj.data || '服务器繁忙,正在重试...');
}
setting.div.children('span').html(obj.msg || '');
} else if (xhr.status == 403) {
var html = xhr.responseText.indexOf('{') ? '请求过于频繁,建议稍后再试' : $.parseJSON(xhr.responseText).data;
setting.$div.data('html', html).siblings('button:eq(0)').click();
} else {
setting.$div.text('服务器异常,正在重试...');
}
},
ontimeout: function() {
setting.loop && setting.$div.text('服务器超时,正在重试...');
}
});
}

 

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: