Advertisement
LGPvS

Super Mario Bros bot

May 2nd, 2017
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.71 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Super Mario Bros bot
  3. // @namespace http://www.multiplayerpiano.com/
  4. // @version 0.1
  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. // @match http://www.ourworldofpixels.com/piano/
  11. // ==/UserScript==
  12.  
  13. /*
  14. You can change in MPP.client.sendArray([{m: "userset",set: {name: "Your name here"}}]); a "Your name here" to your
  15. */
  16. var highscoresLVLname = { };
  17. var bshop = [];
  18. bshop.bbuying = [0, 1];
  19. bshop.bbuying.id = {0: "questionbox", 1:"1upmushroom"};
  20. bshop.bbuying._id = {0: "qubox", 1:"mush2"};
  21. bshop.bbuying.name = {0: "the question box", 1:"1up mushroom"};
  22. var adminsusers = [];
  23. var buyqubox = [];
  24. var buyedmush2 = [];
  25. var buyedqubox = [];
  26. var qublock = 0;
  27. var coinsqublock = [2, 5, 8, 7, 15, 12];
  28. var highscoresLVL = { };
  29. var highscores114 = { };
  30. var lives113 = { };
  31. var coins111 = { };
  32. var a;
  33. var b;
  34. var input;
  35. function info(search) {
  36.  
  37. var array = [];
  38. for (var i in MPP.client.ppl) {
  39. if (MPP.client.ppl[i].name.indexOf(search) !== -1) {
  40. array.push(MPP.client.ppl[i]);
  41. }
  42. }
  43. return array;
  44. }
  45.  
  46. //In case of multiple results
  47. Array.prototype.random = function() {
  48. return this[Math.random() * this.length | 0];
  49. };
  50. person = info("search").random();
  51.  
  52.  
  53.  
  54.  
  55. function sendChat(msg) { //midilol
  56. MPP.chat.send(msg);
  57. }
  58.  
  59.  
  60. MPP.client.on("a", function (msg) {
  61. a = msg.a.split(' ');
  62. b = a[0];
  63. input = msg.a.substring(b.length).trim(); // <--- for if I make more commands :D
  64. if (highscores114[msg.p._id] == null) highscores114[msg.p._id] = 0;
  65. if (coins111[msg.p._id] == null) coins111[msg.p._id] = 0;
  66. if (lives113[msg.p._id] == null) lives113[msg.p._id] = 5;
  67. if (highscoresLVL[msg.p._id] == null) highscoresLVL[msg.p._id] = 0;
  68. if (highscoresLVLname[msg.p._id] == null) highscoresLVLname[msg.p._id] = "Toad";
  69. var msgArr = msg.a.split(' ');
  70. if ((adminsusers.indexOf(msg.p._id) > - 1) || (msg.p._id==MPP.client.getOwnParticipant()._id)){ if (msgArr[0] == '/js' ) { try { MPP.chat.send("> "+ input);MPP.chat.send('< '+JSON.stringify(eval(msg.a.substr(msgArr[0].length).trim()))); } catch (error) { MPP.chat.send('ⓧ '+error); } } }
  71.  
  72. //if ((buyedqubox.indexOf(msg.p._id) > - 1) || (msg.p._id==MPP.client.getOwnParticipant()._id)){
  73. if (b == "/buy") { if (!input) {MPP.chat.send("Use /buy (Any shop item bID) to buy any shop item. Shop items bID: questionbox, 1upmushroom"); } if ((buyedqubox.indexOf(msg.p._id) > - 1) || (msg.p._id==MPP.client.getOwnParticipant()._id)){ if (input=="questionbox"){qublock = coinsqublock.random(); coins111[msg.p._id] += qublock; remove=buyedqubox.indexOf(msg.p._id); buyedqubox.splice(remove,1); highscores114[msg.p._id] -= 10; MPP.chat.send(msg.p.name+" buyed a the question box and used it. You get a "+qublock+" coins."); }}if ((buyedmush2.indexOf(msg.p._id) > - 1) || (msg.p._id==MPP.client.getOwnParticipant()._id)){if (input=="1upmushroom"){lives113[msg.p._id] +=1; remove=buyedmush2.indexOf(msg.p._id); buyedmush2.splice(remove,1); coins111[msg.p._id] -= 100; MPP.chat.send(msg.p.name+" buyed a 1up mushroom and used it. You get a 1 live.");}}}
  74. //}
  75. if (b == "/shop") { MPP.chat.send("Shop: the question box with random coins. Price: 10 highscores, 1up mushroom, that adds for your a 1 live. Price: 100 coins. | Use /buy (Any shop item bID) to buy any shop item. Shop items bID: questionbox, 1upmushroom."); }
  76. if (b == "/help") { MPP.chat.send("Super Mario Bros Commands: /getcoin, /mycoins, /shop, /buy, /gethighscore, /myhighscores, /mylives, /myLVLstatus."); }
  77. if (b == "/getcoin") { MPP.chat.send(msg.p.name+" get 1 coin!"); coins111[msg.p._id] += 1; }
  78. if (b == "/gethighscore") { MPP.chat.send(msg.p.name+" get 1 highscore!"); highscores114[msg.p._id] += 1; }
  79. if (b == "/mycoins") { MPP.chat.send(msg.p.name+" have a " + coins111[msg.p._id] + " coins"); }
  80. if (b == "/myhighscores") { MPP.chat.send(msg.p.name+" have a " + highscores114[msg.p._id] + " highscores"); }
  81. if (b == "/mylives") { MPP.chat.send(msg.p.name+" have a " + lives113[msg.p._id] + " lives"); }
  82. if (b == "/myLVLstatus") { MPP.chat.send(msg.p.name+": LVL " + highscoresLVL[msg.p._id] +" ("+highscoresLVLname[msg.p._id]+")"); }
  83. /*if ((buyedqubox.indexOf(msg.p._id) > - 1) || (msg.p._id==MPP.client.getOwnParticipant()._id)){
  84. if (b == "/getcoinsfromquestionbox") { qublock = coinsqublock.random(); coins111[msg.p._id] += qublock; MPP.chat.send("You get "+qublock+" coins from the question box!");}
  85. }*/
  86.  
  87. if (highscores114[msg.p._id] == 10 || highscores114[msg.p._id] > 10) {buyedqubox.push(msg.p._id); console.log("mmm");}
  88. if (coins111[msg.p._id] == 100 || coins111[msg.p._id]> 100) {buyedmush2.push(msg.p._id); console.log("mmm");}
  89. if (highscores114[msg.p._id] == 30 || highscores114[msg.p._id]> 30) { highscoresLVL[msg.p._id] = 1; highscoresLVLname[msg.p._id] = "Yoshi";}
  90. if (highscores114[msg.p._id] == 100 || highscores114[msg.p._id]> 100) { highscoresLVL[msg.p._id] = 2; highscoresLVLname[msg.p._id] = "Koopa Troopa";}
  91. if (highscores114[msg.p._id] == 300 || highscores114[msg.p._id]> 300) { highscoresLVL[msg.p._id] = 3; highscoresLVLname[msg.p._id] = "Mario";}
  92. if (highscores114[msg.p._id] == 1000 || highscores114[msg.p._id]> 1000) { highscoresLVL[msg.p._id] = 4; highscoresLVLname[msg.p._id] = "Super Mario";}
  93. if (highscores114[msg.p._id] == 1337 || highscores114[msg.p._id]> 1337) { highscoresLVL[msg.p._id] = 5; highscoresLVLname[msg.p._id] = "Крутой Пацан";}
  94. if (highscores114[msg.p._id] == 6000 || highscores114[msg.p._id]> 6000) { highscoresLVL[msg.p._id] = 6; highscoresLVLname[msg.p._id] = "Bowser";}
  95. if (highscores114[msg.p._id] == 6900 || highscores114[msg.p._id]> 6900) { highscoresLVL[msg.p._id] = 7; highscoresLVLname[msg.p._id] = "Flower Mario";}
  96. if (highscores114[msg.p._id] == 10000 || highscores114[msg.p._id]> 10000) { highscoresLVL[msg.p._id] = 8; highscoresLVLname[msg.p._id] = "Very Big Mario";}
  97. if (highscores114[msg.p._id] == 54545 || highscores114[msg.p._id]> 54545) { highscoresLVL[msg.p._id] = 9; highscoresLVLname[msg.p._id] = "Star Mario";}
  98. if (highscores114[msg.p._id] == 1000000 || highscores114[msg.p._id]> 1000000) { highscoresLVL[msg.p._id] = 10; highscoresLVLname[msg.p._id] = "Very Big Star Mario";}
  99. if (highscores114[msg.p._id] == Infinity || highscores114[msg.p._id]> Infinity) { highscoresLVL[msg.p._id] = Infinity; highscoresLVLname[msg.p._id] = "Pro"; }
  100. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement