自动刷课v1

自动刷课

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

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

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

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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);
})();