// ==UserScript== // @name 宁夏专技挂机(360浏览器增强版) // @namespace http://tampermonkey.net/ // @version 1.4.4 // @description 360浏览器完美运行,自动播放视频+关弹窗+自动下一章+后台不掉线+稳定防检测 // @match https://nxzj.chinahrt.com/* // @grant none // @run-at document-start // @noframes // ==/UserScript== (function () { console.log("✅ 宁夏专技挂机脚本(360专用)已启动"); // 配置项 const CONFIG = { playSpeed: 1.0, // 播放倍速(可改 1.0 / 1.25 / 1.5 / 2.0) autoNext: true, // 自动下一节 skipAlert: true, // 自动关闭弹窗 antiHangUp: true // 后台保活 }; // 工具方法 const $ = document.querySelector.bind(document); const $$ = document.querySelectorAll.bind(document); // 根据文字点击元素 function clickByText(text) { try { const elements = $$("button, a, span, div"); for (let el of elements) { if (el.innerText?.trim().includes(text)) { el.click(); return true; } } } catch (e) {} return false; } // 自动播放 + 静音 + 倍速 function autoPlayVideo() { const video = $("video"); if (!video) return; // 静音 video.muted = true; // 设置倍速 video.playbackRate = CONFIG.playSpeed; // 自动播放 if (video.paused && !video.ended) { video.play().catch(err => console.log("播放异常:", err)); } } // 关闭所有干扰弹窗 function closePopups() { // 文字关闭 clickByText("确定"); clickByText("关闭"); clickByText("我知道了"); clickByText("继续学习"); clickByText("确认"); clickByText("知道了"); // 选择器关闭 $(".el-dialog__close")?.click(); $(".btn-close")?.click(); $(".close-btn")?.click(); $(".el-button--primary")?.click(); } // 自动播放下一节/下一章 function autoNextLesson() { if (!CONFIG.autoNext) return; const video = $("video"); if (!video || isNaN(video.duration)) return; // 剩余时间小于10秒 或 播放完毕 → 切下一节 const remainTime = video.duration - video.currentTime; if (remainTime < 10 || video.ended) { console.log("▶ 视频即将结束,自动切换下一节"); // 文字匹配点击 clickByText("下一节"); clickByText("下一章"); clickByText("下一课"); clickByText("下一个"); clickByText("继续学习"); clickByText("完成学习"); // 选择器匹配点击 $(".next-btn")?.click(); $('[title="下一节"]')?.click(); $(".el-button--success:last")?.click(); $(".next-chapter")?.click(); } } // 360浏览器后台保活(防止暂停) function keepBrowserAlive() { if (!CONFIG.antiHangUp) return; // 模拟页面活动,骗过网站休眠检测 document.dispatchEvent(new Event("mouseover")); document.dispatchEvent(new Event("mousemove")); window.dispatchEvent(new Event("focus")); // 视频意外暂停 → 重新播放 const video = $("video"); if (video && video.paused && !video.ended) { video.play().catch(() => {}); } } // 主循环 function runScript() { try { autoPlayVideo(); closePopups(); autoNextLesson(); keepBrowserAlive(); } catch (e) { console.log("脚本执行异常:", e); } } // 启动(360浏览器稳定延迟) setTimeout(() => { setInterval(runScript, 700); runScript(); }, 2500); })();