学银在线助手/自动刷课

学银在线刷课,自动点击下一页

目前为 2020-04-20 提交的版本。查看 最新版本

// ==UserScript==
// @name         学银在线助手/自动刷课
// @namespace    http://apcbat.top/
// @version      1.01
// @description  学银在线刷课,自动点击下一页
// @author       Apcbat
// @match        http://mooc1.xueyinonline.com/mycourse/studentstudy?*
// @grant        none
// @supportURL   [email protected]
// @contributionURL http://donate.apcbat.top/
// @license      Apache Licence 2.0
// @icon         http://donate.apcbat.top/xyzx/logo.ico
// ==/UserScript==
var t;
var started=false;
var button,btnDonate,divD;
(function() {
    'use strict';
    var div= $("<div style='background-color:#FFF;position: fixed;left: 0;top: 50%;z-index: 99999;padding: 16px;transform: translateY(-50%);text-align: center;border-radius: 0 8px 8px 0;box-shadow: 0 0 4px #000000b3;box-sizing: border-box;'><strong>学银在线助手</strong><br><br></div>");
    button=$("<button style='border: none; background-color:#2196F3; color: #fff; padding: 8px; border-radius: 8px;width: 100px;'>点击开启</button>");
    button.click(function(){toggle();});
    btnDonate=$("<br><br><button style='border: none; background-color:#FF5722; color: #fff; padding: 8px; border-radius: 8px;width: 100px;'>捐  赠</button>");

    divD=$("<div style='background-color:#FFF;display: none;position: fixed;top: 50%;left: 50%;padding: 16px; text-align: center;border-radius: 8px;transform: translate(-50%, -50%);box-shadow: 0 0 4px #000000b3;box-sizing: border-box;font-size:1.4em'>"+
           "<p><strong>感谢您的捐赠:)</strong></p><p><br><img src='http://donate.apcbat.top/AliPay.webp' width='200px' /> <img src='http://donate.apcbat.top/WeChat.webp' width='200px' /> </p>"+
           "<p><br><button style='border: none; background-color:#2196F3; color: #fff; padding: 8px; border-radius: 8px;width: 100px;z-index: 999999;'>关闭</button></p></div>")
    btnDonate.click(function(){
            divD.fadeIn();
    });
    divD.find("button").click(function(){closeDonate();});
    div.append(button,btnDonate);
    $("body").append(div,divD);
})();

function toggle(){
    started=!started;
    if (started){
        button.text("点击关闭");
        log("已开启");
        tik();
        t = setInterval(function(){
            tik();
        }, 3000);
    }else {
        button.text("点击开启");
        log("已关闭");
        clearInterval(t);
    }
}

function tik(){
    if(!started) return;
    var f=isFinshed();
    log("tik: Finshed:"+f);

    if(f) {
        $(".tabtags .orientationright").click();
    }else{
        var ff=$("iframe").contents().find("iframe").contents();
        var video=ff.find("video")[0];
        if(video.paused){
            log("paused");
            ff.find(".vjs-big-play-button").click();
        }
    }
}

function isFinshed(){
    var ff = window.frames[0];
    var length=$(".ans-job-finished",ff.document).length;
    return length>0;
}

function log(msg){
    console.log(msg);
}

function closeDonate(){
    divD.fadeOut();
}

QingJ © 2025

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