Diep.io Region Decoder

press L and region shows

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 or Violentmonkey 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.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

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         Diep.io Region Decoder
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  press L and region shows
// @author       el bismut
// @match        https://diep.io/
// @icon         https://www.google.com/s2/favicons?domain=diep.io
// @grant        none
// @license      none
// ==/UserScript==
//original content

var region = '';
var link = '';
function serverConnectHook(server) {
    region = server.split("lobby.")[1].split(".hiss")[0];
}
window.WebSocket = new Proxy(WebSocket, {construct(t, args) {serverConnectHook(args[0]); return Reflect.construct(t, args)}});
CanvasRenderingContext2D.prototype.fillText = new Proxy(CanvasRenderingContext2D.prototype.fillText, {
    apply(fillText, ctx, [text, x, y, ...blah]) {
        if(text.includes("ms") && text.includes(".")) {
            const lengthBefore = ctx.measureText(text).width;
            text = text.split(" ms")[0] + "ms " + region;
            ctx.textAlign = 'right';
            x += lengthBefore;
        }
        fillText.call(ctx, text, x, y, ...blah);
    }
});
CanvasRenderingContext2D.prototype.strokeText = new Proxy(CanvasRenderingContext2D.prototype.strokeText, {
    apply(strokeText, ctx, [text, x, y, ...blah]) {
        if(text.includes("ms") && text.includes(".")) {
            const lengthBefore = ctx.measureText(text).width;
            text = text.split(" ms")[0] + "ms " + region;
            ctx.textAlign = 'right';
            x += lengthBefore;
        }
        strokeText.call(ctx, text, x, y, ...blah);
    }
});