Advertisement
Slowstone72

EpicOS v1 - Cleaned Up

Dec 20th, 2024
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 6.77 KB | Software | 0 0
  1. /* "EpicOS v1 - Cleaned Up"
  2. 2015 - 2024.12.20
  3.  
  4. This is the original 2015 web browser version of EpicOS. I have:
  5. - Corrected some typos
  6. - Removed Squid's name collector script
  7. Other than that, the original (bad) code structure remains.
  8.  
  9. Callum Fisher <cf.fisher.bham@gmail.com
  10.  
  11. ----
  12.  
  13. This is free and unencumbered software released into the public domain.
  14.  
  15. Anyone is free to copy, modify, publish, use, compile, sell, or
  16. distribute this software, either in source code form or as a compiled
  17. binary, for any purpose, commercial or non-commercial, and by any
  18. means.
  19.  
  20. In jurisdictions that recognize copyright laws, the author or authors
  21. of this software dedicate any and all copyright interest in the
  22. software to the public domain. We make this dedication for the benefit
  23. of the public at large and to the detriment of our heirs and
  24. successors. We intend this dedication to be an overt act of
  25. relinquishment in perpetuity of all present and future rights to this
  26. software under copyright law.
  27.  
  28. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  29. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  30. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  31. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
  32. OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  33. ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  34. OTHER DEALINGS IN THE SOFTWARE.
  35.  
  36. For more information, please refer to <https://unlicense.org/> */
  37.  
  38. let cmdChar = "/";
  39. let selfId2 = MPP.client.getOwnParticipant()._id; // Your _ID on Multiplayer Piano
  40.  
  41. MPP.client.setChannel("lolwutsecretlobbybackdoor");
  42.  
  43. MPP.chat.send('EpicOS is now active. Type /help for the command list.');
  44.  
  45. MPP.client.on("a", function (msg) {
  46. var cmds = ['help', 'lol', 'test', 'say (Word or sentence.)','encode (Encode text)','decode (Decode encoded text.)','myinfo (Gets your _id, id and other user info.)','8ball (WIP command.)','info (Shows info about this bot.)'];
  47. var commands = cmdChar+cmds[0];
  48.    for (i = 1; i < cmds.length; i++) {
  49.    commands += ", "+cmdChar+cmds[i]; }
  50.  
  51. if (cmd == cmdChar+"help") { MPP.chat.send('✨✨EpicOS commands: ' + commands + '✨✨'); }
  52.  
  53. });
  54.  
  55. MPP.client.on("a", function(msg) { if( msg.a == cmdChar + "test") MPP.chat.send( msg.p.name + ', the bot is active and working correctly!'); });
  56.  
  57. MPP.client.on("a", function(msg) { if( msg.a == cmdChar + "myinfo") MPP.chat.send( msg.p.name + ', your id is ' + msg.p.id + ', your _id is ' + msg.p._id + ', the length of your name (' + msg.p.name + ') is ' + msg.p.name.length + ' characters long, your color in hex is ' + msg.p.color + ', your color name is ' + new Color(msg.p.color).getName().toLowerCase() + ' .Thats all the information i have.'); });
  58.  
  59. MPP.client.on("a", function(msg) { if( msg.a == cmdChar + "lol") MPP.chat.send( msg.p.name + ' laughs so hard he/she begins to choke. *Hands ' + msg.p.name +  ' a glass of water.*'); });
  60.  
  61. MPP.client.on("a", function (msg) { var cmd = msg.a.split(' ')[0].toLowerCase(); var input = msg.a.substring(cmd.length).trim(); if (cmd == cmdChar+"say") { if (input == "") { MPP.chat.send("Please enter a word/sentence for me to say! :P") } else if (input.indexOf(cmdChar+"say") == 0) { MPP.chat.send("Not today.") } else { MPP.chat.send(input) }}});
  62.  
  63.  
  64. //Below are just the responses for the 8ball command
  65. var ball = ['XD LOL.No.', 'Hell no!', 'bitch u stupid or something??? XD Lol no', 'never','maybe idk','go away pls'];
  66.  
  67.  
  68. MPP.client.on("a", function (msg) { var cmd = msg.a.split(' ')[0].toLowerCase(); var input = msg.a.substring(cmd.length).trim(); if (cmd == cmdChar+"8ball") { if (input == "") { MPP.chat.send("Please input something for the 8ball to reply to! :P (8ball <Statement/Question/Word>)") }  else {  var ball1 = Math.floor(Math.random() * ball.length); MPP.chat.send('The 8ball says: '+ball[ball1]+'.');  }}});
  69.  
  70.  
  71.  
  72. var selfId = MPP.client.getOwnParticipant()._id; MPP.client.on("a", function(msg) { if (msg.a.split(' ')[0] == "hi" || msg.a.split(' ')[0] == "hey" || msg.a.split(' ')[0] == "hello") { if (msg.p._id == selfId) {} else { MPP.chat.send('EpicOS: Hi there, ' + msg.p.name + '!, how may i help you?') } }})
  73.  
  74. MPP.client.on("participant added", function(msg){ if (welcome){ MPP.chat.send('Welcome, ' + msg.name + ' do feel free to try out a few of my commands with ' + cmdChar + 'help!'); } });
  75.  
  76.  
  77.  
  78.  
  79. function binary(text) { var output = ""; var input = text; for (i=0; i < input.length; i++) { var e=input[i].charCodeAt(0);var s = ""; do{ var a =e%2; e=(e-a)/2; s=a+s; } while(e!=0); while(s.length<8){s="0"+s;} output+=s + " "; } return output; }
  80.  
  81. function info(name){ for (var pl in MPP.client.ppl){ if (MPP.client.ppl[pl].name.toLowerCase().contains(name.toLowerCase())){ return MPP.client.ppl[pl]; } } }
  82.  
  83. function encode(text) { return window.btoa(unescape(encodeURIComponent(text))); }
  84.  
  85. function decode(text){ return decodeURIComponent(escape(window.atob(text))); }
  86.  
  87.                                          
  88. // MPP.client.on('a', m => { if (m.p._id == "") { if (m.a.startsWith("/p")) { MPP.chat.send("/stop") } } });
  89.  
  90. MPP.client.on("a", function (msg) { var cmd = msg.a.split(' ')[0].toLowerCase(); var input = msg.a.substring(cmd.length).trim(); if (cmd == cmdChar+"encode") { if (input == "") { MPP.chat.send("Please input something for me to encode! ") }  else {  MPP.chat.send('Encoded: ' + encode(input) + '.');  }}});
  91.  
  92. MPP.client.on("a", function (msg) { var cmd = msg.a.split(' ')[0].toLowerCase(); var input = msg.a.substring(cmd.length).trim(); if (cmd == cmdChar+"decode") { if (input == "") { MPP.chat.send("Please input something for me to decode! ") }  else {  MPP.chat.send('Decoded: ' + decode(input) + '.');  }}});
  93.  
  94. MPP.client.on("a", function (msg) { var cmd = msg.a.split(' ')[0].toLowerCase(); var input = msg.a.substring(cmd.length).trim(); if (cmd == cmdChar+"decode") { if (input == "") { MPP.chat.send("Please input something for me to convert to binary! ") }  else {  MPP.chat.send('Binary: ' + binary(input) + '.');  }}});
  95.  
  96. //if (msg.p._id == selfId) {  }
  97.  
  98. MPP.client.on("a", function(msg) { if( msg.a == cmdChar + "welcome off") if (msg.p._id == selfId2) { MPP.chat.send('Welcome messages were disabled.'); delete welcome } else { MPP.chat.send('Sorry, this command is owner only.') } });
  99.  
  100.  
  101. MPP.client.on("a", function(msg) { if( msg.a == cmdChar + "welcome on") if (msg.p._id == selfId2) { MPP.chat.send('Welcome messages were enabled.'); welcome = "1" } else { MPP.chat.send('Sorry, this command is owner only.') } });
  102.  
  103.  
  104.  
  105.  
  106. MPP.client.on("a", function(msg) { if( msg.a == cmdChar + "clear") if (msg.p._id == selfId2) { MPP.chat.clear();MPP.chat.send('For those people that give a shit (Which i can guarantee would be nobody.), the chat was cleared locally.');} else { MPP.chat.send('Sorry, this command is owner only.') } });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement