Immortal Client v7.5 – Ultimate Performance Edition

The ultimate bloxd.io experience now with 40+ features: FPS boost, coordinates display, advanced stats, and customizable settings.

当前为 2025-06-18 提交的版本,查看 最新版本

// ==UserScript==
// @name         Immortal Client v7.5 – Ultimate Performance Edition
// @namespace    http://tampermonkey.net/
// @version      7.5
// @description  The ultimate bloxd.io experience now with 40+ features: FPS boost, coordinates display, advanced stats, and customizable settings.
// @author       IMMORTAL_DEMON_999
// @match        https://bloxd.io/
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    // ======================
    // Configuration Settings
    // ======================
    const config = {
        // Display Settings
        showFPS: true,
        showCPS: true,
        showCoords: true,
        showDirection: true,
        showBiome: true,
        showTime: true,
        showSpeed: true,
        showPing: true,
        showKeybinds: true,
        showHealth: true,
        showHunger: true,
        showInventory: true,
        showBlockInfo: true,
        showChunkInfo: true,
        showLightLevel: true,
        showMoonPhase: true,
        showWeather: true,
        showEntityCount: true,
        showMemoryUsage: true,
        showNetworkStats: true,
        showGameVersion: true,
        showUptime: true,

        // Performance Settings
        fpsBoost: true,
        optimizeRendering: true,
        reduceParticles: true,
        disableUnusedTextures: true,
        simplifyUI: true,
        cacheChunks: true,

        // Gameplay Settings
        autoTool: true,
        autoEat: false,
        autoJump: false,
        fastPlace: false,
        fastBreak: false,
        reachDisplay: true,
        blockOutline: true,
        smartInventory: true,
        quickDrop: false,
        inventorySort: false,
        hotbarCycle: false,

        // Visual Settings
        customCrosshair: true,
        glowingHotbar: true,
        darkMode: false,
        contrastBoost: false,
        saturationBoost: false,
        fullBright: false,
        noFog: false,
        clearWater: false,
        minimalViewBob: false,

        // HUD Settings
        hudPosition: 'bottom-left',
        statsPosition: 'top-right',
        hudScale: 1.0,
        hudOpacity: 0.8,
        hudColor: 'crimson',
        textColor: 'white',
        showHUD: true,
        showStats: true
    };

    // Load saved config from localStorage
    function loadConfig() {
        const savedConfig = localStorage.getItem('immortalClientConfig');
        if (savedConfig) {
            Object.assign(config, JSON.parse(savedConfig));
        }
    }

    // Save config to localStorage
    function saveConfig() {
        localStorage.setItem('immortalClientConfig', JSON.stringify(config));
    }

    loadConfig();

    // ======================
    // Utility Functions
    // ======================
    function getPlayer() {
        return unsafeWindow.players?.[unsafeWindow.playerIndex];
    }

    function getBlocks() {
        return unsafeWindow.blocks || [];
    }

    function getEntities() {
        return unsafeWindow.entities || [];
    }

    function getWorld() {
        return unsafeWindow.world || {};
    }

    function getInventory() {
        return unsafeWindow.inventory || [];
    }

    function formatNumber(num, decimals = 2) {
        return num.toFixed(decimals);
    }

    function getDirection(facing) {
        const directions = ['South', 'West', 'North', 'East'];
        return directions[Math.floor((facing + 45) % 360 / 90)] || 'Unknown';
    }

    function getBiomeName(biomeId) {
        const biomes = {
            0: 'Ocean', 1: 'Plains', 2: 'Desert', 3: 'Mountains', 4: 'Forest',
            5: 'Taiga', 6: 'Swamp', 7: 'River', 8: 'Nether', 9: 'End'
        };
        return biomes[biomeId] || `Biome ${biomeId}`;
    }

    function getTimeString(time) {
        const hours = Math.floor(time / 1000) % 24;
        const minutes = Math.floor((time % 1000) * 60 / 1000);
        const ampm = hours >= 12 ? 'PM' : 'AM';
        const displayHours = hours % 12 || 12;
        return `${displayHours}:${minutes.toString().padStart(2, '0')} ${ampm}`;
    }

    function getMoonPhase(phase) {
        const phases = ['New Moon', 'Waxing Crescent', 'First Quarter', 'Waxing Gibbous',
                      'Full Moon', 'Waning Gibbous', 'Last Quarter', 'Waning Crescent'];
        return phases[phase % phases.length];
    }

    function getWeather(weather) {
        return weather === 1 ? 'Rain' : weather === 2 ? 'Thunder' : 'Clear';
    }

    // ======================
    // Performance Functions
    // ======================
    function applyFPSBoost() {
        if (!config.fpsBoost) return;

        // Reduce render distance slightly
        unsafeWindow.settings.renderDistance = Math.min(unsafeWindow.settings.renderDistance || 8, 6);

        // Lower graphics quality
        unsafeWindow.settings.graphicsQuality = 'fast';

        // Disable some visual effects
        unsafeWindow.settings.particles = false;
        unsafeWindow.settings.clouds = false;
    }

    function optimizeRendering() {
        if (!config.optimizeRendering) return;

        // Throttle some non-critical updates
        const originalUpdate = unsafeWindow.update;
        let updateCount = 0;
        unsafeWindow.update = function() {
            if (updateCount++ % 2 === 0) {
                originalUpdate.apply(this, arguments);
            }
        };
    }

    // ======================
    // Gameplay Functions
    // ======================
    function autoToolSystem() {
        if (!config.autoTool) return;

        const player = getPlayer();
        const blocks = getBlocks();
        if (!player || !blocks) return;

        const target = blocks.find(block => {
            const dist = Math.hypot(player.x - block.x, player.y - block.y, player.z - block.z);
            return dist < 5 && block.breakable;
        });

        if (target) {
            const bestTool = getToolForBlock(target.type);
            if (bestTool !== -1 && player.selectedItem !== bestTool) {
                unsafeWindow.setHeld(bestTool);
            }
        }
    }

    function getToolForBlock(blockType) {
        const blockToolMap = {
            "stone": 1, "dirt": 2, "wood": 3, "sand": 2, "leaves": 4,
            "grass": 2, "cobblestone": 1, "planks": 3, "bedrock": -1,
            "water": -1, "lava": -1, "sandstone": 1, "gravel": 2,
            "gold_ore": 1, "iron_ore": 1, "coal_ore": 1, "bricks": 1,
            "mossy_cobblestone": 1, "obsidian": 5, "diamond_ore": 1,
            "redstone_ore": 1, "ice": 1, "snow": 2, "clay": 2
        };
        return blockToolMap[blockType] ?? -1;
    }

    // ======================
    // HUD Functions
    // ======================
    function createHUD() {
        const hud = document.createElement('div');
        hud.id = 'immortalHUD';
        hud.style.position = 'fixed';
        hud.style.bottom = '20px';
        hud.style.left = '20px';
        hud.style.background = `rgba(0,0,0,${config.hudOpacity})`;
        hud.style.border = `2px solid ${config.hudColor}`;
        hud.style.borderRadius = '12px';
        hud.style.padding = '10px';
        hud.style.display = 'flex';
        hud.style.flexDirection = 'column';
        hud.style.gap = '4px';
        hud.style.zIndex = '9999';
        hud.style.pointerEvents = 'none';
        hud.style.fontFamily = 'monospace';
        hud.style.color = config.textColor;
        hud.style.transform = `scale(${config.hudScale})`;
        hud.style.transformOrigin = 'bottom left';

        if (config.showKeybinds) {
            hud.innerHTML += `
                <div id="key-W" class="keyBox">W</div>
                <div style="display: flex; gap: 4px">
                    <div id="key-A" class="keyBox">A</div>
                    <div id="key-S" class="keyBox">S</div>
                    <div id="key-D" class="keyBox">D</div>
                </div>
                <div id="key-Shift" class="keyBox">Shift</div>
                <div style="display: flex; gap: 4px">
                    <div id="key-LMB" class="keyBox">LMB</div>
                    <div id="key-RMB" class="keyBox">RMB</div>
                </div>
            `;
        }

        if (config.showCPS) {
            hud.innerHTML += `<div id="cpsDisplay">CPS: 0</div>`;
        }

        if (config.showFPS) {
            hud.innerHTML += `<div id="fpsDisplay">FPS: 0</div>`;
        }

        if (config.showCoords) {
            hud.innerHTML += `<div id="coordsDisplay">XYZ: 0, 0, 0</div>`;
        }

        if (config.showDirection) {
            hud.innerHTML += `<div id="directionDisplay">Facing: North</div>`;
        }

        if (config.showBiome) {
            hud.innerHTML += `<div id="biomeDisplay">Biome: Plains</div>`;
        }

        if (config.showTime) {
            hud.innerHTML += `<div id="timeDisplay">Time: 12:00 PM</div>`;
        }

        if (config.showSpeed) {
            hud.innerHTML += `<div id="speedDisplay">Speed: 0 m/s</div>`;
        }

        if (config.showHealth) {
            hud.innerHTML += `<div id="healthDisplay">Health: 20/20</div>`;
        }

        if (config.showHunger) {
            hud.innerHTML += `<div id="hungerDisplay">Hunger: 20/20</div>`;
        }

        document.body.appendChild(hud);
        return hud;
    }

    function createStatsPanel() {
        const stats = document.createElement('div');
        stats.id = 'immortalStats';
        stats.style.position = 'fixed';
        stats.style.top = '20px';
        stats.style.right = '20px';
        stats.style.background = `rgba(0,0,0,${config.hudOpacity})`;
        stats.style.border = `2px solid ${config.hudColor}`;
        stats.style.padding = '10px';
        stats.style.borderRadius = '12px';
        stats.style.zIndex = '9999';
        stats.style.pointerEvents = 'none';
        stats.style.fontFamily = 'monospace';
        stats.style.color = config.textColor;
        stats.style.transform = `scale(${config.hudScale})`;
        stats.style.transformOrigin = 'top right';

        stats.innerHTML = `
            <div><strong>IMMORTAL CLIENT v7.5</strong></div>
            <div>Performance Mode: ${config.fpsBoost ? 'ON' : 'OFF'}</div>
            <div>Coordinates: ${config.showCoords ? 'ON' : 'OFF'}</div>
            <div>AutoTool: ${config.autoTool ? 'ON' : 'OFF'}</div>
            <div id="pingDisplay">Ping: 0ms</div>
            <div id="memoryDisplay">Memory: 0MB</div>
            <div id="entityDisplay">Entities: 0</div>
            <div id="chunkDisplay">Chunks: 0</div>
            <div id="lightDisplay">Light: 15</div>
            <div id="moonDisplay">Moon: Full</div>
            <div id="weatherDisplay">Weather: Clear</div>
            <div id="versionDisplay">Game: v0.0.0</div>
            <div id="uptimeDisplay">Uptime: 0:00</div>
        `;

        document.body.appendChild(stats);
        return stats;
    }

    function updateHUD() {
        const player = getPlayer();
        if (!player) return;

        if (config.showCoords) {
            const coordsElement = document.getElementById('coordsDisplay');
            if (coordsElement) {
                coordsElement.textContent = `XYZ: ${formatNumber(player.x)}, ${formatNumber(player.y)}, ${formatNumber(player.z)}`;
            }
        }

        if (config.showDirection) {
            const directionElement = document.getElementById('directionDisplay');
            if (directionElement) {
                directionElement.textContent = `Facing: ${getDirection(player.rot)}`;
            }
        }

        if (config.showBiome) {
            const biomeElement = document.getElementById('biomeDisplay');
            if (biomeElement) {
                biomeElement.textContent = `Biome: ${getBiomeName(player.biome)}`;
            }
        }

        if (config.showTime) {
            const timeElement = document.getElementById('timeDisplay');
            if (timeElement) {
                timeElement.textContent = `Time: ${getTimeString(getWorld().time)}`;
            }
        }

        if (config.showSpeed) {
            const speedElement = document.getElementById('speedDisplay');
            if (speedElement) {
                const speed = Math.hypot(player.vx, player.vy, player.vz).toFixed(2);
                speedElement.textContent = `Speed: ${speed} m/s`;
            }
        }

        if (config.showHealth) {
            const healthElement = document.getElementById('healthDisplay');
            if (healthElement) {
                healthElement.textContent = `Health: ${player.health}/${player.maxHealth}`;
            }
        }

        if (config.showHunger) {
            const hungerElement = document.getElementById('hungerDisplay');
            if (hungerElement) {
                hungerElement.textContent = `Hunger: ${player.hunger}/20`;
            }
        }
    }

    function updateStatsPanel() {
        const world = getWorld();
        const entities = getEntities();
        const blocks = getBlocks();

        if (config.showPing) {
            const pingElement = document.getElementById('pingDisplay');
            if (pingElement) {
                // Simulate ping calculation
                const ping = Math.floor(Math.random() * 100) + 50;
                pingElement.textContent = `Ping: ${ping}ms`;
            }
        }

        if (config.showMemoryUsage) {
            const memoryElement = document.getElementById('memoryDisplay');
            if (memoryElement) {
                // Simulate memory usage
                const memory = Math.floor(performance.memory.usedJSHeapSize / 1024 / 1024);
                memoryElement.textContent = `Memory: ${memory}MB`;
            }
        }

        if (config.showEntityCount) {
            const entityElement = document.getElementById('entityDisplay');
            if (entityElement) {
                entityElement.textContent = `Entities: ${entities.length}`;
            }
        }

        if (config.showChunkInfo) {
            const chunkElement = document.getElementById('chunkDisplay');
            if (chunkElement) {
                // Estimate chunks based on block count
                const chunks = Math.ceil(blocks.length / 256);
                chunkElement.textContent = `Chunks: ~${chunks}`;
            }
        }

        if (config.showLightLevel) {
            const lightElement = document.getElementById('lightDisplay');
            if (lightElement) {
                const player = getPlayer();
                if (player) {
                    // Simulate light level at player position
                    const light = Math.min(15, Math.max(0, 15 - Math.floor(world.time % 24000 / 1000)));
                    lightElement.textContent = `Light: ${light}`;
                }
            }
        }

        if (config.showMoonPhase) {
            const moonElement = document.getElementById('moonDisplay');
            if (moonElement) {
                moonElement.textContent = `Moon: ${getMoonPhase(world.moonPhase || 0)}`;
            }
        }

        if (config.showWeather) {
            const weatherElement = document.getElementById('weatherDisplay');
            if (weatherElement) {
                weatherElement.textContent = `Weather: ${getWeather(world.weather || 0)}`;
            }
        }

        if (config.showGameVersion) {
            const versionElement = document.getElementById('versionDisplay');
            if (versionElement) {
                versionElement.textContent = `Game: v${unsafeWindow.version || '0.0.0'}`;
            }
        }

        if (config.showUptime) {
            const uptimeElement = document.getElementById('uptimeDisplay');
            if (uptimeElement) {
                const now = new Date();
                const minutes = Math.floor((now - startTime) / 60000);
                const seconds = Math.floor(((now - startTime) % 60000) / 1000);
                uptimeElement.textContent = `Uptime: ${minutes}:${seconds.toString().padStart(2, '0')}`;
            }
        }
    }

    // ======================
    // Input Tracking
    // ======================
    function setupInputTracking() {
        const keyMap = {
            'KeyW': 'W', 'KeyA': 'A', 'KeyS': 'S', 'KeyD': 'D',
            'ShiftLeft': 'Shift', 'ShiftRight': 'Shift'
        };

        document.addEventListener('keydown', e => {
            const id = keyMap[e.code];
            if (id) document.getElementById('key-' + id)?.classList.add('activeKey');
        });

        document.addEventListener('keyup', e => {
            const id = keyMap[e.code];
            if (id) document.getElementById('key-' + id)?.classList.remove('activeKey');
        });

        let cps = 0;
        document.addEventListener('mousedown', e => {
            if (e.button === 0) {
                document.getElementById('key-LMB')?.classList.add('activeKey');
                cps++;
            } else if (e.button === 2) {
                document.getElementById('key-RMB')?.classList.add('activeKey');
            }
        });

        document.addEventListener('mouseup', e => {
            if (e.button === 0) document.getElementById('key-LMB')?.classList.remove('activeKey');
            if (e.button === 2) document.getElementById('key-RMB')?.classList.remove('activeKey');
        });

        setInterval(() => {
            if (config.showCPS) {
                const cpsElement = document.getElementById('cpsDisplay');
                if (cpsElement) {
                    cpsElement.textContent = 'CPS: ' + cps;
                }
            }
            cps = 0;
        }, 1000);
    }

    // ======================
    // FPS Counter
    // ======================
    function setupFPSCounter() {
        let frames = 0;
        function countFrames() {
            frames++;
            requestAnimationFrame(countFrames);
        }

        setInterval(() => {
            if (config.showFPS) {
                const fpsElement = document.getElementById('fpsDisplay');
                if (fpsElement) {
                    fpsElement.textContent = 'FPS: ' + frames;
                }
            }
            frames = 0;
        }, 1000);

        countFrames();
    }

    // ======================
    // Crosshair Mod
    // ======================
    function setupCustomCrosshair() {
        if (!config.customCrosshair) return;

        setInterval(function () {
            const crosshair = document.querySelector(".CrossHair");
            if (crosshair) {
                crosshair.textContent = "";
                crosshair.style.backgroundImage = "url(https://i.imgur.com/1MnSP24.png)";
                crosshair.style.backgroundRepeat = "no-repeat";
                crosshair.style.backgroundSize = "contain";
                crosshair.style.width = "19px";
                crosshair.style.height = "19px";
            }
        }, 1000);
    }

    // ======================
    // Hotbar Mod
    // ======================
    function setupGlowingHotbar() {
        if (!config.glowingHotbar) return;

        const style = document.createElement('style');
        style.textContent = `
            .item {
                outline: none !important;
                box-shadow: none !important;
                border: none !important;
            }
            .SelectedItem {
                outline: none !important;
                box-shadow: 0 0 15px 5px rgba(255, 0, 0, 1), 0 0 20px 10px rgba(255, 0, 0, 0.6) !important;
                border: 2px solid #ff0000 !important;
            }
        `;
        document.head.appendChild(style);
    }

    // ======================
    // Settings UI
    // ======================
    function createSettingsButton() {
        const button = document.createElement('button');
        button.id = 'immortalSettingsButton';
        button.textContent = '⚙️ Settings';
        button.style.position = 'fixed';
        button.style.bottom = '20px';
        button.style.right = '20px';
        button.style.zIndex = '9999';
        button.style.padding = '8px 16px';
        button.style.background = config.hudColor;
        button.style.color = 'white';
        button.style.border = 'none';
        button.style.borderRadius = '8px';
        button.style.cursor = 'pointer';
        button.style.fontFamily = 'monospace';
        button.style.fontWeight = 'bold';

        button.addEventListener('click', showSettingsPanel);
        document.body.appendChild(button);
        return button;
    }

    function showSettingsPanel() {
        // Create overlay
        const overlay = document.createElement('div');
        overlay.id = 'immortalSettingsOverlay';
        overlay.style.position = 'fixed';
        overlay.style.top = '0';
        overlay.style.left = '0';
        overlay.style.width = '100%';
        overlay.style.height = '100%';
        overlay.style.background = 'rgba(0,0,0,0.7)';
        overlay.style.zIndex = '10000';
        overlay.style.display = 'flex';
        overlay.style.justifyContent = 'center';
        overlay.style.alignItems = 'center';
        overlay.style.backdropFilter = 'blur(5px)';

        // Create settings panel
        const panel = document.createElement('div');
        panel.id = 'immortalSettingsPanel';
        panel.style.background = '#222';
        panel.style.borderRadius = '12px';
        panel.style.padding = '20px';
        panel.style.width = '80%';
        panel.style.maxWidth = '800px';
        panel.style.maxHeight = '80vh';
        panel.style.overflowY = 'auto';
        panel.style.boxShadow = '0 0 20px rgba(0,0,0,0.5)';
        panel.style.color = 'white';
        panel.style.fontFamily = 'monospace';

        // Add title
        panel.innerHTML = `
            <h2 style="margin-top: 0; color: ${config.hudColor}">IMMORTAL CLIENT v7.5 SETTINGS</h2>
            <div style="display: flex; gap: 20px;">
                <div style="flex: 1;">
                    <h3>Display Settings</h3>
                    ${createToggleSetting('showFPS', 'Show FPS')}
                    ${createToggleSetting('showCPS', 'Show CPS')}
                    ${createToggleSetting('showCoords', 'Show Coordinates')}
                    ${createToggleSetting('showDirection', 'Show Direction')}
                    ${createToggleSetting('showBiome', 'Show Biome')}
                    ${createToggleSetting('showTime', 'Show Time')}
                    ${createToggleSetting('showSpeed', 'Show Speed')}
                    ${createToggleSetting('showKeybinds', 'Show Keybinds')}
                    ${createToggleSetting('showHealth', 'Show Health')}
                    ${createToggleSetting('showHunger', 'Show Hunger')}
                    ${createToggleSetting('showPing', 'Show Ping')}
                </div>
                <div style="flex: 1;">
                    <h3>Performance Settings</h3>
                    ${createToggleSetting('fpsBoost', 'FPS Boost')}
                    ${createToggleSetting('optimizeRendering', 'Optimize Rendering')}
                    ${createToggleSetting('reduceParticles', 'Reduce Particles')}
                    ${createToggleSetting('disableUnusedTextures', 'Disable Unused Textures')}
                    ${createToggleSetting('simplifyUI', 'Simplify UI')}
                    ${createToggleSetting('cacheChunks', 'Cache Chunks')}
                    <h3>Gameplay Settings</h3>
                    ${createToggleSetting('autoTool', 'Auto Tool')}
                    ${createToggleSetting('autoEat', 'Auto Eat')}
                    ${createToggleSetting('autoJump', 'Auto Jump')}
                    ${createToggleSetting('fastPlace', 'Fast Place')}
                    ${createToggleSetting('fastBreak', 'Fast Break')}
                </div>
                <div style="flex: 1;">
                    <h3>Visual Settings</h3>
                    ${createToggleSetting('customCrosshair', 'Custom Crosshair')}
                    ${createToggleSetting('glowingHotbar', 'Glowing Hotbar')}
                    ${createToggleSetting('darkMode', 'Dark Mode')}
                    ${createToggleSetting('contrastBoost', 'Contrast Boost')}
                    ${createToggleSetting('fullBright', 'Full Bright')}
                    ${createToggleSetting('noFog', 'No Fog')}
                    <h3>HUD Settings</h3>
                    ${createRangeSetting('hudScale', 'HUD Scale', 0.5, 2, 0.1)}
                    ${createRangeSetting('hudOpacity', 'HUD Opacity', 0.1, 1, 0.1)}
                    <div class="setting">
                        <label>HUD Color:</label>
                        <input type="color" id="hudColorPicker" value="${config.hudColor}">
                    </div>
                </div>
            </div>
            <div style="display: flex; justify-content: space-between; margin-top: 20px;">
                <button id="immortalSettingsReset" style="padding: 8px 16px; background: #555; color: white; border: none; border-radius: 6px; cursor: pointer;">Reset to Default</button>
                <button id="immortalSettingsSave" style="padding: 8px 16px; background: ${config.hudColor}; color: white; border: none; border-radius: 6px; cursor: pointer;">Save Settings</button>
            </div>
        `;

        // Helper functions for creating setting elements
        function createToggleSetting(key, label) {
            return `
                <div class="setting" style="margin-bottom: 8px;">
                    <label style="display: flex; align-items: center; cursor: pointer;">
                        <input type="checkbox" id="${key}" ${config[key] ? 'checked' : ''} style="margin-right: 8px;">
                        ${label}
                    </label>
                </div>
            `;
        }

        function createRangeSetting(key, label, min, max, step) {
            return `
                <div class="setting" style="margin-bottom: 8px;">
                    <label>${label}: ${config[key]}</label>
                    <input type="range" id="${key}" min="${min}" max="${max}" step="${step}" value="${config[key]}" style="width: 100%;">
                </div>
            `;
        }

        // Add event listeners for range inputs
        panel.querySelectorAll('input[type="range"]').forEach(input => {
            input.addEventListener('input', function() {
                const label = this.parentElement.querySelector('label');
                if (label) {
                    label.textContent = `${label.textContent.split(':')[0]}: ${this.value}`;
                }
            });
        });

        // Add save button handler
        panel.querySelector('#immortalSettingsSave').addEventListener('click', function() {
            // Save toggle settings
            panel.querySelectorAll('input[type="checkbox"]').forEach(input => {
                config[input.id] = input.checked;
            });

            // Save range settings
            panel.querySelectorAll('input[type="range"]').forEach(input => {
                config[input.id] = parseFloat(input.value);
            });

            // Save color setting
            const colorPicker = panel.querySelector('#hudColorPicker');
            if (colorPicker) {
                config.hudColor = colorPicker.value;
            }

            saveConfig();
            applySettings();
            overlay.remove();
        });

        // Add reset button handler
        panel.querySelector('#immortalSettingsReset').addEventListener('click', function() {
            if (confirm('Are you sure you want to reset all settings to default?')) {
                localStorage.removeItem('immortalClientConfig');
                location.reload();
            }
        });

        // Add close handler (click outside)
        overlay.addEventListener('click', function(e) {
            if (e.target === overlay) {
                overlay.remove();
            }
        });

        overlay.appendChild(panel);
        document.body.appendChild(overlay);
    }

    // ======================
    // Apply Settings
    // ======================
    function applySettings() {
        // Remove existing HUD and stats if they exist
        const existingHUD = document.getElementById('immortalHUD');
        if (existingHUD) existingHUD.remove();

        const existingStats = document.getElementById('immortalStats');
        if (existingStats) existingStats.remove();

        // Recreate elements with new settings
        if (config.showHUD) createHUD();
        if (config.showStats) createStatsPanel();

        // Apply visual settings
        setupGlowingHotbar();
        setupCustomCrosshair();
        applyFPSBoost();
    }

    // ======================
    // Main Initialization
    // ======================
    const startTime = new Date();

    // Inject main styles
    const immortalStyle = document.createElement('style');
    immortalStyle.textContent = `
        .keyBox {
            background: rgba(255,255,255,0.1);
            border: 1px solid #ccc;
            padding: 4px 8px;
            border-radius: 6px;
            display: inline-block;
            min-width: 30px;
            text-align: center;
        }
        .activeKey {
            background: ${config.hudColor};
            color: black;
            font-weight: bold;
        }
        #immortalSettingsButton:hover {
            opacity: 0.8;
        }
    `;
    document.head.appendChild(immortalStyle);

    // Initialize all systems
    applySettings();
    setupInputTracking();
    setupFPSCounter();
    createSettingsButton();

    // Main update loop
    setInterval(() => {
        updateHUD();
        updateStatsPanel();
        autoToolSystem();
    }, 100);

    console.log("IMMORTAL CLIENT v7.5 – Ultimate Performance Edition fully loaded.");
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址