SpecBouncer

MINI Bot to MPP

目前为 2023-06-15 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name SpecBouncer
  3. // @namespace https://greasyfork.org/
  4. // @version v3.17
  5. // @description MINI Bot to MPP
  6. // @author SpecSeeker
  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. // @licence SpecSeeker
  14. // ==/UserScript==
  15. //local vars mmmmk
  16. var prefix = "sp" //prefix of the bot mmmmk
  17. var botName = "SpecSeeker#1444" //Name of the bot mmmmk
  18. var botnameintial = `${botName} (${prefix}help)` //The finished name, Prefix and bot name combined mmmmk
  19. var botColor = "#e1e1e1" //HEX CODE mmmmk
  20. var botversion = "v3.17" //HEX CODE mmmmk
  21. Admins = [
  22. '16c11a31bea1d46170549751', // SpecSeeker (Owner)
  23. ' ' // NOTHING
  24. ]
  25. Spectators = [
  26. '16c11a31bea1d46170549751', // SpecSeeker (Owner)
  27. ' ' // NOTHING
  28. ]
  29. MPP.client.sendArray([{
  30. m: "userset",
  31. set: {
  32. name: botnameintial,
  33. color: botColor
  34. }
  35. }]);
  36. function run(code) {
  37. if (new String(code) == "[object Object]" == false && new String(code) == "[object JSON]" == false) {
  38. try {
  39. return '► ' + eval(code);
  40. } catch (error) {
  41. return '► ❌ ' + error + ''
  42. }
  43. }
  44. if (new String(code) == "[object Object]" || new String(code) == "[object JSON]") {
  45. try {
  46. return '► ' + JSON.stringify(eval(code));
  47. } catch (error) {
  48. return '► ❌ ' + error + ' '
  49. }
  50. }
  51. }
  52.  
  53. var follow = "server"
  54. MPP.client.on('m', m => {
  55. if (m.id == follow) {
  56. MPP.client.sendArray([{
  57. m: "m",
  58. "x": m.x,
  59. "y": m.y
  60. }]);
  61. }
  62. })
  63.  
  64. var idgetter = "server"
  65. // program to reverse a string
  66.  
  67. function reverseString(str) {
  68.  
  69. // empty string
  70. let newString = "";
  71. for (let i = str.length - 1; i >= 0; i--) {
  72. newString += str[i];
  73. }
  74. return newString;
  75. }
  76.  
  77. MPP.client.on("a", function(msg) {
  78. //MSG vars
  79. var isAdmins = (Admins.indexOf(msg.p._id) !== -1);
  80. var isSpectators = (Spectators.indexOf(msg.p._id) !== -1);
  81. var args = msg.a.split(" ");
  82. var args2 = msg.a.split("");
  83. var cmd = args[0].toLowerCase();
  84. var cmd2 = args2[0].toLowerCase();
  85. args = args.slice(1);
  86. var sendChat = function(msg) {
  87. MPP.chat.send(msg)
  88. };
  89. var botsname = "SpecSeeker#1444"
  90. var botsversion = "v3.17"
  91. var name = msg.p.name;
  92. var version = msg.p.version;
  93. var element = ["Hello.", `I'm ${botsname} with ${botsversion}, and you are ${name}`, "I'm good. How about you?", "Maybe.", "Sure.", "I guess so.", "and?", "Ok.", "Nice.", "Thanks.", "No.", `${msg.a.substring(7).trim()}? Ok.`, `${msg.a.substring(7).trim()}? Nice!`, `${msg.a.substring(7).trim()}? Fine.`, `${msg.a.substring(7).trim()}? I guess not.`, `${msg.a.substring(7).trim()}? Sure.`, "I think so.", "I dont really know about that.", "My favorite song? Checkpoints by Nitro Fun & Hyper Potions.", "Nice try.", "Don't.", "Yes.", "Why?"];
  94. var randomresponse = element[Math.floor(Math.random() * element.length)];
  95. var cfolders = "(hidden)";
  96. const string = msg.a.substring(9).trim()
  97. const result = reverseString(string);
  98. const number = msg.a.substring(12).trim()
  99. function makeid(length) {
  100. var result = '';
  101. var characters = ['abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()[]{}~`´|/?;:><-_+=çêéèÈÉÊáÁàÀãÃâÂëËäÄúùÙÚüÜ'];
  102. var charactersLength = characters.length;
  103. for ( var i = 0; i < length; i++ ) {
  104. result += characters.charAt(Math.floor(Math.random() * charactersLength));
  105. }
  106. return result;
  107. }
  108. const codelangs = [
  109. "Hello!",
  110. "How are you?",
  111. "I'm great!",
  112. "Let's friend?",
  113. "This great!",
  114. "Let's go to home?",
  115. "Let's go to bed?",
  116. "(This my great friend...)",
  117. ]
  118. var rct = codelangs[Math.floor(Math.random() * codelangs.length)]
  119. var commands = ["help", "crownholderid", "systeminfo", "follow", "roominfo", "rules", "codetype - SpecBouncer"];
  120. var admincmds = ["spjs, spsayraw, spkickban, spunban,spgivecrown"];
  121. var secretcmds = ["spstringtest, spreverse, spcolor, spid, spskull, spthonk, spesrever - Owner by SpecSeeker"];
  122. var spectatorcmds = ["wspectator, wunectator"];
  123. var noperms = "❎ You don't have permission to use this command.";
  124. var perms = "✅ You have permission to use this command.";
  125. if (cmd === "spjs") {
  126. if (isAdmins) {
  127. var input = msg.a.split(" ").slice(1).join(" ");
  128. if (!input) {
  129. return sendChat(run(input))
  130. }
  131. sendChat(run(input))
  132. } else {
  133. sendChat(`❎ You don't have permission to use this command.`)
  134. }
  135. }
  136. if (cmd === "spsayraw") {
  137. if (isAdmins) {
  138. if (args.length == 0) {
  139. sendChat("No text specified.");
  140. } else {
  141. sendChat(msg.a.substring(8).trim())
  142. }
  143. } else {
  144. sendChat(noperms);
  145. }
  146. }
  147. if (cmd === "spstringtest") {
  148. if (isAdmins) {
  149. sendChat(perms)
  150. sendChat(makeid(10))
  151. } else {
  152. sendChat(noperms + " Also, this command generates 10 characters.")
  153. }
  154. }
  155. if (cmd === "spreverse" | cmd === "spesrever") {
  156. if (isAdmins) {
  157. if (args.length == 0) {
  158. sendChat("No text to reverse. | Usage: //reverse (text) | .eciN .esreveR");
  159. } else {
  160. sendChat(`${result}`)
  161. }
  162. } else {
  163. if (args.length == 0) {
  164. sendChat("No text to reverse. | Usage: //reverse (text) | .eciN .esreveR");
  165. } else {
  166. sendChat(`Reversed String: ${result}`)
  167. }
  168. }
  169. }
  170. if (cmd === "wspectator") {
  171. if (isSpectators) {
  172. if (args.length == 0) {
  173. sendChat("Spectator has enabled.");
  174. } else {
  175. }
  176. }
  177. }
  178. if (cmd === "wunspectator") {
  179. if (isSpectators) {
  180. if (args.length == 0) {
  181. sendChat("Spectator has turn offed.");
  182. } else {
  183. }
  184. }
  185. }
  186. if (cmd === "spkickban") {
  187. if (isAdmins) {
  188. if (args.length == 0) {
  189. sendChat("Usage: //kickban (id) | Duration of kickban is 5 hours.");
  190. } else {
  191. MPP.client.sendArray([{m: 'kickban', ms: 18000000, _id: `${msg.a.substring(9).trim()}`}]);
  192. sendChat("");
  193. }
  194. } else {
  195. sendChat("❎ You don't have permission to use this command.")
  196. }
  197. }
  198. if (cmd === "spunban") {
  199. if (isAdmins) {
  200. if (args.length == 0) {
  201. sendChat("Usage: spunban (id) | Unbans people. Huh.");
  202. } else {
  203. MPP.client.sendArray([{m: 'unban', ms: 18000000, _id: `${msg.a.substring(7).trim()}`}]);
  204. sendChat("Unbanned.");
  205. }
  206. } else {
  207. sendChat("❎ You don't have permission to use this command.")
  208. }
  209. }
  210. if (cmd == "spgivecrown") {
  211. if (isAdmins) {
  212. if (args.length == 0) {
  213. sendChat("Usage: spgivecrown (id)");
  214. } else {
  215. MPP.client.sendArray([{m: 'chown', id: msg.a.substring(11).trim()}])
  216. MPP.chat.send("Done.");
  217. }
  218. } else {
  219. sendChat("❎ You don't have permission to use this command.")
  220. }
  221. }
  222. if (cmd === "spcolor") {
  223. var input = msg.a.split(" ").slice(1).join(" ");
  224. if (args.length == 0) {
  225. sendChat(`${msg.p.color}`)
  226. } else {
  227. var targetfrommsg = MPP.client.findParticipantByName[input]; {
  228. sendChat(`[${targetfrommsg._id}] ${targetfrommsg.name}'s color is ${targetfrommsg.color}`)
  229. }
  230. }
  231. }
  232. if (cmd === "spid") {
  233. sendChat(`${msg.p._id}`)
  234. }
  235. if (cmd === `${prefix}follow`) {
  236. var input = msg.a.split(" ").slice(1).join(" ");
  237. sendChat(`Following: [${msg.p._id}] ${msg.p.name}`);
  238. follow = msg.p._id;
  239. return;
  240. var target = MPP.client.ppl[input] | MPP.client.findParticipantByName(input); {
  241. if (!target) {
  242. return sendChat(`User not found or the user is not in this room.`);
  243. }
  244. follow = target._id
  245. sendChat(`Following: [${target._id}] ${target.name}`)
  246. }
  247. }
  248. if (cmd === "spcrownholderid") {
  249. sendChat(`${MPP.client.channel.crown.participantId}`);
  250. }
  251. if (cmd === "spcodetype") {
  252. sendChat(`${rct}`);
  253. }
  254. if (cmd === "sproominfo") {
  255. sendChat(`Room Info | Room Name: ${MPP.client.channel._id} | Room User Limit: ${MPP.client.channel.settings.limit} | BG Colors: 1. ${MPP.client.channel.settings.color} 2. ${MPP.client.channel.settings.color2} | Chat is Enabled: ${MPP.client.channel.settings.chat} | Room is visible: ${MPP.client.channel.settings.visible} | Crown Holder _ID: ${MPP.client.channel.crown.participantId}`);
  256. }
  257. if (cmd === "spskull") {
  258. if (args.length == 0) {
  259. sendChat("Usage: spskull (msg)");
  260. } else {
  261. sendChat(name + ": " + msg.a.substring(7).trim() + " 💀");
  262. }
  263. }
  264. if (cmd === "spthonk") {
  265. if (args.length == 0) {
  266. sendChat("Usage: spthonk (msg)");
  267. } else {
  268. sendChat(name + ": " + msg.a.substring(7).trim() + " 🤔");
  269. }
  270. }
  271. if (cmd === "sphelp") {
  272. var cmds = "sp" + commands[0];
  273. for (i = 1; i < commands.length; i++) {
  274. cmds += ", sp" + commands[i];
  275. }
  276. sendChat("Normal commands are: " + cmds);
  277. sendChat("Admin commands are: " + admincmds);
  278. sendChat("Secret commands are: " + secretcmds);
  279. sendChat("Spectator commands are: " + spectatorcmds);
  280. }
  281. });
  282. MPP.chat.send(`${botName} with ${botversion} is Spectating! ✅`);