From 589266f0278d9d1aa8482ddfd77ade476ab910f1 Mon Sep 17 00:00:00 2001 From: m_c_player Date: Thu, 10 Oct 2024 07:56:44 -0400 Subject: [PATCH] the 100 prefix update --- index.js | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index fad9c45..41223e7 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,7 @@ const { parseFormatCodes } = require("./pcc"); const config = require("./conf"); const mc = require('minecraft-protocol'); - const prefixes = ['radium:', 'r!', 'radium!', 'r/', 'radium/', '⁄€‹›fifl‡°·‚—±Œ„´‰ˇÁ¨ˆØ∏”’»ÅÍÎÏ˝ÓÔÒÚƸ˛Ç◊ı˜Â¯˘¿¡™£¢∞¶•ªº–≠œ∑´®†¥¨ˆøπ“‘«åß∂ƒ©˙∆˚¬…æΩ≈ç√∫˜µ≤≥÷'.split('')].flat(); + const prefixes = ['radium:', 'r:', 'r!', 'radium!', 'r/', 'radium/', 'rad:', 'rad!', 'rad/', '⁄€‹›fifl‡°·‚—±Œ„´‰ˇÁ¨ˆØ∏”’»ÅÍÎÏ˝ÓÔÒÚƸ˛Ç◊ı˜Â¯˘¿¡™£¢∞¶•ªº–≠œ∑´®†¥¨ˆøπ“‘«åß∂ƒ©˙∆˚¬…æΩ≈ç√∫˜µ≤≥÷'.split('')].flat(); // random name function function random(length) { @@ -21,6 +21,7 @@ }; // bot creation +function main () { var bots = []; var client = mc.createClient ( @@ -63,7 +64,9 @@ client.on("systemChat", async ({ formattedMessage, positionId }) => { try { var msg = new ChatMessage(JSON.parse(formattedMessage)) - console.log(parseFormatCodes("&c[&6System Chat&c] ") + msg.toAnsi()); + if (!String(msg).startsWith("Command set: ")) { + console.log(parseFormatCodes("&c[&6System Chat&c] ") + msg.toAnsi()); + } } catch (err) { console.log(parseFormatCodes("&c[&6Error&c] ") + err) } @@ -135,7 +138,7 @@ function commandError(players, errorTitle, otherthing) { ( [ { - "text": "Radium » List of commands (" + Object.keys(cmds).length + "):\n" + Object.keys(cmds).join(" | ") + "text": "Radium » List of commands (" + Object.keys(cmds).length + "):\n" + Object.keys(cmds).join(" ") } ] ) @@ -159,7 +162,7 @@ function commandError(players, errorTitle, otherthing) { }; }, prefixes: async () => { - tellraw("@a", JSON.stringify(`Prefixes (${prefixes.length}): ` + prefixes.join(" | "))); + tellraw("@a", JSON.stringify(`Prefixes (${prefixes.length}): ` + prefixes.join(" "))); }, wiki: async (args) => { // Credits: FNFBoyfriendBot, Parker2991 @@ -231,4 +234,14 @@ client.on("playerChat", chatListener); client.on("end", () => { client.off("playerChat", chatListener); -}); // idfk what this does \ No newline at end of file +}); +// on disconnect, rejoin + client.on("end", () => { + main(); + }) +} +main(); +// on error, rejoin + process.on("error", () => { + main(); + }) \ No newline at end of file