智慧树刷课脚本

自撸脚本,没有完整测试过,但是试过几个章节可行,如有bug希望可以留言一下

打开智慧树,选择你当前播放那个章节,然后播放,F12->console->输入一下代码->enter

$(
			function zhihuishu()
			{
				var e=document.createEvent("MouseEvents");
 				e.initEvent("click",true,true);
			//关闭弹窗
			function mclose()
			{
			 
				if(document.getElementsByClassName("popboxes_close tmui_txt_hidd").length)
				document.getElementsByClassName("popboxes_close tmui_txt_hidd")[0].dispatchEvent(e);
			};
			setInterval(mclose,1000);
			//关闭弹窗			 		
			
				
 				
//轮播

			var currentduration=document.getElementsByClassName("duration")[0];
 			var next=document.getElementsByClassName("next_lesson_bg tm_next_lesson")[0];
 			var h=Number(currentduration.textContent.split(":")[0]);
 			var m=Number(currentduration.textContent.split(":")[1]);
 			var s=Number(currentduration.textContent.split(":")[2]);
 			var time=h*3600+m*60+s;
 			function playnext()
 			{
 				
 				next.dispatchEvent(e);
 				setTimeout(function(){
 			currentduration=document.getElementsByClassName("duration")[0];
 			next=document.getElementsByClassName("next_lesson_bg tm_next_lesson")[0];
 			h=Number(currentduration.textContent.split(":")[0]);
 			m=Number(currentduration.textContent.split(":")[1]);
 			s=Number(currentduration.textContent.split(":")[2]);
 			time=h*3600+m*60+s+7;
 			console.log(time);
 			setTimeout(playnext,time*1000);	
 				},6000)
 			
 			}
 			setTimeout(playnext,time*1000);
 			console.log(time);
 			
//轮播
}
		)

你可能感兴趣的:(javascript)