Anti-curse Bypass

Bypasses the anti-profanity chat in MooMoo.io

目前為 2023-01-26 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Anti-curse Bypass
// @version      1.0.0
// @description  Bypasses the anti-profanity chat in MooMoo.io
// @author       Nuro
// @grant        none
// @match        *://*.moomoo.io/*
// @run-at       document-end
// @require      https://greasyfork.org/scripts/456235-moomoo-js/code/MooMoojs.js?version=1138845
// @namespace https://greasyfork.org/users/761829
// ==/UserScript==

/*
Support us on social media (follow and leave a star)
 
GitHub: https://moomooforge.github.io/MooMoo.js/
Author: https://github.com/NuroC
YouTube: https://www.youtube.com/@nuro9607
Discord: https://discord.gg/NMS3YR9Q5R
 
*/

const badwords = ["word1", "word2"]
const MooMoo = (function MooMooJS_beta() {})[69]

const msgpack = MooMoo.msgpack;
const PacketInterceptor = MooMoo.PacketInterceptor;

const clientCallback = PacketInterceptor.addCallback("client", packet => {
    let decoded = msgpack.decode(packet);
    let [packetid, [...data]] = decoded;
    if (packetid == "ch") {
        let [msg] = data;
        if (badwords.some(word => msg.includes(word))) {
            badwords.forEach(badword => {
                let index = msg.indexOf(badword);
                while (index !== -1) {
                    msg = msg.substring(0, index + 2) + String.fromCharCode(0) + msg.substring(index + 2);
                    msg = msg.substring(0, 30);
                    index = msg.indexOf(badword, index + 2);
                }
            });
        }
        packet = msgpack.encode(["ch", [msg]])
    }
    return packet;
})