Ghost Boy Bot

Bot to MPP

  1. // ==UserScript==
  2. // @name Ghost Boy Bot
  3. // @namespace https://greasyfork.org/
  4. // @version 2
  5. // @description Bot to MPP
  6. // @author Ghosty
  7. // @icon https://png.pngtree.com/png-vector/20220611/ourmid/pngtree-chatbot-icon-chat-bot-robot-png-image_4841963.png
  8. // @include *://mppclone.com/*
  9. // @include *://multiplayerpiano.com/*
  10. // @include *://piano.ourworldofpixels.com/*
  11. // @grant none
  12. // @license MIT
  13.  
  14.  
  15. // ==/UserScript==
  16.  
  17. var mass = 1;
  18. var gravity = 10;
  19. var friction = 1;
  20. var pos = {x: 50, y: 50};
  21. var pos2 = {x: 50, y: 50};
  22. var acc = {x: 0, y: 0};
  23. var vel = {x: 0, y: 0};
  24. var follower = "";
  25. var followPos = {x: 50, y: 50};
  26. MPP.client.on("m", function(msg) {
  27. var part = MPP.client.findParticipantById(msg.id);
  28. if (part._id == MPP.client.user._id) return;
  29. followPos.x = +msg.x;
  30. followPos.y = +msg.y;
  31. });
  32. var updateInt = setInterval(function() {
  33. pos2.x = followPos.x;
  34. pos2.y = followPos.y;
  35. acc.x = ((pos2.x-pos.x) - (friction*vel.x))/mass;
  36. acc.y = ((pos2.y-pos.y) - (friction*vel.y) + gravity)/mass;
  37. vel.x += acc.x;
  38. vel.y += acc.y;
  39. pos.x += vel.x;
  40. pos.y += vel.y;
  41. MPP.client.sendArray([{m: "m", x: MPP.client.getOwnParticipant().x = pos.x, y: MPP.client.getOwnParticipant().y = pos.y}]);
  42. }, 15);
  43. // Script constants
  44. const PRE_MSG = "MPP BOT" + " (v" + "0.5" + "): ";
  45.  
  46. // Connected.
  47. window.addEventListener('load', (event) => {
  48. //
  49.  
  50. const OnOff = "113"; //F2
  51. const FirstKey = "3"; //3
  52. const SecondKey = "Tab"; //Tab
  53.  
  54. //
  55.  
  56. var notes = 0, nps = 0, fps = 0;
  57.  
  58. async function ping() {
  59. let start = Date.now();
  60. try { await fetch(`${window.location.protocol}${MPP.client.uri.slice(4)}`) }
  61. catch(err) {}
  62. return (Date.now() - start);
  63. };
  64.  
  65. function fpsCount() { fps += 1; requestAnimationFrame(fpsCount) };
  66.  
  67. requestAnimationFrame(fpsCount);
  68.  
  69. if(!localStorage.getItem("speed")) localStorage.setItem("speed", 60);
  70. var noteSpeed = localStorage.getItem("speed"); //default 60 per sec
  71.  
  72. MPP.client.on("a", function(msg) {
  73. let message = msg.a.split(" ");
  74. if(message[0] == "speed" && msg.p.id == MPP.client.participantId && !isNaN(Number(message[1]))) {
  75. noteSpeed = (Number(message[1]) > 1000) ? 1000 : (Number(message[1]) <= 0) ? 1 : Number(message[1]);
  76. localStorage.setItem("speed", noteSpeed);
  77. document.getElementById("nspd").innerText = noteSpeed;
  78. }
  79. });
  80.  
  81. MPP.client.emit("notification", {
  82. title: "Update #1 (by Ghosty)",
  83. id:"Script_notification",
  84. duration:999999,
  85. target:"#piano",
  86. html:`<p><h3><font id="f2" color="">F2</font> - show/hide notes window</h3></br></p><p><h3><font id="3d" color="">Tab+3</font> - on/off darkly window</h3></br></p><p><h4><font color="white">${noteSpeed}</font> - current speed (<span style="background-color: black"><font color="Sky Blue">to chat "speed" [min - 1 max - 1000]</font></span>)</h4></br></p><p><h5><span style="background-color: Black">Example: "speed 60"</span></h5></br></p> With The Help Of U We Can Do This <a target="_blank" href="`
  87. });
  88. console.log('%cLoaded MPP! ','color:orange; font-size:15px;');
  89. if (!localStorage.tag) {
  90. localStorage.tag = JSON.stringify({text: 'User', color: '#000000'});
  91. }
  92. if (!localStorage.knownTags) {
  93. localStorage.knownTags = '{}';
  94. }
  95. const Debug = false;
  96. const ver = '1';
  97. let tag = JSON.parse(localStorage.tag),
  98. knownTags = JSON.parse(localStorage.knownTags);
  99.  
  100. MPP.client.on('hi', () => {
  101. MPP.client.sendArray([{m: '+custom'}]);
  102. setTimeout(function() { //w
  103. updtag(tag.text, tag.color, MPP.client.getOwnParticipant()._id, tag.gradient);
  104. askForTags();
  105. }, 1500);
  106. });
  107.  
  108. const allowedGradients = ['linear-gradient', 'radial-gradient', 'repeating-radial-gradient', 'conic-gradient', 'repeating-conic-gradient'];
  109.  
  110. function updtag(text, color, _id, gradient) {
  111. if (text.length > 50) {
  112. if (Debug) console.log('Failed to update tag. Reason: text too long. _ID: ' + _id);
  113. return;
  114. }
  115. if (!document.getElementById(`namediv-${_id}`)) return;
  116. if (document.getElementById(`nametag-${_id}`) != null) {
  117. document.getElementById(`nametag-${_id}`).remove();
  118. } else if (Debug) console.log('New tag. _ID: ' + _id);
  119. knownTags[_id] = {text: text, color: color};
  120. localStorage.knownTags = JSON.stringify(knownTags);
  121. let tagDiv = document.createElement('div')
  122. tagDiv.className = 'nametag';
  123. tagDiv.id = `nametag-${_id}`;
  124. tagDiv.style['background-color'] = color;
  125. if (gradient) {
  126. if (!gradient.includes('"') && !gradient.includes(';') && !gradient.includes(':') && (gradient.split('(').length === 2 && gradient.split(')').length === 2)) {
  127. let gradientAllowed = false;
  128. allowedGradients.forEach((Gradient) => {
  129. if (gradient.startsWith(Gradient)) {
  130. if (gradientAllowed) return;
  131. else gradientAllowed = true;
  132. tagDiv.style.background = gradient;
  133. knownTags[_id].gradient = gradient;
  134. localStorage.knownTags = JSON.stringify(knownTags);
  135. }
  136. });
  137. }
  138. }
  139. tagDiv.innerText = text; // xss fix
  140. document.getElementById(`namediv-${_id}`).prepend(tagDiv);
  141. document.getElementById(`namediv-${_id}`).title = 'This is an MPPCT user.';
  142. }
  143.  
  144.  
  145. let sendTagLocked = false; //
  146. function sendTag(id) {
  147. if (sendTagLocked && !id) {
  148. if (Debug) return console.log('Called function sendTag(), but its locked');
  149. else return;
  150. };
  151. if (id) MPP.client.sendArray([{m: "custom", data: {m: "mppct", text: tag.text, color: tag.color, gradient: tag.gradient}, target: { mode: "id", id: id } }]);
  152. else MPP.client.sendArray([{m: "custom", data: {m: "mppct", text: tag.text, color: tag.color, gradient: tag.gradient}, target: { mode: "subscribed" } }]);
  153. if (Debug) console.log('Called function sendTag(), tag successfully sent');
  154. sendTagLocked = true;
  155. setTimeout(function() {
  156. sendTagLocked = false;
  157. }, 750)
  158. }
  159. function askForTags() {
  160. MPP.client.sendArray([{m: "custom", data: {m: "mppctreq"}, target: { mode: "subscribed" } }]);
  161. }
  162.  
  163. MPP.client.on('custom', (data) => {
  164. if (data.data.m == 'mppctreq') {
  165. if (data.data.text && (data.data.color || data.data.gradient)) {
  166. if (MPP.client.ppl[data.p]) {
  167. updtag(data.data.text || 'User', data.data.color || '#000000', data.p, data.data.gradient);
  168. if (Debug) console.log(`Received tag and its successfully confirmed. _ID: ${data.p}, text: ${data.data.text}, color: ${data.data.color || 'User'}, gradient: ${data.data.gradient || 'NoUserne'}`);
  169. } else if (Debug) console.warn('Received tag, but its failed to confirm. Reason: not found _id in ppl');
  170. } else if (Debug) console.warn('Received tag, but its failed to confirm. Reason: missing data.text or data.color');
  171. }
  172. if (data.data.m == 'mppctreq') {
  173. if (MPP.client.ppl[data.p] != undefined) {
  174. sendTag(data.p);
  175. if (Debug) console.log('Received tags request and its succesfully confirmed. _ID: ' + data.p);
  176. } else if (Debug) console.warn('Received tags request, but its failed to confirm. Reason: not found _id in ppl. Sender _ID: ' + data.p);
  177. }
  178. });
  179. MPP.client.on('p', (p) => {
  180. if (p._id == MPP.client.getOwnParticipant()._id) {
  181. updtag(tag.text, tag.color, MPP.client.getOwnParticipant()._id, tag.gradient);
  182. if (Debug) console.log('Got own player update, tag updated');
  183. sendTag();
  184. }
  185. });
  186. MPP.client.on('ch', (p) => {
  187. if (!p.hasOwnProperty('p')) return;
  188. askForTags();
  189. sendTag();
  190. if (Debug) console.log('Received ch event and sent tags request');
  191. });
  192.  
  193. // Tags in chat
  194. MPP.client.on('a', (msg) => {
  195. if (!knownTags[msg.p._id]) return;
  196. let aTag;
  197. if (msg.p._id == MPP.client.getOwnParticipant()._id) aTag = tag;
  198. else aTag = knownTags[msg.p._id];
  199.  
  200. if (document.getElementById(`nametext-${msg.p._id}`)) {
  201. if (document.getElementById(`nametag-${msg.p._id}`).innerText != knownTags[msg.p._id].text) {
  202. delete knownTags[msg.p._id];
  203. localStorage.knownTags = JSON.stringify(knownTags);
  204. return;
  205. }
  206. }
  207.  
  208. let chatMessage = $('.message').last()[0];
  209. let Span = document.createElement('span'); // <span style="background-color: ${aTag.color};color:#ffffff;" class="nametag">${aTag.text}</span>
  210. Span.style['background-color'] = aTag.color;
  211. if (knownTags[msg.p._id]) Span.style.background = aTag.gradient;
  212. Span.style.color = '#ffffff';
  213. Span.className = 'nametag';
  214. Span.innerText = aTag.text;
  215. chatMessage.appendChild(Span);
  216. });
  217.  
  218. MPP.client.on('c', (msg) => { //
  219. if (!msg.c) return;
  220. if (!Array.isArray(msg.c)) return;
  221. msg.c.forEach((a, i) => {
  222. if (a.m == 'dm') return;
  223. let p = a.p;
  224. if (!knownTags[p._id]) return;
  225. let aTag;
  226. if (p._id == MPP.client.getOwnParticipant()._id) aTag = tag;
  227. else aTag = knownTags[p._id];
  228.  
  229. setTimeout(function() {
  230. if (document.getElementById(`nametext-${p._id}`)) { // xd
  231. if (p._id != MPP.client.getOwnParticipant()._id) {
  232. if (document.getElementById(`nametag-${p._id}`).innerText != aTag.text) {
  233. delete knownTags[p._id];
  234. localStorage.knownTags = JSON.stringify(knownTags);
  235. return;
  236. }
  237. }
  238. }
  239. }, 2000);
  240.  
  241. let chatMessage = $('.message')[i];
  242. let Span = document.createElement('span'); // <span style="background-color: ${aTag.color};color:#ffffff;" class="nametag">${aTag.text}</span>
  243. Span.style['background-color'] = aTag.color;
  244. if (knownTags[p._id]) Span.style.background = aTag.gradient;
  245. Span.style.color = '#ffffff';
  246. Span.className = 'nametag';
  247. Span.innerText = aTag.text;
  248. chatMessage.appendChild(Span);
  249. });
  250. });
  251. const stat = document.createElement("div");
  252. stat.id = "stat_notes";
  253. stat.style.opacity = "1";
  254. stat.style.position = "fixed";
  255. stat.style["z-index"] = 150;
  256. stat.style.display = "block";
  257. stat.style.float = "right";
  258. stat.style.margin = "auto";
  259. stat.style.top = `${document.getElementById("piano").height}px`;
  260. stat.style["background-color"] = "rgba(137, 137, 137, 0.414)";
  261. stat.style["backdrop-filter"] = "blur(1px)";
  262. stat.style["font-size"] = "21px"
  263. stat.innerHTML = `Notes: <span id="notes">0</span> NPS: <span id="nps">0</span> Speed: <span id="nspd">${localStorage.getItem("speed")}</span> NQ: <span id="nquota">${MPP.noteQuota.points}</span> Ping: <span id="ping"></span> FPS: <span id="fps"></span>`;
  264. stat.style.marginLeft = `${String(document.getElementById("piano").offsetLeft + document.getElementById("piano").getElementsByTagName("canvas")[0].offsetLeft)}px`;
  265.  
  266.  
  267. const canvas = document.createElement("canvas");
  268. canvas.height = parseInt(document.getElementById("piano").style["margin-top"]);
  269. canvas.width = Math.round(MPP.piano.renderer.width - (MPP.piano.renderer.width - MPP.piano.keys.c7.rect.x2));
  270. canvas.id = "track_of_notes";
  271. canvas.style.opacity = "1";
  272. canvas.style.top = "0";
  273. canvas.style.display = "block";
  274. canvas.style.float = "right";
  275. canvas.style.position = "fixed";
  276. canvas.style.margin = "auto";
  277. canvas.style.marginLeft = `${String(document.getElementById("piano").offsetLeft + document.getElementById("piano").getElementsByTagName("canvas")[0].offsetLeft)}px`;
  278. canvas.style["z-index"] = 150;
  279.  
  280. const ctx = window.ctx = canvas.getContext("2d");
  281. const pixel = window.pixel = ctx.createImageData(document.getElementById("piano").querySelector("canvas").width,canvas.height);
  282. pixel.data.fill(0);
  283. let lastUpdate = 0, onlyevery = 4, counter = 0, prevTime = Date.now();
  284. const noteDB = {};
  285.  
  286. Object.keys(MPP.piano.keys).forEach(key => noteDB[key] = MPP.piano.keys[key].rect.x);
  287.  
  288. window.redraw = function() {
  289. if (lastUpdate <= canvas.height && counter++ % 4 == 0) {
  290. const currentTime = Date.now();
  291. const deltaTime = currentTime - prevTime;
  292.  
  293. ctx.globalCompositeOperation = "copy";
  294. ctx.drawImage(ctx.canvas, 0, -Math.ceil(deltaTime * (noteSpeed / 1000)));
  295. ctx.globalCompositeOperation = "source-over";
  296. ctx.putImageData(pixel, 0, canvas.height - 1);
  297.  
  298. prevTime = currentTime;
  299.  
  300. if (lastUpdate++ == 0) {
  301. pixel.data.fill();
  302. }
  303. }
  304. requestAnimationFrame(redraw);
  305. };
  306.  
  307. redraw();
  308. redraw(); //
  309. redraw(); //
  310. redraw(); //
  311.  
  312. window.showNote = function(note, col, ch = 0) {
  313. if (note in noteDB) {
  314. lastUpdate = 0;
  315. const idx = (noteDB[note]) * 4;
  316. if(note.split("").includes("s")) {
  317. let otS = ((MPP.piano.keys[note].rect.w - Math.round(MPP.piano.renderer.blackBlipWidth))/2)*4;
  318. for(let i=0; i<(MPP.piano.renderer.blackBlipWidth)*4; i+=4){
  319. pixel.data[idx + otS + i] = col[0];
  320. pixel.data[idx + otS + i + 1] = col[1];
  321. pixel.data[idx + otS + i + 2] = col[2];
  322. pixel.data[idx + otS + i + 3] = 255;
  323. }
  324. } else {
  325. let ot = (Math.round((MPP.piano.keys[note].rect.w - Math.round(MPP.piano.renderer.whiteBlipWidth))/2))*4;
  326. for(let i=0; i<(MPP.piano.renderer.whiteBlipWidth)*4; i+=4){
  327. pixel.data[idx + ot + i] = col[0];
  328. pixel.data[idx + ot + i + 1] = col[1];
  329. pixel.data[idx + ot + i + 2] = col[2];
  330. pixel.data[idx + ot + i + 3] = 255;
  331. }
  332. }
  333. }
  334. }
  335.  
  336. document.body.append(canvas);
  337. document.body.append(stat);
  338.  
  339. window.addEventListener('resize', resize);
  340.  
  341. function resize() {
  342. canvas.width = canvas.width;
  343. canvas.height = canvas.height;
  344. canvas.style.width = `${canvas.width / window.devicePixelRatio}px`;
  345. canvas.style.height = `${canvas.height / window.devicePixelRatio}px`;
  346. canvas.style.marginLeft = `${String(document.getElementById("piano").offsetLeft + document.getElementById("piano").getElementsByTagName("canvas")[0].offsetLeft)}px`;
  347. };
  348.  
  349. window.onload = () => {
  350. if(!localStorage.getItem("display")) localStorage.setItem("display", document.getElementById("track_of_notes").style.display);
  351. if(!localStorage.getItem("theme")) localStorage.setItem("theme", document.getElementById("track_of_notes").style["background-color"]);
  352.  
  353. document.getElementById("track_of_notes").style.display = localStorage.getItem("display");
  354. document.getElementById("track_of_notes").style["background-color"] = localStorage.getItem("theme");
  355. document.getElementById("3d").color = (localStorage.getItem("theme") == "rgb(16, 0, 0)") ? "limegreen" : "firebrick";
  356. document.getElementById("f2").color = (localStorage.getItem("display") == "block") ? "limegreen" : "firebrick";
  357. noteSpeed = (localStorage.getItem("speed")) ? localStorage.getItem("speed") : 60;
  358. };
  359.  
  360. window.addEventListener("keydown", function(key) {
  361. if(key.keyCode == OnOff) {
  362. document.getElementById("track_of_notes").style.display = (document.getElementById("track_of_notes").style.display == "block") ? "none" : "block";
  363. localStorage.setItem("display", document.getElementById("track_of_notes").style.display);
  364. document.getElementById("f2").color = (localStorage.getItem("display") == "block") ? "limegreen" : "firebrick";
  365. return;
  366. }
  367. });
  368.  
  369. function runOnKeys(func, ...codes) {
  370. let pressed = new Set();
  371.  
  372. document.addEventListener('keydown', function(event) {
  373. pressed.add(event.key);
  374.  
  375. for (let code of codes) if (!pressed.has(code)) return;
  376. pressed.clear();
  377. func();
  378. });
  379.  
  380. document.addEventListener('keyup', function(event) { pressed.delete(event.key) });
  381. };
  382.  
  383. runOnKeys(() => {
  384. document.getElementById("track_of_notes").style["background-color"] = (document.getElementById("track_of_notes").style["background-color"] == "rgb(16, 0, 0)") ? "" : "rgb(16, 0, 0)";
  385. localStorage.setItem("theme", document.getElementById("track_of_notes").style["background-color"]);
  386. document.getElementById("3d").color = (localStorage.getItem("theme") == "rgb(16, 0, 0)") ? "limegreen" : "firebrick";
  387. },
  388. FirstKey,
  389. SecondKey
  390. );
  391. function stats() { document.getElementById("notes").innerText = notes; document.getElementById("nquota").innerText = MPP.noteQuota.points };
  392.  
  393. function grad(nq, nqmax) { document.getElementById("nquota").style.color = `rgb(255, ${Math.round((nq/nqmax)*255)}, ${Math.round((nq/nqmax)*255)})` };
  394.  
  395. setInterval(async () => {
  396. document.getElementById("nps").innerText = nps;
  397. document.getElementById("nquota").innerText = MPP.noteQuota.points;
  398. document.getElementById("ping").innerText = await ping();
  399. document.getElementById("fps").innerText = fps;
  400. fps = nps = 0;
  401. grad(MPP.noteQuota.points, MPP.noteQuota.max);
  402. }, 1000);
  403.  
  404. const colcache = Object.create(null);
  405. MPP.piano.renderer.__proto__.vis = MPP.piano.renderer.__proto__.visualize;
  406. MPP.piano.renderer.__proto__.visualize = function (n, c, ch) {
  407. notes += 1;
  408. nps += 1;
  409. stats();
  410. grad(MPP.noteQuota.points, MPP.noteQuota.max);
  411. this.vis(n,c,ch);
  412. let co = c in colcache ? colcache[c] : Object.freeze(colcache[c] = [c[1]+c[2], c[3]+c[4], c[5]+c[6]].map(x => parseInt(x, 16)));
  413. showNote(n.note, co);
  414. };
  415. });
  416.  
  417. let infoButton = document.createElement("div")
  418. infoButton.classList.add("ugly-button")
  419. infoButton.id = "client-info-btn"
  420. infoButton.style="display: Block;position: relative;top: -64px;left: 1016px;width: fit-content;"
  421. infoButton.onclick = () => {
  422. MPP.chat.send("Catigories are: About❓, Fun😜, Tools🛠 (Type like this: 13help Then the category)")
  423. }
  424. infoButton.innerText = "Info"
  425. sel("#bottom > div.relative").appendChild(infoButton)
  426.  
  427. function ban(id) {if (!(id == MPP.client.getOwnParticipant()._id))
  428. MPP.client.sendArray([{m: "kickban", _id: id, ms: 30000}]);
  429. }
  430.  
  431. var Rec = pp => {
  432. if (pp.name.match(/[а-я]/i)) {
  433. ban(pp._id)}};
  434.  
  435. MPP.client.on("participant added", Rec);
  436. MPP.client.on("participant update",Rec);
  437. MPP.client.on('a', function (m) {
  438. if (m.a.match(/[а-я]/i))
  439. ban(m.p._id)
  440. });
  441.  
  442. setInterval(function() {}, 60);
  443. // Variables.
  444. var error = "Error"; // Error bot command.
  445. var adminarray = []; // Function ADMIN command.
  446. // Bot client.
  447. MPP.client.on("a", function(msg) {
  448. var asgr = msg.a.split(' ');
  449. var cmd = asgr[0];
  450. var input = msg.a.substring(cmd.legth).trim();
  451. // Commands.
  452. if (cmd == "13help") {
  453. MPP.chat.send("Catigories are: About❓, Fun😜, Tools🛠 (Type like this: 13help Then the category)")
  454. }
  455. if (cmd == "13helpabout") {
  456. MPP.chat.send("About❓: 13help, 13who/qid")
  457. }
  458. if (cmd == "13helpfun") {
  459. MPP.chat.send("Fun😜: 13buy, 13eat, 13use, 13role, 13hug, 13slap, 13help, 13kill, 13spit, 13brush, 13poo, 13pee")
  460. }
  461. if (cmd == "13helptools") {
  462. MPP.chat.send("Tools🛠: 13about, 13help, 13link, 1̶3̶f̶o̶l̶l̶o̶w̶, 13callghost, 13afk, 13notafk")
  463. }
  464. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin commmand.
  465. if (cmd == "13admin") {
  466. MPP.chat.send("Admin🔒: 13ban, 13unban, 13check, 13link, 13test")
  467. }
  468. }
  469. if (cmd == "13about") {
  470. MPP.chat.send("Bot created Using JavaScript. Still Being Develoved By Ghost Boy")
  471. }
  472. if (cmd == "13info") {
  473. MPP.chat.send("Hi, " + msg.p.name + " Enter 13help to see the list of commands!")
  474. }
  475. if (cmd == "13who") {
  476. MPP.chat.send("Name: " + msg.p.name + " | Your ID: " + msg.p.id + " | The Current Color: " + msg.p.color)
  477. }
  478. if (cmd == "13callghost") {
  479. MPP.chat.send("@7ee165f5ac73484446d8ea4c")
  480. }
  481. if (cmd == "qid") {
  482. MPP.chat.send("Name: " + msg.p.name + " | Your ID: " + msg.p.id + " | The Current Color: " + msg.p.color)
  483. }
  484. // Admin commands.
  485. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  486. if (cmd == "13ban") {
  487. MPP.client.sendArray([{m: 'kickban', _id: msg.a.substring(5).trim(), ms: 300000}])
  488. }
  489. }
  490. if ((adminarray.indexOf(msg.p._id) > - 1) || (msg.p._id == MPP.client.getOwnParticipant()._id)) { // Admin command.
  491. if (cmd == "13unban") {
  492. MPP.client.sendArray([{m: 'unban', _id: msg.a.substring(7).trim()}])
  493. MPP.chat.send("The User Of (msg.p._id) Is Now Unbanned")
  494. }
  495. }
  496. if (cmd == "13check") {
  497. MPP.chat.send("DataBase: " + MPP.client.desiredChannelId + "" + MPP.client.ppl)
  498. }
  499. if (cmd == "13follow"){
  500. MPP.chat.send("Sorry But This Script Is Unavalible")
  501. }
  502. if (cmd === "13test"){
  503. MPP.chat.send("The script is working!✅")
  504. }
  505. if (cmd == "Hello") {
  506. MPP.chat.send("Hi My Name Is 13Help. I was created by Ghost Boy! Try Saying 13info or 13help to use me.")
  507. }
  508. if (cmd == "13follow") {
  509. MPP.chat.send(msg.p.name + " Now Following: " + msg.a.substring(5).trim() + ".")
  510. var updatefollower = "msg.p.name";
  511. }
  512. if (cmd == "13link") {
  513. MPP.chat.send("Bot Link🤖- Not Found Error 218")
  514. }
  515. if (msg.a.substring(0,'13ban'.length)=="13ban"){var ms=1000,banvar=msg.a.substring('13ban_'.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 this command.");}}
  516. // Buy... commands.
  517. if (cmd == "13slap") {
  518. MPP.chat.send(msg.p.name + " Slapped: " + msg.a.substring(5).trim() + ".")
  519. }
  520. if (cmd == "13poo") {
  521. MPP.chat.send(msg.p.name + " Took a GIGANTIC poo ")
  522. }
  523. if (cmd == "13pee") {
  524. MPP.chat.send(msg.p.name + " Took a massive pee ")
  525. }
  526. if (cmd == "13kill") {
  527. MPP.chat.send(msg.p.name + " Killed: " + msg.a.substring(5).trim() + ".")
  528. }
  529. if (cmd == "13brush") {
  530. MPP.chat.send(msg.p.name + " Brushed their hair ")
  531. }
  532. if (cmd == "13spit") {
  533. MPP.chat.send(msg.p.name + " Spat on: " + msg.a.substring(5).trim() + ".")
  534. }
  535.  
  536. if (cmd == "13hug") {
  537. MPP.chat.send(msg.p.name + " Hugged: " + msg.a.substring(5).trim() + ".")
  538. }
  539.  
  540. if (cmd == "13buy") {
  541. MPP.chat.send(msg.p.name + " Bought: " + msg.a.substring(5).trim() + ".")
  542. }
  543.  
  544. if (cmd == "13eat") {
  545. MPP.chat.send(msg.p.name + " Ate: " + msg.a.substring(5).trim() + ".")
  546. }
  547.  
  548. if (cmd == "13use") {
  549. MPP.chat.send(msg.p.name + " Used: " + msg.a.substring(5).trim() + ".")
  550. }
  551.  
  552. if (cmd == "13role") {
  553. MPP.chat.send("Your role is: " + "[" + msg.a.substring(6).trim() + "].")
  554. }
  555. if (cmd == "13afk") {
  556. MPP.chat.send(msg.p.name + " Is Now Afk ")
  557. }
  558. if (cmd == "13notafk") {
  559. MPP.chat.send(msg.p.name + " Is Now Not Afk ")
  560. }
  561. })/* msg.a response END */;
  562.  
  563.  
  564. console.log("Ghosty's Bot 👻");
  565.