Greasy Fork

Fortnite Xbox Cloud Silent Aim with Advanced Features

Advanced Fortnite Silent Aim with ESP, FOV control, auto-shoot, no recoil, controller support, enhanced GUI, crosshair overlay, and more.

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

// ==UserScript==
// @name         Fortnite Xbox Cloud Silent Aim with Advanced Features
// @namespace    http://tampermonkey.net/
// @version      32.4
// @description  Advanced Fortnite Silent Aim with ESP, FOV control, auto-shoot, no recoil, controller support, enhanced GUI, crosshair overlay, and more.
// @author       You
// @match        https://www.xbox.com/en-US/play/launch/fortnite/BT5P2X999VH2
// @grant        none
// ==/UserScript==
 
(function () {
    'use strict';
 
    const config = {
        enemySelector: '.enemy-class',
        playerSelector: '.PlayerInfo-module__container___ROgVL',
        aimInterval: 100,
        aimSmoothing: 0.2,
        fov: 60,
        fovRadius: 100,
        fovEnabled: true,
        enableESP: false,
        enableSilentAim: true,
        autoShoot: false,
        visibleCheck: true,
        distanceLimit: 500,
        hitbox: 'head', // Options: 'head', 'body', 'nearest'
        silentAimSpeed: 0.2,
        noRecoil: true,
        debugMode: true,
        crosshair: {
            enabled: true,
            size: 15,
            color: 'red',
            style: 'circle' // Options: 'circle', 'dot', 'cross'
        },
    };
 
    function debugLog(message) {
        if (config.debugMode) {
            console.log(`[DEBUG] ${message}`);
        }
    }
 
    debugLog('Initializing script...');
 
    // GUI setup
    const guiStyle = `
        position: fixed;
        top: 10px;
        left: 10px;
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 10px;
        border-radius: 10px;
        z-index: 1000;
        font-family: Arial, sans-serif;
    `;
 
    const sliderStyle = `
        margin: 5px 0;
        width: 100%;
    `;
 
    const buttonStyle = `
        background: #4CAF50;
        color: white;
        border: none;
        padding: 5px 10px;
        margin: 5px 0;
        cursor: pointer;
        text-align: center;
        font-size: 14px;
        border-radius: 5px;
    `;
 
    const gui = document.createElement('div');
    gui.style.cssText = guiStyle;
    document.body.appendChild(gui);
    debugLog('GUI added to the page.');
 
    function createSlider(label, min, max, step, initialValue, onChange) {
        const container = document.createElement('div');
        container.style.marginBottom = '10px';
 
        const sliderLabel = document.createElement('label');
        sliderLabel.textContent = `${label}: ${initialValue}`;
        container.appendChild(sliderLabel);
 
        const slider = document.createElement('input');
        slider.type = 'range';
        slider.min = min;
        slider.max = max;
        slider.step = step;
        slider.value = initialValue;
        slider.style.cssText = sliderStyle;
        slider.addEventListener('input', (event) => {
            const value = parseFloat(event.target.value);
            sliderLabel.textContent = `${label}: ${value}`;
            onChange(value);
            debugLog(`${label} updated to ${value}`);
        });
        container.appendChild(slider);
 
        gui.appendChild(container);
    }
 
    function createButton(label, onClick) {
        const button = document.createElement('button');
        button.textContent = label;
        button.style.cssText = buttonStyle;
        button.addEventListener('click', onClick);
        gui.appendChild(button);
    }
 
    createSlider('Field of View (FOV)', 20, 180, 1, config.fov, (value) => {
        config.fov = value;
        updateFovCircle();
    });
 
    createSlider('Silent Aim Speed', 0.1, 1, 0.1, config.silentAimSpeed, (value) => {
        config.silentAimSpeed = value;
    });
 
    createSlider('FOV Radius', 50, 500, 10, config.fovRadius, (value) => {
        config.fovRadius = value;
        updateFovCircle();
    });
 
    createSlider('Crosshair Size', 5, 50, 1, config.crosshair.size, (value) => {
        config.crosshair.size = value;
        updateCrosshair();
    });
 
    createButton('Toggle ESP', () => {
        config.enableESP = !config.enableESP;
        debugLog(`ESP ${config.enableESP ? 'Enabled' : 'Disabled'}`);
    });
 
    createButton('Toggle Silent Aim', () => {
        config.enableSilentAim = !config.enableSilentAim;
        debugLog(`Silent Aim ${config.enableSilentAim ? 'Enabled' : 'Disabled'}`);
    });
 
    createButton('Toggle Auto-Shoot', () => {
        config.autoShoot = !config.autoShoot;
        debugLog(`Auto-Shoot ${config.autoShoot ? 'Enabled' : 'Disabled'}`);
    });
 
    createButton('Toggle Debug Mode', () => {
        config.debugMode = !config.debugMode;
        debugLog(`Debug Mode ${config.debugMode ? 'Enabled' : 'Disabled'}`);
    });
 
    // Crosshair setup
    const crosshair = document.createElement('div');
    crosshair.style.position = 'fixed';
    crosshair.style.top = '50%';
    crosshair.style.left = '50%';
    crosshair.style.transform = 'translate(-50%, -50%)';
    crosshair.style.pointerEvents = 'none';
    crosshair.style.border = `2px solid ${config.crosshair.color}`;
    crosshair.style.width = `${config.crosshair.size}px`;
    crosshair.style.height = `${config.crosshair.size}px`;
    crosshair.style.borderRadius = config.crosshair.style === 'circle' ? '50%' : '0';
    crosshair.style.background = config.crosshair.style === 'dot' ? config.crosshair.color : 'none';
    crosshair.style.zIndex = '1001';
    document.body.appendChild(crosshair);
 
    function updateCrosshair() {
        crosshair.style.width = `${config.crosshair.size}px`;
        crosshair.style.height = `${config.crosshair.size}px`;
        crosshair.style.borderRadius = config.crosshair.style === 'circle' ? '50%' : '0';
    }
 
    // FOV Circle
    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);
 
    function updateFovCircle() {
        debugLog(`Updating FOV Circle to radius: ${config.fovRadius}`);
        fovCircle.style.width = `${config.fovRadius * 2}px`;
        fovCircle.style.height = `${config.fovRadius * 2}px`;
    }
 
    // Silent Aim logic
    function silentAimAtEnemies() {
        const player = document.querySelector(config.playerSelector);
        const enemies = document.querySelectorAll(config.enemySelector);
 
        if (!player || enemies.length === 0) {
            debugLog('Player or enemies not found.');
            return;
        }
 
        let closestEnemy = null;
        let closestDistance = Infinity;
 
        enemies.forEach((enemy) => {
            const enemyRect = enemy.getBoundingClientRect();
            const playerRect = player.getBoundingClientRect();
 
            if (!isVisible(enemyRect, playerRect)) {
                debugLog('Enemy not visible. Skipping.');
                return;
            }
 
            const { x: enemyX, y: enemyY } = getHitbox(enemyRect, config.hitbox);
            const playerX = playerRect.x + playerRect.width / 2;
            const playerY = playerRect.y + playerRect.height / 2;
 
            const distance = Math.hypot(enemyX - playerX, enemyY - playerY);
 
            if (distance < closestDistance && distance <= config.distanceLimit) {
                closestEnemy = { x: enemyX, y: enemyY };
                closestDistance = distance;
            }
        });
 
        if (closestEnemy) {
            debugLog(`Silent aiming at enemy within ${closestDistance}px.`);
            if (config.autoShoot) {
                debugLog('Auto-shoot triggered!');
            }
        }
    }
 
    setInterval(() => {
        if (config.enableSilentAim) {
            silentAimAtEnemies();
        }
    }, config.aimInterval);
 
    debugLog('Silent Aim initialized.');
 
    window.addEventListener('gamepadconnected', (event) => {
        debugLog(`Controller connected: ${event.gamepad.id}`);
    });
})();