Greasy Fork

Greasy Fork is available in English.

Cryzen.io Auto BH

Auto bhop w cryzen.io z Right Shift toggle i działającym "keydown" spacji

当前为 2025-05-26 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greasyfork.icu/scripts/537334/1596277/Cryzenio%20Auto%20BH.js

// ==UserScript==
// @name         Cryzen.io Auto BH
// @namespace    ViolentMonkey
// @version      1.4
// @description  Auto bhop w cryzen.io z Right Shift toggle i działającym "keydown" spacji
// @author       hackerrrrrrr
// @match        *://cryzen.io/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    let autoBunnyHopInterval = null;
    let bhopEnabled = false;

    // GUI
    const injectedDiv = document.createElement('div');
    injectedDiv.textContent = 'Injected [BH: OFF]';
    Object.assign(injectedDiv.style, {
        position: 'fixed',
        top: '10px',
        right: '10px',
        background: 'rgba(0,0,0,0.6)',
        color: 'lime',
        padding: '4px 10px',
        fontFamily: 'monospace',
        fontSize: '14px',
        borderRadius: '6px',
        zIndex: 9999
    });
    document.body.appendChild(injectedDiv);

    console.log('%cSuccess: Injected', 'color: lime; font-weight: bold;');

    function enableUP() {
        console.log('%cAuto Bunny Hop: ON', 'color: cyan;');
        autoBunnyHopInterval = setInterval(() => {
            const downEvent = new KeyboardEvent('keydown', {
                key: ' ',
                code: 'Space',
                keyCode: 32,
                which: 32,
                bubbles: true
            });

            Object.defineProperty(downEvent, 'keyCode', { get: () => 32 });
            Object.defineProperty(downEvent, 'which', { get: () => 32 });

            document.dispatchEvent(downEvent);
        }, 30);
    }

    function disableUP() {
        console.log('%cAuto Bunny Hop: OFF', 'color: orange;');
        clearInterval(autoBunnyHopInterval);
        autoBunnyHopInterval = null;
    }

    // Przełącznik pod Right Shift
    document.addEventListener('keydown', (e) => {
        if (e.code === 'ShiftRight') {
            bhopEnabled = !bhopEnabled;
            injectedDiv.textContent = `Injected [BH: ${bhopEnabled ? 'ON' : 'OFF'}]`;

            if (bhopEnabled) {
                enableUP();
            } else {
                disableUP();
            }
        }
    });
})();