Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name LGPvS's bot
- // @namespace http://www.multiplayerpiano.com/
- // @version 0.4.3
- // @description Lol
- // @author LGPvS
- // @include http://www.multiplayerpiano.com/*
- // @include http://www.ourworldofpixels.com/piano/*
- // @match http://www.multiplayerpiano.com/script.js
- // ==/UserScript==
- /*
- You can change in MPP.client.sendArray([{m: "userset",set: {name: "Your name here"}}]); a "Your name here" to your
- */
- var adminarray=[];
- var onoff=true;
- var a;
- var b;
- var input;
- function sendChat(msg) { //midilol
- MPP.chat.send(msg);
- }
- MPP.client.on("a", function (msg) {
- a = msg.a.split(' ');
- b = a[0];
- input = msg.a.substring(b.length).trim(); // <--- for if I make more commands :D
- if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id==MPP.client.getOwnParticipant()._id)){
- if (msg.a.toLowerCase()=="/on")
- {
- onoff=true;
- MPP.chat.send("Commands turned on: ("+onoff+")");
- }
- else
- {
- if (msg.a.toLowerCase()=="/off")
- {
- onoff=false;
- MPP.chat.send("Commands turned off: ("+onoff+")");
- }}}
- if (onoff===true){
- /*
- MPP.client.on('participant added', pp => { MPP.chat.send( 'User ' + pp.name + ' joined to this room, use /help'); });
- */
- /* adminarray.push("Any user id"); */
- /* remove=adminarray.indexOf("Id where"); adminarray.splice(remove,1); */
- if (msg.p._id==MPP.client.getOwnParticipant()._id) { if (msg.a.substring(0, "/js".length) == "/js") {var getscrtext = msg.a.substring(3);var docode = getscrtext;MPP.chat.send("Console:" + eval(docode));}}
- //commands
- if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id==MPP.client.getOwnParticipant()._id)){
- if (b == "/waveMIDI") {
- MPP.client.sendArray([{m: "userset",set: {name: "/waveMIDI"}}]);
- sendChat("Reading MIDI effect:Name:/waveMIDI");
- MPP.client.emit("notification", { title: "lol", html: "" });
- t=0; Object.keys(MPP.piano.keys).forEach(function(key) {setTimeout(function () {MPP.press(key,1);}, t++ * 70);});
- t=0; Object.keys(MPP.piano.keys).forEach(function(key) {setTimeout(function () {MPP.press(key,1);}, t++ * 65);});
- t=0; Object.keys(MPP.piano.keys).forEach(function(key) {setTimeout(function () {MPP.press(key,1);}, t++ * 60);});
- t=0; Object.keys(MPP.piano.keys).forEach(function(key) {setTimeout(function () {MPP.press(key,1);}, t++ * 55);});
- t=0; Object.keys(MPP.piano.keys).forEach(function(key) {setTimeout(function () {MPP.press(key,1);}, t++ * 50);});
- t=0; Object.keys(MPP.piano.keys).forEach(function(key) {setTimeout(function () {MPP.press(key,1);}, t++ * 70);});
- t=0; Object.keys(MPP.piano.keys).forEach(function(key) {setTimeout(function () {MPP.press(key,1);}, t++ * 65);});
- t=0; Object.keys(MPP.piano.keys).forEach(function(key) {setTimeout(function () {MPP.press(key,1);}, t++ * 60);});
- t=0; Object.keys(MPP.piano.keys).forEach(function(key) {setTimeout(function () {MPP.press(key,1);}, t++ * 55);});
- t=0; Object.keys(MPP.piano.keys).forEach(function(key) {setTimeout(function () {MPP.press(key,1);}, t++ * 50);});
- }
- }
- if (b == "/h") {
- MPP.chat.send("Commands: /help (/h), /returnadminnickname, /about, /version, /versions, /myfavoriteNMPBmusiclist, /eatfood, /drink.");
- MPP.chat.send("F̲i̲s̲h̲i̲n̲g̲: /fish, /eat");
- }
- if (b == "/help") {
- MPP.chat.send("Commands: /help (/h), /returnadminnickname, /about, /version, /versions, /myfavoriteNMPBmusiclist, /eatfood, /drink.");
- MPP.chat.send("F̲i̲s̲h̲i̲n̲g̲: /fish, /eat");
- }
- if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id==MPP.client.getOwnParticipant()._id)){
- if (b == "/setroom") {
- MPP.chat.send("Bot owner left to room named " + msg.a.substring(8).trim() + " and it works with command /setroom and user what using a /setroom is " + msg.p.name);
- MPP.client.setChannel(msg.a.substring(8).trim());
- }
- }
- /* msg.a.substring(3).trim() */
- if (b == "/eatfood") {
- MPP.chat.send("Our dear friend " + msg.p.name + " eat a " + msg.a.substring(8).trim());
- }
- if (b == "/drink") {
- MPP.chat.send("Our dear friend " + msg.p.name + " drink a " + msg.a.substring(6).trim());
- }
- if (b == "/myfavoriteNMPBmusic_0") {
- MPP.chat.send("/p 824");
- }
- if (b == "/myfavoriteNMPBmusic_1") {
- MPP.chat.send("/p 2245");
- }
- if (b == "/myfavoriteNMPBmusic_2") {
- MPP.chat.send("/p 3203");
- }
- if (b == "/myfavoriteNMPBmusic_3") {
- MPP.chat.send("/p 110");
- MPP.chat.send("/tempo 50");
- }
- if (b == "/myfavoriteNMPBmusic_4") {
- MPP.chat.send("/p 8984");
- }
- if (b == "/myfavoriteNMPBmusic_5") {
- MPP.chat.send("/p 9271");
- }
- if (b == "/myfavoriteNMPBmusiclist") {
- MPP.chat.send("Total: 6");
- MPP.chat.send("Tracks here: /myfavoriteNMPBmusic_0, /myfavoriteNMPBmusic_1, /myfavoriteNMPBmusic_2, /myfavoriteNMPBmusic_3, /myfavoriteNMPBmusic_4, /myfavoriteNMPBmusic_5.");
- }
- if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id==MPP.client.getOwnParticipant()._id)){
- if (b == "/h") {
- MPP.chat.send("Admin Commands: /js, /kickban, /renameadminnickname, /on, /off, /waveMIDI, /setroom, /pianohide_on, /pianohide_off.");
- }
- }
- if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id==MPP.client.getOwnParticipant()._id)){
- if (b == "/help") {
- MPP.chat.send("Admin Commands: /js, /kickban, /renameadminnickname, /on, /off, /waveMIDI, /setroom, /pianohide_on, /pianohide_off.");
- }
- }
- if (b == "/eat") {
- MPP.chat.send("You ate fish");
- }
- if (b == "/about") {
- MPP.chat.send("Author:LGPvS,Pastebin:http://pastebin.com/u/LGPvS");
- }
- if (b == "/version") {
- MPP.chat.send("Version:0.4.3");
- }
- if (b == "/versions") {
- MPP.chat.send("Version:0.1,Version:0.2,Version:0.3,Version:0.3.2,Version:0.4,Version:0.4.2,Version:0.4.3");
- }
- if (b == "/returnadminnickname") {
- MPP.client.sendArray([{m: "userset",set: {name: "Your name here"}}]);
- }
- else if (msg.a.substring(0,'/kickban'.length)=="/kickban"){var ms=1000,banvar=msg.a.substring('/kickban_'.length,msg.a.length); if (msg.p._id==MPP.client.getOwnParticipant()._id){ MPP.client.sendArray([{m: "kickban", _id: banvar, ms: ms}]);} else {MPP.chat.send(" "+msg.p.name+", you not have a permission to use it command.");}}
- else if (b == "/gochcn") {
- MPP.client.setChannel("channel name");
- }
- if (b == "/fish") { var words = ['Our dear friend ' + msg.p.name + ' caught a Pike', 'Our dear friend ' + msg.p.name + ' caught a Salmon', 'Our dear friend ' + msg.p.name + ' caught a Jellyfish, '+ msg.p.name +' got burns', 'Our dear friend ' + msg.p.name + ' caught a Puffer, this fish is poisonous' ]; var random = Math.floor(Math.random() * words.length); MPP.chat.send(words[random]); }
- //easter eggs
- gSeeOwnCursor = (window.location.hash && window.location.hash.match(/^(?:#.+)*#cursor(?:#.+)*$/i));
- //changing elements
- $('#more-button').css ('background', 'url(http://i.imgur.com/ADG2hzy.jpg)');
- $('#crown').css ('background', 'url(http://emoji.ameba.jp/img/user/ha/hakka17/949650.gif)');
- $('#inclinations').css ('background', 'url(https://pic.rutube.ru/video/f0/db/f0db598f8058ff6e0ab15f7821807906.jpg?size=l)');
- //command /hidepiano
- if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id==MPP.client.getOwnParticipant()._id)){
- if (b == "/hidepiano_off") {
- $('#piano').fadeIn();
- }
- }
- if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id==MPP.client.getOwnParticipant()._id)){
- if (b == "/hidepiano_on") {
- $('#piano').fadeOut();
- MPP.chat.send("Piano hide is enabled (for bot owner only)");
- }
- }
- if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id==MPP.client.getOwnParticipant()._id)){ /*here is code only admins can use*/if (b == "/renameadminnickname") { MPP.client.sendArray([{m: "userset",set: {name: a [1] }}]); }}
- }/*onoff end*/
- });/*msg.a. response end*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement