我爱学习,学习使我快乐:中国职业培训在线

try to take over the world!

目前为 2020-11-24 提交的版本。查看 最新版本

// ==UserScript==
// @name         我爱学习,学习使我快乐:中国职业培训在线
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://px.class.com.cn/*
// @grant        none
// ==/UserScript==

(function () {

    // 手速要慢,而且随机
    var randomeTime1 = Math.random() * 60000 + 60000
    var randomeTime2 = Math.random() * 5000 + 5000

    // 视频页面
    if (location.href.includes('player/study/index')) {
        setInterval(function(){

            //学完了,返回班级
            if (document.querySelector('#btn_submit').disabled) {
                document.querySelector('.btn-back a').click()
            }

            // 看看学没学完
            document.querySelector('#btn_submit').click()
            var randomeTime3 = Math.random() * 3000+1000
            setTimeout(function() {
                document.querySelector('#d_sub_confirm_my').click()
            }, randomeTime3)

        }, randomeTime1)
    }

    // 列表页面
    if (location.href.includes('/study/myclass/index')) {

        setInterval(function() {
            document.querySelectorAll('.toStudy')[document.querySelectorAll('.toStudy').length - 1].click()
        }, randomeTime2)
    }

})();