Diep.io Region Decoder

press L and region shows

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

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