Advertisement
LGPvS

LudwigOS MPP bot. Version:0.4.3

Jan 20th, 2017
1,766
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.02 KB | None | 0 0
  1. // ==UserScript==
  2. // @name LGPvS's bot
  3. // @namespace http://www.multiplayerpiano.com/
  4. // @version 0.4.3
  5. // @description Lol
  6. // @author LGPvS
  7. // @include http://www.multiplayerpiano.com/*
  8. // @include http://www.ourworldofpixels.com/piano/*
  9. // @match http://www.multiplayerpiano.com/script.js
  10. // ==/UserScript==
  11.  
  12. /*
  13. You can change in MPP.client.sendArray([{m: "userset",set: {name: "Your name here"}}]); a "Your name here" to your
  14. */
  15. var adminarray=[];
  16. var onoff=true;
  17. var a;
  18. var b;
  19. var input;
  20.  
  21. function sendChat(msg) { //midilol
  22. MPP.chat.send(msg);
  23. }
  24. MPP.client.on("a", function (msg) {
  25. a = msg.a.split(' ');
  26. b = a[0];
  27. input = msg.a.substring(b.length).trim(); // <--- for if I make more commands :D
  28. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id==MPP.client.getOwnParticipant()._id)){
  29. if (msg.a.toLowerCase()=="/on")
  30. {
  31. onoff=true;
  32. MPP.chat.send("Commands turned on: ("+onoff+")");
  33. }
  34. else
  35. {
  36. if (msg.a.toLowerCase()=="/off")
  37. {
  38. onoff=false;
  39. MPP.chat.send("Commands turned off: ("+onoff+")");
  40. }}}
  41.  
  42. if (onoff===true){
  43. /*
  44. MPP.client.on('participant added', pp => { MPP.chat.send( 'User ' + pp.name + ' joined to this room, use /help'); });
  45. */
  46.  
  47.  
  48.  
  49. /* adminarray.push("Any user id"); */
  50.  
  51. /* remove=adminarray.indexOf("Id where"); adminarray.splice(remove,1); */
  52.  
  53.  
  54.  
  55. 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));}}
  56.  
  57.  
  58.  
  59. //commands
  60.  
  61. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id==MPP.client.getOwnParticipant()._id)){
  62. if (b == "/waveMIDI") {
  63. MPP.client.sendArray([{m: "userset",set: {name: "/waveMIDI"}}]);
  64. sendChat("Reading MIDI effect:Name:/waveMIDI");
  65. MPP.client.emit("notification", { title: "lol", html: "" });
  66. t=0; Object.keys(MPP.piano.keys).forEach(function(key) {setTimeout(function () {MPP.press(key,1);}, t++ * 70);});
  67. t=0; Object.keys(MPP.piano.keys).forEach(function(key) {setTimeout(function () {MPP.press(key,1);}, t++ * 65);});
  68. t=0; Object.keys(MPP.piano.keys).forEach(function(key) {setTimeout(function () {MPP.press(key,1);}, t++ * 60);});
  69. t=0; Object.keys(MPP.piano.keys).forEach(function(key) {setTimeout(function () {MPP.press(key,1);}, t++ * 55);});
  70. t=0; Object.keys(MPP.piano.keys).forEach(function(key) {setTimeout(function () {MPP.press(key,1);}, t++ * 50);});
  71. t=0; Object.keys(MPP.piano.keys).forEach(function(key) {setTimeout(function () {MPP.press(key,1);}, t++ * 70);});
  72. t=0; Object.keys(MPP.piano.keys).forEach(function(key) {setTimeout(function () {MPP.press(key,1);}, t++ * 65);});
  73. t=0; Object.keys(MPP.piano.keys).forEach(function(key) {setTimeout(function () {MPP.press(key,1);}, t++ * 60);});
  74. t=0; Object.keys(MPP.piano.keys).forEach(function(key) {setTimeout(function () {MPP.press(key,1);}, t++ * 55);});
  75. t=0; Object.keys(MPP.piano.keys).forEach(function(key) {setTimeout(function () {MPP.press(key,1);}, t++ * 50);});
  76. }
  77. }
  78.  
  79. if (b == "/h") {
  80. MPP.chat.send("Commands: /help (/h), /returnadminnickname, /about, /version, /versions, /myfavoriteNMPBmusiclist, /eatfood, /drink.");
  81. MPP.chat.send("F̲i̲s̲h̲i̲n̲g̲: /fish, /eat");
  82. }
  83.  
  84.  
  85. if (b == "/help") {
  86. MPP.chat.send("Commands: /help (/h), /returnadminnickname, /about, /version, /versions, /myfavoriteNMPBmusiclist, /eatfood, /drink.");
  87. MPP.chat.send("F̲i̲s̲h̲i̲n̲g̲: /fish, /eat");
  88. }
  89.  
  90. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id==MPP.client.getOwnParticipant()._id)){
  91. if (b == "/setroom") {
  92. 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);
  93. MPP.client.setChannel(msg.a.substring(8).trim());
  94. }
  95. }
  96.  
  97. /* msg.a.substring(3).trim() */
  98.  
  99.  
  100.  
  101. if (b == "/eatfood") {
  102. MPP.chat.send("Our dear friend " + msg.p.name + " eat a " + msg.a.substring(8).trim());
  103. }
  104.  
  105.  
  106. if (b == "/drink") {
  107. MPP.chat.send("Our dear friend " + msg.p.name + " drink a " + msg.a.substring(6).trim());
  108. }
  109.  
  110.  
  111. if (b == "/myfavoriteNMPBmusic_0") {
  112. MPP.chat.send("/p 824");
  113. }
  114.  
  115. if (b == "/myfavoriteNMPBmusic_1") {
  116. MPP.chat.send("/p 2245");
  117. }
  118.  
  119. if (b == "/myfavoriteNMPBmusic_2") {
  120. MPP.chat.send("/p 3203");
  121. }
  122.  
  123. if (b == "/myfavoriteNMPBmusic_3") {
  124. MPP.chat.send("/p 110");
  125. MPP.chat.send("/tempo 50");
  126. }
  127.  
  128. if (b == "/myfavoriteNMPBmusic_4") {
  129. MPP.chat.send("/p 8984");
  130. }
  131.  
  132. if (b == "/myfavoriteNMPBmusic_5") {
  133. MPP.chat.send("/p 9271");
  134. }
  135.  
  136. if (b == "/myfavoriteNMPBmusiclist") {
  137. MPP.chat.send("Total: 6");
  138. MPP.chat.send("Tracks here: /myfavoriteNMPBmusic_0, /myfavoriteNMPBmusic_1, /myfavoriteNMPBmusic_2, /myfavoriteNMPBmusic_3, /myfavoriteNMPBmusic_4, /myfavoriteNMPBmusic_5.");
  139. }
  140.  
  141.  
  142. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id==MPP.client.getOwnParticipant()._id)){
  143. if (b == "/h") {
  144. MPP.chat.send("Admin Commands: /js, /kickban, /renameadminnickname, /on, /off, /waveMIDI, /setroom, /pianohide_on, /pianohide_off.");
  145. }
  146. }
  147.  
  148. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id==MPP.client.getOwnParticipant()._id)){
  149. if (b == "/help") {
  150. MPP.chat.send("Admin Commands: /js, /kickban, /renameadminnickname, /on, /off, /waveMIDI, /setroom, /pianohide_on, /pianohide_off.");
  151. }
  152. }
  153.  
  154. if (b == "/eat") {
  155. MPP.chat.send("You ate fish");
  156. }
  157.  
  158. if (b == "/about") {
  159. MPP.chat.send("Author:LGPvS,Pastebin:http://pastebin.com/u/LGPvS");
  160. }
  161.  
  162. if (b == "/version") {
  163. MPP.chat.send("Version:0.4.3");
  164. }
  165.  
  166. if (b == "/versions") {
  167. 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");
  168. }
  169.  
  170.  
  171.  
  172.  
  173.  
  174. if (b == "/returnadminnickname") {
  175. MPP.client.sendArray([{m: "userset",set: {name: "Your name here"}}]);
  176. }
  177.  
  178. 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.");}}
  179.  
  180. else if (b == "/gochcn") {
  181. MPP.client.setChannel("channel name");
  182. }
  183.  
  184. 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]); }
  185.  
  186. //easter eggs
  187.  
  188. gSeeOwnCursor = (window.location.hash && window.location.hash.match(/^(?:#.+)*#cursor(?:#.+)*$/i));
  189.  
  190. //changing elements
  191.  
  192. $('#more-button').css ('background', 'url(http://i.imgur.com/ADG2hzy.jpg)');
  193.  
  194. $('#crown').css ('background', 'url(http://emoji.ameba.jp/img/user/ha/hakka17/949650.gif)');
  195.  
  196. $('#inclinations').css ('background', 'url(https://pic.rutube.ru/video/f0/db/f0db598f8058ff6e0ab15f7821807906.jpg?size=l)');
  197.  
  198. //command /hidepiano
  199.  
  200. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id==MPP.client.getOwnParticipant()._id)){
  201. if (b == "/hidepiano_off") {
  202. $('#piano').fadeIn();
  203.  
  204. }
  205. }
  206.  
  207. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id==MPP.client.getOwnParticipant()._id)){
  208. if (b == "/hidepiano_on") {
  209. $('#piano').fadeOut();
  210. MPP.chat.send("Piano hide is enabled (for bot owner only)");
  211. }
  212. }
  213.  
  214. 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] }}]); }}
  215.  
  216.  
  217.  
  218. }/*onoff end*/
  219. });/*msg.a. response end*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement