Server Uptime

made for 100% scale

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Server Uptime
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  made for 100% scale
// @author       Aaa > Aeros
// @match        *://*.diep.io/*
// @icon         https://cdn.discordapp.com/attachments/215907305231876096/707356518034571302/diepbox.png
// @grant        none
// ==/UserScript==
(function(){//info
	if(window.updateInfo) return;
    //some coding info
	var info = {};
	var info_container = document.createElement("div");
    info_container.style.cssText = "color: white; position: fixed; text-shadow: -2px 0 black, 0 2px black,	2px 0 black, 0 -2px black, -2px -2px black, -2px 2px black, 2px 2px black, 2px -2px black; font-family: Ubuntu; font-size: 20px; top: 0.5%; left: 2%"
	info_container.style["pointer-events"] = "none"; //its text info
	document.body.appendChild(info_container);

	function toggle_info_container(e){
		if(e.key == "i"){
			info_container.style.display = info_container.style.display=="block" ? "none" : "block";
		}
	}
	window.addEventListener("keyup", toggle_info_container);

	window.updateInfo = function(key, value){
		if(!value) delete info[key];
		else info[key] = value;
		var a1 = "";
		for(var _key in info){
			a1 += info[_key] + "\n"; //makes data changing
		}
		info_container.innerText = a1;
	};
})();
(function() {
    'use strict';
    WebSocket.prototype._send = WebSocket.prototype.send; //its ur websocket
    WebSocket.prototype.send = function (data) {
        this._send(data);
        this.addEventListener('message', function (msg) { //receive messages
            let A = new Uint8Array(msg.data)
            if(A[0] == 0){
                let aaa = Array.from(A).slice(1)
                this.aaa = 0;
                for (let i = 0; i < aaa.length; i++)
                {
                     this.aaa += aaa[i] % 128 * Math.pow(128, i); //vu
                     if (aaa[i] < 128) break; //parse
                }
                let Aaa = this.aaa * 40 / 1000 / 60
                let AAA = Math.round(Aaa)
                if(AAA >= 60) {
                     let a = (AAA / 60 | 0) + " hours " + AAA % 60 + " minutes" ;
                     window.updateInfo && window.updateInfo("time", "Server time: " + a); //full time
                } else {
                     let a = AAA + " minutes";
                     window.updateInfo && window.updateInfo("time", "Server time: " + a);
                };
            }
        }, false);
        this.send = function (data) {
            this._send(data); //send packets back
        };
    }
})();