平安毓秀

自动完成平安毓秀学习(打开课程列表,全自动完成)

目前为 2023-03-07 提交的版本。查看 最新版本

// ==UserScript==
// @name         平安毓秀
// @namespace    yuanlu
// @version      0.3
// @description  自动完成平安毓秀学习(打开课程列表,全自动完成)
// @author       yuanlu
// @match        http*://*.mycourse.cn/*
// @icon         https://www.google.com/s2/favicons?domain=mycourse.cn
// @grant        none
// @require      https://code.jquery.com/jquery-latest.js
// ==/UserScript==

(function () {
    'use strict';
    const reload = () =>{
        setTimeout(()=>location.reload(),4000);
    };
    const x = () => {
        console.log("加载平安毓秀自动刷课脚本");
        if (window)window.alert=(a)=>console.log(a);
        if (location.hash.indexOf("course/list") >= 0) {
            console.debug("课程列表页面");
            setTimeout(() => {
                let tar = $(window.$("li.course")[0]);
                let finish = tar.find('h3>i').length;
                if (finish) {
                    console.debug('back');
                    history.go(-1);
                    reload();
                } else {
                    console.debug('enter', tar);
                    tar.click();
                    // reload();
                }
            }, 5000);
        } else if (location.host.startsWith("mcwk")) {
            console.debug("课程学习页面");
            console.debug("interval: " + setInterval(()=>window.finishWxCourse(), 30*1000));
            setTimeout(() => {
                console.debug("back");
                history.go(-1);
                reload();
            }, 61 * 1000);
        } else if (location.hash.startsWith("#/course")&&!location.hash.startsWith("#/course/")) {
            console.debug('课程大类页面');
            setTimeout(() => {
                let state = window.$(".mint-tab-container .state");
                let a = window.$(".mint-tab-container a");
                for (let i = 0; i < state.length; i++) {
                    let rate = eval(state[i].textContent);
                    if (rate == 1) continue;

                    console.debug(`进入第${i}个课程列表`);
                    a[i].click();
                    reload();

                    return;
                }
                console.log("全部课程学习完毕");
            }, 5000);
        }
    }
    $(window).bind('hashchange', () => x());
    x();
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址