Diep.io Region Decoder

press L and region shows

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

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