Cube Client

Cliente PvP para Bloxd.io con hitboxes, keystrokes, contador de CPS, crosshair personalizado, FPS Boost y barra de salud.

目前為 2025-01-04 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Cube Client
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Cliente PvP para Bloxd.io con hitboxes, keystrokes, contador de CPS, crosshair personalizado, FPS Boost y barra de salud.
// @author       TuNombre
// @match        https://*.bloxd.io/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Configuración inicial
    const config = {
        hitboxes: false,
        customCrosshair: false,
        fpsBoost: false,
        healthBar: false,
        keystrokes: true, // Keystrokes activado por defecto
        cpsCounter: true,  // CPS activado por defecto
        keystrokeColor: '#00ff00', // Color de keystrokes
        keystrokeBackgroundColor: '#333333', // Fondo predeterminado de las teclas
        healthBarColor: '#ff0000', // Color de la barra de salud
        keystrokeSize: '50px', // Tamaño de las teclas
        keystrokeFontSize: '25px', // Tamaño de fuente para las letras en las teclas
        keystrokeBorderColor: '#ffffff', // Color del borde (no editable)
    };

    // Crear el contenedor de Keystrokes y CPS
    const keystrokesContainer = document.createElement('div');
    keystrokesContainer.id = 'keystrokes';
    keystrokesContainer.style.position = 'fixed';
    keystrokesContainer.style.bottom = '100px';
    keystrokesContainer.style.left = '10px';
    keystrokesContainer.style.zIndex = '10000';
    keystrokesContainer.style.fontFamily = 'Arial, sans-serif';
    keystrokesContainer.style.color = 'white';
    keystrokesContainer.style.display = config.keystrokes ? 'block' : 'none';
    keystrokesContainer.style.textAlign = 'center';
    keystrokesContainer.style.cursor = 'move';

    keystrokesContainer.innerHTML = `
        <div style="display: flex; flex-direction: column; align-items: center;">
            <div id="key-W" class="key" style="width: ${config.keystrokeSize}; height: ${config.keystrokeSize}; background-color: ${config.keystrokeBackgroundColor}; border: 2px solid ${config.keystrokeBorderColor}; font-size: ${config.keystrokeFontSize}; display: flex; align-items: center; justify-content: center;">W</div>
            <div style="display: flex;">
                <div id="key-A" class="key" style="width: ${config.keystrokeSize}; height: ${config.keystrokeSize}; background-color: ${config.keystrokeBackgroundColor}; border: 2px solid ${config.keystrokeBorderColor}; font-size: ${config.keystrokeFontSize}; display: flex; align-items: center; justify-content: center;">A</div>
                <div id="key-S" class="key" style="width: ${config.keystrokeSize}; height: ${config.keystrokeSize}; background-color: ${config.keystrokeBackgroundColor}; border: 2px solid ${config.keystrokeBorderColor}; font-size: ${config.keystrokeFontSize}; display: flex; align-items: center; justify-content: center;">S</div>
                <div id="key-D" class="key" style="width: ${config.keystrokeSize}; height: ${config.keystrokeSize}; background-color: ${config.keystrokeBackgroundColor}; border: 2px solid ${config.keystrokeBorderColor}; font-size: ${config.keystrokeFontSize}; display: flex; align-items: center; justify-content: center;">D</div>
            </div>
            <div style="display: flex; justify-content: center; width: 100%; margin-top: 10px;">
                <div id="key-Shift" class="key" style="width: ${config.keystrokeSize}; height: ${config.keystrokeSize}; background-color: ${config.keystrokeBackgroundColor}; border: 2px solid ${config.keystrokeBorderColor}; font-size: ${config.keystrokeFontSize}; display: flex; align-items: center; justify-content: center;">Shift</div>
                <div id="key-Space" class="key" style="width: ${config.keystrokeSize}; height: ${config.keystrokeSize}; background-color: ${config.keystrokeBackgroundColor}; border: 2px solid ${config.keystrokeBorderColor}; font-size: ${config.keystrokeFontSize}; display: flex; align-items: center; justify-content: center;">Space</div>
            </div>
            <div style="margin-top: 20px;">
                <div id="leftCPS" style="margin: 5px; font-size: 16px;">LMB CPS: 0</div>
                <div id="rightCPS" style="margin: 5px; font-size: 16px;">RMB CPS: 0</div>
            </div>
        </div>
    `;
    document.body.appendChild(keystrokesContainer);

    // Función para hacer el contenedor de keystrokes arrastrable
    let isDragging = false;
    let offsetX, offsetY;

    keystrokesContainer.addEventListener('mousedown', (e) => {
        isDragging = true;
        offsetX = e.clientX - keystrokesContainer.getBoundingClientRect().left;
        offsetY = e.clientY - keystrokesContainer.getBoundingClientRect().top;
        keystrokesContainer.style.cursor = 'grabbing';
    });

    document.addEventListener('mousemove', (e) => {
        if (isDragging) {
            keystrokesContainer.style.left = `${e.clientX - offsetX}px`;
            keystrokesContainer.style.top = `${e.clientY - offsetY}px`;
        }
    });

    document.addEventListener('mouseup', () => {
        isDragging = false;
        keystrokesContainer.style.cursor = 'move';
    });

    // Variables para el manejo de clics
    let lastLeftClickTime = 0;
    let lastRightClickTime = 0;
    const clickCooldown = 100; // en milisegundos (100ms de espera entre clics)

    // Actualizar Keystrokes al presionar teclas
    document.addEventListener('keydown', (e) => {
        const keyElement = document.getElementById(`key-${e.key}`);
        if (keyElement) {
            keyElement.style.background = config.keystrokeColor; // Color configurable cuando está presionado
        }
    });

    document.addEventListener('keyup', (e) => {
        const keyElement = document.getElementById(`key-${e.key}`);
        if (keyElement) {
            keyElement.style.background = config.keystrokeBackgroundColor; // Vuelve al color de fondo predeterminado cuando se suelta
        }
    });

    // Manejo de clics para CPS
    document.addEventListener('mousedown', (e) => {
        const currentTime = Date.now();
        
        if (e.button === 0 && currentTime - lastLeftClickTime > clickCooldown) {
            lastLeftClickTime = currentTime;
            leftClickCount++; // Clic izquierdo
        }
        if (e.button === 2 && currentTime - lastRightClickTime > clickCooldown) {
            lastRightClickTime = currentTime;
            rightClickCount++; // Clic derecho
        }
    });

    // Reiniciar los contadores cada segundo y mostrar los CPS
    let leftClickCount = 0;
    let rightClickCount = 0;

    setInterval(() => {
        document.getElementById('leftCPS').textContent = `LMB CPS: ${leftClickCount}`;
        document.getElementById('rightCPS').textContent = `RMB CPS: ${rightClickCount}`;
        leftClickCount = 0;
        rightClickCount = 0;
    }, 1000);

    // Crear el menú de configuración
    const menu = document.createElement('div');
    menu.style.position = 'fixed';
    menu.style.top = '50px';
    menu.style.left = '50px';
    menu.style.backgroundColor = '#000';
    menu.style.color = '#fff';
    menu.style.padding = '10px';
    menu.style.border = '2px solid #fff';
    menu.style.borderRadius = '5px';
    menu.style.zIndex = '10000';
    menu.style.display = 'none';
    menu.style.fontFamily = 'Arial, sans-serif';

    menu.innerHTML = `
        <h3>Cube Client - Configuración</h3>
        <label><input type="checkbox" id="toggleHitboxes"> Activar Hitboxes</label><br>
        <label><input type="checkbox" id="toggleCrosshair"> Activar Crosshair Personalizado</label><br>
        <label><input type="checkbox" id="toggleFPSBoost"> Activar FPS Boost</label><br>
        <label><input type="checkbox" id="toggleHealthBar"> Activar Barra de Salud</label><br>
        <label><input type="checkbox" id="toggleKeystrokes"> Activar Keystrokes</label><br>
        <label><input type="checkbox" id="toggleCPSCounter"> Activar Contador de CPS</label><br>
        <button id="closeMenu" style="margin-top: 10px;">Cerrar Menú</button>
    `;

    document.body.appendChild(menu);

    // Eventos para los controles del menú
    document.getElementById('toggleHitboxes').addEventListener('change', (e) => {
        config.hitboxes = e.target.checked;
    });

    document.getElementById('toggleCrosshair').addEventListener('change', (e) => {
        config.customCrosshair = e.target.checked;
    });

    document.getElementById('toggleFPSBoost').addEventListener('change', (e) => {
        config.fpsBoost = e.target.checked;
    });

    document.getElementById('toggleHealthBar').addEventListener('change', (e) => {
        config.healthBar = e.target.checked;
    });

    document.getElementById('toggleKeystrokes').addEventListener('change', (e) => {
        config.keystrokes = e.target.checked;
        keystrokesContainer.style.display = config.keystrokes ? 'block' : 'none';
    });

    document.getElementById('toggleCPSCounter').addEventListener('change', (e) => {
        config.cpsCounter = e.target.checked;
    });

    document.getElementById('closeMenu').addEventListener('click', () => {
        menu.style.display = 'none';
    });

    // Abrir el menú con la tecla "Inicio"
    document.addEventListener('keydown', (e) => {
        if (e.key === 'Home') {
            menu.style.display = menu.style.display === 'none' ? 'block' : 'none';
        }
    });

})();