Add Eval script

This commit is contained in:
Hri7566 2024-01-07 00:31:45 -05:00
commit ced81cc429
1 changed files with 22 additions and 0 deletions

22
tools/Eval.user.js Normal file
View File

@ -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}`}])
});