Greasy Fork

Greasy Fork is available in English.

Cryzen.io Auto BH

Test if everything is loading properly

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

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

// ==UserScript==
// @name         Cryzen.io Auto BH
// @namespace    ViolentMonkey
// @version      1.1
// @description  Test if everything is loading properly 
// @author       Diwi
// @match        *://cryzen.io/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // === Wypisz w konsoli ===
    console.log('%cSuccess: Injected', 'color: lime; font-weight: bold;');

    // === Dodaj napis "Injected" w rogu ===
    const injectedDiv = document.createElement('div');
    injectedDiv.textContent = 'Injected';
    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);

    // === Auto Bunnyhop ===
    let spacePressed = false;

    setInterval(() => {
        const gameCanvas = document.querySelector("canvas");
        if (!gameCanvas) return;

        const isFocused = document.activeElement === gameCanvas;

        if (isFocused) {
            if (!spacePressed) {
                spacePressed = true;
                const downEvent = new KeyboardEvent("keydown", {
                    key: " ",
                    code: "Space",
                    keyCode: 32,
                    which: 32,
                    bubbles: true
                });
                document.dispatchEvent(downEvent);
            }

            setTimeout(() => {
                const upEvent = new KeyboardEvent("keyup", {
                    key: " ",
                    code: "Space",
                    keyCode: 32,
                    which: 32,
                    bubbles: true
                });
                document.dispatchEvent(upEvent);
                spacePressed = false;
            }, 10);
        }
    }, 50);
})();