CameronFitzy

Blackjack Message

Nov 6th, 2020 (edited)
1,486
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. FTT=[`Flips the table over and gets wrestled to the ground by security`,
  2. `Flips the table over and makes a run for the exit with a glass of champagne in hand`,
  3. `Flips the table over and flips off an old lady playing slots whilst being escorted out of the casino`,
  4. `Flips the table over and yells BINGO as loud as they can`,
  5. `Flips the table over after realizing this isn’t UNO`,
  6. `Flips the table over after getting caught with a deck of Pokemon cards up their sleeve`];
  7.  
  8. Total=parseInt(Info[1]);
  9. AceCount=Info[2];
  10. AceUse=Info[3];
  11. Add1=parseInt(Info[4]);
  12. Add2=parseInt(Info[5]);
  13. Message=Info[6];
  14. MessageSub=Info[7];
  15. Dealer=parseInt(Info[8]);
  16. DealerLastCard=parseInt(Info[9]);
  17. Game=Info[10];
  18. DealerAceCount=Info[11];
  19. DealerAceUse=Info[12];
  20.  
  21. WinTotal=0;
  22. LoseTotal=0;
  23. TieTotal=0;
  24.  
  25. TotalStats=Data.filter(x=>x.split(` `)[10]!=`Null`);
  26. UserStats=TotalStats.filter(x=>x.split(` `)[0].toLowerCase()==Message.slice(5).toLowerCase());
  27.  
  28. FaceCard=[`Ten`,`Jack`,`King`,`Queen`];
  29. CardSuit=[`Spades`,`Hearts`,`Clubs`,`Diamonds`];
  30.  
  31. if(Add1==2)
  32. {Card1=`Two`}
  33. else
  34. if(Add1==3)
  35. {Card1=`Three`}
  36. else
  37. if(Add1==4)
  38. {Card1=`Four`}
  39. else
  40. if(Add1==5)
  41. {Card1=`Five`}
  42. else
  43. if(Add1==6)
  44. {Card1=`Six`}
  45. else
  46. if(Add1==7)
  47. {Card1=`Seven`}
  48. else
  49. if(Add1==8)
  50. {Card1=`Eight`}
  51. else
  52. if(Add1==9)
  53. {Card1=`Nine`}
  54. else
  55. if(Add1==10)
  56. {Card1=FaceCard[Math.floor(Math.random()*4)]}
  57. else
  58. if(Add1==11||Add1==1)
  59. {Card1=`Ace`};
  60.  
  61. if(Add2==2)
  62. {Card2=`Two`}
  63. else
  64. if(Add2==3)
  65. {Card2=`Three`}
  66. else
  67. if(Add2==4)
  68. {Card2=`Four`}
  69. else
  70. if(Add2==5)
  71. {Card2=`Five`}
  72. else
  73. if(Add2==6)
  74. {Card2=`Six`}
  75. else
  76. if(Add2==7)
  77. {Card2=`Seven`}
  78. else
  79. if(Add2==8)
  80. {Card2=`Eight`}
  81. else
  82. if(Add2==9)
  83. {Card2=`Nine`}
  84. else
  85. if(Add2==10)
  86. {Card2=FaceCard[Math.floor(Math.random()*4)]}
  87. else
  88. if(Add2==11||Add2==1)
  89. {Card2=`Ace`};
  90.  
  91. if(DealerLastCard==2)
  92. {DealerCard=`Two`}
  93. else
  94. if(DealerLastCard==3)
  95. {DealerCard=`Three`}
  96. else
  97. if(DealerLastCard==4)
  98. {DealerCard=`Four`}
  99. else
  100. if(DealerLastCard==5)
  101. {DealerCard=`Five`}
  102. else
  103. if(DealerLastCard==6)
  104. {DealerCard=`Six`}
  105. else
  106. if(DealerLastCard==7)
  107. {DealerCard=`Seven`}
  108. else
  109. if(DealerLastCard==8)
  110. {DealerCard=`Eight`}
  111. else
  112. if(DealerLastCard==9)
  113. {DealerCard=`Nine`}
  114. else
  115. if(DealerLastCard==10)
  116. {DealerCard=FaceCard[Math.floor(Math.random()*4)]}
  117. else
  118. if(DealerLastCard==11||DealerLastCard==1)
  119. {DealerCard=`Ace`};
  120.  
  121. CardSuit1=CardSuit[Math.floor(Math.random()*4)];
  122. CardSuit2=CardSuit[Math.floor(Math.random()*4)];
  123. DealerCardSuit=CardSuit[Math.floor(Math.random()*4)];
  124.  
  125. R=`If you are reading this please contact me on twitch @potatoeaterlove`;
  126.  
  127. if(Message==`Help`)
  128. {R=`Please put one of the following after the command: (Help,Deal,Hit,Stay,Stats {@UserName,All,Total})`};
  129.  
  130. if(Message==`Deal`)
  131. {if(Total==21)
  132. {if(Game==`Win`)
  133. {R=`You get dealt a ${Card1} of ${CardSuit1} and a ${Card2} of ${CardSuit2} getting 21 while the dealer got ${Dealer} Congratulations you won!!!`}
  134. else
  135. if(Game==`Tie`)
  136. {R=`You get dealt a ${Card1} of ${CardSuit1} and a ${Card2} of ${CardSuit2} getting 21 the dealer also got 21 you tied.`}}
  137. else
  138. if((Add1==Add2||Add2!=1)&&(Card1==Card2))
  139. {R=`You get dealt a pair of ${Card1}s bringing your total to ${Total}.`}
  140. else
  141. if(Add1==10&&Add2==10&&Card1!=Card2)
  142. {R=`You get dealt a ${Card1} of ${CardSuit1} and a ${Card2} of ${CardSuit2} bringing you to 20.`}
  143. else
  144. {R=`You get dealt a ${Card1} of ${CardSuit1} and a ${Card2} of ${CardSuit2} bringing you to ${Total}.`}};
  145.  
  146. if(Message==`NoDeal`)
  147. {R=`You already have a game of cards going silly.`};
  148.  
  149. if(Message==`Hit`||Message==`Check`)
  150. {if(Total==21)
  151. {if(Game==`Win`)
  152. {R=`You get dealt a ${Card1} of ${CardSuit1} getting you 21 while the dealer got ${Dealer} congratulations you won!!!`}
  153. else
  154. if(Game==`Tie`)
  155. {R=`You get dealt a ${Card1} of ${CardSuit1} getting 21 the dealer also got 21 you tied.`}}
  156. else
  157. if(Total>21)
  158. {R=`You get dealt a ${Card1} of ${CardSuit1} bringing you to ${Total} you lost.`}
  159. else
  160. if(Total<21)
  161. {R=`You get dealt a ${Card1} of ${CardSuit1} bringing you to ${Total}.`}};
  162.  
  163. if(Message==`NoHit`)
  164. {R=`You don’t have a hand of cards yet try typing “deal” after the command`};
  165.  
  166. if(Message==`Over`)
  167. {R=`You can’t hit your over 21 already.`};
  168.  
  169. if(Message==`Stay`)
  170. {if(Game==`Win`)
  171. {if(DealerLastCard>11)
  172. {R=`The dealer has ${Dealer} you win with ${Total}!`}
  173. else
  174. if(DealerLastCard<=11)
  175. {R=`The dealer draws a ${DealerCard} of ${DealerCardSuit} bringing their total to ${Dealer} while you have ${Total} you win!`}}
  176. else
  177. if(Game==`Tie`)
  178. {if(DealerLastCard>11)
  179. {R=`The dealer has ${Dealer} you tie with ${Total}.`}
  180. else
  181. if(DealerLastCard<=11)
  182. {R=`The dealer draws a ${DealerCard} of ${DealerCardSuit} bringing their total to ${Dealer} you have ${Total} you tie.`}}
  183. else
  184. if(Game==`Lose`)
  185. {if(DealerLastCard>11)
  186. {R=`The dealer has ${Dealer} you lost with ${Total}!`}
  187. else
  188. if(DealerLastCard<=11)
  189. {R=`The dealer draws a ${DealerCard} of ${DealerCardSuit} bringing their total to ${Dealer} you have ${Total} you lost.`}}};
  190.  
  191. if(Message==`NoStay`)
  192. {R=`You can't stay you don’t have any cards!`};
  193.  
  194. if(Message.includes(`Stats`))
  195. {if(Message==`AllStats`)
  196. {for(i=0;i<TotalStats.length;i++)
  197. {GameCheck=TotalStats[i].split(` `)[10];
  198. if(GameCheck==`Win`)
  199. {WinTotal++}
  200. else
  201. if(GameCheck==`Lose`)
  202. {LoseTotal++}
  203. else
  204. if(GameCheck==`Tie`)
  205. {TieTotal++}};
  206. R=`${WinTotal} total game${WinTotal==1?``:`s`} won, ${TieTotal} total game${TieTotal==1?``:`s`} tied, and ${LoseTotal} total game${LoseTotal==1?``:`s`} lost to Nightbot.`}
  207. else
  208. if(UserStats.length>=1)
  209. {for(i=0;i<UserStats.length;i++)
  210. {GameCheck=UserStats[i].split(` `)[10];
  211. if(GameCheck==`Win`)
  212. {WinTotal++}
  213. else
  214. if(GameCheck==`Lose`)
  215. {LoseTotal++}
  216. else
  217. if(GameCheck==`Tie`)
  218. {TieTotal++}};
  219. R=`@${Message.slice(5,6).toUpperCase()+Message.slice(6,Message.length)} has ${WinTotal} win${WinTotal==1?``:`s`}, ${TieTotal} tie${TieTotal==1?``:`s`}, and ${LoseTotal} loss${LoseTotal==1?``:`es`} against nightbot.`}
  220. else
  221. {R=`@${Message.slice(5,6).toUpperCase()+Message.slice(6,Message.length)} has not played before or their name is typed incorrectly.`}};
  222.  
  223. if(Message==`Flip`)
  224. {R=`${User} ${FTT[Math.floor(Math.random()*FTT.length)]}`};
  225.  
  226. if(Message==`TooMuch`)
  227. {R=`Please only put up to 2 messages after “!bj”`};
  228.  
  229. if(Message==`Error`)
  230. {R=`“${MessageSub}” is not an acceptable argument.`};
  231.  
  232. R
Add Comment
Please, Sign In to add comment