Source Bot

MINI Bot to MPP

  1. // ==UserScript==
  2. // @name Source Bot
  3. // @namespace https://greasyfork.org/
  4. // @version 0.1
  5. // @description MINI Bot to MPP
  6. // @author COdER#3389
  7. // @icon https://mpphust.ga/assets/icon%20(48).png
  8. // @include *://multiplayerpiano.com/*
  9. // @include *://mppclone.com/*
  10. // @include *://mpp.terrium.net/*
  11. // @include *://piano.ourworldofpixels.com/*
  12. // @grant none
  13. // ==/UserScript==
  14.  
  15. // Variables.
  16. var words = ['Good!', 'Wow!', 'Thanks!']; var random = Math.floor(Math.random() * words.length); // Random words about say on command - "/buy".
  17. var error = "Error"; // Error bot command.
  18. var adminarray = []; // Function ADMIN command.
  19.  
  20. // Bot client.
  21. MPP.client.on("a", function(msg) {
  22. var asgr = msg.a.split(' ');
  23. var cmd = asgr[0];
  24. var input = msg.a.substring(cmd.legth).trim();
  25.  
  26. // Commands.
  27. if (cmd == "/help") {
  28. MPP.chat.send("Info: /help (command), /about, /versions, /codelangauges, /check, /alfa, /info, /who.")
  29. MPP.chat.send("Fun: /buy, /eat, /use, /role, /pp, /à¶ž, /123, /mppsites.")
  30. }
  31. if (cmd == "/h") {
  32. MPP.chat.send("Info: /help (command), /about, /versions, /codelangauges, /check, /alfa, /info, /who.")
  33. MPP.chat.send("Fun: /buy, /eat, /use, /role, /pp, /à¶ž, /abc, /mppsites.")
  34. }
  35. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin commmand.
  36. if (cmd == "/help") {
  37. MPP.chat.send("Admin commands: /name (command), /ban, /unban, /rc, /spam.")
  38. }
  39. }
  40. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  41. if (cmd == "/h") {
  42. MPP.chat.send("Admin commands: /name (command), /ban, /unban, /rc, /spam.")
  43. }
  44. }
  45. if (cmd == "/about") {
  46. MPP.chat.send("Bot created on JavaScript. Made by COdEr, / Bheese.")
  47. }
  48. if (cmd == "/ab") {
  49. MPP.chat.send("Bot created on JavaScript. Made by COdER, / Bheese."
  50. ); MPP.chat.send("Versions: 0.7")
  51. }
  52. if (cmd == "/vers") {
  53. MPP.chat.send("Versions: 0.7")
  54. }
  55. if (cmd == "/codelangauges") {
  56. MPP.chat.send("Langauges: C# • C++ • CSS • HTML • JSON • Java • JavaScript - used • Phyton.")
  57. }
  58. if (cmd == "/cl") {
  59. MPP.chat.send("Langauges: C# • C++ • CSS • HTML • JSON • Java • JavaScript - used • Phyton.")
  60. }
  61. if (cmd == "/check") {
  62. MPP.chat.send("DataBase checked room name: " + MPP.client.desiredChannelId + " and _id's on room: " + MPP.client.ppl)
  63. }
  64. if (cmd == "/ch") {
  65. MPP.chat.send("DataBase checked room name: " + MPP.client.desiredChannelId + " • and _id's on room: " + MPP.client.ppl)
  66. }
  67. if (cmd == "/alfa") {
  68. MPP.chat.send("Lapis • Hustandant • COdER • AutoPlayer • Bro_67 • Hri7566.")
  69. }
  70. if (cmd == "/af") {
  71. MPP.chat.send("Lapis • Hustandant • COdER • AutoPlayer • Bro_67 • Hri7566.")
  72. }
  73. if (cmd == "/info") {
  74. MPP.chat.send("Hi, " + msg.p.name + "! Enter /help to list commands!")
  75. }
  76. if (cmd == "/if") {
  77. MPP.chat.send("Hi, " + msg.p.name + "! Enter /help to list commands!")
  78. }
  79. if (cmd == "/who") {
  80. MPP.chat.send("Name: " + msg.p.name + " | _id: " + msg.p.id + " | Color: " + msg.p.color)
  81. }
  82. if (cmd == "/pp") {
  83. MPP.chat.send("pp")
  84. }
  85. if (cmd == "/à¶ž") {
  86. MPP.chat.send("à¶ž")
  87. }
  88. if (cmd == "/123") {
  89. MPP.chat.send("is stinky")
  90. }
  91. if (cmd == "/mppsites") {
  92. MPP.chat.send("https://mppclone.com/, https://www.multiplayerpiano.org/, https://multiplayerpiano.com/ https://piano.ourworldofpixels.com https://mpp.hri7566.info/")
  93. }
  94. if (cmd == "/ms") {
  95. MPP.chat.send("Check Hustandants site about MPP! Site: https://mpphust.ga/")
  96. }
  97. // Admin commands.
  98. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  99. if (cmd == "/name") {
  100. MPP.chat.send("Name commands: /changename, /changecolor, /name1, /name2.")
  101. }
  102. }
  103. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  104. if (cmd == "/ban") {
  105. MPP.client.sendArray([{m: 'kickban', _id: msg.a.substring(5).trim(), ms: 600000}])
  106. MPP.chat.send("Banned.")
  107. }
  108. }
  109. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  110. if (cmd == "/unban") {
  111. MPP.client.sendArray([{m: 'unban', _id: msg.a.substring(7).trim()}])
  112. MPP.chat.send("Unbanned.")
  113. }
  114. }
  115. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  116. if (cmd == "/ub") {
  117. MPP.client.sendArray([{m: 'unban', _id: msg.a.substring(3).trim()}])
  118. MPP.chat.send("Unbanned.")
  119. }
  120. }
  121. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  122. if (cmd == "/rc") {
  123. var color12 = "#000000"; // This _id color.
  124. MPP.client.sendArray([{m: "chset", set: {
  125. color: color12,
  126. color2: color12
  127. }
  128. }])
  129. MPP.chat.send("Seted room color: #000000 (inner) • #000000 (outer).")
  130. }
  131. }
  132. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  133. if (cmd == "/spam") {
  134. MPP.chat.send("Spam...");
  135. MPP.chat.send("Spam...");
  136. MPP.chat.send("Spam...");
  137. MPP.chat.send("Spam...");
  138. MPP.chat.send("Spam...");
  139. MPP.chat.send("Spam...");
  140. MPP.chat.send("Spam...");
  141. MPP.chat.send("Spam...");
  142. MPP.chat.send("Spam...");
  143. MPP.chat.send("Spam...");
  144. MPP.chat.send("Spam...");
  145. MPP.chat.send("Spam...");
  146. MPP.chat.send("Spam...");
  147. MPP.chat.send("Spam...");
  148. MPP.chat.send("Spam...");
  149. MPP.chat.send("Spam...");
  150. MPP.chat.send("Spam...");
  151. MPP.chat.send("Spam...");
  152. MPP.chat.send("Spam...");
  153. MPP.chat.send("Spam...");
  154. MPP.chat.send("Spam...");
  155. MPP.chat.send("Spam...");
  156. MPP.chat.send("Spam...");
  157. MPP.chat.send("Spam...");
  158. MPP.chat.send("Spam...");
  159. MPP.chat.send("Spam...");
  160. MPP.chat.send("Spam...");
  161. MPP.chat.send("Spam...");
  162. MPP.chat.send("Spam...");
  163. MPP.chat.send("Spam...");
  164. MPP.chat.send("Spam...");
  165. MPP.chat.send("Spam...");
  166. MPP.chat.send("Spam...");
  167. MPP.chat.send("Spam...");
  168. MPP.chat.send("Spam...");
  169. MPP.chat.send("Spam...");
  170. MPP.chat.send("Spam...");
  171. MPP.chat.send("Spam...");
  172. MPP.chat.send("Spam...");
  173. MPP.chat.send("Spam...");
  174. MPP.chat.send("Spam...");
  175. MPP.chat.send("Spam...");
  176. MPP.chat.send("Spam...");
  177. MPP.chat.send("Spam...");
  178. MPP.chat.send("Spam...");
  179. MPP.chat.send("Spam...");
  180. MPP.chat.send("Spam...");
  181. MPP.chat.send("Spam...");
  182. MPP.chat.send("Spam...");
  183. MPP.chat.send("Spam...");
  184. MPP.chat.send("Spam...");
  185. MPP.chat.send("Spam...");
  186. MPP.chat.send("Spam...");
  187. MPP.chat.send("Spam...");
  188. MPP.chat.send("Spam...");
  189. MPP.chat.send("Spam...");
  190. MPP.chat.send("Spam...");
  191. MPP.chat.send("Spam...");
  192. MPP.chat.send("Spam...");
  193. MPP.chat.send("Spam...");
  194. MPP.chat.send("Spam...");
  195.  
  196. }
  197. }
  198. // Name commands.
  199. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  200. if (cmd == "/changename") {
  201. MPP.client.sendArray([{m: "userset", set: {
  202. name: msg.a.substring(12).trim()
  203. }
  204. }])
  205. MPP.chat.send("Your name changed to: " + msg.a.substring(12).trim())
  206. }
  207. }
  208. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  209. if (cmd == "/cn") {
  210. MPP.client.sendArray([{m: "userset", set: {
  211. name: msg.a.substring(3).trim()
  212. }
  213. }])
  214. MPP.chat.send("Your name changed to: " + msg.a.substring(3).trim())
  215. }
  216. }
  217. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  218. if (cmd == "/changecolor") {
  219. MPP.client.sendArray([{m: "userset", set: {
  220. color: msg.a.substring(13).trim()
  221. }
  222. }])
  223. MPP.chat.send("You color_name changed to: " + msg.a.substring(13).trim())
  224. }
  225. }
  226. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  227. if (cmd == "/cc") {
  228. MPP.client.sendArray([{m: "userset", set: {
  229. color: msg.a.substring(3).trim()
  230. }
  231. }])
  232. MPP.chat.send("You color_name changed to: " + msg.a.substring(3).trim())
  233. }
  234. }
  235. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  236. if (cmd == "/name1") {
  237. MPP.client.sendArray([{m: "userset", set: {
  238. name: "BheeseMPP [NSG]",
  239. color: "#ff5c5c"
  240. }
  241. }])
  242. }
  243. }
  244. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  245. if (cmd == "/name2") {
  246. MPP.client.sendArray([{m: "userset", set: {
  247. name: "BheeseBot [NSG]",
  248. color: "#5286ff"
  249. }
  250. }])
  251. }
  252. }
  253. // Buy... commands.
  254. if (cmd == "/buy") {
  255. MPP.chat.send(msg.p.name + " You buyed: " + msg.a.substring(5).trim() + ". " + words[random])
  256. }
  257. if (cmd == "/eat") {
  258. MPP.chat.send(msg.p.name + " You eating: " + msg.a.substring(5).trim() + ".")
  259. }
  260. if (cmd == "/use") {
  261. MPP.chat.send(msg.p.name + " You used: " + msg.a.substring(5).trim() + "].")
  262. }
  263. if (cmd == "/role") {
  264. MPP.chat.send("Your role is: " + "[" + msg.a.substring(6).trim() + "].")
  265. }
  266. }) /* msg.a response END */;
  267.  
  268. /*
  269. MPP.client.on('participant added', pp => {
  270. MPP.chat.send("Welcome " + pp.name + " to the " + MPP.client.desiredChannelId + "! Type '/info' to info this bot.")
  271. }) /* added response end /*;
  272. */
  273.  
  274. console.log("Bot Source: Online!");