commit ced81cc429862390373824396444dc1763b5305e Author: Hri7566 Date: Sun Jan 7 00:31:45 2024 -0500 Add Eval script diff --git a/tools/Eval.user.js b/tools/Eval.user.js new file mode 100644 index 0000000..2ae383c --- /dev/null +++ b/tools/Eval.user.js @@ -0,0 +1,22 @@ +// ==UserScript== +// @name Eval +// @namespace Violentmonkey Scripts +// @match https://multiplayerpiano.net/* +// @grant none +// @version 1.0 +// @author Hri7566 +// @description 4/21/2023, 7:12:33 AM +// ==/UserScript== + +MPP.client.on("a", msg => { + if (msg.p._id !== MPP.client.getOwnParticipant()._id) return; + if (!msg.a.startsWith(">")) return; + let out; + try { + out = eval(msg.a.substring(1)); + } catch (err) { + out = `❌ ${err}`; + } + + MPP.client.sendArray([{m: 'a', message: `\u034f✔️ ${typeof out} ${out}`}]) +});