wangzexi / zhihuishu-assistant Goto Github PK
View Code? Open in Web Editor NEW智慧树网课辅助脚本✨
智慧树网课辅助脚本✨
(function () {
const MAX_DELAY = 30 // 切课时的最大延迟,单位:秒
const sleep = (time) => new Promise((resolve) => setTimeout(resolve, time))
SpeedFlag = 0
VolumeFlag = 0
const start = async function () {
console.log('智慧树助手已启动')
while (true) {
console.log('正在检查')
const delay = Math.floor(Math.random() * MAX_DELAY * 1000) + 1000
// if (!/liuchang/.test($('.definiBox').attr('style'))) {
// console.log('更改画质')
// $('.line1bq').click()
// }
if (!/1\.5/.test($('.speedBox').attr('style')) && !SpeedFlag) {
console.log('提升到1.5倍速')
SpeedFlag = 1
$('.speedTab15').click()
}
if ($('.volumeBox').find('.passVolume').width() != 0 && !VolumeFlag) {
console.log('静音')
VolumeFlag = 1
$('.volumeIcon').click()
}
if ($('.popbtn_cancel')[0]) {
console.log('发现弹题,将在' + delay / 1000 + ' 秒后点击关闭')
await sleep(delay / 2)
const iframe = document.getElementById('tmDialog_iframe').contentWindow
iframe.document.querySelector('.answerOption label').click()
await sleep(delay / 2)
$('.popbtn_cancel').click()
}
else if ($('.playButton').length > 0) {
console.log('本节完成,' + delay / 1000 + ' 秒后将切到下一课')
await sleep(delay)
$('.current_play').nextAll('.video')[0].click()
console.log('已经切换到下一课')
console.log('点击播放')
$('.playButton').click()
SpeedFlag = 0
VolumeFlag = 0
}
await sleep(1000)
}
}
start()
}())
// 由wangzexi代码改进而来,增加了两个flag用于判断。
脚本用不了了,估计要关闭智慧树插件检测
当前的策略是0~60s随机取值,在统计上会表现起来不符合关于反应速度的曲线,所以我建议把delay
用正态曲线生成,这样也不用再额外加上1s的延时了
Thank you for your fancy code!
I wan't to use use it to make a Chrome extension and publish it in Chrome extension store.
(function () {
const MAX_DELAY = 30 // 切课时的最大延迟,单位:秒
const sleep = (time) => new Promise((resolve) => setTimeout(resolve, time))
SpeedFlag = 0
VolumeFlag = 0
const start = async function () {
console.log('智慧树助手已启动')
while (true) {
console.log('正在检查')
const delay = Math.floor(Math.random() * MAX_DELAY * 1000) + 1000
if (!/1\.5/.test($('.speedBox').attr('style')) && !SpeedFlag) {
console.log('提升到1.5倍速')
SpeedFlag = 1
$('.speedTab15').click()
}
// if (!/liuchang/.test($('.definiBox').attr('style'))) {
// console.log('更改画质')
// $('.line1bq').click()
// }
if ($('.volumeBox').find('.passVolume').width() != 0 && !VolumeFlag) {
console.log('静音')
VolumeFlag = 1
$('.volumeIcon').click()
}
if ($('.popbtn_cancel')[0]) {
console.log('发现弹题,将在' + delay / 1000 + ' 秒后点击关闭')
await sleep(delay / 2)
const iframe = document.getElementById('tmDialog_iframe').contentWindow
iframe.document.querySelector('.answerOption label').click()
await sleep(delay / 2)
$('.popbtn_cancel').click()
}
if ($('.playButton').length > 0) {
console.log('本节完成,' + delay / 1000 + ' 秒后将切到下一课')
await sleep(delay)
$('.current_play').nextAll('.video')[0].click()
console.log('已经切换到下一课')
console.log('点击播放')
$('.playButton').click()
SpeedFlag = 0
VolumeFlag = 0
}
await sleep(1000)
}
}
start()
}())
TalentChopper is a similar project which I made several years ago (when I was a student), and I'm not sure if it still works.
However, when it works you would just need to spend a few seconds on each lesson.
弹题之后马上就进行了下一个while 循环 进行了是否播放if判断 迅速在弹题之后将暂停的视频继续播放,和正常用户行为不一样。
jQuery的DOM元素click方法是否存在坐标点偏移,还是默认0,0点 ,我之前写过其他平台的挂课脚本,弹窗关闭按钮在固定位置将会检测到作弊
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.