法宣在线10分钟自动结束学习

10分钟自动结束学习

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         法宣在线10分钟自动结束学习
// @namespace    http://tampermonkey.net/
// @version      0.1.5.1
// @description  10分钟自动结束学习
// @author       AN drew
// @match        *://*.faxuanyun.com/sps/courseware/*
// @license      MIT
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    setInterval(function(){
        if($('#inBtnDiv a').length>0)
            $('#inBtnDiv a').get(0).click();
        if($('#prompt2 a').length>0)
            $('#prompt2 a').get(0).click();
    },3000);

    setInterval(function(){
        var time = $('#ware_time_num').text().split(':');
        if(time[1]>=10 && $('#popwin').length==0)
        {
            $('#exitCourse').get(0).click();
            setTimeout(function(){
                if($('#exitBtnDiv > a.pms-newspoint-btn:nth-child(2)').length>0)
                    $('#exitBtnDiv > a.pms-newspoint-btn:nth-child(2)').get(0).click();
                if($('#popwinConfirm.tanchu_btn01').length>0)
                    $('#popwinConfirm.tanchu_btn01').get(0).click();
            },3000);
        }

        var timer = $('#timer').text().split(':');
        if(timer[1]>=10 && $('#popwin').length==0)
        {
            $('#mainyemian2 > div.lessoncontainer > div.timebtn.clear > a').get(0).click();
            setTimeout(function(){
                if($('#exitBtnDiv > a.pms-newspoint-btn:nth-child(2)').length>0)
                    $('#exitBtnDiv > a.pms-newspoint-btn:nth-child(2)').get(0).click();
                if($('#popwinConfirm.tanchu_btn01').length>0)
                    $('#popwinConfirm.tanchu_btn01').get(0).click();
            },3000);
        }
    },100);

    /*
    //自动点击未学习课程的第一个课程
    let t = setInterval(function(){
        $('#kejmc-box-id li a').each(function(){
            if($(this).text().indexOf('开始学习')>-1)
            {
                $(this).get(0).click();
                clearInterval(t);
            }
        })
    },1000);
    */

})();