Bypass DevTools Detection, Unlock Functionality, and Auto Check-in

Bỏ qua phát hiện DevTools, mở khóa các chức năng và tự động điểm danh trên https://loulxgame.com/

目前為 2024-10-11 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Bypass DevTools Detection, Unlock Functionality, and Auto Check-in
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Bỏ qua phát hiện DevTools, mở khóa các chức năng và tự động điểm danh trên https://loulxgame.com/
// @author       hieuck
// @match        https://loulxgame.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Mở khóa chuột phải
    document.addEventListener('contextmenu', function(event) {
        event.stopPropagation(); // Ngăn chặn hành động mặc định
    }, true);

    // Mở khóa phím tắt
    document.addEventListener('keydown', function(event) {
        const allowedKeys = [123, 73, 74, 67, 85, 83, 80, 65, 67, 86]; // F12, Ctrl+Shift+I, Ctrl+Shift+J, ...
        if (allowedKeys.includes(event.keyCode)) {
            event.stopPropagation(); // Ngăn chặn hành động mặc định
        }
    }, true);

    // Ghi đè hàm debugger
    window.debugger = function() {
        // Không làm gì khi gọi debugger
    };

    // Ngăn chặn phát hiện DevTools
    (function() {
        let callbacks = [];
        let timeLimit = 50;
        let open = false;

        function loop() {
            const startTime = new Date();
            // Ghi đè hàm debugger
            if (window._debugger === undefined) {
                window._debugger = function() {};
            }

            window._debugger(); // Gọi hàm giả mạo

            if (new Date() - startTime > timeLimit) {
                if (!open) {
                    callbacks.forEach(function(fn) {
                        fn.call(null);
                    });
                }
                open = true;
                console.log('Phát hiện DevTools, nhưng đã được xử lý.');
                // Ngăn chặn việc xóa nội dung
                // document.body.innerHTML = ""; // Không xóa nội dung trang
                // window.stop(); // Không dừng trang
            } else {
                open = false;
            }
        }

        setInterval(loop, 100); // Kiểm tra mỗi 100ms

        // Phương thức thêm listener
        window.addListener = function(fn) {
            callbacks.push(fn);
        };

        // Phương thức xóa listener
        window.cancelListener = function(fn) {
            callbacks = callbacks.filter(function(v) {
                return v !== fn;
            });
        };

    })();

    // Hàm tự động điểm danh
    function autoCheckIn() {
        const checkInButton = document.querySelector('.checkin-details-link');

        // Nếu nút có chứa "Đã điểm danh"
        if (checkInButton && checkInButton.innerHTML.includes("Đã điểm danh")) {
            console.log('Đã điểm danh hôm nay. Dừng lại.');
            return; // Dừng lại nếu đã điểm danh
        }

        // Tìm nút điểm danh
        if (checkInButton) {
            // Tạo sự kiện click cho nút điểm danh
            checkInButton.click();
            console.log('Đã điểm danh tự động!');
        } else {
            console.log('Nút điểm danh không tìm thấy.');
        }
    }

    // Chờ trang tải xong trước khi điểm danh
    window.addEventListener('load', function() {
        if (window.location.href === 'https://loulxgame.com/') {
            setTimeout(autoCheckIn, 1000); // Tự động điểm danh sau 1 giây
        }
    });
})();