Moomoo.io: added menus, space hold feature, weapon synch

Exactly what the title says

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

(I already have a user script manager, let me install it!)

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        Moomoo.io: added menus, space hold feature, weapon synch
// @namespace    -
// @version     1.1
// @description Exactly what the title says
// @author       ???
// @match        *://moomoo.io/*
// @match        *://sandbox.moomoo.io/*
// @match        *://dev.moomoo.io/*
// @match        *://spurious-butter-wineberry.glitch.me/*
// @grant    GM_addStyle
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @require https://code.jquery.com/ui/1.12.0/jquery-ui.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.js
// ==/UserScript==


let mouseX;
let mouseY;

let width;
let height;




let coreURL = new URL(window.location.href);
window.sessionStorage.force = coreURL.searchParams.get("fc");



function n(){
     this.buffer = new Uint8Array([0]);
     this.buffer.__proto__ = new Uint8Array;
     this.type = 0;
}

WebSocket.prototype.oldSend = WebSocket.prototype.send;
WebSocket.prototype.send = function(m){
    if (!ws){
        document.ws = this;

        ws = this;
        socketFound(this);
    }
    this.oldSend(m);
};


function socketFound(socket){
    socket.addEventListener('message', function(message){
        handleMessage(message);
    });
}




function doNewSend(sender){
    ws.send(new Uint8Array(Array.from(encode(sender))));
}


function vlace(id, angle = Math.atan2(mouseY - height / 2, mouseX - width / 2)) {
    doNewSend(["c", [1, angle]]);
    doNewSend(["c", [0, angle]]);

}





const p = repeater(32, () => {vlace(spikeType)
                              vlace(spikeType)
                              vlace(spikeType)}, 0);

document.addEventListener('keydown', (e)=>{
    p.start(e.keyCode);
})

document.addEventListener('keyup', (e)=>{
    p.stop(e.keyCode);
})


function isElementVisible(e) {
    return (e.offsetParent !== null);
}