智慧树Plugin

智慧树脚本

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

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.

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

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

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==
// @license MIT
// @name         智慧树Plugin
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  智慧树脚本
// @author       You
// @match        https://hike.zhihuishu.com/aidedteaching/sourceLearning/*
// @grant        none
// ==/UserScript==

(function() {
var regx = /(?<=fileId=)\d+/;
var url = window.location.href
var id = parseInt(url.match(regx));

var cirl = function() {
	var eleId = 'file_'+id;
	var ele = document.getElementById(eleId);
	//console.log(id);
	if (ele.innerHTML.indexOf('icon-finish')!=-1) {
		var index = id+1;
		var baseUrl = url.replace(regx,index);
		window.location.href=baseUrl;
	}

};
setInterval(cirl,500);
setTimeout(function(){
document.getElementById("playButton").click();
document.getElementsByClassName("speedTab15")[0].click();
//document.getElementsByClassName("line1bq")[0].click();
document.getElementsByClassName("volumeIcon")[0].click();
},2000)

})();