Hyper Evo Online Loader

Loader for evoworld.io cheat

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Hyper Evo Online Loader
// @namespace    http://tampermonkey.net/
// @version      1.0.1
// @description  Loader for evoworld.io cheat
// @author       YoMino
// @license MIT
// @match        https://evoworld.io/
// @grant        GM_xmlhttpRequest
// @connect      raw.githubusercontent.com
// @run-at       document-idle
// ==/UserScript==

(function () {
    'use strict';

    const CONFIG = {
        enabled: true,
        remoteScriptUrl: 'https://raw.githubusercontent.com/danneagudan08-cmd/Script-Config/refs/heads/main/NEWloader.js',
        loadRemoteScript: true,
        debug: true
    };

    function log(...args) {
        if (CONFIG.debug) console.log('[HyperEvo Offline]', ...args);
    }

    function warn(...args) {
        console.warn('[HyperEvo Offline]', ...args);
    }

    function error(...args) {
        console.error('[HyperEvo Offline]', ...args);
    }

    function waitForGame(timeoutMs = 15000) {
        return new Promise((resolve, reject) => {
            const start = Date.now();

            const timer = setInterval(() => {
                if (window.game) {
                    clearInterval(timer);
                    resolve(window.game);
                    return;
                }

                if (Date.now() - start > timeoutMs) {
                    clearInterval(timer);
                    reject(new Error('window.game non trovato.'));
                }
            }, 250);
        });
    }

    function loadRemoteScript(url) {
        return new Promise((resolve, reject) => {
            if (!url || !/^https:\/\/raw\.githubusercontent\.com\//.test(url)) {
                reject(new Error('URL remoto non valido.'));
                return;
            }

            GM_xmlhttpRequest({
                method: 'GET',
                url,
                timeout: 15000,

                onload(res) {
                    if (res.status < 200 || res.status >= 300) {
                        reject(new Error('HTTP ' + res.status));
                        return;
                    }

                    const code = String(res.responseText || '');

                    if (!code.trim()) {
                        reject(new Error('Script remoto vuoto.'));
                        return;
                    }

                    try {
                        const script = document.createElement('script');
                        script.textContent = `
                            try {
                                ${code}
                            } catch (e) {
                                console.error('[Remote Script Error]', e);
                            }
                        `;
                        document.documentElement.appendChild(script);
                        script.remove();
                        resolve();
                    } catch (e) {
                        reject(e);
                    }
                },

                onerror() {
                    reject(new Error('Errore rete.'));
                },

                ontimeout() {
                    reject(new Error('Timeout.'));
                }
            });
        });
    }

    function installDebugTools() {
        window.HyperEvoDebug = {
            getGame() {
                return window.game || null;
            },

            getMe() {
                return window.game && window.game.me ? window.game.me : null;
            },

            printMe() {
                const me = this.getMe();
                console.log('[HyperEvoDebug me]', me);
                return me;
            },

            isReady() {
                return !!(window.game && window.game.me);
            }
        };

        log('Debug tools installati.');
    }

    async function main() {
        if (!CONFIG.enabled) return;

        installDebugTools();

        try {
            await waitForGame();
            log('Game trovato:', window.game);
        } catch (e) {
            warn(e.message);
        }

        if (CONFIG.loadRemoteScript) {
            try {
                await loadRemoteScript(CONFIG.remoteScriptUrl);
                log('Script remoto caricato.');
            } catch (e) {
                error('Errore caricamento script remoto:', e);
            }
        }
    }

    main();
})();