Hyper Evo Online Loader

Loader for evoworld.io cheat

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 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();
})();