Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const send = MPP.chat.send;
- var playing = false;
- var play = confirm("Are you sure want to start 'TNT Strick Spam' Midi");
- if (!play) {
- alert("Cancelled");
- } else {
- alert("Started Playing | use '/stop' to stop");
- send("Now playing 'TNT Stick Spam'");
- start();
- }
- function start() {
- var s1 = setInterval(function () {MPP.press("a-1");}, 100); setInterval(function () {MPP.press("a3");}, 100); setInterval(function () {MPP.press("a-2");}, 100);
- var s2 = setInterval(function () {Object.keys(MPP.piano.keys).forEach((key)=>{MPP.press(key);});}, 900);
- playing = true;
- }
- function stop() {
- clearInterval(s1);
- clearInterval(s2);
- send("Stopped playing 'TNT Stick spam'");
- playing = false;
- }
- MPP.client.on('a', function msg() {
- if (msg.a.startsWith("/play") && !playing) return start();
- if (msg.a.startsWith("/stop") && playing) return stop();
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement