-
-
Save wstczlt/5e5d513f89d4f507a2f2 to your computer and use it in GitHub Desktop.
使用方法: 下载此文件保存成dfss_autoplay.user.js, 拖进chrome浏览器即可
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name 东方时尚课程自动播放 | |
| // @namespace http://your.homepage/ | |
| // @version 0.1 | |
| // @description enter something useful | |
| // @author You | |
| // @match *://dfss.anjia365.com/player.do* | |
| // @grant none | |
| // ==/UserScript== | |
| // 作用: 自动学习完东方时尚科目一的课程, 不用再等待视频播放, 不用点下一步, 不用做题! | |
| // 使用方法: 下载此文件保存成dfss_autoplay.user.js, 拖进chrome浏览器即可 | |
| alert('自动播放插件加载成功'); | |
| setInterval(function() { | |
| var $ = jQuery; | |
| var doExamIfNeeded = function() { | |
| console.log('dfss.user.js doExamIfNeeded works'); | |
| var radios = $('input[type="radio"]'); | |
| if (radios.length > 0) { | |
| radios.each(function() { | |
| $(this).click(); | |
| var answerHints=$("#answerHints").first().html(); | |
| if(answerHints != '1'&& answerHints!='') { | |
| // 错误 | |
| }else { | |
| // 答对,退出循环 | |
| return false; | |
| } | |
| }); | |
| $('#btnNext').click(); | |
| } | |
| }; | |
| var showNextCourseIfNeeded = function() { | |
| console.log('dfss.user.js setInterval works'); | |
| if ($('#showNextWare').length > 0 && $('#showNextWare.dfss_no').length == 0) { | |
| showNext(); | |
| } | |
| } | |
| var seekPlayerIfNeeded = function() { | |
| var player = document.getElementById("playerswf"); | |
| if (player) { | |
| var duration = player.spark_player_duration(); | |
| var position = player.spark_player_position(); | |
| if (position < duration) { | |
| // start if needed | |
| player.spark_player_start(); | |
| } | |
| if (position < duration - 4) { | |
| player.spark_player_seek(duration-2); | |
| } | |
| } | |
| } | |
| doExamIfNeeded(); | |
| seekPlayerIfNeeded(); | |
| showNextCourseIfNeeded(); | |
| }, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment