Greasy Fork

Fortnite Xbox Cloud Aim Assist with Full Features, FOV Control, and More

Fully featured Fortnite aimbot with ESP, FOV, auto-detection, target prioritization, and more.

目前为 2024-12-11 提交的版本。查看 最新版本

// ==UserScript==
// @name         Fortnite Xbox Cloud Aim Assist with Full Features, FOV Control, and More
// @namespace    http://tampermonkey.net/
// @version      23
// @description  Fully featured Fortnite aimbot with ESP, FOV, auto-detection, target prioritization, and more.
// @author       You
// @match        https://www.xbox.com/en-US/play/launch/fortnite/BT5P2X999VH2
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    // Default configuration for the aimbot and ESP
    const config = {
        enemySelector: '.enemy-class', // Placeholder for enemy class
        playerSelector: '.PlayerInfo-module__container___ROgVL', // Placeholder for player class
        aimInterval: 100, // Interval in milliseconds for aim checks
        aimSmoothing: 0.2, // Smoothing factor for more natural aim adjustments
        fov: 60, // Field of View for the aimbot in degrees
        fovRadius: 100, // Radius of the FOV circle (in pixels)
        enableESP: false, // Flag to enable or disable ESP
        enableAimbot: true, // Flag to enable or disable aimbot
        enableFOVCircle: true, // Flag to enable FOV circle
        distanceLimit: 500, // Distance limit for aiming at enemies (in pixels)
    };

    // Add GUI overlay to control FOV, sensitivity, ESP, etc.
    const guiStyle = `
        position: fixed;
        top: 10px;
        left: 10px;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        padding: 10px;
        border-radius: 10px;
        z-index: 1000;
    `;
    const buttonStyle = `
        background: #4CAF50;
        border: none;
        color: white;
        padding: 5px 10px;
        text-align: center;
        text-decoration: none;
        display: inline-block;
        font-size: 12px;
        cursor: pointer;
        margin: 5px;
    `;
    const sliderStyle = `
        margin: 5px 0;
    `;

    // Create GUI elements
    const gui = document.createElement('div');
    gui.style.cssText = guiStyle;

    // FOV Slider
    const fovLabel = document.createElement('label');
    fovLabel.innerText = 'FOV: ';
    const fovSlider = document.createElement('input');
    fovSlider.type = 'range';
    fovSlider.min = 20;
    fovSlider.max = 180;
    fovSlider.value = config.fov;
    fovSlider.style.cssText = sliderStyle;
    fovSlider.addEventListener('input', () => {
        config.fov = fovSlider.value;
        fovValue.innerText = `${config.fov}°`;
        config.fovRadius = (config.fov / 180) * window.innerWidth * 0.3; // Dynamically adjust the FOV circle size
        updateFovCircle();
    });
    const fovValue = document.createElement('span');
    fovValue.innerText = `${config.fov}°`;

    // Distance Limit Slider
    const distanceLabel = document.createElement('label');
    distanceLabel.innerText = 'Aimbot Distance Limit: ';
    const distanceSlider = document.createElement('input');
    distanceSlider.type = 'range';
    distanceSlider.min = 100;
    distanceSlider.max = 1000;
    distanceSlider.value = config.distanceLimit;
    distanceSlider.style.cssText = sliderStyle;
    distanceSlider.addEventListener('input', () => {
        config.distanceLimit = distanceSlider.value;
        distanceValue.innerText = `${config.distanceLimit}px`;
    });
    const distanceValue = document.createElement('span');
    distanceValue.innerText = `${config.distanceLimit}px`;

    // Smoothing Slider
    const smoothingLabel = document.createElement('label');
    smoothingLabel.innerText = 'Aim Smoothing: ';
    const smoothingSlider = document.createElement('input');
    smoothingSlider.type = 'range';
    smoothingSlider.min = 0;
    smoothingSlider.max = 1;
    smoothingSlider.step = 0.05;
    smoothingSlider.value = config.aimSmoothing;
    smoothingSlider.style.cssText = sliderStyle;
    smoothingSlider.addEventListener('input', () => {
        config.aimSmoothing = smoothingSlider.value;
        smoothingValue.innerText = config.aimSmoothing;
    });
    const smoothingValue = document.createElement('span');
    smoothingValue.innerText = config.aimSmoothing;

    // ESP Toggle Button
    const espButton = document.createElement('button');
    espButton.innerText = 'Toggle ESP';
    espButton.style.cssText = buttonStyle;
    espButton.addEventListener('click', () => {
        config.enableESP = !config.enableESP;
        espButton.innerText = config.enableESP ? 'Disable ESP' : 'Enable ESP';
    });

    // Aimbot Toggle Button
    const aimbotButton = document.createElement('button');
    aimbotButton.innerText = 'Disable Aimbot';
    aimbotButton.style.cssText = buttonStyle;
    aimbotButton.addEventListener('click', () => {
        config.enableAimbot = !config.enableAimbot;
        aimbotButton.innerText = config.enableAimbot ? 'Disable Aimbot' : 'Enable Aimbot';
    });

    // FOV Circle Toggle Button
    const fovToggleButton = document.createElement('button');
    fovToggleButton.innerText = 'Disable FOV Circle';
    fovToggleButton.style.cssText = buttonStyle;
    fovToggleButton.addEventListener('click', () => {
        config.enableFOVCircle = !config.enableFOVCircle;
        fovToggleButton.innerText = config.enableFOVCircle ? 'Disable FOV Circle' : 'Enable FOV Circle';
        fovCircle.style.display = config.enableFOVCircle ? 'block' : 'none';
    });

    // Append elements to the GUI
    gui.appendChild(fovLabel);
    gui.appendChild(fovSlider);
    gui.appendChild(fovValue);
    gui.appendChild(document.createElement('br'));
    gui.appendChild(distanceLabel);
    gui.appendChild(distanceSlider);
    gui.appendChild(distanceValue);
    gui.appendChild(document.createElement('br'));
    gui.appendChild(smoothingLabel);
    gui.appendChild(smoothingSlider);
    gui.appendChild(smoothingValue);
    gui.appendChild(document.createElement('br'));
    gui.appendChild(espButton);
    gui.appendChild(aimbotButton);
    gui.appendChild(fovToggleButton);

    // Add the GUI to the page
    document.body.appendChild(gui);

    // Create FOV Circle (hidden initially)
    const fovCircle = document.createElement('div');
    fovCircle.style.cssText = `
        position: fixed;
        top: 50%;
        left: 50%;
        width: ${config.fovRadius * 2}px;
        height: ${config.fovRadius * 2}px;
        border-radius: 50%;
        border: 2px solid red;
        pointer-events: none;
        transform: translate(-50%, -50%);
        opacity: 0.5;
        z-index: 999;
    `;
    document.body.appendChild(fovCircle);

    /**
     * Update the FOV Circle based on the current FOV setting
     */
    function updateFovCircle() {
        fovCircle.style.width = `${config.fovRadius * 2}px`;
        fovCircle.style.height = `${config.fovRadius * 2}px`;
    }

    /**
     * Calculate the angle between two points.
     * @param {number} targetX - Target X coordinate.
     * @param {number} targetY - Target Y coordinate.
     * @param {number} playerX - Player X coordinate.
     * @param {number} playerY - Player Y coordinate.
     * @returns {number} Angle in degrees.
     */
    function calculateAngle(targetX, targetY, playerX, playerY) {
        return Math.atan2(targetY - playerY, targetX - playerX) * (180 / Math.PI);
    }

    /**
     * Smoothly rotate the player towards the enemy.
     * @param {number} angle - The calculated angle to rotate the player.
     */
    function smoothAim(angle) {
        const player = document.querySelector(config.playerSelector);
        if (player) {
            const currentRotation = parseFloat(player.style.transform.replace('rotate(', '').replace('deg)', '')) || 0;
            const targetRotation = angle;
            const smoothedRotation = currentRotation + (targetRotation - currentRotation) * config.aimSmoothing;
            player.style.transform = `rotate(${smoothedRotation}deg)`;
        }
    }

    /**
     * Check if the enemy is within the player's Field of View (FOV).
     * @param {number} angle - The angle between the player and the enemy.
     * @returns {boolean} Whether the enemy is within the FOV.
     */
    function isWithinFov(angle) {
        return Math.abs(angle) <= (config.fov / 2);
    }

    /**
     * Highlight enemy with a bounding box (ESP).
     * @param {HTMLElement} enemy - The enemy element to highlight.
     */
    function highlightEnemy(enemy) {
        if (config.enableESP) {
            const rect = enemy.getBoundingClientRect();
            const espBox = document.createElement('div');
            espBox.style.cssText = `
                position: absolute;
                border: 2px solid yellow;
                top: ${rect.top}px;
                left: ${rect.left}px;
                width: ${rect.width}px;
                height: ${rect.height}px;
                pointer-events: none;
                z-index: 999;
            `;
            document.body.appendChild(espBox);

            // Remove the ESP box after a short delay
            setTimeout(() => {
                espBox.remove();
            }, 100);
        }
    }

    /**
     * Auto-detect player and enemy elements in the DOM and aim at them.
     */
    function aimAtEnemies() {
        const player = document.querySelector(config.playerSelector);
        const enemies = document.querySelectorAll(config.enemySelector);

        if (!player || enemies.length === 0) {
            console.warn('Player or enemies not found.');
            return;
        }

        enemies.forEach((enemy) => {
            const enemyRect = enemy.getBoundingClientRect();
            const playerRect = player.getBoundingClientRect();

            const enemyX = enemyRect.x + enemyRect.width / 2;
            const enemyY = enemyRect.y + enemyRect.height / 2;
            const playerX = playerRect.x + playerRect.width / 2;
            const playerY = playerRect.y + playerRect.height / 2;

            const angle = calculateAngle(enemyX, enemyY, playerX, playerY);

            // Calculate distance to the enemy
            const distance = Math.sqrt(Math.pow(enemyX - playerX, 2) + Math.pow(enemyY - playerY, 2));

            // If the enemy is within the FOV and distance limit, aim at them
            if (isWithinFov(angle) && distance <= config.distanceLimit) {
                smoothAim(angle);
                if (config.enableESP) {
                    highlightEnemy(enemy);
                }
            }
        });
    }

    /**
     * Initialize the aimbot functionality.
     */
    function initializeAimAssist() {
        console.log('Aim Assist Initialized');
        setInterval(() => {
            if (config.enableAimbot) {
                aimAtEnemies();
            }
        }, config.aimInterval);
    }

    // Start the aimbot script
    initializeAimAssist();
})();