tglogo.png

Downloading File

Filename: Roulette V2

on *:text:!play*:#: {  
  if (!$hget(Roully, $address($nick,2))) { msg $chan $nick you don't have an account, type !new | halt }
  if ($3 !isnum) { msg $chan You can only bet numerical values. | Halt }
  if ($left($3,1) == $chr(45)) { msg $chan You can not use negative numbers $nick | halt }
  if ($3 <= 0) { msg $chan Please use a positive number. | halt }
  if ($3) && ($hget(Roully, $address($nick,2)) < $3) { msg $chan You can not wager that much $nick as you only have $chr(36) $+ $hget(Roully, $address($nick,2)) $+ . | halt }
  if ($2 == Red || $2 == Black || $2 == Odd || $2 == Even || $2 == Row1 || $2 == Row2 || $2 == Row3 || $2 == Column1 || $2 == Column2 || $2 == Column3 || $2 isnum) {
    if ($2 != num || $2 < 27 && $2 >= 0) {
      if (%rltimer != on) { 
        set %rltimer on 
        msg $chan You now have 60 seconds to place your bets 
        timer 1 60 msg $chan Betting is now off 
        timer 1 60 unset %rltimer
        timer 1 60 /spin $chan
      }
      msg $chan Your bet has been added to the table!
      write bets.txt $address($nick, 2) $nick $2 $3
      hdec Roully $address($nick, 2) $3
    }
  }
  else { msg $chan That is not a valid bet, try !play red 1000 }
}
alias spin { 
  var %num = $rand(0,36)
  msg $1 The Roulette spins and lands on %num
  if (%num == 0) { var %bets = 0 }
  if (%num == 1) { var %bets = 1 red odd row1 column1 }
  if (%num == 2) { var %bets = 2 black even row2 column1 }
  if (%num == 3) { var %bets = 3 red odd row3 column1 }
  if (%num == 4) { var %bets = 4 black even row1 column1 }
  if (%num == 5) { var %bets = 5 red odd row2 column1 }
  if (%num == 6) { var %bets = 6 black even row3 column1 }
  if (%num == 7) { var %bets = 7 red odd row1 column1 }
  if (%num == 8) { var %bets = 8 black even row2 column1 }
  if (%num == 9) { var %bets = 9 red odd row3 column1 }
  if (%num == 10) { var %bets = 10 black even row1 column1 }
  if (%num == 11) { var %bets = 11 black odd row2 column1 }
  if (%num == 12) { var %bets = 12 red even row3 column1 }
  if (%num == 13) { var %bets = 13 black odd row1 column2 }
  if (%num == 14) { var %bets = 14 red even row2 column2 }
  if (%num == 15) { var %bets = 15 black odd row3 column2 }
  if (%num == 16) { var %bets = 16 red even row1 column2 }
  if (%num == 17) { var %bets = 17 black odd row2 column2 }
  if (%num == 18) { var %bets = 18 red even row3 column2 }
  if (%num == 19) { var %bets = 19 red odd row1 column2 }
  if (%num == 20) { var %bets = 20 black even row2 column2 }
  if (%num == 21) { var %bets = 21 red odd row3 column2 }
  if (%num == 22) { var %bets = 22 black even row1 column2 }
  if (%num == 23) { var %bets = 23 red odd row2 column2 }
  if (%num == 24) { var %bets = 24 black even row3 column2 }
  if (%num == 25) { var %bets = 25 red odd row1 column3 }
  if (%num == 26) { var %bets = 26 black even row2 column3 }
  if (%num == 27) { var %bets = 27 red odd row3 column3 }
  if (%num == 28) { var %bets = 28 black even row1 column3 }
  if (%num == 29) { var %bets = 29 black odd row2 column3 }
  if (%num == 30) { var %bets = 30 red even row3 column3 }
  if (%num == 31) { var %bets = 31 black odd row1 column3 }
  if (%num == 32) { var %bets = 32 red even row2 column3 }
  if (%num == 33) { var %bets = 33 black odd row3 column3 }
  if (%num == 34) { var %bets = 34 red even row1 column3 }
  if (%num == 35) { var %bets = 35 black odd row2 column3 }
  if (%num == 36) { var %bets = 36 red even row3 column3 }
  var %count = 1
  while ($read(bets.txt, %count) != $null) {
    var %add = $wildtok($read(bets.txt, %count), *, 1, 32)
    var %nick = $wildtok($read(bets.txt, %count), *, 2, 32)
    var %bet = $wildtok($read(bets.txt, %count), *, 3, 32)
    var %ammount = $wildtok($read(bets.txt, %count), *, 4, 32)
    if (%bet isin %bets) {
      if (%bet == Red || %bet == Black || %bet == Odd || %bet == Even) {
        hinc Roully %add $calc(%ammount * 2) 
        msg $1 %nick has won %ammount with their bet on %bet
      }
      if (%bet == Row1 || %bet == Row2 || %bet == Row3 || %bet == Column1 || %bet == Column2 || %bet == Column3) { 
        hinc Roully %add $calc(%ammount * 3)
        msg $1 %nick has won $calc(%ammount * 2) with their bet on %bet 
      }
      if (%bet == 0 || %bet == 1 || %bet == 2 || %bet == 3 || %bet == 4 || %bet == 5 || %bet == 6 || %bet == 7 || %bet == 8 || %bet == 9 || %bet == 10 || %bet == 11 || %bet == 12 || %bet == 13 || %bet == 14 || %bet == 15 || %bet == 16 || %bet == 17 || %bet == 18 || %bet == 19 || %bet == 20 || %bet == 21 || %bet == 22 || %bet == 23 || %bet == 24 || %bet == 25 || %bet == 26 || %bet == 27 || %bet == 28 || %bet == 29 || %bet == 30 || %bet == 31 || %bet == 32 || %bet == 33 || %bet == 34 || %bet == 35 || %bet == 36) { 
        hinc Roully %add $calc(%ammount * 37)
        msg $1 %nick has won $calc(%ammount * 36) with their bet on %bet  
      }
    }
    inc %count
  }
  msg $1 All other bets were lost, better luck next time!
  remove bets.txt
}
on *:text:!new:#:{ 
  if ($hget(Roully, $address($nick,2)) < 0 || $hget(Roully, $address($nick,2))) { msg $chan $nick You already have an account. | halt }
  if (!$hget(Roully, $address($nick,2)) || $hget(Roully, $address($nick,2)) >= 0) {
    hadd -m Roully $address($nick,2) 100000 
    msg $chan A new account has been created. $nick has $chr(36) $+ 100000 to gamble.
  }
}
on *:text:!money*:#:{ 
  if (!$2) {
    if ($hget(Roully, $address($nick,2)) > 0) { msg $chan $nick has $chr(36) $+ $hget(Roully, $address($nick,2)) dollars. }
    else { msg $chan $nick is broke. | halt } 
  }
  else if ($2 == $me) { msg $chan I am rich! Fear me! | halt } 
  else if ($2 != $me) { 
    if ($hget(Roully, $address($2,2)) > 0) { msg $chan $2 has $chr(36) $+ $hget(Roully, $address($2,2)) dollars. }
    else { msg $chan $2 is broke. | halt }
  }
}
on *:text:!reset*:#: { 
  if (!$2) { 
    if ($hget(Roully, $address($nick,2)) < 0 || !$hget(Roully, $address($nick,2))) { msg $chan You do not have an account. | halt }
    if ($hget(Roully, $address($nick,2)) || $hget(Roully, $address($nick,2)) >= 0) {
      hadd Roully $address($nick,2) 100000 
      msg $chan $nick $+ 's money has been reset to $chr(36) $+ 100000.
    }
  }
}
on *:text:!give*:#: { 
  if ($2) { 
    if (!$hget(Roully, $address($nick, 2))) { msg $chan You do not have an account. | halt }
    if (!$hget(Roully, $address($2, 2))) { msg $chan This person does not have an account. | halt }
    if ($hget(Roully, $address($nick,2)) > $3) {
      hdec Roully $address($nick,2) $3
      hinc Roully $address($2,2) $3
      msg $chan $nick gave $2 $ $+ $3 $+ .
    }
    else { msg $chan You do not have that much money to give }
  }
}
on *:text:!rlycommands*:#: { 
  msg $chan !New, !Reset, !Money/!Money (Nick), !Give (Nick), !Play (Bet) (Ammount)
  msg $chan Bets are Red, Black, Odd, Even, Row1 - Row3, Column1 - Column3, 0 - 36
}


Related Files


Please note that on our website we use cookies necessary for the functioning of our website, cookies that optimize the performance. To learn more about our cookies, how we use them and their benefits, please read our Cookie Policy.
I Understand