Krunker Continuous Jump

Hold space to keep jumping in Krunker

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==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);
        }
    });
})();