// ==UserScript== // @name 江苏省无锡教育公共服务平台学习外挂 // @namespace https://greasyfork.org/zh-CN/users/41249-tantiancai // @version 0.6 // @description 自动挂机学习,轻松达到1000分钟的学习要求。 // @author Tantiancai // @match http://learn.wxjy.com.cn/lms/learning/* // @grant none // @downloadURL none // ==/UserScript== (function () { 'use strict'; if (typeof unsafeWindow == "undefined"){ console.log("unsafeWindow undefined"); var unsafeWindow = window; } var processTimer = null; var cntRetry = 0; function TimeProcess() { unsafeWindow.process += 60; unsafeWindow.currentPosition = unsafeWindow.process; if(videoTotalTime == 0) { var duration = unsafeWindow.player.getDuration(); videoTotalTime = parseInt(duration); cntRetry++; console.log('Retry:' + cntRetry); if(cntRetry >3) { unsafeWindow.location.reload(); } } if (videoTotalTime > 0) { unsafeWindow.player.stop(); if (process >= videoTotalTime) { unsafeWindow.process = videoTotalTime; unsafeWindow.currentPosition = videoTotalTime; unsafeWindow.learningSave(); unsafeWindow.document.getElementById('nextSectionLink').click(); unsafeWindow.clearInterval(processTimer); console.log('Complete'); } else { unsafeWindow.learningSave(); unsafeWindow.clearInterval(saveTimer); console.log('SaveTime'); } } else if(videoTotalTime < 0) { unsafeWindow.document.getElementById('nextSectionLink').click(); unsafeWindow.clearInterval(processTimer); console.log('Error'); } } if (typeof (player) !== 'undefined') { unsafeWindow.clearInterval(clockTimer); processTimer = unsafeWindow.setInterval(TimeProcess, 60000); } else { unsafeWindow.document.getElementById('nextSectionLink').click(); } }) ();