Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. function getRandomInt(min, max) {
  2. min = Math.ceil(min);
  3. max = Math.floor(max);
  4. return Math.floor(Math.random() * (max - min)) + min;
  5. }
  6. if (msg.content.toLowerCase().startsWith("*8ball")) { //The 8ball Message
  7. var msg1 = Array(5);
  8. msg1[1] = "Yes";
  9. msg1[2] = "No";
  10. msg1[3] = "Maybe :wink:";
  11. msg1[4] = "Without a doubt.";
  12. msg1[5] = "I Honestly Have No Idea :neutral_face:"
  13. msg1[6] = "Highly Unlikely"
  14. var x = getRandomInt(0, 20);
  15. if (x < 5){
  16. if (x < 3){
  17. msg.channel.sendMessage(msg1[1]);
  18. }
  19. else {
  20. msg.channel.sendMessage(msg1[3]);
  21. }
  22. }
  23. else if (x<= 9) {
  24. if (x >= 7){
  25. msg.channel.sendMessage(msg1[2]); }
  26. else{
  27. msg.channel.sendMessage(msg1[4]);
  28. }
  29. }
  30. else if (x <= 12 ) {
  31. msg.channel.sendMessage(msg1[5]);
  32. }
  33. else {
  34. msg.channel.sendMessage(msg1[6])
  35. }
  36. }
  37.  
  38. if (msg.content.toLowerCase().startsWith("*random")) {
  39. msg.channel.sendMessage("The number is "+ getRandomInt(1, 1000));
  40. }
  41. if (msg.content.toLowerCase().startsWith("*coinflip")) { //The coinflip Message
  42. var msg2 = Array(2);
  43. msg2[1] = "Heads";
  44. msg2[2] = "Tails";
  45. var x = getRandomInt(0, 8);
  46. if (x < 4){
  47. msg.channel.sendMessage(msg2[1]);
  48. }
  49. else{
  50. msg.channel.sendMessage(msg2[2]);
  51. }
  52. }
  53. if (msg.content.toLowerCase().startsWith("*rps")) { //The rps Message
  54. var msg1 = Array(3);
  55. msg1[1] = "Rock :black_circle:";
  56. msg1[2] = "Paper :page_facing_up:";
  57. msg1[3] = "Scissors :scissors:"
  58. var x = getRandomInt(0, 9);
  59. if (x < 6){
  60. if (x < 3){
  61. msg.channel.sendMessage(msg1[1]);
  62. }
  63. else{
  64. msg.channel.sendMessage(msg1[3]);
  65. }
  66. }
  67. else{
  68. msg.channel.sendMessage(msg1[2]);
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement