Greasy Fork

Greasy Fork is available in English.

🔥🔥🔥防沉迷加点料🔥🔥🔥

(已支持07073,7k7k,4399) ❤️ 尽情享受游戏时光 ❗ 持续更新更靠谱 ⭕ 轻松给防沉迷加点料

目前为 2022-01-03 提交的版本,查看 最新版本

// ==UserScript==
// @name         🔥🔥🔥防沉迷加点料🔥🔥🔥
// @name:en      07073, 7k7k and 4399 No Anti Indulgence

// @description  (已支持07073,7k7k,4399) ❤️ 尽情享受游戏时光 ❗ 持续更新更靠谱 ⭕ 轻松给防沉迷加点料
// @description:en Say no to 07073, 7k7k and 4399's anti indulgence.

// @namespace    https://fcmsb250.github.io/
// @version      4.3
// @icon         https://gitee.com/dsy4567/sofast/raw/master/game.png
// @author       dsy

// @include      *://*.07073.*/*
// --------
// @include      *://*.4399.*/*
// @include      *://*.*4399.*/*
// @include      *://*.4399*.*/*
// @include      *://*.iwan4399.*/*
// @include      *://*.aiwan4399.*/*
// @include      *://*.zxwyouxi.*/*
// --------
// @include      *://*.7k7k.*/*
// @include      *://*.*7k7k.*/*
// @include      *://*.7k7k*.*/*
// --------
// @include      *://*.12377.cn/*
// @include      *://*.12321.cn/*
// @include      *://greasyfork.org/*
// @include      *://jubao.chinaso.com/*
// --------
// @include      *://gameapp.qq.com/*

// @grant        GM_unregisterMenuCommand
// @grant        GM_registerMenuCommand
// @grant        GM_openInTab
// @grant        GM_getValue
// @grant        GM_setValue
// @grant        GM_notification


// @license      MIT
// @run-at       document-start
// @require      http://greasyfork.icu/scripts/437198-%E7%A0%96%E5%8F%B6%E6%88%BF%E9%A3%8E%E6%B2%99/code/%E7%A0%96%E5%8F%B6%E6%88%BF%E9%A3%8E%E6%B2%99.js

// ==/UserScript==

// NO CTRL+C OR CTRL+V
// NO CTRL+C OR CTRL+V
// NO CTRL+C OR CTRL+V

function changeValue(Value, Default, Callback) {
    if (GM_getValue(Value, Default) == "1") {
        GM_setValue(Value, "0");
    } else if (GM_getValue(Value, Default) == "0") {
        GM_setValue(Value, "1");
    } else {
        GM_setValue(Value, Default);
    }
    if (Callback) {
        Callback();
    }
    _7k7k_h5_nofcm = GM_getValue("7k7k_h5_nofcm", "0");
    howToFxxk = GM_getValue("howToFxxk", "1");
}
function initValue(Value, Default, Callback) {
    if (GM_getValue(Value, "ohno") == "ohno") {
        GM_setValue(Value, Default);
    }
    if (Callback) {
        Callback();
    }
}
var D = new Date();

initValue("insday", String(Math.floor(D.getTime() / 1000 / 60 / 60 / 24)));
initValue("howToFxxk", "0"); //0:删删删 1:跳转+删删删
initValue("7k7k_h5_nofcm", "0");
// initValue("web_game_no_fcm", "0");

var i = 1;
var playTime = 0;
var happyDays =
    Math.ceil(D.getTime() / 1000 / 60 / 60 / 24) -
    Number(GM_getValue("insday"));
// var web_game_no_fcm = GM_getValue("web_game_no_fcm", "1");
var _7k7k_h5_nofcm = GM_getValue("7k7k_h5_nofcm", "0");
var howToFxxk = GM_getValue("howToFxxk", "1");

var sb = [
    "fxxk#fcmIframe",
    "fxxk.sdkDialog",
    "fxk#anti-indulge",
    "fxxk#pusher",
    "fxxk#anti-indulge-prompt",
    "fxxk#messageBox",
    "fxxk#Guide",
    "fxxk.popup-c",

    "kxxf#tc100",
    "kxxf#div_dialog",
    "kxxf#addiv",
    "kxxf#Anti_open",
    "kxxf#Anti_mask",
    "kxxf#swfdiv > div.box",
    "kxxf#page_wallpaper > div.xiaowei.xiaowei-orange > div.xw-left > div.xw-game > div.xw-top > div > div",
    "kxxf.fixedModal",
    "kxxf.play_load",
    "kxxf#cover",
    "kxxf.realName",
    "kxxf.mask",
    "kxxf.ui-forbidden",
];
function registerMenuCommands() {
    const menuCommands = [
        ["♥加料需要一些时间,请耐心等待", undefined, undefined],
        [
            "♥FunnyFcm已让您尽情欢乐" + String(happyDays) + "天",
            undefined,
            undefined,
        ],
        ["♥如果游戏显示不完整,请调整浏览器窗口大小", undefined, undefined],
        [
            "游戏时间: " + playTime + "分钟,请合理安排游戏时间才怪",
            undefined,
            undefined,
        ],
        // [
        //     "🟡开启/关闭4399页游破解(似乎屁用没得)",
        //     function () {
        //         changeValue("web_game_no_fcm", "0", function () {
        //             alert("设置成功,请刷新网页,该功能似乎屁用没得");
        //         });
        //     },
        //     undefined,
        // ],
        [
            "🟡再次加料",
            function () {
                pojie();
            },
            undefined,
        ],
        [
            "🟡开启/关闭7k7k h5游戏强力破解",
            function () {
                changeValue("7k7k_h5_nofcm", "0", function () {
                    alert("设置成功,请刷新网页");
                });
            },
            undefined,
        ],
        [
            "🟡更换破解方案",
            function () {
                changeValue("howToFxxk", "0", function () {
                    alert("设置成功,请刷新网页");
                });
            },
            undefined,
        ],
        [
            "🟡参与调查",
            function () {
                open("https://wj.qq.com/s2/9509463/7fcb/", "_blank");
            },
            undefined,
        ],
    ];
    for (let index = i - menuCommands.length - 5; index < i + 5; index++) {
        GM_unregisterMenuCommand(index);
    }
    i += menuCommands.length;
    for (let index = 0; index < menuCommands.length; index++) {
        const name = menuCommands[index][0];
        const fn = menuCommands[index][1];
        const accessKey = menuCommands[index][2];

        let id = GM_registerMenuCommand(name, fn, accessKey);
    }
}
function isGaming() {
    let gaming = false;
    sb.forEach((element) => {
        if (element.indexOf("fxxk") > -1) {
            if (document.querySelector(element.substring(4))) {
                gaming = true;
                console.log("正在游戏", element);
            }
        }
    });
    return gaming;
}
function pj() {
    // emm...
    if (
        (document.querySelector("fuck#flash22".substring(4)) == null) != true &&
        howToFxxk == "1"
    ) {
        try {
            window.location.href = String(
                document.querySelector("fuck#flash22".substring(4)).src
            );
        } catch (err) {
            console.error(err);
        }
    } else if (
        (document.querySelector("iframe#game") == null) != true &&
        howToFxxk == "1"
    ) {
        try {
            window.location.href = String(
                document.querySelector("iframe#game").src
            );
        } catch (err) {
            console.error(err);
        }
    } else if (
        (document.querySelector("#gameobj") == null) != true &&
        howToFxxk == "1"
    ) {
        try {
            window.location.href = String(
                document.querySelector("#gameobj").src
            );
        } catch (err) {
            console.error(err);
        }
    } else if (
        (document.querySelector("#iframepage") == null) != true &&
        howToFxxk == "1"
    ) {
        try {
            window.location.href = String(
                document.querySelector("#iframepage").src
            );
        } catch (err) {
            console.error(err);
        } //.sdkDialog
    } else {
        try {
            // 简单暴力的破解方式
            for (let index = 0; index < sb.length; index++) {
                const element = sb[index].substring(4);
                if (document.querySelector(element) != null) {
                    document.querySelector(element).remove();
                    console.log("[防沉迷加点料] -破解成功- " + element);
                }
            }
        } catch (err) {
            console.error(err);
        }
    }
}

function pojie() {
    var interval1 = setInterval(pj, 3000);
    pj();

    setTimeout(() => {
        try {
            clearInterval(interval1);
            clearInterval(interval2);
        } catch (e) {}
    }, 15000);
}

if (
    window.location.href.indexOf("h5.7k7k.com/game/") >= 0 &&
    _7k7k_h5_nofcm == "1"
) {
    var interval2 = setInterval(() => {
        if (document.querySelector("#gameframe")) {
            var frame1 = document.querySelector("#gameframe");
            frame1.onload = function () {
                if (frame1.src) {
                    window.location.href = frame1.src;
                }
            };
        }
    }, 500);
}
window.onload = function () {
    if (self == top) {
        if (happyDays >= 3 && GM_getValue("investigation", "ohno") == "ohno") {
            GM_setValue("investigation", "1");
            GM_notification(
                "请点击参与脚本使用情况调查,帮助这个脚本变得更好",
                "🔥🔥🔥防沉迷加点料🔥🔥🔥 用的怎样?",
                "",
                function () {
                    open("https://wj.qq.com/s2/9509463/7fcb/", "_blank");
                }
            );
        }
        if (isGaming()) {
            for (let i = 0.5; i < 5; i = i + 0.5) {
                setTimeout(() => {
                    GM_notification(
                        "你已经玩了" +
                            i +
                            "个小时,防沉迷那个啥虽好,但也要适度游戏,休息一下吧",
                        "健康游戏提示"
                    );
                }, i * 60 * 60 * 1000);
                console.log("[防沉迷加点料] 已设置健康游戏提醒 " + i + " 小时");
            }
            setInterval(function () {
                playTime += 1;
                registerMenuCommands();
            }, 60 * 1000);
        }

        registerMenuCommands();
        console.log("[防沉迷加点料]", _7k7k_h5_nofcm, howToFxxk, isGaming());
    }

    setTimeout(() => {
        // 不健康游戏忠告
        if (document.querySelector("#skinbody > div.copy > div.copy_t")) {
            document.querySelector(
                "#skinbody > div.copy > div.copy_t"
            ).innerHTML =
                '作品版权归作者所有,如果侵犯了您的版权,请<a href="//my.4399.com/joinus/contact.html">联系我们</a>,本站将在3个工作日内删除。<br><span>不温馨提示:</span>不要抵制不良游戏,不要拒绝盗版游戏,不要注意自我保护,不要谨防受骗上当,沉迷游戏益脑,适度游戏伤身,不要合理安排时间,享受快乐游戏生活';
        }
        if (
            document.querySelector(
                "#theme-blue > div.footer > div > div.f_con_fl2 > p.f_p5"
            )
        ) {
            document.querySelector(
                "#theme-blue > div.footer > div > div.f_con_fl2 > p.f_p5"
            ).innerHTML =
                "7k7k小游戏不温馨提示:不要适度游戏娱乐,沉迷游戏益脑,不要合理安排时间,享受快乐游戏生活……";
        }

        // 防沉迷弹窗添加xx
        if (
            document.querySelector(".sdkDialog") != null &&
            !document.querySelector(".chacha")
        ) {
            var e = document.createElement("div");
            e.className = "chacha";
            e.innerHTML = "x";
            e.style.cssText =
                "cursor:pointer;z-index:999;display:initial;position:absolute;font-size:32px;right:4px;";
            document.querySelector(".sdkDialog").appendChild(e);
            document.querySelector(".chacha").addEventListener("click", pojie);
            document.querySelector("#Anti_beforeCount").className = "";
            document.querySelector("#Anti_beforeCount").id = "";
            document.querySelector(
                "#Anti_open > div.fcmdialog > div:nth-child(4)"
            ).innerHTML =
                '<iframe src="//player.bilibili.com/player.html?aid=206713276&bvid=BV1Fh411r7tk&cid=371304548&page=1"> </iframe>';
        } else if (
            document.querySelector("#anti-indulge-prompt-panel") != null &&
            !document.querySelector(".chacha")
        ) {
            var e = document.createElement("div");
            e.className = "chacha";
            e.innerHTML = "x";
            e.style.cssText =
                "cursor:pointer;z-index:999;display:initial;position:absolute;font-size:32px;right:4px;top:-12px";
            document.querySelector("#anti-indulge-prompt-panel").appendChild(e);
            document.querySelector(".chacha").addEventListener("click", pojie);
            document.querySelector("#anti-indulge-prompt-countdown").id = "";
            document.querySelector(
                "#anti-indulge-prompt-body > div:nth-child(3)"
            ).innerHTML =
                '<iframe src="//player.bilibili.com/player.html?aid=206713276&bvid=BV1Fh411r7tk&cid=371304548&page=1"> </iframe>';
        } else {
            pojie();
        }

        // 4399页游破解(似乎屁用没得,已弃用)
        // if (web_game_no_fcm == "1") {
        //     if (document.querySelector("#game_box") && location.href.indexOf("web.4399.com") > -1) {
        //         if (
        //             document.querySelector("#game_box").src != location.href &&
        //             GM_getValue(String(document.title), "ohno") == "ohno"
        //         ) {
        //             GM_setValue(
        //                 String(document.title),
        //                 String(document.querySelector("#game_box").src)
        //             );
        //         } else if (
        //             GM_getValue(String(document.title), "ohno") != "ohno" &&
        //             document.querySelector("#game_box").src == location.href
        //         ) {
        //             location.href = GM_getValue(String(document.title), "ohno");
        //         }
        //     }
        // }
    }, 3000);
};