Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on *:text:!bet*:#ecasino.roulette: {
- var %Balance = $read(CasinoChips.txt, s, $nick))
- if ($3 < 10) { msg # $nick $+ , 2the minimum bet is 10 chips. | halt }
- if ($3 > 500) { msg # $nick $+ , 2the maximum bet is 500 chips. | halt }
- if (!%Balance) { msg $chan $nick $+ , 2you don't have any chips, contact an operator. | halt }
- if ($3 !isnum) { msg $chan $nick $+ , 2that is not a valid bet, try !Bet Red 25 | Halt }
- if ($left($3,1) == $chr(45)) { msg $chan $nick $+ , 2you can not use negative numbers $nick | halt }
- if ($3 <= 0) { msg $chan $+ $nick , 2please use a positive number. | halt }
- if ($3) && %Balance < $3 { msg $chan $nick $+ , 2you can not wager that much $nick as you only have %Balance chips. | halt }
- 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) {
- if ($2 != num || $2 < 27 && $2 >= 0) {
- if (%rltimer != on) {
- set %rltimer on
- msg $chan 2You now have 5 seconds to place your bets
- timer 1 5 msg $chan 4Betting is now off
- timer 1 5 unset %rltimer
- timer 1 5 /spin $chan
- }
- msg $chan 2 $+ $nick $+ , your bet on $2 has been added to the table!
- write bets.txt $nick $2 $3
- var %chips $calc($read(CasinoChips.txt, s, $nick) - $3)
- write -ds $nick CasinoChips.txt
- write CasinoChips.txt $nick %chips
- }
- }
- else { msg $chan $nick $+ , 2that is not a valid bet, try !Bet Red 25 }
- }
- alias spin {
- var %num = $rand(0,36)
- if (%num == 0) { var %bets = 0 | msg #eCasino.roulette 2The roulette spins and lands on3 0 [Green] }
- if (%num == 1) { var %bets = 1 red odd row1 column1 low | msg #eCasino.roulette 2The roulette spins and lands on4 1 [Red] }
- if (%num == 2) { var %bets = 2 black even row2 column1 low | msg #eCasino.roulette 2The roulette spins and lands on1 2 [Black] }
- if (%num == 3) { var %bets = 3 red odd row3 column1 low | msg #eCasino.roulette 2The roulette spins and lands on4 3 [Red] }
- if (%num == 4) { var %bets = 4 black even row1 column1 low | msg #eCasino.roulette 2The roulette spins and lands on1 4 [Black] }
- if (%num == 5) { var %bets = 5 red odd row2 column1 low | msg #eCasino.roulette 2The roulette spins and lands on4 5 [Red] }
- if (%num == 6) { var %bets = 6 black even row3 column1 low | msg #eCasino.roulette 2The roulette spins and lands on1 6 [Black] }
- if (%num == 7) { var %bets = 7 red odd row1 column1 low | msg #eCasino.roulette 2The roulette spins and lands on4 7 [Red] }
- if (%num == 8) { var %bets = 8 black even row2 column1 low | msg #eCasino.roulette 2The roulette spins and lands on1 8 [Black] }
- if (%num == 9) { var %bets = 9 red odd row3 column1 low | msg #eCasino.roulette 2The roulette spins and lands on4 9 [Red] }
- if (%num == 10) { var %bets = 10 black even row1 column1 low | msg #eCasino.roulette 2The roulette spins and lands on1 10 [Black] }
- if (%num == 11) { var %bets = 11 black odd row2 column1 low | msg #eCasino.roulette 2The roulette spins and lands on1 11 [Black] }
- if (%num == 12) { var %bets = 12 red even row3 column1 low | msg #eCasino.roulette 2The roulette spins and lands on4 12 [Red] }
- if (%num == 13) { var %bets = 13 black odd row1 column2 low | msg #eCasino.roulette 2The roulette spins and lands on1 13 [Black] }
- if (%num == 14) { var %bets = 14 red even row2 column2 low | msg #eCasino.roulette 2The roulette spins and lands on4 14 [Red] }
- if (%num == 15) { var %bets = 15 black odd row3 column2 low | msg #eCasino.roulette 2The roulette spins and lands on1 15 [Black] }
- if (%num == 16) { var %bets = 16 red even row1 column2 low | msg #eCasino.roulette 2The roulette spins and lands on4 16 [Red] }
- if (%num == 17) { var %bets = 17 black odd row2 column2 low | msg #eCasino.roulette 2The roulette spins and lands on1 17 [Black] }
- if (%num == 18) { var %bets = 18 red even row3 column2 low | msg #eCasino.roulette 2The roulette spins and lands on4 18 [Red] }
- if (%num == 19) { var %bets = 19 red odd row1 column2 high | msg #eCasino.roulette 2The roulette spins and lands on4 19 [Red] }
- if (%num == 20) { var %bets = 20 black even row2 column2 high | msg #eCasino.roulette 2The roulette spins and lands on1 20 [Black] }
- if (%num == 21) { var %bets = 21 red odd row3 column2 high | msg #eCasino.roulette 2The roulette spins and lands on4 21 [Red] }
- if (%num == 22) { var %bets = 22 black even row1 column2 high | msg #eCasino.roulette 2The roulette spins and lands on1 22 [Black] }
- if (%num == 23) { var %bets = 23 red odd row2 column2 high | msg #eCasino.roulette 2The roulette spins and lands on4 23 [Red] }
- if (%num == 24) { var %bets = 24 black even row3 column2 high | msg #eCasino.roulette 2The roulette spins and lands on1 24 [Black] }
- if (%num == 25) { var %bets = 25 red odd row1 column3 high | msg #eCasino.roulette 2The roulette spins and lands on4 25 [Red] }
- if (%num == 26) { var %bets = 26 black even row2 column3 high | msg #eCasino.roulette 2The roulette spins and lands on1 26 [Black] }
- if (%num == 27) { var %bets = 27 red odd row3 column3 high | msg #eCasino.roulette 2The roulette spins and lands on4 27 [Red] }
- if (%num == 28) { var %bets = 28 black even row1 column3 high | msg #eCasino.roulette 2The roulette spins and lands on1 28 [Black] }
- if (%num == 29) { var %bets = 29 black odd row2 column3 high | msg #eCasino.roulette 2The roulette spins and lands on1 29 [Black] }
- if (%num == 30) { var %bets = 30 red even row3 column3 high | msg #eCasino.roulette 2The roulette spins and lands on4 30 [Red] }
- if (%num == 31) { var %bets = 31 black odd row1 column3 high | msg #eCasino.roulette 2The roulette spins and lands on1 31 [Black] }
- if (%num == 32) { var %bets = 32 red even row2 column3 high | msg #eCasino.roulette 2The roulette spins and lands on4 32 [Red] }
- if (%num == 33) { var %bets = 33 black odd row3 column3 high | msg #eCasino.roulette 2The roulette spins and lands on1 33 [Black] }
- if (%num == 34) { var %bets = 34 red even row1 column3 high | msg #eCasino.roulette 2The roulette spins and lands on4 34 [Red] }
- if (%num == 35) { var %bets = 35 black odd row2 column3 high | msg #eCasino.roulette 2The roulette spins and lands on1 35 [Black] }
- if (%num == 36) { var %bets = 36 red even row3 column3 high | msg #eCasino.roulette 2The roulette spins and lands on4 36 [Red] }
- var %count = 1
- while ($read(bets.txt, %count) != $null) {
- var %nick $gettok($read(bets.txt, %count),1,32)
- var %bet $gettok($read(bets.txt, %count),2,32)
- var %amount $gettok($read(bets.txt, %count),3,32)
- if (%bet == $gettok(%bets,1,32)) {
- var %won true
- var %chips $calc($read(CasinoChips.txt, s, %nick) + %amount * 37)
- write -ds $+ %nick CasinoChips.txt
- write CasinoChips.txt %nick %chips
- msg $1 2 $+ %nick has won $calc(%amount * 36) chips with their bet on %bet
- }
- elseif ((%bet == $gettok(%bets,2,32)) || (%bet == $gettok(%bets,3,32)) || (%bet == $gettok(%bets,6,32))) {
- var %won true
- var %chips $calc($read(CasinoChips.txt, s, %nick) + %amount * 2)
- write -ds $+ %nick CasinoChips.txt
- write CasinoChips.txt %nick %chips
- msg $1 2 $+ %nick has won %amount chips with their bet on %bet
- }
- elseif ((%bet == $gettok(%bets,4,32)) || (%bet == $gettok(%bets,5,32))) {
- var %won true
- var %chips $calc($read(CasinoChips.txt, s, %nick) + %amount * 2)
- write -ds $+ %nick CasinoChips.txt
- write CasinoChips.txt %nick %chips
- msg $1 2 $+ %nick has won $calc(%amount * 2) chips with their bet on %bet
- }
- inc %count
- }
- if (%won == true) {
- msg $1 2All other bets were lost, better luck next time!
- }
- else {
- msg $1 2Looks like we have no winners... better luck next time!
- }
- remove bets.txt
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement