Greasy Fork

Greasy Fork is available in English.

Lunar Client - Crosshair, FPS Booster, Aimbot for Fortnite on Xbox Cloud Gaming

Crosshair, FPS Booster, and Aimbot for Fortnite on Xbox Cloud Gaming (Made by ChatGPT)

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

// ==UserScript==
// @name        Lunar Client - Crosshair, FPS Booster, Aimbot for Fortnite on Xbox Cloud Gaming
// @namespace   Violentmonkey Scripts
// @match       https://www.xbox.com/en-US/play/launch/fortnite/BT5P2X999VH2*
// @grant       none
// @version     3.3
// @author      -
// @description Crosshair, FPS Booster, and Aimbot for Fortnite on Xbox Cloud Gaming (Made by ChatGPT)
// ==/UserScript==
// Inject "Product Sans" font
function injectProductSans() {
    const link = document.createElement('link');
    link.rel = 'stylesheet';
    link.href = 'https://fonts.googleapis.com/css2?family=Product+Sans&display=swap';
    document.head.appendChild(link);
    document.body.style.fontFamily = '"Product Sans", sans-serif';
}

// Create a custom crosshair
function createCrosshair() {
    const crosshair = document.createElement('img');
    crosshair.src = 'https://static-00.iconduck.com/assets.00/crosshair-icon-2048x2048-5h6w9rqc.png';
    crosshair.style.position = 'absolute';
    crosshair.style.top = '50%';
    crosshair.style.left = '50%';
    crosshair.style.transform = 'translate(-50%, -50%)';
    crosshair.style.width = '50px';
    crosshair.style.height = '50px';
    crosshair.style.pointerEvents = 'none';
    crosshair.style.zIndex = '10000';
    document.body.appendChild(crosshair);
}

// Remove Crosshair
function removeCrosshair() {
    const crosshair = document.querySelector('img');
    if (crosshair) {
        crosshair.remove();
    }
}

// FPS Booster: Improve performance without overly bright effects
function enableFPSBooster() {
    document.body.style.overflow = 'hidden';
    const style = document.createElement('style');
    style.innerHTML = `
        * {
            animation: none !important;
            transition: none !important;
        }
        video {
            transform: scale(1);
            filter: none !important;
        }
    `;
    document.head.appendChild(style);
    const meta = document.createElement('meta');
    meta.name = 'viewport';
    meta.content = 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui';
    document.head.appendChild(meta);
    console.log("[FPS Booster] Optimizations enabled.");
}

function disableFPSBooster() {
    document.body.style.overflow = 'auto';
    const style = document.querySelector('style');
    if (style) style.remove();
    const metaTags = document.querySelectorAll('meta[name="viewport"]');
    metaTags.forEach(meta => meta.remove());
    console.log("[FPS Booster] Optimizations disabled.");
}

// Create and toggle the menu
let menuVisible = true;
let menuMinimized = false;
let espEnabled = true;
let crosshairEnabled = true;
let fpsBoosterEnabled = true;

const menu = document.createElement('div');
menu.style.position = 'fixed';
menu.style.top = '20px';
menu.style.left = '20px';
menu.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
menu.style.color = '#FFF';
menu.style.padding = '10px';
menu.style.fontSize = '16px';
menu.style.fontFamily = 'Product Sans, sans-serif';
menu.style.zIndex = '10001';
menu.style.cursor = 'move'; // Make the menu draggable
menu.innerHTML = `
    <div style="display: flex; justify-content: space-between;">
        <span id="menuTitle">Lunar Client</span>
        <span id="menuMinimize" style="cursor: pointer;">-</span>
    </div>
    <div id="menuContent">
        <button id="toggleESP">Disable ESP</button>
        <div id="crosshairStatus">Crosshair: Enabled</div>
        <button id="toggleCrosshair">Disable Crosshair</button>
        <button id="toggleFPS">Disable FPS Booster</button>
    </div>
`;
document.body.appendChild(menu);

// Menu dragging functionality
let isDragging = false;
let offsetX, offsetY;

menu.addEventListener('mousedown', (event) => {
    isDragging = true;
    offsetX = event.clientX - menu.offsetLeft;
    offsetY = event.clientY - menu.offsetTop;
    menu.style.transition = 'none'; // Disable smooth transition while dragging
});

document.addEventListener('mousemove', (event) => {
    if (isDragging) {
        menu.style.left = `${event.clientX - offsetX}px`;
        menu.style.top = `${event.clientY - offsetY}px`;
    }
});

document.addEventListener('mouseup', () => {
    isDragging = false;
    menu.style.transition = 'all 0.3s'; // Re-enable smooth transition after drag
});

// Minimize/Restore menu functionality
const menuMinimizeButton = document.getElementById('menuMinimize');
const menuContent = document.getElementById('menuContent');

menuMinimizeButton.addEventListener('click', () => {
    if (menuMinimized) {
        menuContent.style.display = 'block';
        menuMinimizeButton.textContent = '-';
    } else {
        menuContent.style.display = 'none';
        menuMinimizeButton.textContent = '+';
    }
    menuMinimized = !menuMinimized;
});

// Function to toggle menu visibility with Ctrl + A
function toggleMenu() {
    menuVisible = !menuVisible;
    menu.style.display = menuVisible ? 'block' : 'none';
}

// Listen for Ctrl+A keypress to toggle the menu visibility
window.addEventListener('keydown', (event) => {
    if (event.ctrlKey && event.key === 'a') {
        event.preventDefault(); // Prevent default Ctrl+A behavior
        toggleMenu();
    }
});

// Toggle ESP functionality
const toggleESPButton = document.getElementById('toggleESP');
toggleESPButton.addEventListener('click', () => {
    espEnabled = !espEnabled;
    toggleESPButton.textContent = espEnabled ? 'Disable ESP' : 'Enable ESP';  // Change button text
    if (espEnabled) {
        console.log("[ESP] ESP enabled.");
    } else {
        console.log("[ESP] ESP disabled.");
    }
});

// Toggle Crosshair functionality
const toggleCrosshairButton = document.getElementById('toggleCrosshair');
toggleCrosshairButton.addEventListener('click', () => {
    crosshairEnabled = !crosshairEnabled;
    toggleCrosshairButton.textContent = crosshairEnabled ? 'Disable Crosshair' : 'Enable Crosshair';
    const crosshairStatus = document.getElementById('crosshairStatus');
    crosshairStatus.textContent = crosshairEnabled ? 'Crosshair: Enabled' : 'Crosshair: Disabled';
    if (crosshairEnabled) {
        createCrosshair();
    } else {
        removeCrosshair();
    }
});

// FPS Booster functionality
const toggleFPSButton = document.getElementById('toggleFPS');
toggleFPSButton.addEventListener('click', () => {
    fpsBoosterEnabled = !fpsBoosterEnabled;
    toggleFPSButton.textContent = fpsBoosterEnabled ? 'Disable FPS Booster' : 'Enable FPS Booster';
    if (fpsBoosterEnabled) {
        enableFPSBooster();
    } else {
        disableFPSBooster();
    }
});

// Simulate a simple player/enemy data for testing
const targets = [
    { x: 300, y: 250, id: 'Player1' },
    { x: 500, y: 400, id: 'Player2' }
];

// Function to simulate aimbot logic
function aimbot(targets) {
    // Check if targets exist
    if (!targets || targets.length === 0) return;

    // Assume you have access to your player position and enemy positions
    const playerPosition = { x: 400, y: 300 }; // Placeholder for player position
    let closestTarget = null;
    let closestDistance = Infinity;

    // Find the closest enemy to the player
    targets.forEach(target => {
        const distance = Math.sqrt(Math.pow(target.x - playerPosition.x, 2) + Math.pow(target.y - playerPosition.y, 2));
        if (distance < closestDistance) {
            closestDistance = distance;
            closestTarget = target;
        }
    });

    if (closestTarget) {
        // Calculate the angle between the player and the target (basic 2D angle calculation)
        const angleToTarget = Math.atan2(closestTarget.y - playerPosition.y, closestTarget.x - playerPosition.x);

        // Call a function to aim at the target (move mouse or calculate angle for shooting)
        aimAtTarget(angleToTarget);

        // Simulate shooting when in range
        if (closestDistance < 100) { // Check if target is within 100px distance
            shootAtTarget(closestTarget); // Call a function to simulate shooting
            console.log(`[Aimbot] Shooting at ${closestTarget.id}`);
        }
    }
}

// Function to simulate aiming at the target (this would be more complex in realit