Enhanced Krunker.IO Aimbot & ESP with Modes and Team Check

High-performance aimbot and ESP for Krunker.io with modes and team-based filtering

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

// ==UserScript==
// @name         Enhanced Krunker.IO Aimbot & ESP with Modes and Team Check
// @namespace    http://tampermonkey.net/
// @version      1.0.0
// @description  High-performance aimbot and ESP for Krunker.io with modes and team-based filtering
// @author       Loki
// @match        *://krunker.io/*
// @exclude      *://krunker.io/social*
// @exclude      *://krunker.io/editor*
// @grant        none
// @run-at       document-start
// ==/UserScript==

const settings = {
    aimbotEnabled: true,
    aimbotMode: 'snap', // Modes: 'snap', 'soft', 'assist'
    espEnabled: true,
    espLines: true,
    wireframe: false,
};

// Key bindings
const keyBindings = {
    KeyB: 'aimbotEnabled', // Toggle aimbot
    KeyT: 'toggleMode', // Toggle between aimbot modes
    KeyM: 'espEnabled', // Toggle ESP
    KeyN: 'espLines', // Toggle ESP lines
};

// Aimbot Modes
const AIMBOT_MODES = ['snap', 'soft', 'assist'];

// Cached objects
let scene = null;
let myPlayer = null;
let rightMouseDown = false;
const tempVector = new THREE.Vector3();
const tempObject = new THREE.Object3D();
tempObject.rotation.order = 'YXZ';

// Hook into scene
const origArrayPush = Array.prototype.push;
Array.prototype.push = function (...args) {
    try {
        if (args[0]?.parent?.type === 'Scene' && args[0]?.parent?.name === 'Main') {
            scene = args[0].parent;
            Array.prototype.push = origArrayPush; // Restore original behavior
            console.log('Scene injected!');
        }
    } catch (e) {
        console.error('Error injecting scene:', e);
    }
    return origArrayPush.apply(this, args);
};

// Find players and current user
function findPlayers() {
    if (!scene) return { players: [], myPlayer: null };

    const players = [];
    let myPlayer = null;

    for (const child of scene.children) {
        if (child.type !== 'Object3D') continue;

        try {
            const camera = child.children[0]?.children[0];
            if (camera?.type === 'PerspectiveCamera') {
                myPlayer = child;
            } else if (child.children[0]) {
                players.push(child);
            }
        } catch (e) {
            console.warn('Error processing player object:', e);
        }
    }

    return { players, myPlayer };
}

// Aimbot logic
function aimbot(targetPlayer, myPlayer) {
    if (!settings.aimbotEnabled || !targetPlayer || !myPlayer) return;

    if (isTeammate(targetPlayer)) return; // Skip teammates

    tempVector.setScalar(0);
    targetPlayer.children[0].children[0].localToWorld(tempVector);

    // Apply aimbot mode logic
    if (settings.aimbotMode === 'snap') {
        // Snap directly to target
        tempObject.position.copy(myPlayer.position);
        tempObject.lookAt(tempVector);
        myPlayer.children[0].rotation.x = -tempObject.rotation.x;
        myPlayer.rotation.y = tempObject.rotation.y + Math.PI;

    } else if (settings.aimbotMode === 'soft') {
        // Smoothly adjust aim
        tempObject.position.copy(myPlayer.position);
        tempObject.lookAt(tempVector);
        myPlayer.children[0].rotation.x +=
            (-tempObject.rotation.x - myPlayer.children[0].rotation.x) * 0.1; // Smoothing factor
        myPlayer.rotation.y +=
            (tempObject.rotation.y + Math.PI - myPlayer.rotation.y) * 0.1;

    } else if (settings.aimbotMode === 'assist') {
        // Slightly nudge toward target
        tempObject.position.copy(myPlayer.position);
        tempObject.lookAt(tempVector);
        myPlayer.children[0].rotation.x +=
            (-tempObject.rotation.x - myPlayer.children[0].rotation.x) * 0.05; // Smaller adjustment
        myPlayer.rotation.y +=
            (tempObject.rotation.y + Math.PI - myPlayer.rotation.y) * 0.05;
    }
}

// Check if a player is on the same team
function isTeammate(player) {
    try {
        const playerTeam = player.team || player.playerTeam; // Adjust based on game structure
        const myTeam = myPlayer.team || myPlayer.playerTeam;
        return playerTeam === myTeam;
    } catch (e) {
        console.warn('Error checking teammate:', e);
        return false;
    }
}

// Game loop
function gameLoop() {
    requestAnimationFrame(gameLoop);

    const { players, myPlayer } = findPlayers();
    if (!players.length || !myPlayer) return;

    // Find the closest target
    let targetPlayer = null;
    let minDist = Infinity;

    for (const player of players) {
        if (isTeammate(player)) continue; // Skip teammates
        const dist = player.position.distanceTo(myPlayer.position);
        if (dist < minDist) {
            minDist = dist;
            targetPlayer = player;
        }
    }

    aimbot(targetPlayer, myPlayer);
}

// Event listeners
window.addEventListener('pointerdown', (e) => {
    if (e.button === 2) rightMouseDown = true;
});
window.addEventListener('pointerup', (e) => {
    if (e.button === 2) rightMouseDown = false;
});
window.addEventListener('keyup', (e) => {
    if (document.activeElement?.value !== undefined) return;

    const setting = keyBindings[e.code];
    if (setting === 'toggleMode') {
        const currentIndex = AIMBOT_MODES.indexOf(settings.aimbotMode);
        settings.aimbotMode = AIMBOT_MODES[(currentIndex + 1) % AIMBOT_MODES.length];
        console.log(`Aimbot mode: ${settings.aimbotMode}`);
    } else if (setting) {
        settings[setting] = !settings[setting];
        console.log(`${setting}: ${settings[setting] ? 'ON' : 'OFF'}`);
    }
});

// Start script
console.log('Starting enhanced Krunker.IO aimbot with modes and team check...');
gameLoop();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址