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

Greasy fork 爱吃馍镜像

Poxel.io Custom Crosshair + Smart Macro + Anti-Lag + Real FPS GUI

Draggable GUI with custom crosshair, real FPS counter, smart auto macro, and anti-lag for Poxel.io — press M to toggle the mod menu visibility

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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

公众号二维码

扫码关注【爱吃馍】

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

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

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

公众号二维码

扫码关注【爱吃馍】

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

// ==UserScript==
// @name         Poxel.io Custom Crosshair + Smart Macro + Anti-Lag + Real FPS GUI
// @namespace    http://tampermonkey.net/
// @version      3.1
// @description  Draggable GUI with custom crosshair, real FPS counter, smart auto macro, and anti-lag for Poxel.io — press M to toggle the mod menu visibility
// @author       You
// @match        *://poxel.io/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    // ========== CREATE MOD MENU ==========
    const menu = document.createElement('div');
    menu.style.position = 'fixed';
    menu.style.top = '100px';
    menu.style.left = '20px';
    menu.style.padding = '10px';
    menu.style.background = 'rgba(0,0,0,0.85)';
    menu.style.color = 'white';
    menu.style.fontFamily = 'sans-serif';
    menu.style.zIndex = '99999';
    menu.style.borderRadius = '10px';
    menu.style.fontSize = '14px';
    menu.style.maxWidth = '240px';
    menu.style.cursor = 'move';
    menu.innerHTML = `<b>🔧 Poxel Mod Menu</b><br><br>`;
    document.body.appendChild(menu);

    // Toggle menu visibility with M key
    document.addEventListener('keydown', (e) => {
        if (e.key.toLowerCase() === 'm') {
            menu.style.display = (menu.style.display === 'none') ? 'block' : 'none';
        }
    });

    // Drag logic
    let isDragging = false, offsetX = 0, offsetY = 0;
    menu.addEventListener('mousedown', e => {
        isDragging = true;
        offsetX = e.offsetX;
        offsetY = e.offsetY;
    });
    document.addEventListener('mousemove', e => {
        if (isDragging) {
            menu.style.left = (e.clientX - offsetX) + 'px';
            menu.style.top = (e.clientY - offsetY) + 'px';
        }
    });
    document.addEventListener('mouseup', () => isDragging = false);

    function addToggle(name, callback) {
        const label = document.createElement('label');
        label.style.display = 'block';
        label.style.marginBottom = '6px';
        const input = document.createElement('input');
        input.type = 'checkbox';
        input.style.marginRight = '6px';
        input.addEventListener('change', () => callback(input.checked));
        label.appendChild(input);
        label.appendChild(document.createTextNode(name));
        menu.appendChild(label);
    }

    // ========== CUSTOM CROSSHAIR ==========
    const crosshair = document.createElement('div');
    crosshair.style.position = 'fixed';
    crosshair.style.top = '50%';
    crosshair.style.left = '50%';
    crosshair.style.transform = 'translate(-50%, -50%)';
    crosshair.style.zIndex = '9999';
    crosshair.style.pointerEvents = 'none';
    crosshair.style.display = 'none';
    document.body.appendChild(crosshair);

    const crosshairs = {
        Dot: '8px solid red',
        Cross: '1px solid lime',
        X: '2px dashed white',
        Circle: '2px solid yellow',
    };

    const select = document.createElement('select');
    for (const name in crosshairs) {
        const option = document.createElement('option');
        option.value = name;
        option.textContent = name;
        select.appendChild(option);
    }
    menu.appendChild(document.createTextNode("Crosshair Style: "));
    menu.appendChild(select);

    addToggle("🎯 Show Crosshair", (on) => {
        crosshair.style.display = on ? 'block' : 'none';
    });

    select.addEventListener('change', () => {
        const style = crosshairs[select.value];
        crosshair.style.width = '12px';
        crosshair.style.height = '12px';
        crosshair.style.border = style;
        crosshair.style.borderRadius = select.value === 'Circle' ? '50%' : '0';
    });
    select.dispatchEvent(new Event('change'));

    // ========== SMART MACRO ==========
    let macroActive = false;
    let macroInterval = null;
    addToggle("⚡ Smart Macro Spray", (on) => {
        macroActive = on;
        if (on) {
            macroInterval = setInterval(() => {
                const enemies = document.querySelectorAll('.enemy, .player:not(.me)');
                if (enemies.length > 0) {
                    window.dispatchEvent(new MouseEvent('mousedown'));
                    window.dispatchEvent(new MouseEvent('mouseup'));
                }
            }, 100);
        } else {
            clearInterval(macroInterval);
        }
    });

    // ========== ANTI-LAG ==========
    const removeLagElements = () => {
        const selectors = ['#adContainer', '.adsbygoogle', 'iframe', 'script[src*="analytics"]'];
        selectors.forEach(sel => {
            document.querySelectorAll(sel).forEach(el => el.remove());
        });
    };

    addToggle("🚀 Anti-Lag Boost", (on) => {
        if (on) {
            removeLagElements();
            setTimeout(removeLagElements, 3000);
        }
    });

    // ========== REAL FPS DISPLAY ==========
    const fpsDisplay = document.createElement('div');
    Object.assign(fpsDisplay.style, {
        position: 'fixed',
        bottom: '10px',
        left: '10px',
        padding: '5px 10px',
        background: 'rgba(0,0,0,0.7)',
        color: 'lime',
        fontFamily: 'monospace',
        fontSize: '13px',
        zIndex: '9999',
        display: 'none'
    });
    document.body.appendChild(fpsDisplay);

    let lastFrame = performance.now();
    let frameCount = 0;
    function trackFPS() {
        const now = performance.now();
        frameCount++;
        if (now - lastFrame >= 1000) {
            fpsDisplay.textContent = `FPS: ${frameCount}`;
            frameCount = 0;
            lastFrame = now;
        }
        requestAnimationFrame(trackFPS);
    }
    trackFPS();

    addToggle("📈 Real FPS", (on) => {
        fpsDisplay.style.display = on ? 'block' : 'none';
    });
})();