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      31.2
// @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}`);
        }
    }

    // Utility to display notifications
    function showNotification(message, duration = 2000) {
        const notification = document.createElement('div');
        notification.textContent = message;
        notification.style.cssText = `
            position: fixed;
            top: 20px;
            right: 20px;
            background: rgba(0, 0, 0, 0.8);
            color: white;
            padding: 10px;
            border-radius: 5px;
            z-index: 1000;
            font-family: Arial, sans-serif;
        `;
        document.body.appendChild(notification);
        setTimeout(() => notification.remove(), duration);
    }

    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;
        width: 300px;
        cursor: move;
    `;

    const gui = document.createElement('div');
    gui.style.cssText = guiStyle;
    document.body.appendChild(gui);
    debugLog('GUI added to the page.');

    // Drag-and-drop functionality for GUI
    gui.addEventListener('mousedown', (event) => {
        let shiftX = event.clientX - gui.getBoundingClientRect().left;
        let shiftY = event.clientY - gui.getBoundingClientRect().top;

        function moveAt(pageX, pageY) {
            gui.style.left = pageX - shiftX + 'px';
            gui.style.top = pageY - shiftY + 'px';
        }

        function onMouseMove(event) {
            moveAt(event.pageX, event.pageY);
        }

        document.addEventListener('mousemove', onMouseMove);

        gui.onmouseup = () => {
            document.removeEventListener('mousemove', onMouseMove);
            gui.onmouseup = null;
        };
    });

    gui.ondragstart = () => false;

    function createButton(label, onClick) {
        const button = document.createElement('button');
        button.textContent = label;
        button.style.cssText = `
            background: #4CAF50;
            color: white;
            border: none;
            padding: 5px 10px;
            margin: 5px 0;
            cursor: pointer;
            font-size: 14px;
            border-radius: 5px;
        `;
        button.addEventListener('click', onClick);
        gui.appendChild(button);
    }

    createButton('Toggle ESP', () => {
        config.enableESP = !config.enableESP;
        const status = config.enableESP ? 'Enabled' : 'Disabled';
        showNotification(`ESP ${status}`);
        debugLog(`ESP ${status}`);
    });

    createButton('Toggle Silent Aim', () => {
        config.enableSilentAim = !config.enableSilentAim;
        const status = config.enableSilentAim ? 'Enabled' : 'Disabled';
        showNotification(`Silent Aim ${status}`);
        debugLog(`Silent Aim ${status}`);
    });

    createButton('Toggle Auto-Shoot', () => {
        config.autoShoot = !config.autoShoot;
        const status = config.autoShoot ? 'Enabled' : 'Disabled';
        showNotification(`Auto-Shoot ${status}`);
        debugLog(`Auto-Shoot ${status}`);
    });

    createButton('Toggle Debug Mode', () => {
        config.debugMode = !config.debugMode;
        const status = config.debugMode ? 'Enabled' : 'Disabled';
        showNotification(`Debug Mode ${status}`);
        debugLog(`Debug Mode ${status}`);
    });

    function getHitbox(rect, hitboxType) {
        switch (hitboxType) {
            case 'head':
                return { x: rect.x + rect.width / 2, y: rect.y + rect.height * 0.2 };
            case 'body':
                return { x: rect.x + rect.width / 2, y: rect.y + rect.height / 2 };
            default:
                return { x: rect.x + rect.width / 2, y: rect.y + rect.height / 2 };
        }
    }

    function isVisible(enemyRect, playerRect) {
        return config.visibleCheck ? enemyRect.top > playerRect.top : true;
    }

    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}`);
    });
})();