Server Uptime

made for 100% scale

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

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