河南专技辅助挂机

河南专技辅助挂机(自动完成单元测试)

// ==UserScript==
// @name         河南专技辅助挂机
// @version      0.1
// @description  河南专技辅助挂机(自动完成单元测试)
// @author       xisp
// @icon         data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA6CAYAAADlTpoVAAAJIklEQVRoBe1a228c1Rn/zezVu76tLzi24zgkdpwLKYGEivQCLQ2kaqUK2qZPVXlASH3sS+kD75VA6gsP6R+AShFVywMtakUrJUi0KAkJJA4xiYkdx1cSe7O+rHd3bv19s17HdmZnjr3Likb9kvXO7jlzzvc73/2b1RwS7mPS72NsLrT/A/xfl/B9L8FwrSX0+S0Lv3svi4Wcg5jP7jkT6GzS8fIPkmiu07bMps8WW17T98ahaRMjty3fOaXBJgJrjG8dnKxTcxUdpgRV6ZGeMPTK8NUWYDrr4PKkGsAwj35PR+UKVlMJTmUs3JxTA1gf03CgK6Qq7LLzagpw+As1cMJtR6OO1mTl7FW+QtmzWz9gENvgJF2jIvVXQT1lq5oBLJgOPlW0P3Esx/ZFFY/Cf1rNAN5MW5hdsv25WRn96eE4Bjoqtz9ZriYAZxdtnDy1rARuf2cYv3g8rjRXZVLFfnjyjo0zowbuMASIamkb4laeqnl21MRYgPfUYONQTwQv/zCJUBWPfcsARSpvnsvjzIiBLxb8VU8wy8umwhhaFCHHRBgmCrzmsSAEC88eSeD5wxqS1TG9VeFuCeBZSuzk6WVMZ/yByS4h1tPpcAoRal1jBOgxZ3AbrchoYXQ5GTz2oIan98awv3OD6FdZrOxC22xF/8m4id++u4R5Jst+pFE2Ag7tLXhhbxrH9jeiPl4dx+G378axTUlwet7GK3/PBoIT6HHHRrKnFa8dN9CSTAFzN4Dh8zDyy66NaToV07YRys4CluEar6npiOQWYH79RRh17RiacRDVbdeuQzRusW/3xfV12qnYvLzkHOMRzU0OtgwwW3BcyaWzCmpJa8vU1+Pkd7IElwAuvIXCu7+Bk7lJi7P5j4zKKZC5rBaiXYpkReYaUoVlWAd/hj9+1ow3PrQQ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a+fyDKRNq/hpdQcrh387nkVkCtvaeqqdrahb8q1xWr6FcFSDk+/guPlBzroYmbjwAAAABJRU5ErkJggg==
// @match        *://*.ghlearning.com/*
// @require      https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js
// @run-at       document-end
// @namespace https://greasyfork.org/users/750368
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
//进入还没有学习的课程。。

    function enterCourse() {
        if (document.getElementsByClassName("item-box")[0]) {
            for (var i = 0; i < document.getElementsByClassName("item-box").length; i++) {
                if (document.getElementsByClassName("sr-only")[i * 2].innerText != "100.0%") {
                    document.getElementsByClassName("item-box")[i].click();
                    break;
                }
            }
            setTimeout(function () {
                console.log("恭喜您完成已选的所有课程!");
                clearInterval(myTimer);
                alert("恭喜您完成已选的所有课程!\n河南专技辅助挂机\n作者:xisp");
            }, 2000);
        }
    }

    var myTimer = setInterval(enterCourse, 3000);

    //自动返回课程目录
     function fh() {
         if (document.getElementsByClassName("btn btn-primary")[1].innerText == "返回课程列表") {
                //console.log('课程进度完成,即将返回课程列表');
                document.getElementsByClassName("btn btn-primary")[1].click()
               }
         if (document.getElementsByClassName("clearfix")[1].innerText == "您已完成该课程学习"){
           history.back(-1);//返回
             }
         }
    var fhTimer = setInterval(fh, 10000);
    //播放视频,刷新单元测试
   function bfang() {
        var text = document.getElementsByClassName("clearfix videoLi active")[0].innerText
        if (text.match(/[0-9]+%/)[0] == "100%"){
            for (var m = 0; m < document.getElementsByClassName("video-info ellipsis-1").length; m++) {
               if (document.getElementsByClassName("badge")[m].innerText != "100%"){
                document.getElementsByClassName("clearfix videoLi")[m].click()
                break;
                }
            }
        }
       if (document.getElementsByClassName("text-newBlue f24 center")[0].innerText == "单元测试"){
               window.location.reload();//刷新
        }
    }
     var bfTimer = setInterval(bfang, 3000); 
    })();