craps

By ovelayer on Mar 28, 2013

cant remember who posted it but it wasnt working
fixed it (not sure if its the best coding but it works)
enjoy

on *:LOAD: { set %c ! }
on *:TEXT:*Craps*:*: {
  if ($1 = %c $+ Craps) {
    if ($2 = $null) { notice $nick 0(7 $+ $Nick $+ 0) No Money Was Bet, Please Bet Money With Your Craps, No Freebies xD | halt }
    if ($2 != $null) && ($readini(Money.ini,$nick,Money) <= $2) { notice $Nick 0(7 $+ $Nick $+ 0) You Dont Have Enough Money To Place This Bet! Bet Lower, Type %c $+ balance To View Money That You Have and %c $+ money to get money | halt }
    if ($2 != $null) && ($readini(Money.ini,$nick,Money) >= $2) {
      var %R = $rand(1,6) | var %C = $rand(1,6)
      var %T = $Calc(%R + %C)
      writeini Bet.ini $nick Bet $2- 
      msg $chan 0(7 $+ $Nick $+ 0) Rolled Two Dice For Craps: Results; ( $+ %R and %C $+ )
      msg $chan 6Dice Roll Total; (8 %T 6)
    }
    if (%T = 7) || (%T = 11) {
      msg $chan 0,10(7 $+ $Nick $+ 0) GOT CRAPS!! 
      var %Bet = $readini(Bet.ini,$nick,Bet)
      var %Current = $readini(Money.ini,$nick,Money)
      var %TotalWin = $Calc(%bet + %Current)
      remini Money.ini $nick Money
      remini Bet.ini $nick Bet
      writeini Money.ini $Nick Money %totalwin
      msg $chan 0(7 $+ $Nick $+ 0) Now Has $readini(Money.ini,$nick,Money) 
      halt
    }
    else {
      msg $chan 0(7 $+ $Nick $+ 0) Didnt Get Craps
      var %Bet = $readini(Bet.ini,$nick,Bet)
      var %Current = $readini(Money.ini,$nick,Money)
      var %TotalLoss = $Calc(%current - %bet)
      remini Money.ini $nick Money 
      remini Bet.ini $nick Bet 
      writeini Money.ini $Nick Money %TotalLoss
      msg $chan 0(7 $+ $Nick $+ 0) Now Has %TotalLoss
    }
  }
}
on *:TEXT:*money*:*: {
  if ($1 = %c $+ money) {
    if ($readini(Money.ini,$nick,Money) = 0) { msg $chan I'm feeling generous today | writeini Money.ini $nick Money 1000 | msg $chan 0(7 $+ $Nick $+ 0) Now Has7 1000 0Dollars | halt }
    if ($readini(Money.ini,$nick,Money) = 1) { msg $chan you lost everything.. | .timer 1 2 msg $chan I'm feeling generous today | writeini Money.ini $nick Money 1000 | msg $chan ( $+ $Nick $+ ) Now Has 1000 Dollars | halt }
    if ($readini(Money.ini,$nick,Money) = $null) {
      writeini Money.ini $nick Money 1000
      msg $chan 0(7 $+ $Nick $+ 0) Now Has 1000 Dollars | halt
    }
  }
}
on *:TEXT:*balance*:*: {
  if ($1 = %c $+ Balance) {
    if ($2 = $null) {
      msg $chan $+(7,$nick) 14You have7 $readini(Money.ini,$nick,Money) 14Dollars for Craps.
      halt
    }
    if ($2 != $null) {
      msg $chan $2 Has $readini(Money.ini,$2,money) Dollars
      halt
    }
    if ($readini(Money.ini,$nick,Money) = $null) { msg $chan $nick Has No Money, Use %c $+ Money To Get some | halt }
    if ($readini(Money.ini,$2,Money) = $null) { msg $chan $2 has No Money, Use %c $+ Money To Get some | halt }
  }
}

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.