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

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

Versione datata 05/12/2024. Vedi la nuova versione l'ultima versione.

// ==UserScript==
// @name         Enhanced Krunker.IO Aimbot & ESP with Modes and Team Check
// @namespace    http://tampermonkey.net/
// @version      1.0.1
// @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
Object.defineProperty(Object.prototype, 'add', {
    configurable: true,
    set(value) {
        if (value?.type === 'Scene' && value.name === 'Main') {
            scene = value;
            console.log('Scene injected!');
        }
        return value;
    },
});

// 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.set(0, 0, 0);
    targetPlayer.children[0]?.children[0]?.localToWorld(tempVector);

    const direction = tempVector.sub(myPlayer.position).normalize();

    // Apply aimbot mode logic
    if (settings.aimbotMode === 'snap') {
        myPlayer.lookAt(tempVector);

    } else if (settings.aimbotMode === 'soft') {
        const currentDir = new THREE.Vector3().setFromMatrixPosition(myPlayer.matrixWorld).normalize();
        myPlayer.rotation.x += (direction.x - currentDir.x) * 0.1; // Smooth adjust
        myPlayer.rotation.y += (direction.y - currentDir.y) * 0.1;

    } else if (settings.aimbotMode === 'assist') {
        myPlayer.rotation.x += (direction.x - myPlayer.rotation.x) * 0.05; // Assist level adjustment
        myPlayer.rotation.y += (direction.y - myPlayer.rotation.y) * 0.05;
    }
}

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

// Render ESP
function renderESP(players) {
    if (!settings.espEnabled) return;

    const canvas = document.getElementById('espCanvas') || createCanvas();
    const ctx = canvas.getContext('2d');
    ctx.clearRect(0, 0, canvas.width, canvas.height);

    for (const player of players) {
        const screenPos = toScreenPosition(player.position);
        ctx.beginPath();
        ctx.moveTo(screenPos.x, screenPos.y);
        ctx.lineTo(window.innerWidth / 2, window.innerHeight); // Draw to bottom center (example)
        ctx.strokeStyle = 'red';
        ctx.stroke();
    }
}

function createCanvas() {
    const canvas = document.createElement('canvas');
    canvas.id = 'espCanvas';
    canvas.width = window.innerWidth;
    canvas.height = window.innerHeight;
    canvas.style.position = 'absolute';
    canvas.style.top = '0';
    canvas.style.left = '0';
    canvas.style.pointerEvents = 'none';
    document.body.appendChild(canvas);
    return canvas;
}

function toScreenPosition(position) {
    // Convert 3D position to 2D screen position (pseudo-code)
    return { x: position.x * 100, y: position.y * 100 };
}

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

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

    let targetPlayer = null;
    let minDist = Infinity;

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

    aimbot(targetPlayer, myPlayer);
    renderESP(players);
}

// Event listeners
window.addEventListener('keyup', (e) => {
    if (document.activeElement?.tagName === 'INPUT') 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'}`);
    }
});

console.log('Enhanced Krunker.IO script running...');
gameLoop();
长期地址
遇到问题?请前往 GitHub 提 Issues,或加Q群1031348184

赞助商

Fishcpy

广告

Rainyun

注册一下就行

Rainyun

一年攒够 12 元