Advertisement
xKevinn

MC Macros - Slot Machine

Nov 2nd, 2014
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.88 KB | None | 0 0
  1. IFMATCHES(%@&chatclean%,"%@&regex%\.bet (.+)",&bet,2)
  2. MATCH(%@&chatclean%,"%@&regex%(.+) (.+)",&better,1)
  3.  
  4. IndexOf(@&player[],#pos,%&better%)
  5. IF(%@&inprogress[%#pos%]% != "true")
  6. IF(&bet != "random")
  7. Set(#bet,%&bet%)
  8. #bet = %#bet% / 1
  9. ELSE
  10. IndexOf(@&player[],#pos,%&better%)
  11. RANDOM(#bet,1,%@#money[%#pos%]%)
  12. Set(@#bet[%#pos%],%#bet%)
  13. ENDIF
  14. IF(#bet < 1)
  15. Echo(%&channel% &cInvalid bet of $%#bet%.)
  16. ELSE
  17. IndexOf(@&player[],#pos,%&better%)
  18. Set(@#bet[%#pos%],%#bet%)
  19.  
  20. IF(#pos > -1)
  21. IF((#bet > %@#money[%#pos%]%) && (&better != %PLAYER%))
  22. Echo(%&channel% &cYou do not have enough money to cover that bet.)
  23. ELSE
  24. IndexOf(@&player[],#pos,%&better%)
  25. IF(#pos > -1)
  26. IF(%@&inprogress[%#pos%]% = "")
  27. Push(@&inprogress[],"true")
  28. ELSE
  29. IndexOf(@&player[],#pos,%&better%)
  30. Set(@&inprogress[%#pos%],"true")
  31. ENDIF
  32. ENDIF
  33.  
  34. Echo(%&channel% &b%@&player[%#pos%]% &ebet &a$%#bet%&e. Spinning... &a[&kE&r&a-&kE&r&a-&kE&r&a])
  35. #fix = %@#money[%#pos%]% - %#bet%
  36. Set(@#money[%#pos%],%#fix%)
  37. Wait(3)
  38. RANDOM(#result1,1,10)
  39.  
  40. IF(#result1 = 1)
  41. &reel1 = C
  42. ELSEIF(#result1 = 2)
  43. &reel1 = C
  44. ELSEIF(#result1 = 3)
  45. &reel1 = C
  46. ELSEIF(#result1 = 4)
  47. &reel1 = C
  48. ELSEIF(#result1 = 5)
  49. &reel1 = B
  50. ELSEIF(#result1 = 6)
  51. &reel1 = B
  52. ELSEIF(#result1 = 7)
  53. &reel1 = B
  54. ELSEIF(#result1 = 8)
  55. &reel1 = A
  56. ELSEIF(#result1 = 9)
  57. &reel1 = A
  58. ELSEIF(#result1 = 10)
  59. &reel1 = O
  60. ENDIF
  61.  
  62. RANDOM(#result2,1,10)
  63. IF(#result2 = 1)
  64. &reel2 = C
  65. ELSEIF(#result2 = 2)
  66. &reel2 = C
  67. ELSEIF(#result2 = 3)
  68. &reel2 = C
  69. ELSEIF(#result2 = 4)
  70. &reel2 = C
  71. ELSEIF(#result2 = 5)
  72. &reel2 = B
  73. ELSEIF(#result2 = 6)
  74. &reel2 = B
  75. ELSEIF(#result2 = 7)
  76. &reel2 = B
  77. ELSEIF(#result2 = 8)
  78. &reel2 = A
  79. ELSEIF(#result2 = 9)
  80. &reel2 = A
  81. ELSEIF(#result2 = 10)
  82. &reel2 = O
  83. ENDIF
  84.  
  85. RANDOM(#result3,1,10)
  86. IF(#result3 = 1)
  87. &reel3 = C
  88. ELSEIF(#result3 = 2)
  89. &reel3 = C
  90. ELSEIF(#result3 = 3)
  91. &reel3 = C
  92. ELSEIF(#result3 = 4)
  93. &reel3 = C
  94. ELSEIF(#result3 = 5)
  95. &reel3 = B
  96. ELSEIF(#result3 = 6)
  97. &reel3 = B
  98. ELSEIF(#result3 = 7)
  99. &reel3 = B
  100. ELSEIF(#result3 = 8)
  101. &reel3 = A
  102. ELSEIF(#result3 = 9)
  103. &reel3 = A
  104. ELSEIF(#result3 = 10)
  105. &reel3 = O
  106. ENDIF
  107.  
  108. //Multipler for wins
  109. &result = %&reel1%%&reel2%%&reel3%
  110. IF(&result = "CCC")
  111. #multi = 3
  112. ELSEIF(&result = "BBB")
  113. #multi = 8
  114. ELSEIF(&result = "AAA")
  115. #multi = 25
  116. ELSEIF(&result = "OOO")
  117. #multi = 250
  118. ELSE
  119. #multi = 0
  120. ENDIF
  121.  
  122. IF(&reel1 = "A");&reel1 = &dA;ENDIF;IF(&reel2 = "A");&reel2 = &dA;ENDIF;IF(&reel3 = "A");&reel3 = &dA;ENDIF
  123. IF(&reel1 = "B");&reel1 = &6B;ENDIF;IF(&reel2 = "B");&reel2 = &6B;ENDIF;IF(&reel3 = "B");&reel3 = &6B;ENDIF
  124. IF(&reel1 = "C");&reel1 = &3C;ENDIF;IF(&reel2 = "C");&reel2 = &3C;ENDIF;IF(&reel3 = "C");&reel3 = &3C;ENDIF
  125. IF(&reel1 = "O");&reel1 = &5O;ENDIF;IF(&reel2 = "O");&reel2 = &5O;ENDIF;IF(&reel3 = "O");&reel3 = &5O;ENDIF
  126.  
  127. IF(#multi = 0)
  128. IndexOf(@&player[],#pos,%&better%)
  129. IF(%@#money[%#pos%]% > 0)
  130. Echo(%&channel% &a[%&reel1%&a-%&reel2%&a-%&reel3%&a] &c%@&player[%#pos%]% didn't win. &eBalance: &a$%@#money[%#pos%]%&e.)
  131. ELSE
  132. Echo(%&channel% &a[%&reel1%&a-%&reel2%&a-%&reel3%&a] &c%@&player[%#pos%]% didn't win. &eBalance: &c$%@#money[%#pos%]%&e.)
  133. ENDIF
  134. @#totalwon = %@#totalwon% - %#bet%
  135. Set(@&inprogress[%#pos%],"false")
  136. ELSE
  137. #win = %#bet% * %#multi%
  138. IndexOf(@&player[],#pos,%&better%)
  139. #fix = %@#money[%#pos%]% + %#win%
  140. Set(@#money[%#pos%],%#fix%)
  141. IF(%@#money[%#pos%]% > 0)
  142. Echo(%&channel% &a[%&reel1%&a-%&reel2%&a-%&reel3%&a] &b%@&player[%#pos%]% &ewon &a$%#win%&e! Balance: &a$%@#money[%#pos%]%&e.)
  143. ELSE
  144. Echo(%&channel% &a[%&reel1%&a-%&reel2%&a-%&reel3%&a] &b%@&player[%#pos%]% &ewon &a$%#win%&e! Balance: &c$%@#money[%#pos%]%&e.)
  145. ENDIF
  146. @#totalwon = %@#totalwon% + %#win%
  147. Set(@&inprogress[%#pos%],"false")
  148. ENDIF
  149.  
  150. IF(#bet > 4)
  151. #total = %#bet% / 5
  152. IF(#total = 0);#total = 1;ENDIF
  153. Inc(@#jackpot,%#total%)
  154. ENDIF
  155.  
  156. //Chance of winning the jackpot
  157. RANDOM(#winjackpot,1,1000)
  158. IF(#winjackpot = 1)
  159. IF(#bet > 4)
  160. IndexOf(@&player[],#pos,%&better%)
  161. Echo(%&channel% &e&k.&5%@&player[%#pos%]% won the jackpot of &a$%@#jackpot%&5!&e&k.)
  162. #fix = %@#money[%#pos%]% + %@#jackpot%
  163. Set(@#money[%#pos%],%#fix%)
  164. @#jackpot = 0
  165. ENDIF
  166. ENDIF
  167.  
  168. //Chance of getting the bonus round
  169. RANDOM(#bchance,1,100)
  170. IF(#bchance = 1)
  171. Push(@&bonus[],%&better%)
  172. Echo(%&channel% &b%@&player[%#pos%]% got a bonus round! Select a box:)
  173. Echo(%&channel% &b[1] [2] [3])
  174. IndexOf(@&player[],#pos,%&better%)
  175. Set(@&inprogress[%#pos%],"true")
  176. ENDIF
  177. ENDIF
  178. ELSE
  179. Push(@&player[],%&better%)
  180. IndexOf(@&player[],#pos,%&better%)
  181. Set(@#money[%#pos%],%@#starting%)
  182. Echo(%&channel% &b%@&player[%#pos%]% &eis new and has been given &a$%@#money[%#pos%]%&e! Repeat your bet to play.)
  183. Set(@&inprogress[%#pos%],"false")
  184. ENDIF
  185. ENDIF
  186. ENDIF
  187. ENDIF
  188.  
  189. IFMATCHES(%@&chatclean%,\.reset)
  190. MATCH(%@&chatclean%,"%@&regex%(.+)",&resetter,1)
  191. IF(&resetter = %PLAYER%)
  192. Echo(&aStatus reset.)
  193. UnSet(@&bonus[])
  194. UnSet(@&inprogress[])
  195. Stop
  196. ENDIF
  197. ENDIF
  198.  
  199. IFMATCHES(%@&chatclean%,"%@&regex%([1-3]{1})",&pick,2)
  200. MATCH(%@&chatclean%,"%@&regex%([1-3]{1})",&picker,1)
  201. IndexOf(@&bonus[],#pos,%&picker%)
  202. IF(&picker = %@&bonus[%#pos%]%)
  203. Set(#pick,%&pick%)
  204. RANDOM(#bamount,0,25)
  205. Set(#bmulti,%#bamount%)
  206. IndexOf(@&player[],#pos,%&picker%)
  207. #bamount = %#bamount% * %@#bet[%#pos%]%
  208. Echo(%&channel% &bBox [%&pick%] opens up and contains...)
  209. IndexOf(@&bonus[],#pos,%&picker%)
  210. UnSet(@&bonus[%#pos%])
  211. Wait(3)
  212. Echo(%&channel% &b...&a%#bmulti%x &byour current bet! (&a$%#bamount%&b))
  213. IndexOf(@&player[],#pos,%&picker%)
  214. #fix = %@#money[%#pos%]% + %#bamount%
  215. Set(@#money[%#pos%],%#fix%)
  216. IndexOf(@&player[],#pos,%&picker%)
  217. Set(@&inprogress[%#pos%],"false")
  218. ENDIF
  219. ENDIF
  220.  
  221. IFMATCHES(%@&chatclean%,"%@&regex%\.set (.+) ([0-9\-]{1,})",&setname,2)
  222. MATCH(%@&chatclean%,"%@&regex%\.set (.+) ([0-9\-]{1,})",&setter,1)
  223. MATCH(%@&chatclean%,"%@&regex%\.set (.+) ([0-9\-]{1,})",&setamount,3)
  224. IF(&setter = %PLAYER%)
  225. Set(#setamount,%&setamount%)
  226. IndexOf(@&player[],#pos,%&setname%)
  227. IF(#pos > -1)
  228. PROMPT(&ask,$$?,"Would you like to continue?")
  229. IFMATCHES(%&ask%,"yes")
  230. IndexOf(@&player[],#pos,%&setname%)
  231. Set(@#money[%#pos%],%#setamount%)
  232. Echo(%&channel% &eSet &b%@&player[%#pos%]%'s &ebalance to &a$%@#money[%#pos%]%&e.)
  233. ELSE
  234. Echo(%&channel% &cInvalid attempt.)
  235. ENDIF
  236. ELSE
  237. Echo(%&channel% &c\"%&setname%\" is not in the database.)
  238. ENDIF
  239. ENDIF
  240. ENDIF
  241.  
  242. IFMATCHES(%@&chatclean%,"%@&regex%\.money ([a-z0-9\-_]{2,16})$",&player,2)
  243. IndexOf(@&player[],#pos,%&player%)
  244. IF(#pos > -1)
  245. IndexOf(@&player[],#pos,%&player%)
  246. IF(%@#money[%#pos%]% > 0)
  247. Echo(%&channel% &b%@&player[%#pos%]% &ehas &a$%@#money[%#pos%]%&e.)
  248. ELSE
  249. Echo(%&channel% &b%@&player[%#pos%]% &ehas &c$%@#money[%#pos%]%&e.)
  250. ENDIF
  251. ELSE
  252. Echo(%&channel% &c\"%&player%\" is not in the database.)
  253. ENDIF
  254. ENDIF
  255.  
  256. IFMATCHES(%@&chatclean%,"%@&regex%\.money$",&player,1)
  257. IndexOf(@&player[],#pos,%&player%)
  258. IF(#pos > -1)
  259. IndexOf(@&player[],#pos,%&player%)
  260. IF(%@#money[%#pos%]% > 0)
  261. Echo(%&channel% &b%@&player[%#pos%]% &ehas &a$%@#money[%#pos%]%&e.)
  262. ELSE
  263. Echo(%&channel% &b%@&player[%#pos%]% &ehas &c$%@#money[%#pos%]%&e.)
  264. ENDIF
  265. ELSE
  266. Echo(%&channel% &c\"%&player%\" is not in the database.)
  267. ENDIF
  268. ENDIF
  269.  
  270. IFMATCHES(%@&chatclean%,"%@&regex%\.add (.+) ([0-9\-]{1,})",&addname,2)
  271. MATCH(%@&chatclean%,"%@&regex%\.add (.+) ([0-9\-]{1,})",&adder,1)
  272. MATCH(%@&chatclean%,"%@&regex%\.add (.+) ([0-9\-]{1,})",&addamount,3)
  273. IF(&adder = %PLAYER%)
  274. Set(#addamount,%&addamount%)
  275. IndexOf(@&player[],#pos,%&addname%)
  276. IF(#pos > -1)
  277. PROMPT(&ask,$$?,"Would you like to continue?")
  278. IFMATCHES(%&ask%,"yes")
  279. #total = %@#money[%#pos%]% + %#addamount%
  280. IndexOf(@&player[],#pos,%&addname%)
  281. Set(@#money[%#pos%],%#total%)
  282. Echo(%&channel% &eAdded &a$%#addamount% &eto &b%@&player[%#pos%]%'s &ebalance.)
  283. ELSE
  284. Echo(%&channel% &cInvalid attempt.)
  285. ENDIF
  286. ELSE
  287. Echo(%&channel% &c\"%&addname%\" is not in the database.)
  288. ENDIF
  289. ENDIF
  290. ENDIF
  291.  
  292. IFMATCHES(%@&chatclean%,"%@&regex%\.addall ([0-9\-]{1,})",&adder,1)
  293. MATCH(%@&chatclean%,"%@&regex%\.addall ([0-9\-]{1,})",&addamount,2)
  294. IF(&adder = %PLAYER%)
  295. Set(#addamount,%&addamount%)
  296. PROMPT(&ask,$$?,"Would you like to continue?")
  297. IFMATCHES(%&ask%,"yes")
  298. FOREACH(@#money[],&amount,#count)
  299. Set(#amount,%&amount%)
  300. #total = %#amount% + %#addamount%
  301. Set(@#money[%#count%],%#total%)
  302. NEXT
  303. Echo(%&channel% &eAdded &a$%#addamount% &eto everyone's balance.)
  304. ELSE
  305. Echo(%&channel% &cInvalid attempt.)
  306. ENDIF
  307. ENDIF
  308. ENDIF
  309.  
  310. IFMATCHES(%@&chatclean%,"%@&regex%\.remall ([0-9\-]{1,})",&remover,1)
  311. MATCH(%@&chatclean%,"%@&regex%\.remall ([0-9\-]{1,})",&remamount,2)
  312. IF(&remover = %PLAYER%)
  313. Set(#remamount,%&remamount%)
  314. PROMPT(&ask,$$?,"Would you like to continue?")
  315. IFMATCHES(%&ask%,"yes")
  316. FOREACH(@#money[],&amount,#count)
  317. Set(#amount,%&amount%)
  318. #total = %#amount% - %#remamount%
  319. Set(@#money[%#count%],%#total%)
  320. NEXT
  321. Echo(%&channel% &eRemoved &c$%#remamount% &efrom everyone's balance.)
  322. ELSE
  323. Echo(%&channel% &cInvalid attempt.)
  324. ENDIF
  325. ENDIF
  326. ENDIF
  327.  
  328. IFMATCHES(%@&chatclean%,"%@&regex%\.rem (.+) ([0-9\-]{1,})",&remname,2)
  329. MATCH(%@&chatclean%,"%@&regex%\.rem (.+) ([0-9\-]{1,})",&remover,1)
  330. MATCH(%@&chatclean%,"%@&regex%\.rem (.+) ([0-9\-]{1,})",&remamount,3)
  331. IF(&remover = %PLAYER%)
  332. Set(#remamount,%&remamount%)
  333. IndexOf(@&player[],#pos,%&remname%)
  334. IF(#pos > -1)
  335. PROMPT(&ask,$$?,"Would you like to continue?")
  336. IFMATCHES(%&ask%,"yes")
  337. #total = %@#money[%#pos%]% - %#remamount%
  338. IndexOf(@&player[],#pos,%&remname%)
  339. Set(@#money[%#pos%],%#total%)
  340. Echo(%&channel% &eRemoved &c$%#remamount% &efrom &b%@&player[%#pos%]%'s &ebalance.)
  341. ELSE
  342. Echo(%&channel% &cInvalid attempt.)
  343. ENDIF
  344. ELSE
  345. Echo(%&channel% &c\"%&remname%\" is not in the database.)
  346. ENDIF
  347. ENDIF
  348. ENDIF
  349.  
  350. IFMATCHES(%@&chatclean%,\.list)
  351. MATCH(%@&chatclean%,"%@&regex%(.+)",&lister,1)
  352. IF(&lister = %PLAYER%)
  353. #num = -1
  354. #bcount = 0
  355. FOREACH(@&player[],&name,#count)
  356. Inc(#num)
  357. Inc(#bcount)
  358. #realnum = #num + 1
  359. IF(%@#money[%#num%]% > 0)
  360. Log(&e%#realnum%: &b%@&player[%#num%]% &e- &a$%@#money[%#num%]%)
  361. ELSE
  362. Log(&e%#realnum%: &b%@&player[%#num%]% &e- &c$%@#money[%#num%]%)
  363. ENDIF
  364. NEXT
  365. ENDIF
  366. ENDIF
  367.  
  368. IFMATCHES(%@&chatclean%,\.won)
  369. //IFMATCHES(%@&chatclean%,%&blocked%)
  370. //ECHO("&cDisabled under certain conditions.")
  371. //Stop()
  372. //ENDIF
  373.  
  374. IF(@#totalwon > 0)
  375. Echo(%&channel% &eTotal money won: &a$%@#totalwon%&e.)
  376. ELSE
  377. Echo(%&channel% &eTotal money won: &c$%@#totalwon%&e.)
  378. ENDIF
  379. ENDIF
  380.  
  381. IFMATCHES(%@&chatclean%,"%@&regex%\.jackpot")
  382. Echo(%&channel% &eJackpot is currently: &a$%@#jackpot%&e.)
  383. ENDIF
  384.  
  385. IFMATCHES(%@&chatclean%,"%@&regex%(\.collect|\.daily)")
  386. //IFMATCHES(%@&chatclean%,%&blocked%)
  387. //ECHO("&cDisabled under certain conditions.")
  388. //Stop()
  389. //ENDIF
  390.  
  391. MATCH(%@&chatclean%,"%@&regex%(.+)",&collector,1)
  392. IF(%DATE% != %@&bdate%)
  393. UnSet(@&dailybonus[])
  394. Set(@&bdate,%DATE%)
  395. ENDIF
  396.  
  397. IndexOf(@&dailybonus[],#pos,%&collector%)
  398. IF(#pos > -1)
  399. Echo(%&channel% &cYou have already collected your daily bonus\, %@&dailybonus[%#pos%]%.)
  400. ELSE
  401. IndexOf(@&player[],#pos,%&collector%)
  402. IF(#pos > -1)
  403. Echo(&a%&collector% has collected their daily bonus of $%@#dailybonus%!)
  404. Push(@&dailybonus[],%&collector%)
  405. #fix = %@#money[%#pos%]% + %@#dailybonus%
  406. Set(@#money[%#pos%],%#fix%)
  407. ELSE
  408. Push(@&player[],%&collector%)
  409. IndexOf(@&player[],#pos,%&collector%)
  410. Echo(%&channel% &b%@&player[%#pos%]% &eis new and has collected their daily bonus of &a$%@#dailybonus% &eas well-)
  411. Echo(%&channel% &eas &a$%@#starting% &efor being a new player!)
  412. Push(@&dailybonus[],%&collector%)
  413. #total = %@#dailybonus% + %@#starting%
  414. Set(@#money[%#pos%],%#total%)
  415. ENDIF
  416. ENDIF
  417. ENDIF
  418. ENDIF
  419.  
  420. IFMATCHES(%@&chatclean%,%@&regex%\.help)
  421. //IFMATCHES(%@&chatclean%,%&blocked%)
  422. //ECHO("&cDisabled under certain conditions.")
  423. //Stop()
  424. // ENDIF
  425.  
  426. MATCH(%@&chatclean%,"%@&regex%(.+)$",&helpname,1)
  427. IF(&helpname = %PLAYER%)
  428. Log(&f(bet/jackpot/money/collect/set/add/rem/reset/list/color/won))
  429. ELSE
  430. Echo(%&channel% &f(bet/jackpot/money/collect/won))
  431. ENDIF
  432. ENDIF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement