自动学习

自动切换,自动模拟鼠标移动--- 开放大学

当前为 2022-02-18 提交的版本,查看 最新版本

// ==UserScript==
// @name         自动学习
// @namespace    http://play.hnzjpx.net/
// @version      0.12
// @description  自动切换,自动模拟鼠标移动--- 开放大学
// @author       MEN
// @match        http://play.hnzjpx.net/**
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

// 483 -496
var tag =1


//换一段视频
function next_() {
    console.log("执行换视频事件!!!")
    window.location.href = window.location.href.replace(/[0-9][0-9][0-9]/,parseInt(window.location.href.match(/[0-9][0-9][0-9]/))+1);
}

//触发鼠标点击事件
function mouse_(){
   console.log("执行鼠标事件")
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("mousemove", false, false);
document.dispatchEvent(evt);
}

 function sleep(millisecond) {
        return new Promise(resolve => {
            setTimeout(() => {
                resolve()
            }, millisecond)
        })
    }

//监听当前播放状态

function video_() {
    console.log("执行播放监听事件"+tag)
    if(tag === 0){
     document.getElementById(document.getElementById("video").childNodes[0].childNodes[0].id).addEventListener("ended",next_())
    }

    document.getElementById(document.getElementById("video").childNodes[0].childNodes[0].id).addEventListener("ended",function (){
       console.log("播放可能结束,执行切换下一页事件")
        tag = 0;
    })
    mouse_();
}
setInterval(video_,30000)

})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址