Greasy Fork

Greasy Fork is available in English.

Advanced Hack Menu with ESP for Xbox Cloud Gaming

An advanced hack menu with ESP and keybinding support for Xbox Cloud Gaming (Fortnite) via the browser

当前为 2024-11-17 提交的版本,查看 最新版本

// ==UserScript==
// @name         Advanced Hack Menu with ESP for Xbox Cloud Gaming
// @version      2.2
// @description  An advanced hack menu with ESP and keybinding support for Xbox Cloud Gaming (Fortnite) via the browser
// @author       YourName
// @match        https://www.xbox.com/en-US/play/launch/fortnite/BT5P2X999VH2
// @grant        none
// @namespace ViolentMonkey Scripts
// ==/UserScript==

(function() {
    'use strict';

    // Flags
    let espEnabled = false;
    let menuVisible = false;
    let hacksEnabled = false;

    // Menu creation
    const menu = document.createElement('div');
    menu.style.position = 'absolute';
    menu.style.top = '10px';
    menu.style.left = '10px';
    menu.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
    menu.style.color = 'white';
    menu.style.padding = '10px';
    menu.style.borderRadius = '5px';
    menu.style.zIndex = '9999'; // Ensure it appears on top
    menu.style.display = 'none';  // Initially hidden
    menu.innerHTML = `
        <h3>Hack Menu</h3>
        <button id="toggleESP">Toggle ESP</button><br>
        <button id="toggleMenu">Toggle Menu</button>
    `;
    document.body.appendChild(menu);

    // Toggle ESP button
    document.getElementById('toggleESP').addEventListener('click', function() {
        espEnabled = !espEnabled;
        console.log(`ESP ${espEnabled ? 'Enabled' : 'Disabled'}`);
    });

    // Toggle menu visibility
    document.getElementById('toggleMenu').addEventListener('click', function() {
        menuVisible = !menuVisible;
        menu.style.display = menuVisible ? 'block' : 'none';
        console.log(`Menu visibility: ${menuVisible ? 'Visible' : 'Hidden'}`);
    });

    // Keybinding for toggling hacks (L + X to enable, X + L to disable)
    document.addEventListener('keydown', function(event) {
        // Check if both L and X are pressed simultaneously
        if ((event.key === 'L' || event.key === 'l') && (event.key === 'X' || event.key === 'x')) {
            hacksEnabled = !hacksEnabled;
            if (hacksEnabled) {
                console.log('Hacks enabled');
                menu.style.display = 'block'; // Show menu
            } else {
                console.log('Hacks disabled');
                menu.style.display = 'none'; // Hide menu
            }
        }
    });

})();
(function() {
    'use strict';

    // Simulated player detection for ESP rendering (this is a mockup and will need real detection logic)
    function detectPlayers() {
        const players = [
            { x: 300, y: 400, width: 50, height: 80, name: 'Player 1' },
            { x: 500, y: 150, width: 50, height: 80, name: 'Player 2' }
        ];
        return players;
    }

    // Function to draw ESP (e.g., player boxes) on the canvas
    function drawESP() {
        if (!espEnabled) return;  // Only draw if ESP is enabled

        const canvas = document.querySelector('canvas'); // Assuming the game uses a canvas for rendering
        if (canvas) {
            const ctx = canvas.getContext('2d');
            ctx.clearRect(0, 0, canvas.width, canvas.height); // Clear the previous frame
            ctx.lineWidth = 2;
            ctx.strokeStyle = 'red';

            // Simulate detecting players
            const players = detectPlayers(); // This should be replaced by actual player detection logic

            // Loop through players and draw a rectangle around each player
            players.forEach(player => {
                // Draw box around player
                ctx.strokeRect(player.x, player.y, player.width, player.height);
                ctx.fillStyle = 'red';
                ctx.font = '12px Arial';
                ctx.fillText(player.name, player.x, player.y - 5);  // Draw player name above the box
            });
        }
    }

    // Main game loop (constantly running to update ESP)
    function mainLoop() {
        if (hacksEnabled) {
            drawESP();
        }
        requestAnimationFrame(mainLoop);  // Call mainLoop recursively for smooth rendering
    }

    // Start main loop
    mainLoop();

})();