Skip to content

Instantly share code, notes, and snippets.

@Hri7566
Created February 5, 2024 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hri7566/23456dbd542a9daff0fc1e37e6c99c08 to your computer and use it in GitHub Desktop.
Save Hri7566/23456dbd542a9daff0fc1e37e6c99c08 to your computer and use it in GitHub Desktop.
// ==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}`}])
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment