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, /!!!, /123, /abc, /mppsite.")
  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, /!!!, /123, /abc, /mppsite.")
  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. Link to the bot ---> . If you need Tampermonkey to install this bot.")
  47. }
  48. if (cmd == "/ab") {
  49. MPP.chat.send("Bot created on JavaScript. Made by COdER. Link to the bot ---> . If you need Tampermonkey to install this bot.")
  50. }
  51. if (cmd == "/versions") {
  52. MPP.chat.send("Versions: 0.1")
  53. }
  54. if (cmd == "/vers") {
  55. MPP.chat.send("Versions: 0.1")
  56. }
  57. if (cmd == "/codelangauges") {
  58. MPP.chat.send("Langauges: C# • C++ • CSS • HTML • JSON • Java • JavaScript - used • Phyton.")
  59. }
  60. if (cmd == "/cl") {
  61. MPP.chat.send("Langauges: C# • C++ • CSS • HTML • JSON • Java • JavaScript - used • Phyton.")
  62. }
  63. if (cmd == "/check") {
  64. MPP.chat.send("DataBase checked room name: " + MPP.client.desiredChannelId + " and _id's on room: " + MPP.client.ppl)
  65. }
  66. if (cmd == "/ch") {
  67. MPP.chat.send("DataBase checked room name: " + MPP.client.desiredChannelId + " • and _id's on room: " + MPP.client.ppl)
  68. }
  69. if (cmd == "/alfa") {
  70. MPP.chat.send("Lapis • Hustandant • COdER • AutoPlayer • Bro_67 • Hri7566.")
  71. }
  72. if (cmd == "/af") {
  73. MPP.chat.send("Lapis • Hustandant • COdER • AutoPlayer • Bro_67 • Hri7566.")
  74. }
  75. if (cmd == "/info") {
  76. MPP.chat.send("Hi, " + msg.p.name + "! Enter /help to list commands!")
  77. }
  78. if (cmd == "/if") {
  79. MPP.chat.send("Hi, " + msg.p.name + "! Enter /help to list commands!")
  80. }
  81. if (cmd == "/who") {
  82. MPP.chat.send("Name: " + msg.p.name + " | _id: " + msg.p.id + " | Color: " + msg.p.color)
  83. }
  84. if (cmd == "/!!!") {
  85. MPP.chat.send("!@#$%^&*()")
  86. }
  87. if (cmd == "/123") {
  88. MPP.chat.send("1 2 3 4 5 6 7 8 9 0")
  89. }
  90. if (cmd == "/abc") {
  91. MPP.chat.send("A B C D E F G H I J K L M N O P Q R S T U V W X Y Z")
  92. }
  93. if (cmd == "/mppsite") {
  94. MPP.chat.send("Check Hustandants site about MPP! Site: https://mpphust.ga/")
  95. }
  96. if (cmd == "/ms") {
  97. MPP.chat.send("Check Hustandants site about MPP! Site: https://mpphust.ga/")
  98. }
  99. // Admin commands.
  100. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  101. if (cmd == "/name") {
  102. MPP.chat.send("Name commands: /changename, /changecolor, /name1, /name2.")
  103. }
  104. }
  105. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  106. if (cmd == "/ban") {
  107. MPP.client.sendArray([{m: 'kickban', _id: msg.a.substring(5).trim(), ms: 600000}])
  108. MPP.chat.send("Banned.")
  109. }
  110. }
  111. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  112. if (cmd == "/unban") {
  113. MPP.client.sendArray([{m: 'unban', _id: msg.a.substring(7).trim()}])
  114. MPP.chat.send("Unbanned.")
  115. }
  116. }
  117. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  118. if (cmd == "/ub") {
  119. MPP.client.sendArray([{m: 'unban', _id: msg.a.substring(3).trim()}])
  120. MPP.chat.send("Unbanned.")
  121. }
  122. }
  123. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  124. if (cmd == "/rc") {
  125. var color12 = "#000000"; // This _id color.
  126. MPP.client.sendArray([{m: "chset", set: {
  127. color: color12,
  128. color2: color12
  129. }
  130. }])
  131. MPP.chat.send("Seted room color: #000000 (inner) • #000000 (outer).")
  132. }
  133. }
  134. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  135. if (cmd == "/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. MPP.chat.send("Spam...");
  196. MPP.chat.send("Spam...");
  197.  
  198. }
  199. }
  200. // Name commands.
  201. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  202. if (cmd == "/changename") {
  203. MPP.client.sendArray([{m: "userset", set: {
  204. name: msg.a.substring(12).trim()
  205. }
  206. }])
  207. MPP.chat.send("Your name changed to: " + msg.a.substring(12).trim())
  208. }
  209. }
  210. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  211. if (cmd == "/cn") {
  212. MPP.client.sendArray([{m: "userset", set: {
  213. name: msg.a.substring(3).trim()
  214. }
  215. }])
  216. MPP.chat.send("Your name changed to: " + msg.a.substring(3).trim())
  217. }
  218. }
  219. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  220. if (cmd == "/changecolor") {
  221. MPP.client.sendArray([{m: "userset", set: {
  222. color: msg.a.substring(13).trim()
  223. }
  224. }])
  225. MPP.chat.send("You color_name changed to: " + msg.a.substring(13).trim())
  226. }
  227. }
  228. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  229. if (cmd == "/cc") {
  230. MPP.client.sendArray([{m: "userset", set: {
  231. color: msg.a.substring(3).trim()
  232. }
  233. }])
  234. MPP.chat.send("You color_name changed to: " + msg.a.substring(3).trim())
  235. }
  236. }
  237. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  238. if (cmd == "/name1") {
  239. MPP.client.sendArray([{m: "userset", set: {
  240. name: "ADMIN BOT Source Bot. [ /info ]",
  241. color: "#ff5c5c"
  242. }
  243. }])
  244. }
  245. }
  246. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  247. if (cmd == "/name2") {
  248. MPP.client.sendArray([{m: "userset", set: {
  249. name: "BOT Source [ /info ]",
  250. color: "#5286ff"
  251. }
  252. }])
  253. }
  254. }
  255. // Buy... commands.
  256. if (cmd == "/buy") {
  257. MPP.chat.send(msg.p.name + " You buyed: " + msg.a.substring(5).trim() + ". " + words[random])
  258. }
  259. if (cmd == "/eat") {
  260. MPP.chat.send(msg.p.name + " You eating: " + msg.a.substring(5).trim() + ".")
  261. }
  262. if (cmd == "/use") {
  263. MPP.chat.send(msg.p.name + " You used: " + msg.a.substring(5).trim() + "].")
  264. }
  265. if (cmd == "/role") {
  266. MPP.chat.send("Your role is: " + "[" + msg.a.substring(6).trim() + "].")
  267. }
  268. }) /* msg.a response END */;
  269.  
  270. /*
  271. MPP.client.on('participant added', pp => {
  272. MPP.chat.send("Welcome " + pp.name + " to the " + MPP.client.desiredChannelId + "! Type '/info' to info this bot.")
  273. }) /* added response end /*;
  274. */
  275.  
  276. console.log("Bot Source: Online!");