自动刷课v1

自动刷课

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         自动刷课v1
// @namespace    一品学堂,进入课程页面即可
// @version      1.7
// @description  自动刷课
// @author       食翔狂魔
// @match        *zjdx-kfkc.webtrn.cn/learnspace/learn/learn/templateeight/index.action*
// @grant        none
// @license MIT
// ==/UserScript==
 
(function() {
  //'use strict';
  setTimeout(() => {
    console.log("四秒已过,开始运行。")
    window.index = 0;

    function autoLearn() {
      window.vlist = $(".s_point[completestate='0']", $("#mainContent")[0].contentDocument);
      window.vlist[window.index].onclick();
      var video;
      setTimeout(() => {
        video = $("video", $("#mainContent")[0].contentDocument.getElementById("mainFrame").contentDocument)[0];
        video.volume=0;
        console.log("获取video。" + video);
        video.play();
        setTimeout(() => {
          console.log("定时下一视频播放");
          video.play();
          video.volume=0;
          if(window.index < window.vlist.length) {
            //window.index++;
            $("#mainContent")[0].contentWindow.location.reload()
            setTimeout(() => {
              autoLearn();
            }, 5000)
          }
        }, ((video.duration - video.currentTime) + 1) * 1000)
      }, 5000)
    }
    autoLearn();
  }, 4000);
})();