Server Uptime

made for 100% scale

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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
        };
    }
})();