Advertisement
illpastethat

eCasino Roulette for JammyPear

Jan 3rd, 2013
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 7.88 KB | None | 0 0
  1. on *:text:!bet*:#ecasino.roulette: {
  2.   var %Balance = $read(CasinoChips.txt, s, $nick))
  3.   if ($3 < 10) { msg # $nick $+ , 2the minimum bet is 10 chips. | halt }
  4.   if ($3 > 500) { msg # $nick $+ , 2the maximum bet is 500 chips. | halt }
  5.   if (!%Balance) { msg $chan $nick $+ , 2you don't have any chips, contact an operator. | halt }
  6.   if ($3 !isnum) { msg $chan $nick $+  , 2that is not a valid bet, try !Bet Red 25 | Halt }
  7.   if ($left($3,1) == $chr(45)) { msg $chan $nick $+ , 2you can not use negative numbers $nick | halt }
  8.   if ($3 <= 0) { msg $chan $+ $nick , 2please use a positive number. | halt }
  9.   if ($3) && %Balance < $3 { msg $chan $nick $+ , 2you can not wager that much $nick as you only have %Balance chips. | halt }
  10.   if ($2 == Red || $2 == Black || $2 == Odd || $2 == Even || $2 == Row1 || $2 == Row2 || $2 == Row3 || $2 == Column1 || $2 == Column2 || $2 == Column3 || $2 == low || $2 == high || $2 isnum) {
  11.     if ($2 != num || $2 < 27 && $2 >= 0) {
  12.       if (%rltimer != on) {
  13.         set %rltimer on
  14.         msg $chan 2You now have 5 seconds to place your bets
  15.         timer 1 5 msg $chan 4Betting is now off
  16.         timer 1 5 unset %rltimer
  17.         timer 1 5 /spin $chan
  18.       }
  19.       msg $chan 2 $+ $nick $+ , your bet on $2 has been added to the table!
  20.       write bets.txt $nick $2 $3
  21.       var %chips $calc($read(CasinoChips.txt, s, $nick) - $3)
  22.       write -ds $nick CasinoChips.txt
  23.       write CasinoChips.txt $nick %chips
  24.     }
  25.   }
  26.   else { msg $chan $nick $+ , 2that is not a valid bet, try !Bet Red 25 }
  27. }
  28. alias spin {
  29.   var %num = $rand(0,36)
  30.   if (%num == 0) { var %bets = 0 | msg #eCasino.roulette 2The roulette spins and lands on3 0 [Green] }
  31.   if (%num == 1) { var %bets = 1 red odd row1 column1 low | msg #eCasino.roulette 2The roulette spins and lands on4 1 [Red] }
  32.   if (%num == 2) { var %bets = 2 black even row2 column1 low | msg #eCasino.roulette 2The roulette spins and lands on1 2 [Black] }
  33.   if (%num == 3) { var %bets = 3 red odd row3 column1 low | msg #eCasino.roulette 2The roulette spins and lands on4 3 [Red] }
  34.   if (%num == 4) { var %bets = 4 black even row1 column1 low | msg #eCasino.roulette 2The roulette spins and lands on1 4 [Black] }
  35.   if (%num == 5) { var %bets = 5 red odd row2 column1 low | msg #eCasino.roulette 2The roulette spins and lands on4 5 [Red] }
  36.   if (%num == 6) { var %bets = 6 black even row3 column1 low | msg #eCasino.roulette 2The roulette spins and lands on1 6 [Black] }
  37.   if (%num == 7) { var %bets = 7 red odd row1 column1 low | msg #eCasino.roulette 2The roulette spins and lands on4 7 [Red] }
  38.   if (%num == 8) { var %bets = 8 black even row2 column1 low | msg #eCasino.roulette 2The roulette spins and lands on1 8 [Black] }
  39.   if (%num == 9) { var %bets = 9 red odd row3 column1 low | msg #eCasino.roulette 2The roulette spins and lands on4 9 [Red] }
  40.   if (%num == 10) { var %bets = 10 black even row1 column1 low | msg #eCasino.roulette 2The roulette spins and lands on1 10 [Black] }
  41.   if (%num == 11) { var %bets = 11 black odd row2 column1 low | msg #eCasino.roulette 2The roulette spins and lands on1 11 [Black] }
  42.   if (%num == 12) { var %bets = 12 red even row3 column1 low | msg #eCasino.roulette 2The roulette spins and lands on4 12 [Red] }
  43.   if (%num == 13) { var %bets = 13 black odd row1 column2 low | msg #eCasino.roulette 2The roulette spins and lands on1 13 [Black] }
  44.   if (%num == 14) { var %bets = 14 red even row2 column2 low | msg #eCasino.roulette 2The roulette spins and lands on4 14 [Red] }
  45.   if (%num == 15) { var %bets = 15 black odd row3 column2 low | msg #eCasino.roulette 2The roulette spins and lands on1 15 [Black] }
  46.   if (%num == 16) { var %bets = 16 red even row1 column2 low | msg #eCasino.roulette 2The roulette spins and lands on4 16 [Red] }
  47.   if (%num == 17) { var %bets = 17 black odd row2 column2 low | msg #eCasino.roulette 2The roulette spins and lands on1 17 [Black] }
  48.   if (%num == 18) { var %bets = 18 red even row3 column2 low | msg #eCasino.roulette 2The roulette spins and lands on4 18 [Red] }
  49.   if (%num == 19) { var %bets = 19 red odd row1 column2 high | msg #eCasino.roulette 2The roulette spins and lands on4 19 [Red] }
  50.   if (%num == 20) { var %bets = 20 black even row2 column2 high | msg #eCasino.roulette 2The roulette spins and lands on1 20 [Black] }
  51.   if (%num == 21) { var %bets = 21 red odd row3 column2 high | msg #eCasino.roulette 2The roulette spins and lands on4 21 [Red] }
  52.   if (%num == 22) { var %bets = 22 black even row1 column2 high | msg #eCasino.roulette 2The roulette spins and lands on1 22 [Black] }
  53.   if (%num == 23) { var %bets = 23 red odd row2 column2 high | msg #eCasino.roulette 2The roulette spins and lands on4 23 [Red] }
  54.   if (%num == 24) { var %bets = 24 black even row3 column2 high | msg #eCasino.roulette 2The roulette spins and lands on1 24 [Black] }
  55.   if (%num == 25) { var %bets = 25 red odd row1 column3 high | msg #eCasino.roulette 2The roulette spins and lands on4 25 [Red] }
  56.   if (%num == 26) { var %bets = 26 black even row2 column3 high | msg #eCasino.roulette 2The roulette spins and lands on1 26 [Black] }
  57.   if (%num == 27) { var %bets = 27 red odd row3 column3 high | msg #eCasino.roulette 2The roulette spins and lands on4 27 [Red] }
  58.   if (%num == 28) { var %bets = 28 black even row1 column3 high | msg #eCasino.roulette 2The roulette spins and lands on1 28 [Black] }
  59.   if (%num == 29) { var %bets = 29 black odd row2 column3 high | msg #eCasino.roulette 2The roulette spins and lands on1 29 [Black] }
  60.   if (%num == 30) { var %bets = 30 red even row3 column3 high | msg #eCasino.roulette 2The roulette spins and lands on4 30 [Red] }
  61.   if (%num == 31) { var %bets = 31 black odd row1 column3 high | msg #eCasino.roulette 2The roulette spins and lands on1 31 [Black] }
  62.   if (%num == 32) { var %bets = 32 red even row2 column3 high | msg #eCasino.roulette 2The roulette spins and lands on4 32 [Red] }
  63.   if (%num == 33) { var %bets = 33 black odd row3 column3 high | msg #eCasino.roulette 2The roulette spins and lands on1 33 [Black] }
  64.   if (%num == 34) { var %bets = 34 red even row1 column3 high | msg #eCasino.roulette 2The roulette spins and lands on4 34 [Red] }
  65.   if (%num == 35) { var %bets = 35 black odd row2 column3 high | msg #eCasino.roulette 2The roulette spins and lands on1 35 [Black] }
  66.   if (%num == 36) { var %bets = 36 red even row3 column3 high | msg #eCasino.roulette 2The roulette spins and lands on4 36 [Red] }
  67.   var %count = 1
  68.   while ($read(bets.txt, %count) != $null) {
  69.     var %nick $gettok($read(bets.txt, %count),1,32)
  70.     var %bet $gettok($read(bets.txt, %count),2,32)
  71.     var %amount $gettok($read(bets.txt, %count),3,32)
  72.     if (%bet == $gettok(%bets,1,32)) {
  73.       var %won true
  74.       var %chips $calc($read(CasinoChips.txt, s, %nick) + %amount * 37)
  75.       write -ds $+ %nick CasinoChips.txt
  76.       write CasinoChips.txt %nick %chips
  77.       msg $1 2 $+ %nick has won $calc(%amount * 36) chips with their bet on %bet
  78.     }
  79.     elseif ((%bet == $gettok(%bets,2,32)) || (%bet == $gettok(%bets,3,32)) || (%bet == $gettok(%bets,6,32))) {
  80.       var %won true
  81.       var %chips $calc($read(CasinoChips.txt, s, %nick) + %amount * 2)
  82.       write -ds $+ %nick CasinoChips.txt
  83.       write CasinoChips.txt %nick %chips
  84.       msg $1 2 $+ %nick has won %amount chips with their bet on %bet
  85.     }
  86.     elseif ((%bet == $gettok(%bets,4,32)) || (%bet == $gettok(%bets,5,32))) {
  87.       var %won true
  88.       var %chips $calc($read(CasinoChips.txt, s, %nick) + %amount * 2)
  89.       write -ds $+ %nick CasinoChips.txt
  90.       write CasinoChips.txt %nick %chips
  91.       msg $1 2 $+ %nick has won $calc(%amount * 2) chips with their bet on %bet
  92.     }
  93.     inc %count
  94.   }
  95.   if (%won == true) {
  96.     msg $1 2All other bets were lost, better luck next time!
  97.   }
  98.   else {
  99.     msg $1 2Looks like we have no winners... better luck next time!
  100.   }
  101.   remove bets.txt
  102. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement