Greasy Fork

Xbox Cloud Gaming Aimbot (Fortnite)

Aim Assist for ViolentMonkey and Xbox Cloud Gaming

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

// ==UserScript==
// @name         Xbox Cloud Gaming Aimbot (Fortnite)
// @version      0.3
// @description  Aim Assist for ViolentMonkey and Xbox Cloud Gaming
// @author       yeebus
// @match        *://*/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @grant        none
// @namespace ViolentMonkey Scripts
// ==/UserScript==

const robot = require('robotjs');
const keyboard = require('keyboard');

let aimbotEnabled = false;
let aiming = false;

function aimAtTarget() {
    if (aimbotEnabled && !aiming) {
        aiming = true;
        // Get the current mouse position
        const mousePos = robot.getMousePos();

        // Find the target by scanning a certain area around the mouse
        const target = findTarget(mousePos.x, mousePos.y, 100);

        if (target) {
            // Move the mouse to the target
            robot.moveMouse(target.x, target.y);
            // Press and hold the 'v' key
            robot.keyToggle('v', 'down');
            // Simulate the 'l' key press
            robot.keyToggle('l', 'down', 50);
            robot.keyToggle('l', 'up', 50);
            // Release the 'v' key
            robot.keyToggle('v', 'up');
        }

        aiming = false;
    }
}

function findTarget(x, y, range) {
    // Scan a square area around the given coordinates
    for (let i = x - range; i <= x + range; i++) {
        for (let j = y - range; j <= y + range; j++) {
            // Get the color of the pixel at (i, j)
            const color = robot.getPixelColor(i, j);

            // Check if the color matches the target color
            if (isTargetColor(color)) {
                return { x: i, y: j };
            }
        }
    }

    return null;
}

function isTargetColor(color) {
    // Define the target color based on your game
    const targetColor = '00FF00'; // Example: Green color
    return color.toUpperCase() === targetColor.toUpperCase();
}

function aimbotOn() {
    if (!aimbotEnabled) {
        aimbotEnabled = true;
        aimAtTarget();
    }
}

function aimbotOff() {
    if (aimbotEnabled) {
        aimbotEnabled = false;
        robot.keyToggle('v', 'up');
        robot.keyToggle('l', 'up');
    }
}

function aimbotOnAl() {
    if (!aimbotEnabled) {
        aimbotEnabled = true;
        aimAtTarget();
    }
}

keyboard.on('v+l', aimbotOn);
keyboard.on('a+l', aimbotOnAl);
keyboard.on('z', aimbotOff);