SploMod - Leading hack for Sploop.io 2022 (only autoheal)

testing

As of 2022-03-25. See the latest version.

// ==UserScript==
// @name         SploMod - Leading hack for Sploop.io 2022 (only autoheal)
// @description  testing
// @version      3.2.2-beta
// @match        *://sploop.io/*
// @author       Nuro#9999
// @run-at       document-start
// @grant        none
// @namespace https://greasyfork.org/users/761829
// ==/UserScript==

var version = "3.2.2-beta"

let healspeed = 100;
let Entity = new Array();
let id = null
const encodeSym = Symbol();
const wsSym = Symbol();


Object.defineProperty(Object.prototype, 'encode', {
    get() {
        return this[encodeSym];
    },
    set(encode) {
        if(this.init) {
        window.encoder = this
        }
        this[encodeSym] = function() {
            return encode.apply(this, arguments);
        };
    }
});
Object.defineProperty(Object.prototype, 'ws', {
    get() {
        return this[wsSym];
    },

    set(ws) {
        ws.safesend = function(data) {
            let msg = new Uint8Array(data);
            window.encoder.encode(msg)
            ws.send(msg)
        }
        ws.addEventListener('message', function(event) {
            let data = event.data
            let decoded = typeof data === 'string' ? JSON.parse(data) : new Uint8Array(data);
            switch(decoded[0]) {
                case 0x1:
                    for (let int = 1; int < decoded.length; int += 18) {
                           let index = decoded[int + 2] | decoded[int + 3] << 8
                        let temp = Entity[index] || {fd: 2};
                        if (!decoded[int] && decoded[int + 8] == 2) {
                            temp = {};
                        } else {
                            if (temp.fd & 2) {
                                if(index === id) {
                                    if(decoded[int + 13] / 255 * 100 < 100) {
                                        setTimeout(() => {
                                            ws.safesend([8, 2]);
                                            ws.safesend([4])
                                            ws.safesend([5])
                                            ws.safesend([8,0])
                                        }, healspeed)
                                    }
                                }
                            }
                        }
                    }
                    break;
                case 0x2:
                    id = decoded[1];
                    break;
            }
        });
        this[wsSym] = ws;
    }
});