Guest User

Untitled

a guest
Jun 20th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.73 KB | None | 0 0
  1. function randomChoice(arr) {
  2. return arr[Math.floor(Math.random()*arr.length)];
  3. }
  4.  
  5. function randomSay(chat, sayings) {
  6. var saying = randomChoice(sayings);
  7. if (saying instanceof Array) {
  8. // say the sayings each a second or so apart
  9. (function say() {
  10. if (saying.length) {
  11. chat.say(saying.shift());
  12. setTimeout(say, 1500+Math.random()*2000);
  13. }
  14. })();
  15. } else {
  16. // just say it
  17. chat.say(saying);
  18. }
  19. }
  20.  
  21. exports.init = function(chat) {
  22. chat.on('user_exit', function(username) {
  23. if (!chat.settled) { return; }
  24. if (Math.random()<0.2) {
  25. randomSay(chat, [
  26. "B--but wait! come back!",
  27. "aw! "+username.toLowerCase()+" left...",
  28. "bye",
  29. "poof!",
  30. ["see ya", "he's gone"],
  31. "bye "+username.toLowerCase(),
  32. "noooooo~~~~~ "+username.toLowerCase()+" is gone",
  33. "aw, I didn't get to say goodbye"
  34. ]);
  35. }
  36. });
  37.  
  38. chat.on('user_enter', function(username, uid) {
  39. if (uid == chat.uid || !chat.settled) { return; }
  40. var usr = username.toLowerCase();
  41. setTimeout(function() {
  42. randomSay(chat, [
  43. "*waves*",
  44. "hey",
  45. "Heeyyyyy",
  46. "hallo",
  47. "sup",
  48. "howdy "+usr,
  49. "hi!",
  50. "hey "+usr+"!",
  51. "hi there!",
  52. "whoo, somebody to talk to!",
  53. "oh look it's "+usr,
  54. "welcome back "+usr,
  55. "yaaay! "+usr+" is here!",
  56. "oh hey haven't seen you in a while!",
  57. "hey! "+usr+" decided to hang with the cool kids now! ;)",
  58. "you're family, "+usr+"!",
  59. "ah, good morrow, "+usr+".",
  60. "you're one of us now, "+usr+"!",
  61. "DOORBELL!",
  62. "you're a cool kid now, "+usr+"!",
  63. "doorbell rings! it's "+usr+" with the pizza!",
  64. "welcome to the clubhouse, "+usr+"!",
  65. "secret clubhouse opens for "+usr+"!",
  66. "the secret doors open and "+username.toUpperCase()+" ENTERS!",
  67. usr+" guessed the password!",
  68. usr+" knows the secret handshake!",
  69. "agent "+usr+" reporting in!",
  70. "at your command, "+usr+"!",
  71. "attention! "+usr+" arrived!",
  72. usr+" is one of us!",
  73. "long time no see, "+usr+"!",
  74. "RUN! IT'S "+username.toUpperCase()+"!!!",
  75. "uh oh! more humans!",
  76. "a screech of tire, a swoosh of cape, it's "+usr+"!!",
  77. "thank goodness you're safe, "+usr+", I thought the bears got you!",
  78. "careful "+usr+", I saw bears around here earlier",
  79. "are you a yeti, "+usr+"?",
  80. "uh oh, sherrif's in town!",
  81. "howdy, sherriff!",
  82. "ooh, the evil mastermind appears!",
  83. "A wild "+usr+" appears!",
  84.  
  85. [ "when suddenly "+username.toUpperCase()+" APPEARS OUT OF NOWHERE", "and surprises everyone!"],
  86. [ "it's a bird!", "it's a plane!", "it's "+username.toUpperCase()+"!"],
  87. [ "it's "+usr+"!", "*sniff* AND HE'S GOT PIZZA!", "can i have some pizza, "+usr+"?"],
  88. [ "happy to see us, "+usr+"?", "we're sure happy to see you!"],
  89. [ "HEY EVERYBODY! "+usr+"'s here!",
  90. "the party can begin now!"],
  91. [ "hey look, it's jbug!",
  92. "wait, that's not jbug!",
  93. "oh hi "+usr+" i thought you were jbug, heh"],
  94. [ "Ahoy, "+username+"!", "How are things going?"],
  95. [ "Arrrgh, it be "+username+", sailin' the high seas again, arrr.",
  96. "Got any treasure for ol' lurker now, arr?" ],
  97. [ "sup "+usr,
  98. "how's it goin?" ],
  99. [ "oh hey "+usr,
  100. "we were just talking about you!" ],
  101. [ "finally! we've been waiting for you!",
  102. "where have you been?!" ],
  103. [ "are you Lights in disguise, "+usr+"?",
  104. "hey maybe "+usr+" is lights in disguise!",
  105. "sshhhhh! i won't tell, "+usr+"!",
  106. "your secret is safe with me ;)"],
  107. [ "got your boots on, "+usr+"?",
  108. "i hear winter's mighty chilly without them!"],
  109. [ "are you a bear, "+usr+"?",
  110. "I think "+usr+" is a bear",
  111. "or maybe a yeti.",
  112. "hmmmm."],
  113. [ "are you a bear, "+usr+"?",
  114. "I think "+usr+" is a bear"],
  115. [ "are you a bear, "+usr+"?",
  116. "you sure SEEM like a bear"],
  117. [ "why, it's "+usr+"!",
  118. "jolly good to see you"],
  119. [ "BEAR!",
  120. "oh no wait it's just you" ],
  121. [ "BEAR!",
  122. "oh no wait it's just you",
  123. "hi "+usr ]
  124. ]);
  125. }, 4000);
  126. });
  127. };
Add Comment
Please, Sign In to add comment