新版智慧树挂机

跳过视频内试题,1.5倍加速 自动下一章

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        新版智慧树挂机
// @description 跳过视频内试题,1.5倍加速 自动下一章
// @namespace	  http://wpa.qq.com/msgrd?v=3&uin=467200236&site=qq&menu=yes
// @version	 2018-08-24
// @author      小鑫
// @match	*://course.zhihuishu.com/learning/videoList?courseId*
// @grant       小鑫
// ==/UserScript==

function query() {
	if ($("#popbox_title").length > 0) {
		$(".popboxes_close")[0].click();
		console.log('关闭窗口');
	}

	if ($("#chapterList .time_ico.fl").nextAll()[2].children[0].style.width === "100%" || $("video").get(0).ended) {
		var num = -1;
		var text = $("#chapterList .time_ico.fl").parent().nextAll()[++num].id;
		while (text === "" ||
			text.substr(0, 5) != "video" ||
			text.substr(0, 7) === "video-0") {
			text = $("#chapterList .time_ico.fl").parent().nextAll()[++num].id;
		}
		$("#chapterList .time_ico.fl").parent().nextAll()[num].click();
	}

	if ($("video").length > 0 && $("video").get(0).playbackRate != 1.5) {
		console.log('切换到1.5倍');
		$(".speedTab15")[0].click();
	}

	if ($("video").get(0).volume > 0) {
		$(".volumeIcon").click();
	}
}

window.setInterval(query, 1000);