学达云刷课脚本
学达云
# 脚本介绍
该油猴脚本用于 学达云 的辅助看课,使用JavaScript编写,适配网址:https://*.ok99ok99.com/
脚本功能如下:
1.后台计时
2.计时结束后自动提交
3.提交后自动刷新页面来学习下一门课
脚本安装地址:
https://scriptcat.org/zh-CN/script-show-page/4557 (opens new window)
如果不会安装脚本,请按照下面安装教程来操作。
# 代学服务
提示
如需代学,请联系客服,支持闲鱼交易。

微信联系:yizhituziang

QQ联系:2422270452
- img: /img/weixin.jpg
name: 微信联系:yizhituziang
- img: /img/qq.jpg
name: QQ联系:2422270452
# 安装教程
# 1.安装浏览器扩展插件
首先需要给我们的浏览器安装上脚本猫插件,这是运行所有用户脚本的基础,如果浏览器已经安装过了脚本猫或者油猴插件,那么可以跳过这一步。推荐使用edge浏览器,安装插件更方便。
浏览器打开网址:https://docs.scriptcat.org/ (opens new window)
这里用edge浏览器作为示范,点击 “添加到Edge浏览器”

接着点击 “获取”

在右上角弹出的窗口,点击 “添加扩展”

等待几秒钟,会提示已经安装好脚本猫插件了。

# 2.安装刷课脚本
打开脚本安装地址后,在页面点击 “安装脚本” 按钮,接着在弹出的窗口点击 “安装” ,之后就会提示“安装成功”。
# 3.体验脚本功能
安装脚本后,需要重新进入学习站点,如果之前已经打开课程学习页面,那么需要刷新页面后脚本才会生效。
# 核心代码
if (window.location.href.indexOf("stu/study") != -1) {
setTimeout(function () {
// 创建一个新的文本节点
const textNode = document.createTextNode("脚本自动学习中...");
// 创建一个容器元素(例如div),用于包裹文本节点
const container = document.createElement("div");
container.appendChild(textNode);
// 添加样式
container.style.position = "fixed"; // 固定位置
container.style.top = "8%"; // 垂直居中
container.style.left = "30%"; // 水平居中
container.style.transform = "translate(-50%, -50%)"; // 偏移自身尺寸的50%以确保中心对齐
container.style.color = "red"; // 字体颜色为红色
container.style.fontWeight = "bold"; // 字体加粗
container.style.zIndex = "1000"; // 确保在最上层
container.style.padding = "10px"; // 添加一些内边距
container.style.background = "white"; // 背景颜色
container.style.border = "1px solid #ddd"; // 边框
container.style.borderRadius = "5px"; // 边框圆角
container.style.textAlign = "center"; // 文本居中
container.style.fontSize = "20px"; // 字体大小
container.style.boxShadow = "0px 0px 10px rgba(0,0,0,0.1)"; // 添加阴影效果
// 将容器元素插入到<body>标签的最前面
document.body.insertBefore(container, document.body.firstChild);
}, 3000)
setTimeout(function () {
console.log("判断")
console.log(window.location.href)
if (document.getElementsByClassName("flex align_content justify_between font18 study_time").length == 1) {
if (document.getElementsByClassName("layui-layer-move").length != 0 && document.getElementById("TB_window") != null) {
if (document.getElementById("TB_window").getElementsByClassName("btn close_camera_standard") != null && document.getElementById("TB_window").getElementsByClassName("btn close_camera_standard").length != 0) {
document.getElementById("TB_window").getElementsByClassName("btn close_camera_standard")[0].click()
}
}
console.log("新版")
setInterval(function () {
var btn_disable = document.getElementsByClassName("btn submit_btn")[0].disabled
console.log("btn_disable " + btn_disable)
if (btn_disable == false) {
document.getElementsByClassName("btn submit_btn")[0].click()
setTimeout(function () {
location.reload()
}, 5 * 1000)
}
}, 5000)
} else {
console.log("旧版")
if (document.getElementById("rightiframe") == null) {
return
}
var right = document.getElementById("rightiframe").contentWindow.document
if (right.getElementById("TB_ajaxWindowTitle") && right.getElementsByClassName("btn_Dora_b").length == 0) {
console.log(right.getElementById("TB_ajaxWindowTitle").disabled)
} else {
if (right.getElementById("curtime").innerText == "00:00:00") {
location.reload()
}
}
setInterval(function () {
if (right.getElementById("SaveStudyRecord").disabled != true) {
right.getElementById("SaveStudyRecord").click()
setTimeout(function () {
location.reload()
}, 3000)
}
}, 5000)
}
}, 10000)
}