🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Greasy Fork is available in English.

Optimized Krunker.IO Aimbot & ESP

High-performance aimbot and ESP for Krunker this auto locks on and tracks through walls

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name         Optimized Krunker.IO Aimbot & ESP
// @namespace    http://tampermonkey.net/
// @version      0.4.1
// @description  High-performance aimbot and ESP for Krunker this auto locks on and tracks through walls
// @author       Original by Lokiion (Loki)
// @match        *://krunker.io/*
// @match        *://browserfps.com/*
// @exclude      *://krunker.io/social*
// @exclude      *://krunker.io/editor*
// @icon         https://www.google.com/s2/favicons?domain=krunker.io
// @grant        none
// @run-at       document-start
// @require      https://unpkg.com/[email protected]/build/three.min.js
// ==/UserScript==

const THREE = window.THREE;
delete window.THREE;

// Settings with default values
const settings = {
    aimbotEnabled: true,
    aimbotOnRightMouse: false,
    espEnabled: true,
    espLines: true,
    wireframe: false
};

// Key bindings
const keyBindings = {
    KeyB: 'aimbotEnabled',
    KeyL: 'aimbotOnRightMouse',
    KeyM: 'espEnabled',
    KeyN: 'espLines',
    KeyK: 'wireframe'
};

// Game state
let scene = null;
let rightMouseDown = false;

// Cached objects for performance
const tempVector = new THREE.Vector3();
const tempObject = new THREE.Object3D();
tempObject.rotation.order = 'YXZ';

// ESP Materials and Geometry
const espMaterial = new THREE.LineBasicMaterial({
    color: 0xff0000,
    depthTest: false
});

const boxGeometry = new THREE.EdgesGeometry(
    new THREE.BoxGeometry(5, 15, 5).translate(0, 7.5, 0)
);

// Line for ESP
const lineGeometry = new THREE.BufferGeometry();
const linePositions = new Float32Array(100 * 2 * 3);
lineGeometry.setAttribute('position', new THREE.BufferAttribute(linePositions, 3));

const line = new THREE.LineSegments(lineGeometry, espMaterial);
line.frustumCulled = false;

// Scene injection
const origArrayPush = Array.prototype.push;
Array.prototype.push = function() {
    try {
        if (arguments[0] && arguments[0].parent &&
            arguments[0].parent.type === 'Scene' &&
            arguments[0].parent.name === 'Main') {
            scene = arguments[0].parent;
            Array.prototype.push = origArrayPush;
            console.log('Scene injected!');
        }
    } catch(e) {}
    return origArrayPush.apply(this, arguments);
};

// Game logic
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 && camera.type === 'PerspectiveCamera') {
                myPlayer = child;
            } else if (child.children[0]) {
                players.push(child);
            }
        } catch(e) {}
    }

    return { players, myPlayer };
}

function updateESP(players, myPlayer) {
    if (!myPlayer) return null;

    let targetPlayer = null;
    let minDist = Infinity;
    let counter = 0;

    tempObject.matrix.copy(myPlayer.matrix).invert();

    for (const player of players) {
        // Skip if it's our own position
        if (player.position.x === myPlayer.position.x &&
            player.position.z === myPlayer.position.z) {
            continue;
        }

        // Create ESP box if needed
        if (!player.box && settings.espEnabled) {
            const box = new THREE.LineSegments(boxGeometry, espMaterial);
            box.frustumCulled = false;
            player.add(box);
            player.box = box;
        }

        // Update ESP visibility
        if (player.box) {
            player.box.visible = settings.espEnabled;
        }

        // Update ESP lines
        if (settings.espLines && counter < linePositions.length / 6) {
            linePositions[counter * 6] = 0;
            linePositions[counter * 6 + 1] = 10;
            linePositions[counter * 6 + 2] = -5;

            tempVector.copy(player.position)
                .add(new THREE.Vector3(0, 9, 0))
                .applyMatrix4(tempObject.matrix);

            linePositions[counter * 6 + 3] = tempVector.x;
            linePositions[counter * 6 + 4] = tempVector.y;
            linePositions[counter * 6 + 5] = tempVector.z;

            counter++;
        }

        // Track closest player for aimbot
        const dist = player.position.distanceTo(myPlayer.position);
        if (dist < minDist) {
            minDist = dist;
            targetPlayer = player;
        }
    }

    // Update line visibility
    line.geometry.attributes.position.needsUpdate = true;
    line.geometry.setDrawRange(0, counter * 2);
    line.visible = settings.espLines;

    return targetPlayer;
}

function aimbot(targetPlayer, myPlayer) {
    if (!settings.aimbotEnabled || !targetPlayer || !myPlayer ||
        (settings.aimbotOnRightMouse && !rightMouseDown)) {
        return;
    }

    // Get target position
    tempVector.setScalar(0);
    targetPlayer.children[0].children[0].localToWorld(tempVector);

    // Calculate aim
    tempObject.position.copy(myPlayer.position);
    tempObject.lookAt(tempVector);

    // Apply aim
    myPlayer.children[0].rotation.x = -tempObject.rotation.x;
    myPlayer.rotation.y = tempObject.rotation.y + Math.PI;
}

// Main game loop
function gameLoop() {
    requestAnimationFrame(gameLoop);

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

    const targetPlayer = updateESP(players, myPlayer);
    aimbot(targetPlayer, myPlayer);
}

// Event handlers
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) {
        settings[setting] = !settings[setting];
        showMessage(`${setting}: ${settings[setting] ? 'ON' : 'OFF'}`);
    }
});

// UI
function showMessage(text) {
    let msgEl = document.querySelector('.hack-message');
    if (!msgEl) {
        msgEl = document.createElement('div');
        msgEl.className = 'hack-message';
        msgEl.style.cssText = `
            position: fixed;
            left: 20px;
            bottom: 20px;
            background: rgba(0, 0, 0, 0.7);
            color: #fff;
            padding: 10px 15px;
            font-family: monospace;
            font-size: 14px;
            border-radius: 4px;
            z-index: 999999;
            transition: opacity 0.3s;
        `;
        document.body.appendChild(msgEl);
    }

    msgEl.textContent = text;
    msgEl.style.opacity = '1';

    clearTimeout(msgEl.fadeTimeout);
    msgEl.fadeTimeout = setTimeout(() => {
        msgEl.style.opacity = '0';
    }, 2000);
}

// Start the script
console.log('Starting Krunker hack...');
gameLoop();