Krunker Continuous Jump

Hold space to keep jumping in Krunker

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         Krunker Continuous Jump
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Hold space to keep jumping in Krunker
// @author       YourName
// @match        *://krunker.io/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    let jumping = false;
    let jumpInterval;

    // Function to simulate jump key press
    function jump() {
        // The jump key in Krunker is usually space (keyCode 32)
        // We simulate keydown and keyup events for space to trigger jump
        const eventDown = new KeyboardEvent('keydown', {key: ' ', code: 'Space', keyCode: 32, which: 32, bubbles: true});
        const eventUp = new KeyboardEvent('keyup', {key: ' ', code: 'Space', keyCode: 32, which: 32, bubbles: true});
        document.dispatchEvent(eventDown);
        document.dispatchEvent(eventUp);
    }

    // Listen for keydown event on space
    window.addEventListener('keydown', function(e) {
        if (e.code === 'Space' && !jumping) {
            jumping = true;
            jumpInterval = setInterval(jump, 100); // Jump every 100 ms while holding space
        }
    });

    // Listen for keyup event on space
    window.addEventListener('keyup', function(e) {
        if (e.code === 'Space') {
            jumping = false;
            clearInterval(jumpInterval);
        }
    });
})();