Krunker Features

Simple script to add client features to Krunker including: Game timer in the menu and find new game

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         Krunker Features
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Simple script to add client features to Krunker including: Game timer in the menu and find new game
// @author       KLZX121
// @match        https://krunker.io/
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    //Menu Timer
    setInterval(()=>{

        //move spectateButton
        document.getElementById('spectButton').setAttribute('style', 'top: 20px;left: 550px')

        //create element menuTimer
        let menuTimer = document.createElement("div")
        menuTimer.setAttribute('id', 'menuTimer')
        menuTimer.setAttribute('style', "margin-bottom: 50px;color: cyan")

        //append to instructions element
        document.getElementById('instructions').appendChild(menuTimer)

        //update menuTimer
        let time = document.getElementById('timerVal').innerHTML
        document.getElementById('menuTimer').innerHTML = time

    }, 1000)

    //Find New Game on F4
    document.onkeydown = findNewGame;

    function findNewGame(a){
        if (a.code !== 'F4') return;
        window.location.href = 'https://krunker.io';
    }

})();