Link Copier

Allows you to copy links that you normally wouldn't be able to copy from (i.e. Maze, FFA, ect..)

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Link Copier
// @namespace    http://tampermonkey.net/
// @version      1
// @description  Allows you to copy links that you normally wouldn't be able to copy from (i.e. Maze, FFA, ect..)
// @author       Someone
// @match        https://diep.io/
// ==/UserScript==

    var realSend = WebSocket.prototype.send;
    var mainWS;
    var serverWS;
    const URLRegex = /^wss?:\/\/[a-z0-9]{4}\.s\.m28n\.net\/$/g;
    let useServerFeatures = false;

    WebSocket.prototype.send = function(data)
    {
        if (!(data instanceof Int8Array && this.url.match(URLRegex)) || this.dontRegister)
        {
            return realSend.call(this, data);
        }

        if (this !== mainWS)
        {
            mainWS = this;
            this.serverID = this.url.split("://")[1].split(".")[0].toLowerCase();
            this.realRecv = this.onmessage;
            this.onmessage = function(event)
            {
                var data = new Uint8Array(event.data);
                switch (data[0])
                {
                    case 4:
                    {
                        if (!this.partyCode) this.onmessage({data: [6]});
                        break;
                    }
                                            case 6:
                    {
                        if (window.location.hash && window.location.hash.indexOf("00") && window.location.hash.indexOf("00") + 2 !== window.location.hash.length)
                        {
                            this.partyCode = window.location.hash.slice(window.location.hash.indexOf("00") + 2).toUpperCase();
                        }
                        else
                        {
                            this.partyCode = Array.from(data).slice(1).map(r => r.toString(16).padStart(2, "0").split('').reverse().join("")).join("").toUpperCase();
                            var x = this.partyCode;
                            console.log(x)
                        }
                        if (useServerFeatures) serverWS.send("\x00" + this.serverID + "\x00" + this.partyCode);
                        break;
                    }
                }
                return this.realRecv.call(this, event);
            }
        }
        return realSend.call(this, data);
    }