Casino Bot

By csgraves28 on Apr 05, 2011

This is a Casino Bot that i got from here..It is not mine I give full credits to the author of this script (Chef-Tech)..
http://www.evolutionscriptz.com/downloads.php?view=detail&df_id=241 I am mainly posting this because i need help on flood protection so my bot doesn't flood off the server i am on..Many thanks for any and all help :)

;Bar & Casino v3 Mirc addon by CHeF-TeCH
;http://www.hawkee.com/phpBB2/profile.php?mode=viewprofile&u=5611
;Here is where i thank:
;RaYdAwG for Blackjack ver. 2.5 http://raydawg005.tripod.com privided key code
;the_prince for Casino-Bot 2.0 http://www.angelfire.com/linux/the_prince/ which was the the idea 
;CowBoy for Craps Bot  http://www.hawkee.com/snippet.php?snippet_id=809
;
;SLOTS
on *:TEXT:!slots:#:{
  if ($readini( casino.ini, $nick, Money ) == $null) {
    /notice $nick $+ , You have not registered yet. Please have some complimentary chips. Type: !atm
    halt
  }
  if ($readini( casino.ini, $nick, Money ) < 5) {
    /notice $nick 10Sorry but you don't have enough money. Ask someone for a loan.
    halt
  }
  if ($rand(1,6) == 1) /set %srand1 ¤
  if ($rand(1,6) == 2) /set %srand1 ¤
  if ($rand(1,6) == 3) /set %srand1 ¤
  if ($rand(1,6) == 4) /set %srand1 Î
  if ($rand(1,6) == 5) /set %srand1 Î
  if ($rand(1,6) == 6) /set %srand1 ¥
  ; 
  if ($rand(1,6) == 1) /set %srand2 ¤
  if ($rand(1,6) == 2) /set %srand2 ¤
  if ($rand(1,6) == 3) /set %srand2 ¤
  if ($rand(1,6) == 4) /set %srand2 Î
  if ($rand(1,6) == 5) /set %srand2 Î
  if ($rand(1,6) == 6) /set %srand2 ¥
  ; 
  if ($rand(1,6) == 1) /set %srand3 ¤
  if ($rand(1,6) == 2) /set %srand3 ¤
  if ($rand(1,6) == 3) /set %srand3 ¤
  if ($rand(1,6) == 4) /set %srand3 Î
  if ($rand(1,6) == 5) /set %srand3 Î
  if ($rand(1,6) == 6) /set %srand3 ¥
  /set %money.temp $calc( $readini( casino.ini, $nick, Money ) -5 )
  /writeini casino.ini $nick Money %money.temp
  /unset %money.temp
  /msg $chan 10 $+ $nick pulls the handle...the slots are ( %srand1 )( %srand2 )( %srand3 )
  if (%srand1 == ¤) if (%srand2 == ¤) if (%srand3 == ¤) /msg $chan 10Congrats $nick $+ !!! You have won 100 dollars!!!
  if (%srand1 == ¤) if (%srand2 == ¤) if (%srand3 == ¤) /set %money.won $calc( $readini( casino.ini, $nick, Money ) +100 )
  if (%srand1 == ¤) if (%srand2 == ¤) if (%srand3 == ¤) /writeini casino.ini $nick Money %money.won
  if (%srand1 == ¤) if (%srand2 == ¤) if (%srand3 == ¤) /unset %money.won
  if (%srand1 == Î) if (%srand2 == Î) if (%srand3 == Î) /msg $chan 10Congrats $nick $+ !!! You have won 500 dollars!!!
  if (%srand1 == Î) if (%srand2 == Î) if (%srand3 == Î) /set %money.won $calc( $readini( casino.ini, $nick, Money ) +500 )
  if (%srand1 == Î) if (%srand2 == Î) if (%srand3 == Î) /writeini casino.ini $nick Money %money.won
  if (%srand1 == Î) if (%srand2 == Î) if (%srand3 == Î) /unset %money.won
  if (%srand1 == ¥) if (%srand2 == ¥) if (%srand3 == ¥) /msg $chan 10JACKPOT!!!! You have won 1,000 dollars $nick $+ !!!
  if (%srand1 == ¥) if (%srand2 == ¥) if (%srand3 == ¥) /set %money.won $calc( $readini( casino.ini, $nick, Money ) +1000 )
  if (%srand1 == ¥) if (%srand2 == ¥) if (%srand3 == ¥) /writeini casino.ini $nick Money %money.won
  if (%srand1 == ¥) if (%srand2 == ¥) if (%srand3 == ¥) /unset %money.won
}
;MONEY MANAGMENT
on *:TEXT:!money*:#:{
  if ($readini( casino.ini, $nick, Money ) == $null) {
    /notice $nick $+ , You have not registered yet. Please have some complimentary chips. Type: !atm
    halt
  }
  if ($2 != $null) {
    if ($readini( casino.ini, $2, Money ) == $null) {
      /msg $chan $2 has not registered.
      halt
    }
    else /msg $chan 10 $$2 has $readini(casino.ini, $$2, Money) dollars.
  }
  if ($2 == $null) /msg $chan 10 $nick has $readini(casino.ini, $nick, Money) dollars.
}
;GIVE
on *:TEXT:!give*:#:{
  if ($readini( casino.ini, $nick, Money ) == $null) {
    /notice $nick $+ , You have not registered yet. Please have some complimentary chips. Type: !atm
    halt
  }
  if ($2 == $null) {
    /notice $nick 10Please use a nickname. ex: !give nick 100
    halt
  }
  if ($3 == $null) {
    /notice $nick 10Please use a type a dollar ammount. ex: !give nick 100
    halt
  }
  if ($$3 < 1) {
    /notice $nick 10Please give more than 1 dollar.
    halt
  }
  if ($readini( casino.ini, $nick, Money ) < $3) {
    /msg $chan 10Sorry $nick doesn't have $3 dollars to give $$2 
    halt
  }
  if ($2 == $nick) {
    /notice $nick 10You can't give money to yourself, you already have it!
    halt
  }
  if ($readini( casino.ini, $nick, Money ) >= $3) {
    /set %money.give $calc( $readini( casino.ini, $nick, Money ) - $3 ) 
    /msg $chan 10 $nick has given $$2 $3 dollars. 
    /set %money.given $calc( $readini( casino.ini, $2, Money ) + $3 ) 
    /writeini casino.ini $nick Money %money.give
    /writeini casino.ini $2 Money %money.given
    /unset %money.give
    /unset %money.given
  }
}
;PICK3
on *:TEXT:!pickthree*:#:{
  if ($readini( casino.ini, $nick, Money ) == $null) {
    /notice $nick $+ , You have not registered yet. Please have some complimentary chips. Type: !atm
    halt
  }
  if ($2 == $null) {
    /notice $nick 10Please pick three numbers 0-9. ex: !pickthree 1 2 3
    halt
  }
  if ($3 == $null) {
    /notice $nick 10Please pick three numbers 0-9. ex: !pickthree 1 2 3
    halt
  }
  if ($4 == $null) {
    /notice $nick 10Please pick three numbers 0-9. ex: !pickthree 1 2 3
    halt
  }
  if ($readini( casino.ini, $nick, Money ) < 5) {
    /notice $nick 10Sorry but you don't have enough money. Ask someone for a loan.
    halt
  }
  if ($readini( casino.ini, $nick, Money ) >= 5) {
    /set %lotto.nick $2 $3 $4
    %lotto.nick = $sorttok(%lotto.nick,32,n)
    /set %lotto.winner $rand(0,9) $rand(0,9) $rand(0,9)
    %lotto.winner = $sorttok(%lotto.winner,32,n)
    if (%lotto.nick == %lotto.winner) {
      /msg $chan 10Congrats $nick $+ !!! The numbers were -----> %lotto.winner <------ You have just won 100,000,000 dollars!!!!
      /set %money.won $calc( $readini( casino.ini, $nick, Money ) + 100000000)
      /writeini casino.ini $nick Money %money.won
      /unset %money.won
      /unset %lotto.nick
      /unset %lotto.winner
    }
    if (%lotto.nick != %lotto.winner) {
      /msg $chan 10Sorry $nick $+ , but you have lost 5 dollars. The numbers were -----> %lotto.winner <------ Try again. Remember if you win you get 100,000,000 dollars!!
      /set %money.temp $calc( $readini( casino.ini, $nick, Money ) - 5)
      /writeini casino.ini $nick Money %money.temp
      /unset %money.temp
      /unset %lotto.nick
      /unset %lotto.winner
    }
  } 
}
;LOTTO
on *:TEXT:!luckylotto*:#:{
  if ($readini( casino.ini, $nick, Money ) == $null) {
    /notice $nick $+ , You have not registered yet. Please have some complimentary chips. Type: !atm
    halt
  }
  if ($2 == $null) {
    /notice $nick 10Please enter a number 1-9. ex: !luckylotto 5
    halt
  }
  if ($readini( casino.ini, $nick, Money ) < 10) {
    /notice $nick 10Sorry but you don't have enough money. Ask someone for a loan.
    halt
  }
  if ($readini( casino.ini, $nick, Money ) >= 10) {
    /set %lotto.user $2
    /set %lotto.number $rand(1,9)
    if (%lotto.user == %lotto.number) {
      /msg $chan 10Congrats $nick $+ !!! You have just won 100 dollars!!!!
      /set %money.won $calc( $readini( casino.ini, $nick, Money ) + 100)
      /writeini casino.ini $nick Money %money.won
      /unset %money.won
    }
    if (%lotto.user != %lotto.number) {
      /msg $chan 10Sorry $nick $+ , but you lost 10 dollars. The number was ---> %lotto.number <---- Try again. Jackpot is 100 dollars!!
    }
    /set %money.temp $calc( $readini( casino.ini, $nick, Money ) - 10)
    /writeini casino.ini $nick Money %money.temp
    /unset %money.temp
    /unset %lotto.user
    /unset %lotto.number
  }
}
;COINTOSS
on *:TEXT:!cointoss*:#:{
  if ($readini( casino.ini, $nick, Money ) == $null) {
    /notice $nick $+ , You have not registered yet. Please have some complimentary chips. Type: !atm
    halt
  }
  if ($readini( casino.ini, $nick, Money ) < $2) {
    /notice $nick 10Sorry but you don't have $2 dollars to spend.
    halt
  }
  if ($2 == $null) {
    /notice $nick 10Please type a dollar ammount. ex: !cointoss (money) (heads or tails)
    halt
  }
  if ($3 == $null) { 
    /notice $nick 10Please indicate whether you are betting on heads or tails. ex: !cointoss (money) (heads or tails)
    halt
  }
  if ($2 < 1) {
    /notice $nick 10Please bet with 1 dollar or more.
    halt
  } 
  if ($readini( casino.ini, $nick, Money ) >= $2) {
    /set %coinflip $rand(1,2)
    if ((%coinflip == 1) && ($3 == heads)) {
      /msg $chan 10Congratulations!!! $nick You have won $2 dollars!!!
      /set %money.temp $calc( $readini( casino.ini, $nick, Money ) + $2)
    }
    if ((%coinflip == 2) && ($3 == tails)) {
      /msg $chan 10Congratulations!!! $nick You have won $2 dollars!!!
      /set %money.temp $calc( $readini( casino.ini, $nick, Money ) + $2)
    }
    if ((%coinflip != 2) && ($3 == tails)) {
      /msg $chan 10Sorry $nick $+ , You lost $2 dollars. The coin landed on HEADS.
      /set %money.temp $calc( $readini( casino.ini, $nick, Money ) - $2) 
    }
    if ((%coinflip == 2) && ($3 != tails)) {
      /msg $chan 10Sorry $nick $+ , You lost $2 dollars. The coin landed on TAILS.
      /set %money.temp $calc( $readini( casino.ini, $nick, Money ) - $2)
    }
    /writeini casino.ini $nick Money %money.temp
    /unset %money.temp
    /unset %coinflip
  }
}
;BAR
on *:TEXT:!beer*:#:{
  if ($readini( casino.ini, $nick, Money ) == $null) {
    /notice $nick $+ , You have not registered yet. Please have some complimentary chips. Type: !atm
    halt
  } 
  if ($readini( casino.ini, $nick, Money ) < 5) {
    /notice $nick $+ , Ask a friend for some cash, no credit here.
    halt
  } 
  if ($2 != $null) /msg $chan 13 $+ $nick buys $$2 a $read(casinobeer.txt)
  if ($2 == $null) /describe $chan pours $nick an ice cold $read(casinobeer.txt)
  /set %money.drink $calc( $readini( casino.ini, $nick, Money ) -5 )
  /writeini casino.ini $nick Money %money.drink
  /unset %money.drink
}
on *:TEXT:!malt*:#:{
  if ($readini( casino.ini, $nick, Money ) == $null) {
    /notice $nick $+ , You have not registered yet. Please have some complimentary chips. Type: !atm
    halt
  }
  if ($readini( casino.ini, $nick, Money ) < 2) {
    /notice $nick $+, Ask a friend for some cash, no credit here.
    halt
  }
  if ($2 != $null) /msg $chan 13 $+ $nick buys $$2 a $read(casinomalt.txt)
  if ($2 == $null) /describe $chan hands $nick a 40 of $read(casinomalt.txt)
  /set %money.drink $calc( $readini( casino.ini, $nick, Money ) -2 )
  /writeini casino.ini $nick Money %money.drink
  /unset %money.drink
}
on *:TEXT:!mixed*:#:{
  if ($readini( casino.ini, $nick, Money ) == $null) {
    /notice $nick $+ , You have not registered yet. Please have some complimentary chips. Type: !atm
    halt
  }
  if ($readini( casino.ini, $nick, Money ) < 8) {
    /notice $nick $+ , Ask a friend for some cash, no credit here.
    halt
  }
  if ($2 != $null) /msg $chan 13 $+ $nick buys $$2 a $read(casinomixed.txt)
  if ($2 == $null) /describe $chan mixes up a $read(casinomixed.txt) for $nick
  /set %money.drink $calc( $readini( casino.ini, $nick, Money ) -8 )
  /writeini casino.ini $nick Money %money.drink
  /unset %money.drink
}
on *:TEXT:!wine*:#:{
  if ($readini( casino.ini, $nick, Money ) == $null) {
    /notice $nick $+ , You have not registered yet. Please have some complimentary chips. Type: !atm
    halt
  }
  if ($readini( casino.ini, $nick, Money ) < 10) {
    /notice $nick $+ Ask a friend for some cash, no credit here.
    halt
  }
  if ($2 != $null) /msg $chan 13 $+ $nick buys $$2 a glass of $read(casinowine.txt)
  if ($2 == $null) /describe $chan pours a glass of $read(casinowine.txt) for $nick
  /set %money.drink $calc( $readini( casino.ini, $nick, Money ) -10 )
  /writeini casino.ini $nick Money %money.drink
  /unset %money.drink
}
on *:TEXT:!shot*:#:{
  if ($readini( casino.ini, $nick, Money ) == $null) {
    /notice $nick $+ , You have not registered yet. Please have some complimentary chips. Type: !atm
    halt
  }
  if ($readini( casino.ini, $nick, Money ) < 7) {
    /notice $nick $+ , Ask a friend for some cash, no credit here.
    halt
  }
  if ($2 != $null) /msg $chan 13 $+ $nick buys $$2 a shot of $read(casinoshot.txt)
  if ($2 == $null) /describe $chan hands $nick a shot of $read(casinoshot.txt)
  /set %money.drink $calc( $readini( casino.ini, $nick, Money ) -7 )
  /writeini casino.ini $nick Money %money.drink
  /unset %money.drink
}
;ORDER
on *:text:!order*:#: {
  if ($readini( casino.ini, $nick, Money ) == $null) {
    /notice $nick $+ , You have not registered yet. Please have some complimentary chips. Type: !atm
    halt
  }
  if ($readini( casino.ini, $nick, Money ) < 10) {
    /notice $nick $+ , Ask a friend for some cash, no credit here.
    halt
  }
  if ($2 == $null) {
    /notice $nick 13Please use: !order (drink) (nick*)
    halt
  }
  if ($3 != $null) {
    /msg $chan 13 $+ $nick buys $$3 a $$2
    /set %money.drink $calc( $readini( casino.ini, $nick, Money ) -10 )
    /writeini casino.ini $nick Money %money.drink
    /unset %money.drink
    halt
  }
  if ($2 != $null) {
    /describe $chan hands $nick a $$2
    /set %money.drink $calc( $readini( casino.ini, $nick, Money ) -10 )
    /writeini casino.ini $nick Money %money.drink
    /unset %money.drink
  }
}
;ATM
on *:TEXT:!atm:#:{
  if ($readini( casino.ini, $nick, Money ) != $null) {
    /notice $nick $+ , You have already registered. Better ask a friend for a loan.
    halt
  }
  /notice $nick Welcome to $chan $+ 's Bar & Casino. Here's 50 bucks. Have Fun and Drink Up! For help type: !bar or !casino
  /writeini casino.ini $nick Money 50
}
on *:TEXT:!tip*:#:{
  if ($readini( casino.ini, $nick, Money ) == $null) {
    /notice $nick $+ , You have not registered yet. Please have some complimentary chips. Type: !atm
    halt
  }
  if ($2 == $null) {
    /notice $nick 10Please type a number. Ex. !tip 10
    halt
  }
  if ($2 < 1) {
    /notice $nick 10Please tip with 1 dollar or more.
    halt
  }
  else  {
    /msg $chan 13Thank you, here's your tip:13,11 $read casinotip.txt
    /set %money.temp $calc( $readini( casino.ini, $nick, Money ) - $2 )
    /set %money.tip $calc( $readini( casino.ini, $me, Money ) + $2 )
    /writeini casino.ini $nick Money %money.temp
    /writeini casino.ini $me Money %money.tip
    /unset %money.temp
    /unset %money.tip
  }
}
;BAR HELP
on *:TEXT:!bar:#:{
  /notice $nick 13Would you like to see the menu? 
  /notice $nick 13!malt, !beer, !shot, !mixed, !wine
  /notice $nick 13Prices: 2, 5, 7, 8, 10
  /notice $nick 13Buy any drink you want for 10 bucks with !order (drink)
  /notice $nick 13To buy anyone a drink type their nick after the trigger.
  /notice $nick 13Give a tip and receive one in return: !tip (#)
}
;CASINO HELP
on *:TEXT:!casino:#:{
  /notice $nick 10!atm [register your nick and recieve 50 dollars.
  /notice $nick 10!money <nick> [check to see your's or anyone's winnings] 
  /notice $nick 10!give <nick> <money> [help someone down on their luck]
  /notice $nick 10!slots [Plays the game, costs 5 dollars a try]
  /notice $nick 10!cointoss <heads or tails> <money> [50/50 bet on the toss of a coin]
  /notice $nick 10!luckylotto <number> [10  dollars a tickets, wins 100]
  /notice $nick 10!pickthree <number> <number> <number> [5 dollars a ticket. wins 100,000,000]
  /notice $nick 10!blackjack <money> [play 21]
  /notice $nick 10!vphelp [shows VideoPoker rules]
  /notice $nick 10!craps <money> [try to hit 7 or 11]
  /notice $nick 10!dice <money> [only 1:1 game]
}
;CRAPS
on *:TEXT:!craps*:#: {
  if ($readini( casino.ini, $nick, Money ) == $null) {
    /notice $nick $+ , You have not registered yet. Please have some complimentary chips. Type: !atm
    halt
  }
  if ($2 == $null) {
    /notice $nick 10Please type a dollar ammount. ex: !craps (money)
    halt
  }
  if ($readini( casino.ini, $nick, Money ) < $2) {
    /notice $nick 10Sorry but you don't have $2 dollars to spend.
    halt
  }
  if ($2 < 1) {
    /notice $nick 10Please bet with 1 dollar or more.
    halt
  }
  var %R = $rand(1,6) | var %C = $rand(1,6)
  var %T = $Calc(%R + %C)
  /msg $chan 10 $+ $nick Rolls the dice......... %R & %C
  /msg $chan 10 Dice Total= %T
  if (%T = 7) {
    var %M = $calc($2 * 5)
    /msg $chan 10 $+ $nick GOT SEVENS!! You Win %m dollars!
    /set %money.temp $calc( $readini( casino.ini, $nick, Money ) + %m)
    /writeini casino.ini $nick Money %money.temp
    /unset %money.temp
    /unset %R
    /unset %C
    /unset %T
    /unset %M  
    /halt
  }
  if  (%T = 11) {
    var %M = $calc($2 * 16)
    /msg $chan 10 $+ $nick GOT ELEVEN!! You Win %m dollars!!!
    /set %money.temp $calc( $readini( casino.ini, $nick, Money ) + %m)
    /writeini casino.ini $nick Money %money.temp
    /unset %money.temp
    /unset %R
    /unset %C
    /unset %T
    /unset %M
    /halt
  }
  else {
    /msg $chan 10 $+ $Nick Crapped out! You Lose $2 dollars.  
    /set %money.temp $calc( $readini( casino.ini, $nick, Money ) - $2)
    /writeini casino.ini $nick Money %money.temp
    /unset %money.temp
    /unset %R
    /unset %C
    /unset %T
    /unset %M
  }
  else return
  set -eu60 $+(%,flood.,$network,.,$chan,.,action) ON
}
;DICE
on *:TEXT:!dice*:#:{
  if ($readini( casino.ini, $nick, Money ) == $null) {
    /notice $nick $+ , You have not registered yet. Please have some complimentary chips. Type: !atm
    halt
  }
  if (%dice == on) {
    /notice $nick 10Game already in progress. Please type: !djoin
    halt
  }
  if ($2 == $null) {
    /notice $nick 10Please enter a bet ammount. ex: !dice 10
    halt
  }
  if ($2 > $readini( casino.ini, $nick, Money )) {
    /msg $chan 10 $+ $nick does not have $2 dollars to play
    halt
  }
  if ($2 < 1) {
    /notice $nick 10Please give more than 1 dollar
    halt
  }
  /set %dicedplayer1 $nick
  /set %dice on
  /set %dicedmoney $2
  /msg $chan 10DICE has been started by %dicedplayer1 The bet is %dicedmoney You have 60 seconds to join type: !djoin
  /timer72 1 60 /msg $chan 10Sorry %dicedplayer1 nobody joined the DICE game.
  /timer73 1 60 /unset %dice*
}
on *:TEXT:!djoin:#:{
  if ($readini( casino.ini, $nick, Money ) == $null) {
    /notice $nick $+ , You have not registered yet. Please have some complimentary chips. Type: !atm
    halt
  }
  if ($nick == %dicedplayer1) {
    /notice $nick 10You cannot play yourself!
    halt
  }
  if (%dice == $null) {
    /notice $nick 10Sorry DICE has not yet started. To start type !dice <money>
    halt
  }
  if (%dicedmoney > $readini( casino.ini, $nick, Money )) {
    /msg $chan 10Sorry, $nick cannot join. $nick does have %dicedmoney dollars.
    halt
  }
  /timer72 off
  /timer73 off
  goto next 
  :next
  /set %dicedplayer2 $nick
  /set %diceplayer1num $rand(1,6)
  /set %diceplayer2num $rand(1,6)
  /msg $chan 10DICE have been thrown. Bet is set at %dicedmoney dollars.
  /msg $chan 10 $+ %dicedplayer1 $+ 's number was ---> %diceplayer1num <---
  /msg $chan 10 $+ %dicedplayer2 $+ 's number was ---> %diceplayer2num <---
  if (%diceplayer1num > %diceplayer2num) {
    /msg $chan 10 $+ %dicedplayer1 has won %dicedmoney dollars!!!
    /set %dicewinner $calc( $readini( casino.ini, %dicedplayer1, Money ) + %dicedmoney)
    /set %diceloser $calc( $readini( casino.ini, %dicedplayer2, Money ) - %dicedmoney)
    /writeini casino.ini %dicedplayer1 Money %dicewinner
    /writeini casino.ini %dicedplayer2 Money %diceloser 
    /unset %dice*
    halt
  }
  if (%diceplayer1num < %diceplayer2num) {
    /msg $chan 10 $+ %dicedplayer2 has won %dicedmoney dollars!!!
    /set %dicewinner $calc( $readini( casino.ini, %dicedplayer2, Money ) + %dicedmoney)
    /set %diceloser $calc( $readini( casino.ini, %dicedplayer1, Money ) - %dicedmoney)
    /writeini casino.ini %dicedplayer2 Money %dicewinner
    /writeini casino.ini %dicedplayer1 Money %diceloser 
    /unset %dice*
    halt
  }
  if (%diceplayer1num == %diceplayer2num) {
    /msg $chan 10It was a tie. Nobody won. Please roll again.
    goto next
  }
}
;BLACKJACK
on *:TEXT:!blackjack*:#:{
  if (%bj == on) {
    /msg $chan 10Blackjack is already in progress. Please wait your turn.
    halt
  }
  if ( %hs [ $+ [ $nick ] ] != $null ) /notice $nick 10 $+ $nick $+ , you have a game in progress!!!
  if ( %hs [ $+ [ $nick ] ] == $null ) {
    if ( $2 == $null ) /notice $nick 10Please enter amount you want to bet. ex. !blackjack 20
    if ($readini( casino.ini, $nick, Money ) == $null ) /notice $nick 10 $+ $nick is not yet registered.  Type !atm
    if ( $readini( casino.ini, $nick, Money ) < $2 ) /notice $nick 10You don't have that much money...try something lower!
    if ( $readini( casino.ini, $nick, Money ) >= $2 ) {
      if ( $2 < 1 ) {
        /notice $nick 10Please bet more than 1 dollar.
        halt
      }
      if ( $2 > 0 ) {
        /set %bj on
        /set %bet [ $+ [ $nick ] ] $2
        /bjdeal
        /msg $chan 10 $+ $nick bet $2 dollars on a hand of blackjack
        /var %cch = $rand(1,4)
        if ( %cch == 1) /msg $chan 10 $+ $nick $+ 's hand: 4,0 %hcard1 [ $+ [ $nick ] ]  4,0 %hcard2 [ $+ [ $nick ] ] 
        if ( %cch == 2) /msg $chan 10 $+ $nick $+ 's hand: 4,0 %hcard1 [ $+ [ $nick ] ]  1,0 %hcard2 [ $+ [ $nick ] ] 
        if ( %cch == 3) /msg $chan 10 $+ $nick $+ 's hand: 1,0 %hcard1 [ $+ [ $nick ] ]  4,0 %hcard2 [ $+ [ $nick ] ] 
        if ( %cch == 4) /msg $chan 10 $+ $nick $+ 's hand: 1,0 %hcard1 [ $+ [ $nick ] ]  1,0 %hcard2 [ $+ [ $nick ] ] 
        if (( %hcard1 [ $+ [ $nick ] ] == A ) && ( %hcard2 [ $+ [ $nick ] ] == A )) {
          /set %addh [ $+ [ $nick ] ] 12
          /set %aceh [ $+ [ $nick ] ] 0
        }
        if (( %hcard1 [ $+ [ $nick ] ] == A ) || ( %hcard2 [ $+ [ $nick ] ] == A )) { /set %aceh [ $+ [ $nick ] ] 0 }
        /set %ccc [ $+ [ $nick ] ] $rand(1,2)
        if ( %ccc [ $+ [ $nick ] ] == 1) /msg $chan 10Dealer's hand: 4,0 %ccard1 [ $+ [ $nick ] ]  12,0 ? 
        if ( %ccc [ $+ [ $nick ] ] == 2) /msg $chan 10Dealer's hand: 1,0 %ccard1 [ $+ [ $nick ] ]  12,0 ? 
        if ( %addh [ $+ [ $nick ] ] == 21 ) {
          /set %bj [ $+ [ $nick ] ] $calc( $2 / 2 )
          /set %bj [ $+ [ $nick ] ] $calc( %bj [ $+ [ $nick ] ] + $2 )
          /msg $chan 4Blackjack!! $nick has won %bj [ $+ [ $nick ] ] dollars!!
          /set %bj.temp $calc( $readini( casino.ini, $nick, Money ) + %bj [ $+ [ $nick ] ] )
          /writeini casino.ini $nick Money %bj.temp
          /unset %bj.temp
          /unset %hs [ $+ [ $nick ] ]
          /unset %bet [ $+ [ $nick ] ]
          /unset %addh [ $+ [ $nick ] ]
          /unset %addc [ $+ [ $nick ] ]
          /unset %hcard1 [ $+ [ $nick ] ]
          /unset %hcard2 [ $+ [ $nick ] ]
          /unset %ccard1 [ $+ [ $nick ] ]
          /unset %ccard2 [ $+ [ $nick ] ]
          /unset %hcard3 [ $+ [ $nick ] ]
          /unset %ccard3 [ $+ [ $nick ] ]
          /unset %bj [ $+ [ $nick ] ]
          /unset %aceh [ $+ [ $nick ] ] 
          /unset %double [ $+ [ $nick ] ]
          /unset %bj
          /halt
        }
        if ( %addh [ $+ [ $nick ] ] != 21 ) {
          set %double [ $+ [ $nick ] ] $calc( %bet [ $+ [ $nick ] ] * 2)
          if ( $readini( casino.ini, $nick, Money ) >= %double [ $+ [ $nick ] ] ) {
            /msg $chan 10 Hit Stand or Double?
            /set %d [ $+ [ $nick ] ] 0
            /set %hs [ $+ [ $nick ] ] 0
            /halt
          }
          if ( $readini( casino.ini, $nick, Money ) < %double [ $+ [ $nick ] ] ) {
            /msg $chan 10 Hit or Stand?
            /set %hs [ $+ [ $nick ] ] 0
            /halt
          }
        }
      }
    }
  }
}
on *:TEXT:d:#:{
  if ( %d [ $+ [ $nick ] ] != $null ) {
    /unset %d [ $+ [ $nick ] ]
    /set %bet [ $+ [ $nick ] ] %double [ $+ [ $nick ] ] 
    /hit
    /var %cch = $rand(1,2)
    if ( %cch = 1 ) {
      if (( %hcard1 [ $+ [ $nick ] ] == A ) || ( %hcard2 [ $+ [ $nick ] ] == A )) {
        /msg $chan 10 $+ $nick hits: 4,0 %hcard3 [ $+ [ $nick ] ] 10 Total is %addh [ $+ [ $nick ] ] or $calc(%addh [ $+ [ $nick ] ] - 10)
      }
      else /msg $chan 10 $+ $nick hits: 4,0 %hcard3 [ $+ [ $nick ] ] 10 Total is %addh [ $+ [ $nick ] ]
    }
    if ( %cch = 2 ) {
      if (( %hcard1 [ $+ [ $nick ] ] == A ) || ( %hcard2 [ $+ [ $nick ] ] == A )) {
        /msg $chan 10 $+ $nick hits: 1,0 %hcard3 [ $+ [ $nick ] ] 10 Total is %addh [ $+ [ $nick ] ] or $calc(%addh [ $+ [ $nick ] ] - 10)
      }
      else {
        /msg $chan 10 $+ $nick hits: 1,0 %hcard3 [ $+ [ $nick ] ] 10 Total is %addh [ $+ [ $nick ] ]
      }
    }
    if ( %addh [ $+ [ $nick ] ] == 21 ) /stand
    if ( %aceh [ $+ [ $nick ] ] != $null ) {
      if ( %add [ $+ [ $nick ] ] > 21 ) {
        /set %addh [ $+ [ $nick ] ] $calc( %addh [ $+ [ $nick ] ] - 10)
        /unset %aceh [ $+ [ $nick ] ]
      }
    }
    if ( %hcard3 [ $+ [ $nick ] ] == A ) {
      if ( %aceh [ $+ [ $nick ] ] != $null ) {
        if ( $calc(%addh [ $+ [ $nick ] ] + 10) > 21 ) {
          /unset %aceh [ $+ [ $nick ] ]
        }
        if ( %addh [ $+ [ $nick ] ] == 21 ) /stand
      }
      if ( $calc(%addh [ $+ [ $nick ] ] + 10) == 21 ) /stand
    }
    if ( %hcard3 [ $+ [ $nick ] ] != A ) {
      if ( %aceh [ $+ [ $nick ] ] != $null ) {
        if ( %addh [ $+ [ $nick ] ] > 21 ) {
          /set %addh [ $+ [ $nick ] ] $calc(%addh [ $+ [ $nick ] ] - 10)
          /unset %aceh [ $+ [ $nick ] ]
        }
        if ( %addh [ $+ [ $nick ] ] == 21 ) /stand
      }
      if ( %addh [ $+ [ $nick ] ] == 21 ) /stand
    }
    if ( %addh [ $+ [ $nick ] ] > 21 ) {
      if ( %aceh [ $+ [ $nick ] ] == $null ) {
        /msg $chan 4 $+ $nick Busts! $nick loses %bet [ $+ [ $nick ] ] dollars
        /var %ccc2 [ $+ [ $nick ] ] = $rand(1,2)
        if ( %ccc2 [ $+ [ $nick ] ] == 1 ) {
          if ( %ccc [ $+ [ $nick ] ] == 1) /msg $chan 10Dealer's hand: 4,0 %ccard1 [ $+ [ $nick ] ]  4,0 %ccard1 [ $+ [ $nick ] ] 
          if ( %ccc [ $+ [ $nick ] ] == 2) /msg $chan 10Dealer's hand: 1,0 %ccard1 [ $+ [ $nick ] ]  4,0 %ccard1 [ $+ [ $nick ] ] 
        }
        if ( %ccc2 [ $+ [ $nick ] ] == 2 ) {
          if ( %ccc [ $+ [ $nick ] ] == 1) /msg $chan 10Dealer's hand: 4,0 %ccard1 [ $+ [ $nick ] ]  1,0 %ccard1 [ $+ [ $nick ] ] 
          if ( %ccc [ $+ [ $nick ] ] == 2) /msg $chan 10Dealer's hand: 1,0 %ccard1 [ $+ [ $nick ] ]  1,0 %ccard1 [ $+ [ $nick ] ] 
        }
        /set %bj.temp $calc( $readini( casino.ini, $nick, Money ) - %bet [ $+ [ $nick ] ] )
        /writeini casino.ini $nick Money %bj.temp
        /unset %bj.temp
        /unset %hs [ $+ [ $nick ] ]
        /unset %bet [ $+ [ $nick ] ]
        /unset %addh [ $+ [ $nick ] ]
        /unset %addc [ $+ [ $nick ] ]
        /unset %hcard1 [ $+ [ $nick ] ]
        /unset %hcard2 [ $+ [ $nick ] ]
        /unset %ccard1 [ $+ [ $nick ] ]
        /unset %ccard2 [ $+ [ $nick ] ]
        /unset %hcard3 [ $+ [ $nick ] ]
        /unset %ccard3 [ $+ [ $nick ] ]
        /unset %a1 [ $+ [ $nick ] ]
        /unset %a2 [ $+ [ $nick ] ]
        /unset %b1 [ $+ [ $nick ] ]
        /unset %b2 [ $+ [ $nick ] ]
        /unset %a3 [ $+ [ $nick ] ]
        /unset %c3 [ $+ [ $nick ] ]
        /unset %aceh [ $+ [ $nick ] ]
        /unset %acec [ $+ [ $nick ] ]
        /unset %double [ $+ [ $nick ] ]
        /unset %bj
      }
      if ( %aceh [ $+ [ $nick ] ] != $null ) /set %addh [ $+ [ $nick ] ] $calc(%addh [ $+ [ $nick ] ] - 10)
    }
    if ( %addh [ $+ [ $nick ] ] < 21 ) /stand
  }
}
on *:TEXT:h:#:{
  if ( %hs [ $+ [ $nick ] ] != $null ) {
    /unset %d [ $+ [ $nick ] ]
    /hit
    /var %cch = $rand(1,2)
    if ( %cch = 1 ) {
      if (( %hcard1 [ $+ [ $nick ] ] == A ) || ( %hcard2 [ $+ [ $nick ] ] == A )) {
        /msg $chan 10 $+ $nick hits: 4,0 %hcard3 [ $+ [ $nick ] ] 10 Total is %addh [ $+ [ $nick ] ] or $calc(%addh [ $+ [ $nick ] ] - 10)
      }
      else /msg $chan 10 $+ $nick hits: 4,0 %hcard3 [ $+ [ $nick ] ] 10 Total is %addh [ $+ [ $nick ] ]
    }
    if ( %cch = 2 ) {
      if (( %hcard1 [ $+ [ $nick ] ] == A ) || ( %hcard2 [ $+ [ $nick ] ] == A )) {
        /msg $chan 10 $+ $nick hits: 1,0 %hcard3 [ $+ [ $nick ] ] 10 Total is %addh [ $+ [ $nick ] ] or $calc(%addh [ $+ [ $nick ] ] - 10)
      }
      else {
        /msg $chan 10 $+ $nick hits: 1,0 %hcard3 [ $+ [ $nick ] ] 10 Total is %addh [ $+ [ $nick ] ]
      }
    }
    if ( %addh [ $+ [ $nick ] ] == 21 ) /stand 
    if ( %aceh [ $+ [ $nick ] ] != $null ) {
      if ( %add [ $+ [ $nick ] ] > 21 ) {
        /set %addh [ $+ [ $nick ] ] $calc( %addh [ $+ [ $nick ] ] - 10)
        /unset %aceh [ $+ [ $nick ] ]
      }
    }
    if ( %hcard3 [ $+ [ $nick ] ] == A ) {
      if ( %aceh [ $+ [ $nick ] ] != $null ) {
        if ( $calc(%addh [ $+ [ $nick ] ] + 10) > 21 ) {
          /unset %aceh [ $+ [ $nick ] ]
        }
        if ( %addh [ $+ [ $nick ] ] == 21 ) /stand
      }
      if ( $calc(%addh [ $+ [ $nick ] ] + 10) == 21 ) /stand
    }
    if ( %hcard3 [ $+ [ $nick ] ] != A ) {
      if ( %aceh [ $+ [ $nick ] ] != $null ) {
        if ( %addh [ $+ [ $nick ] ] > 21 ) {
          /set %addh [ $+ [ $nick ] ] $calc(%addh [ $+ [ $nick ] ] - 10)
          /unset %aceh [ $+ [ $nick ] ]
        }
        if ( %addh [ $+ [ $nick ] ] == 21 ) /stand
      }
      if ( %addh [ $+ [ $nick ] ] == 21 ) /stand
    }
    if ( %addh [ $+ [ $nick ] ] > 21 ) {
      if ( %aceh [ $+ [ $nick ] ] == $null ) {
        /msg $chan 4 $+ $nick Busts! $nick loses %bet [ $+ [ $nick ] ] dollars
        /var %ccc2 [ $+ [ $nick ] ] = $rand(1,2)
        if ( %ccc2 [ $+ [ $nick ] ] == 1 ) {
          if ( %ccc [ $+ [ $nick ] ] == 1) /msg $chan 10Dealer's hand: 4,0 %ccard1 [ $+ [ $nick ] ]  4,0 %ccard1 [ $+ [ $nick ] ] 
          if ( %ccc [ $+ [ $nick ] ] == 2) /msg $chan 10Dealer's hand: 1,0 %ccard1 [ $+ [ $nick ] ]  4,0 %ccard1 [ $+ [ $nick ] ] 
        }
        if ( %ccc2 [ $+ [ $nick ] ] == 2 ) {
          if ( %ccc [ $+ [ $nick ] ] == 1) /msg $chan 10Dealer's hand: 4,0 %ccard1 [ $+ [ $nick ] ]  1,0 %ccard1 [ $+ [ $nick ] ] 
          if ( %ccc [ $+ [ $nick ] ] == 2) /msg $chan 10Dealer's hand: 1,0 %ccard1 [ $+ [ $nick ] ]  1,0 %ccard1 [ $+ [ $nick ] ] 
        }
        /set %bj.temp $calc( $readini( casino.ini, $nick, Money ) - %bet [ $+ [ $nick ] ] )
        /writeini casino.ini $nick Money %bj.temp
        /unset %bj.temp
        /unset %hs [ $+ [ $nick ] ]
        /unset %bet [ $+ [ $nick ] ]
        /unset %addh [ $+ [ $nick ] ]
        /unset %addc [ $+ [ $nick ] ]
        /unset %hcard1 [ $+ [ $nick ] ]
        /unset %hcard2 [ $+ [ $nick ] ]
        /unset %ccard1 [ $+ [ $nick ] ]
        /unset %ccard2 [ $+ [ $nick ] ]
        /unset %hcard3 [ $+ [ $nick ] ]
        /unset %ccard3 [ $+ [ $nick ] ]
        /unset %a1 [ $+ [ $nick ] ]
        /unset %a2 [ $+ [ $nick ] ]
        /unset %b1 [ $+ [ $nick ] ]
        /unset %b2 [ $+ [ $nick ] ]
        /unset %a3 [ $+ [ $nick ] ]
        /unset %c3 [ $+ [ $nick ] ]
        /unset %aceh [ $+ [ $nick ] ]
        /unset %acec [ $+ [ $nick ] ]
        /unset %double [ $+ [ $nick ] ]
        /unset %bj
      }
      if ( %aceh [ $+ [ $nick ] ] != $null ) /set %addh [ $+ [ $nick ] ] $calc(%addh [ $+ [ $nick ] ] - 10)
    }
    if ( %addh [ $+ [ $nick ] ] < 21 ) /msg $chan 10 Hit or Stand?
  }
}
on *:TEXT:s:#:{
  if ( %hs [ $+ [ $nick ] ] != $null ) /stand
  /unset %d [ $+ [ $nick ] ]
  /unset %aceh [ $+ [ $nick ] ]
  /unset %acec [ $+ [ $nick ] ]
  /halt
}

alias /bjdeal {
  set %hcard1 [ $+ [ $nick ] ] $rand(0,11)
  set %hcard2 [ $+ [ $nick ] ] $rand(0,11)
  set %ccard1 [ $+ [ $nick ] ] $rand(0,11)
  set %ccard2 [ $+ [ $nick ] ] $rand(0,11)
  set %a1 [ $+ [ $nick ] ] $rand(1,4)
  set %a2 [ $+ [ $nick ] ] $rand(1,4)
  set %b1 [ $+ [ $nick ] ] $rand(1,4)
  set %b2 [ $+ [ $nick ] ] $rand(1,4)
  set %addh [ $+ [ $nick ] ] $calc( %hcard1 [ $+ [ $nick ] ] + %hcard2 [ $+ [ $nick ] ] )
  set %addc [ $+ [ $nick ] ] $calc( %ccard1 [ $+ [ $nick ] ] + %ccard2 [ $+ [ $nick ] ] )
  if ( %hcard1 [ $+ [ $nick ] ] == 0 ) /set %addh [ $+ [ $nick ] ] $calc(%addh [ $+ [ $nick ] ] + 10)
  if ( %hcard2 [ $+ [ $nick ] ] == 0 ) /set %addh [ $+ [ $nick ] ] $calc(%addh [ $+ [ $nick ] ] + 10)
  if ( %ccard1 [ $+ [ $nick ] ] == 0 ) /set %addc [ $+ [ $nick ] ] $calc(%addc [ $+ [ $nick ] ] + 10)
  if ( %ccard2 [ $+ [ $nick ] ] == 0 ) /set %addc [ $+ [ $nick ] ] $calc(%addc [ $+ [ $nick ] ] + 10)
  if ( %hcard1 [ $+ [ $nick ] ] == 11 ) /set %addh [ $+ [ $nick ] ] $calc(%addh [ $+ [ $nick ] ] - 1)
  if ( %hcard2 [ $+ [ $nick ] ] == 11 ) /set %addh [ $+ [ $nick ] ] $calc(%addh [ $+ [ $nick ] ] - 1)
  if ( %ccard1 [ $+ [ $nick ] ] == 11 ) /set %addc [ $+ [ $nick ] ] $calc(%addc [ $+ [ $nick ] ] - 1)
  if ( %ccard2 [ $+ [ $nick ] ] == 11 ) /set %addc [ $+ [ $nick ] ] $calc(%addc [ $+ [ $nick ] ] - 1)
  if ( %hcard1 [ $+ [ $nick ] ] == 1 ) {
    /set %addh [ $+ [ $nick ] ] $calc( %addh [ $+ [ $nick ] ] + 10 )
    /set %aceh [ $+ [ $nick ] ] 0
    /set %hcard1 [ $+ [ $nick ] ] A
  }
  if (( %hcard1 [ $+ [ $nick ] ] == 10 ) || ( %hcard1 [ $+ [ $nick ] ] == 0 ) || ( %hcard1 [ $+ [ $nick ] ] == 11 )) {
    if ( %a1 [ $+ [ $nick ] ] == 1 ) /set %hcard1 [ $+ [ $nick ] ] J
    if ( %a1 [ $+ [ $nick ] ] == 2 ) /set %hcard1 [ $+ [ $nick ] ] Q
    if ( %a1 [ $+ [ $nick ] ] == 3 ) /set %hcard1 [ $+ [ $nick ] ] K
    if ( %a1 [ $+ [ $nick ] ] == 4 ) /set %hcard1 [ $+ [ $nick ] ] 10
  }
  if ( %hcard2 [ $+ [ $nick ] ] == 1 ) {
    /set %addh [ $+ [ $nick ] ] $calc( %addh [ $+ [ $nick ] ] + 10 )
    /set %aceh [ $+ [ $nick ] ] 0
    /set %hcard2 [ $+ [ $nick ] ] A
  }
  if (( %hcard2 [ $+ [ $nick ] ] == 10 ) || ( %hcard2 [ $+ [ $nick ] ] == 0 ) || ( %hcard2 [ $+ [ $nick ] ] == 11 )) { 
    if ( %a2 [ $+ [ $nick ] ] == 1 ) /set %hcard2 [ $+ [ $nick ] ] J
    if ( %a2 [ $+ [ $nick ] ] == 2 ) /set %hcard2 [ $+ [ $nick ] ] Q
    if ( %a2 [ $+ [ $nick ] ] == 3 ) /set %hcard2 [ $+ [ $nick ] ] K
    if ( %a2 [ $+ [ $nick ] ] == 4 ) /set %hcard2 [ $+ [ $nick ] ] 10
  }
  if ( %ccard1 [ $+ [ $nick ] ] == 1 ) {
    /set %addc [ $+ [ $nick ] ] $calc( %addc [ $+ [ $nick ] ] + 10 )
    /set %acec [ $+ [ $nick ] ] 0
    /set %ccard1 [ $+ [ $nick ] ] A
  }
  if (( %ccard1 [ $+ [ $nick ] ] == 10 ) || ( %ccard1 [ $+ [ $nick ] ] == 0 ) || ( %ccard1 [ $+ [ $nick ] ] == 11 )) {
    if ( %b1 [ $+ [ $nick ] ] == 1 ) /set %ccard1 [ $+ [ $nick ] ] J
    if ( %b1 [ $+ [ $nick ] ] == 2 ) /set %ccard1 [ $+ [ $nick ] ] Q
    if ( %b1 [ $+ [ $nick ] ] == 3 ) /set %ccard1 [ $+ [ $nick ] ] K
    if ( %b1 [ $+ [ $nick ] ] == 4 ) /set %ccard1 [ $+ [ $nick ] ] 10
  }
  if ( %ccard2 [ $+ [ $nick ] ] == 1 ) {
    /set %addc [ $+ [ $nick ] ] $calc( %addc [ $+ [ $nick ] ] + 10 )
    /set %acec [ $+ [ $nick ] ] 0
    /set %ccard2 [ $+ [ $nick ] ] A
  }
  if (( %ccard2 [ $+ [ $nick ] ] == 10 ) || ( %ccard2 [ $+ [ $nick ] ] == 0 ) || ( %ccard2 [ $+ [ $nick ] ] == 11 )) {
    if ( %b2 [ $+ [ $nick ] ] == 1 ) /set %ccard2 [ $+ [ $nick ] ] J
    if ( %b2 [ $+ [ $nick ] ] == 2 ) /set %ccard2 [ $+ [ $nick ] ] Q
    if ( %b2 [ $+ [ $nick ] ] == 3 ) /set %ccard2 [ $+ [ $nick ] ] K
    if ( %b2 [ $+ [ $nick ] ] == 4 ) /set %ccard2 [ $+ [ $nick ] ] 10
  }
  return
}

alias /hit {
  set %hcard3 [ $+ [ $nick ] ] $rand(0,10)
  set %a3 [ $+ [ $nick ] ] $rand(1,4)
  set %addh [ $+ [ $nick ] ] $calc( %addh [ $+ [ $nick ] ] + %hcard3 [ $+ [ $nick ] ] )
  if ( %hcard3 [ $+ [ $nick ] ] == 0 ) /set %addh [ $+ [ $nick ] ] $calc(%addh [ $+ [ $nick ] ] + 10)
  if ( %hcard3 [ $+ [ $nick ] ] == 11 ) /set %addh [ $+ [ $nick ] ] $calc(%addh [ $+ [ $nick ] ] - 1)
  if ( %hcard3 [ $+ [ $nick ] ] == 1 ) {
    if ( %aceh [ $+ [ $nick ] ] != $null ) {
      if ( %addh [ $+ [ $nick ] ] > 11 ) {
        /set %addh [ $+ [ $nick ] ] $calc( %addh [ $+ [ $nick ] ] - 10 )
        /unset %aceh [ $+ [ $nick ] ]
      }
      if ( %addh [ $+ [ $nick ] ] <= 11 ) {
        /set %addh [ $+ [ $nick ] ] $calc( %addh [ $+ [ $nick ] ] + 10 )
        /unset %aceh [ $+ [ $nick ] ]
      }
    }
    if ( %aceh [ $+ [ $nick ] ] == $null ) {
      if ( %addh [ $+ [ $nick ] ] <= 11 ) {
        /set %addh [ $+ [ $nick ] ] $calc( %addh [ $+ [ $nick ] ] + 10 )
        /set %aceh [ $+ [ $nick ] ] 0
      }
    }
    /set %hcard3 [ $+ [ $nick ] ] A
  }
  if (( %hcard3 [ $+ [ $nick ] ] == 10 ) || ( %hcard3 [ $+ [ $nick ] ] == 0 ) || ( %hcard3 [ $+ [ $nick ] ] == 11 )) {
    if ( %a3 [ $+ [ $nick ] ] == 1 ) /set %hcard3 [ $+ [ $nick ] ] J
    if ( %a3 [ $+ [ $nick ] ] == 2 ) /set %hcard3 [ $+ [ $nick ] ] Q
    if ( %a3 [ $+ [ $nick ] ] == 3 ) /set %hcard3 [ $+ [ $nick ] ] K
    if ( %a3 [ $+ [ $nick ] ] == 4 ) /set %hcard3 [ $+ [ $nick ] ] 10
  }
}

alias /stand {
  var %ccc2 [ $+ [ $nick ] ] $rand(1,2)
  if ( %ccc [ $+ [ $nick ] ] == 1 ) {
    if ( %ccc2 [ $+ [ $nick ] ] == 1 ) /msg $chan 10Dealer's hand: 4,0 %ccard1 [ $+ [ $nick ] ]  4,0 %ccard2 [ $+ [ $nick ] ] 
    if ( %ccc2 [ $+ [ $nick ] ] == 2 ) /msg $chan 10Dealer's hand: 4,0 %ccard1 [ $+ [ $nick ] ]  1,0 %ccard2 [ $+ [ $nick ] ] 
  }
  if ( %ccc [ $+ [ $nick ] ] == 2 ) {
    if ( %ccc2 [ $+ [ $nick ] ] == 1 ) /msg $chan 10Dealer's hand: 1,0 %ccard1 [ $+ [ $nick ] ]  4,0 %ccard2 [ $+ [ $nick ] ] 
    if ( %ccc2 [ $+ [ $nick ] ] == 2 ) /msg $chan 10Dealer's hand: 1,0 %ccard1 [ $+ [ $nick ] ]  1,0 %ccard2 [ $+ [ $nick ] ] 
  }
  if ( %addc [ $+ [ $nick ] ] == 21 ) {
    /msg $chan 4Dealer has blackjack... $nick loses %bet [ $+ [ $nick ] ] dollars!
    /set %bj.temp $calc( $readini( casino.ini, $nick, Money ) - %bet [ $+ [ $nick ] ] )
    /writeini casino.ini $nick Money %bj.temp
    /unset %bj.temp
    /unset %hs [ $+ [ $nick ] ]
    /unset %bet [ $+ [ $nick ] ]
    /unset %addh [ $+ [ $nick ] ]
    /unset %addc [ $+ [ $nick ] ]
    /unset %hcard1 [ $+ [ $nick ] ]
    /unset %hcard2 [ $+ [ $nick ] ]
    /unset %ccard1 [ $+ [ $nick ] ]
    /unset %ccard2 [ $+ [ $nick ] ]
    /unset %hcard3 [ $+ [ $nick ] ]
    /unset %ccard3 [ $+ [ $nick ] ]
    /unset %a1 [ $+ [ $nick ] ]
    /unset %a2 [ $+ [ $nick ] ]
    /unset %a3 [ $+ [ $nick ] ]
    /unset %b1 [ $+ [ $nick ] ]
    /unset %b2 [ $+ [ $nick ] ]
    /unset %c3 [ $+ [ $nick ] ]
    /unset %aceh [ $+ [ $nick ] ]
    /unset %acec [ $+ [ $nick ] ]
    /unset %double [ $+ [ $nick ] ]
    /unset %d [ $+ [ $nick ] ]
    /unset %bj
    return
  }
  /goto nextz 
  :hit
  set %ccard3 [ $+ [ $nick ] ] $rand(0,10)
  set %c3 [ $+ [ $nick ] ] $rand(1,4)
  set %addc [ $+ [ $nick ] ] $calc( %addc [ $+ [ $nick ] ] + %ccard3 [ $+ [ $nick ] ] )
  if ( %ccard3 [ $+ [ $nick ] ] == 0 ) /set %addc [ $+ [ $nick ] ] $calc(%addc [ $+ [ $nick ] ] + 10)
  if ( %ccard3 [ $+ [ $nick ] ] == 11 ) /set %addc [ $+ [ $nick ] ] $calc(%addc [ $+ [ $nick ] ] - 1)
  if ( %ccard3 [ $+ [ $nick ] ] == 1 ) {
    if ( %acec [ $+ [ $nick ] ] != $null ) {
      if ( %addc [ $+ [ $nick ] ] > 11 ) {
        /set %addc [ $+ [ $nick ] ] $calc( %addc [ $+ [ $nick ] ] - 10 )
        /unset %acec [ $+ [ $nick ] ]
      }
    }
    if ( %acec [ $+ [ $nick ] ] == $null ) {
      if ( %addc [ $+ [ $nick ] ] > 11 ) {
        /unset %acec [ $+ [ $nick ] ] 
      }
      if ( %addc [ $+ [ $nick ] ] <= 11 ) {
        /set %addc [ $+ [ $nick ] ] $calc( %addc [ $+ [ $nick ] ] + 10 )
        /set %acec [ $+ [ $nick ] ] 0
      }
    }
    /set %ccard3 [ $+ [ $nick ] ] A
  }
  if (( %ccard3 [ $+ [ $nick ] ] == 10 ) || ( %ccard3 [ $+ [ $nick ] ] == 0 ) || ( %ccard3 [ $+ [ $nick ] ] == 11 )) {
    if ( %c3 [ $+ [ $nick ] ] == 1 ) /set %ccard3 [ $+ [ $nick ] ] J
    if ( %c3 [ $+ [ $nick ] ] == 2 ) /set %ccard3 [ $+ [ $nick ] ] Q
    if ( %c3 [ $+ [ $nick ] ] == 3 ) /set %ccard3 [ $+ [ $nick ] ] K
    if ( %c3 [ $+ [ $nick ] ] == 4 ) /set %ccard3 [ $+ [ $nick ] ] 10
  }
  var %dd = $rand(1,2)
  if ( %dd == 1 ) /msg $chan 10Dealer draws 4,0 %ccard3 [ $+ [ $nick ] ] 
  if ( %dd == 2 ) /msg $chan 10Dealer draws 1,0 %ccard3 [ $+ [ $nick ] ] 
  /goto nextz
  :nextz
  if ( %addc [ $+ [ $nick ] ] < 17 ) /goto hit
  if ( %addc [ $+ [ $nick ] ] >= 17 ) {
    if ( %addc [ $+ [ $nick ] ] > 21 ) {
      if ( %acec [ $+ [ $nick ] ] == $null ) {
        /msg $chan 10Dealer busts! $nick has won %bet [ $+ [ $nick ] ] dollars!
        /set %bj.temp $calc( $readini( casino.ini, $nick, Money ) + %bet [ $+ [ $nick ] ] )
        /writeini casino.ini $nick Money %bj.temp
        /unset %bj.temp
        /unset %hs [ $+ [ $nick ] ]
        /unset %bet [ $+ [ $nick ] ]
        /unset %addh [ $+ [ $nick ] ]
        /unset %addc [ $+ [ $nick ] ]
        /unset %hcard1 [ $+ [ $nick ] ]
        /unset %hcard2 [ $+ [ $nick ] ]
        /unset %ccard1 [ $+ [ $nick ] ]
        /unset %ccard2 [ $+ [ $nick ] ]
        /unset %hcard3 [ $+ [ $nick ] ]
        /unset %ccard3 [ $+ [ $nick ] ]
        /unset %a1 [ $+ [ $nick ] ]
        /unset %a2 [ $+ [ $nick ] ]
        /unset %a3 [ $+ [ $nick ] ]
        /unset %b1 [ $+ [ $nick ] ]
        /unset %b2 [ $+ [ $nick ] ]
        /unset %c3 [ $+ [ $nick ] ]
        /unset %acec [ $+ [ $nick ] ]
        /unset %double [ $+ [ $nick ] ]
        /unset %d [ $+ [ $nick ] ]
        /unset %bj
        return
      }
      if ( %acec [ $+ [ $nick ] ] != $null ) {
        /set %addc [ $+ [ $nick ] ] $calc( %addc [ $+ [ $nick ] ] - 10 )
        /unset %acec [ $+ [ $nick ] ]
        /goto hit
      }
    }
    if ( %addc [ $+ [ $nick ] ] <= 21 ) {
      /msg $chan 10Dealer Stands on %addc [ $+ [ $nick ] ]
      if ( %addc [ $+ [ $nick ] ] > %addh [ $+ [ $nick ] ] ) {
        /msg $chan 10Dealer wins! $nick loses %bet [ $+ [ $nick ] ] dollars
        /set %bj.temp $calc( $readini( casino.ini, $nick, Money ) - %bet [ $+ [ $nick ] ] )
        /writeini casino.ini $nick Money %bj.temp
        /unset %bj.temp
        /unset %hs [ $+ [ $nick ] ]
        /unset %bet [ $+ [ $nick ] ]
        /unset %addh [ $+ [ $nick ] ]
        /unset %addc [ $+ [ $nick ] ]
        /unset %hcard1 [ $+ [ $nick ] ]
        /unset %hcard2 [ $+ [ $nick ] ]
        /unset %ccard1 [ $+ [ $nick ] ]
        /unset %ccard2 [ $+ [ $nick ] ]
        /unset %hcard3 [ $+ [ $nick ] ]
        /unset %ccard3 [ $+ [ $nick ] ]
        /unset %acec [ $+ [ $nick ] ]
        /unset %a1 [ $+ [ $nick ] ]
        /unset %a2 [ $+ [ $nick ] ]
        /unset %a3 [ $+ [ $nick ] ]
        /unset %b1 [ $+ [ $nick ] ]
        /unset %b2 [ $+ [ $nick ] ]
        /unset %c3 [ $+ [ $nick ] ]
        /unset %double [ $+ [ $nick ] ]
        /unset %d [ $+ [ $nick ] ]
        /unset %bj
        return
      }
      if ( %addc [ $+ [ $nick ] ] < %addh [ $+ [ $nick ] ] ) {
        /msg $chan 10 $+ $nick has won %bet [ $+ [ $nick ] ] dollars!
        /set %bj.temp $calc( $readini( casino.ini, $nick, Money ) + %bet [ $+ [ $nick ] ] )
        /writeini casino.ini $nick Money %bj.temp
        /unset %bj.temp
        /unset %hs [ $+ [ $nick ] ]
        /unset %bet [ $+ [ $nick ] ]
        /unset %addh [ $+ [ $nick ] ]
        /unset %addc [ $+ [ $nick ] ]
        /unset %hcard1 [ $+ [ $nick ] ]
        /unset %hcard2 [ $+ [ $nick ] ]
        /unset %ccard1 [ $+ [ $nick ] ]
        /unset %ccard2 [ $+ [ $nick ] ]
        /unset %hcard3 [ $+ [ $nick ] ]
        /unset %ccard3 [ $+ [ $nick ] ]
        /unset %a1 [ $+ [ $nick ] ]
        /unset %a2 [ $+ [ $nick ] ]
        /unset %a3 [ $+ [ $nick ] ]
        /unset %b1 [ $+ [ $nick ] ]
        /unset %b2 [ $+ [ $nick ] ]
        /unset %c3 [ $+ [ $nick ] ]
        /unset %double [ $+ [ $nick ] ]
        /unset %d [ $+ [ $nick ] ]
        /unset %bj
        return
      }
      if ( %addc [ $+ [ $nick ] ] == %addh [ $+ [ $nick ] ] ) {
        /msg $chan 10Push
        /unset %hs [ $+ [ $nick ] ]
        /unset %bet [ $+ [ $nick ] ]
        /unset %addh [ $+ [ $nick ] ]
        /unset %addc [ $+ [ $nick ] ]
        /unset %hcard1 [ $+ [ $nick ] ]
        /unset %hcard2 [ $+ [ $nick ] ]
        /unset %ccard1 [ $+ [ $nick ] ]
        /unset %ccard2 [ $+ [ $nick ] ]
        /unset %hcard3 [ $+ [ $nick ] ]
        /unset %ccard3 [ $+ [ $nick ] ]
        /unset %a1 [ $+ [ $nick ] ]
        /unset %a2 [ $+ [ $nick ] ]
        /unset %a3 [ $+ [ $nick ] ]
        /unset %b1 [ $+ [ $nick ] ]
        /unset %b2 [ $+ [ $nick ] ]
        /unset %c3 [ $+ [ $nick ] ]
        /unset %double [ $+ [ $nick ] ]
        /unset %d [ $+ [ $nick ] ]
        /unset %bj
        /return
      }
    }
  }
}
;VIDEOPOKER
on *:INPUT:#:{ pokercommand $1- }
on *:TEXT:*:#:{ pokercommand $1- }
alias -l pokercommand {
  if ($1 == !vphelp) {
    /notice $nick 10Welcome to VideoPoker. Type 4!vp (#)10 to start game. Costs minimum 5 dollars a turn. To see the best hand ever type: 4!besthand Use 
    /notice $nick 10To change cards type 4!draw (card#'s)10. To pass just type 4!draw 
    /notice $nick 10For example this will change the third and fifth cards: 4!draw 35
    /notice $nick 10Payouts(9/6): Royal Flush4,000:1, Straight Flush250:1, Four of a Kind125:1,  Full House45:1, Flush30:1, Straight20:1, Three of a Kind15:1, Two Pair10:1, Jacks or Better5:1 Type 4!vpodds10 for more info.
    /halt
  }
  if ($1 == !vpodds) { /notice $nick 10 There are a total of 2,598,960 totally different hands which can be dealt to you in Video Poker. When reviewing the math a player will get a royal flush once in about 40,000 hands and a straight flush in about 9,000 hands. That results in about a 63% chance of getting at least one royal flush and about a 27% chance of getting two in the same 40,000 hands. }
  if ($1 == !vpreset) {
    trashdeck $vp
    /unset %poker
    /msg $chan 10VideoPoker 4Reset.
    /halt
  }
  if ($1 == !vp) {
    if (%poker == on) {
      /notice $nick 10Game in progress. Please wait your turn...
      /halt
    }
    if ($readini( casino.ini, $nick, Money ) == $null) {
      /notice $nick $+ , You have not registered yet. Please have some complimentary chips. Type: !atm
      /halt
    }
    if ($readini( casino.ini, $nick, Money ) < 5) {
      /notice $nick 10Sorry but you don't have 5 dollars to spend.
      /halt
    }
    else {
      if ($2 != $null) {
        if ($readini( casino.ini, $nick, Money ) < $2) {
          /notice $nick 10Sorry but you don't have $2 dollars to spend.
          /halt
        }  
        else /set %poker.money $2
      }
      if ($2 == $null) /set %poker.money 5
      deal-vp
    }
  }
  if ($1 == !draw) { draw-vp $2- }
  if ($1 == !besthand) { /msg $chan $msg.vp.recordhand }
}
alias -l deal-vp {
  set %poker on
  if ($isdeck($vp)) { return }
  getdeck $vp
  var %i = 1, %deal.temp
  while (%i <= 5) {
    setcard $vp $vp %i
    inc %i
  }
  /msg $chan $msg.vp.hand
  /set %money.temp $calc( $readini( casino.ini, $nick, Money ) - $vp-bet)
  /writeini casino.ini $nick Money %money.temp
  /unset %money.temp
  /timerwarn 1 30 /notice $nick 10You have 30 seconds to change cards or your game will be ended. For help type: !vphelp
  /timerend1 1 60 /msg $chan 10VidoPoker 4GAME ENDED
  /timerend2 1 60 trashdeck $vp
  /timerend3 1 60 /unset %poker
  /timerend4 1 60 /halt
}
alias -l draw-vp {
  if (!$isdeck($vp)) { return }
  if (1 isin $1-) { setcard $vp $vp 1 }
  if (2 isin $1-) { setcard $vp $vp 2 }
  if (3 isin $1-) { setcard $vp $vp 3 }
  if (4 isin $1-) { setcard $vp $vp 4 }
  if (5 isin $1-) { setcard $vp $vp 5 }
  %index = $pkconvert($pvar($vp,1), $pvar($vp,2), $pvar($vp,3), $pvar($vp,4), $pvar($vp,5))
  if (%index > $pvar(Record,Index)) || ($pvar(Record,Index) == $null) {
    pset Record Index %index
    pset Record Hand %last-hand
    pset Record Nick $nick
  }
  /timerwarn off
  /timerend1 off
  /timerend2 off
  /timerend3 off
  /timerend4 off
  /set %money.temp $calc( $readini( casino.ini, $nick, Money ) + $vp-score)
  /writeini casino.ini $nick Money %money.temp
  /unset %money.temp
  psay $msg.vp.finalhand($vp)
  pset $vp
  trashdeck $vp
  /unset %poker
}
alias -l vp { return vp- $+ $nick }
alias -l vp-bet { return %poker.money }
alias -l vp-score {
  if ((%d0 == 8) && (%d1 == 14)) { var %mult = 4000 }
  elseif (%d0 == 8) { var %mult = 250 }
  elseif (%d0 == 7) { var %mult = 125 }
  elseif (%d0 == 6) { var %mult = 45 }
  elseif (%d0 == 5) { var %mult = 30 }
  elseif (%d0 == 4) { var %mult = 20 }
  elseif (%d0 == 3) { var %mult = 15 }
  elseif (%d0 == 2) { var %mult = 10 }
  elseif (%d0 == 1) { var %mult = $iif(%d1 >= 11, 5,0) }
  return $calc($vp-bet * %mult)
}
alias -l pc1 { return 12 }
alias -l pc2 { return 03 }
alias -l msg.vp.finalhand { return 10 $+ $nick $+ , your hand: $msg.vp.thehand $+ , is7 %last-hand $+ . 10You won $vp-score dollars. }
alias -l msg.vp.hand { return 10 $+ $nick $+ , the bet is $vp-bet dollars! Hand: $msg.vp.thehand }
alias -l msg.vp.thehand { return $convert.shortcard(1) $convert.shortcard(2) $convert.shortcard(3) $convert.shortcard(4) $convert.shortcard(5) }
alias -l msg.vp.recordhand { return 10The best hand so far was8 $pvar(Record,Nick) $+ 's $+ 10 hand: 7 $pvar(Record,Hand) $+ . }
alias -l pvar { return $readini(cards.ini, $1, $2) }
alias pset { $iif($3, writeini, remini) cards.ini $1- }
alias -l psay { $iif($nick == $me, .timer 1 0) msg $chan $1- }
alias -l pnotice { $iif($nick != $me, .notice $nick, .timer 1 0 echo $chan) $1- }
alias -l setcard { pset $2 $3 $getcard($1) }

;deck standards
alias -l getcard {
  if (!$hget($1)) { return }
  var %temp = $hget($1,$cardsleft($1))
  hdel $1 $cardsleft($1)
  return %temp
}
alias -l getdeck {
  trashdeck $1
  hmake $1
  var %c = 1
  while (%c <= 52) {
    hadd $1 %c %c
    inc %c
  }
  shuffledeck $1
}
alias -l shuffledeck {
  var %i = 1
  while ($cardsleft($1) >= %i) {
    var %temp = $rand(1,$cardsleft($1))
    var %temp.card = $hget($1,%temp)
    hadd $1 %temp $hget($1,%i)
    hadd $1 %i %temp.card
    inc %i
  }
}
alias -l trashdeck { if ($hget($1)) { hfree $1 } }
alias -l isdeck { if ($hget($1) != $null) { return $true } }
alias -l cardsleft { return $$hget($1,0).item }

;card standards
alias -l convert.shortcard { return $pc2 $+ $left($convert.rank($pvar($vp,$1)),1) $+ $convert.suit($pvar($vp,$1)) $+ 10 }
alias -l convert.card { return $pc2 $+ $convert.rank($1) $+ 10 of $convert.suit($1) }
alias -l convert.rank { return $convert.face($convert.ranknum($1)) }
alias -l convert.suit { return $gettok(06c.04d.04h.06s, $calc($convert.suitnum($1) + 1), $asc(.)) }
alias -l convert.face { return $gettok(Ace.2.3.4.5.6.7.8.9.Ten.Jack.Queen.King.Ace, $1, $asc(.)) }
alias -l convert.ranknum { return $calc($mod($calc($1 - 1),13) + 2) }
alias -l convert.suitnum { return $int($calc(($1 - 1) / 13)) }
alias -l mod { return $calc($1 - ($int($calc($1 / $2)) * $2)) }

;hand standards
alias -l cardrank { return $calc(( %d0 * (16 ^ 5) ) + ( %d1 * (16 ^ 4) ) + ( %d2 * (16 ^ 3) ) + ( %d3 * (16 ^ 2) ) + ( %d4 * (16 ^ 1)) + ( %d5 * (16 ^ 0))) }
alias -l pkconvert {
  setcards 0 0 0 0 0 0
  handconvert $1 $2 $3 $4 $5
  return $cardrank
}
alias -l handconvert {
  if (($convert.suitnum($1) == $convert.suitnum($2)) && ($convert.suitnum($2) == $convert.suitnum($3)) && ($convert.suitnum($3) == $convert.suitnum($4)) && ($convert.suitnum($4) == $convert.suitnum($5))) { var %flush = $true }
  tokenize 46 $sorttok($convert.ranknum($1) $+ . $+ $convert.ranknum($2) $+ . $+ $convert.ranknum($3) $+ . $+ $convert.ranknum($4) $+ . $+ $convert.ranknum($5), 46, nr)
  if (%flush) { setcards 5 $1 $2 $3 $4 $5 }
  if ((($1 == $calc($2 + 1)) || (($1 == 14) && ($2 == 5))) &&  ($2 == $calc($3 + 1)) && ($3 == $calc($4 + 1)) && ($4 == $calc($5 + 1))) {
    setcards $iif(%d0 == 5,8,4) $iif((($1 == 14) && ($2 == 5)),5,$1) 0 0 0 0
  }
  if (($1 == $2) && ($2 == $3) && ($3 == $4) && ($4 == $5)) { setcards 9 $1 0 0 0 0 }
  if (($1 == $2) && ($2 == $3) && ($3 == $4) && ($4 != $5)) { setcards 7 $1 $5 0 0 0 }
  if (($1 == $2) && ($2 == $3) && ($3 != $4) && ($4 == $5)) { setcards 6 $1 $5 0 0 0 }
  if (($1 == $2) && ($2 == $3) && ($3 != $4) && ($4 != $5)) { setcards 3 $1 $4 $5 0 0 }
  if (($1 == $2) && ($2 != $3) && ($3 == $4) && ($4 == $5)) { setcards 6 $5 $1 0 0 0 }
  if (($1 == $2) && ($2 != $3) && ($3 == $4) && ($4 != $5)) { setcards 2 $1 $3 $5 0 0 }
  if (($1 == $2) && ($2 != $3) && ($3 != $4) && ($4 == $5)) { setcards 2 $1 $5 $3 0 0 }
  if (($1 == $2) && ($2 != $3) && ($3 != $4) && ($4 != $5)) { setcards 1 $1 $3 $4 $5 0 }
  if (($1 != $2) && ($2 == $3) && ($3 == $4) && ($4 != $5)) { setcards 3 $4 $1 $5 0 0 }
  if (($1 != $2) && ($2 == $3) && ($3 != $4) && ($4 == $5)) { setcards 2 $3 $5 $1 0 0 }
  if (($1 != $2) && ($2 == $3) && ($3 == $4) && ($4 == $5)) { setcards 7 $5 $1 0 0 0 }
  if (($1 != $2) && ($2 == $3) && ($3 != $4) && ($4 != $5)) { setcards 1 $2 $1 $4 $5 0 }
  if (($1 != $2) && ($2 != $3) && ($3 == $4) && ($4 != $5)) { setcards 1 $3 $1 $2 $5 0 }
  if (($1 != $2) && ($2 != $3) && ($3 != $4) && ($4 == $5)) { setcards 1 $4 $1 $2 $3 0 }
  if (($1 != $2) && ($2 != $3) && ($3 == $4) && ($4 == $5)) { setcards 3 $5 $1 $2 0 0 }
  if (%d0 = 0) { setcards 0 $1 $2 $3 $4 $5 }
  convert.lasthand
}
alias convert.lasthand {
  if (%d0 == 0) { set %last-hand a HighCard, $convert.face(%d1) $+ , $convert.face(%d2) $+ , $convert.face(%d3) $+ , $convert.face(%d4) $+ , $convert.face(%d5) }
  if (%d0 == 1) { set %last-hand a Pair, $convert.face(%d1) $+ 's with $convert.face(%d2) $+ , $convert.face(%d3) $+ , $convert.face(%d4) odd }
  if (%d0 == 2) { set %last-hand Two Pair, $convert.face(%d1) $+ 's and $convert.face(%d2) $+ 's with a $convert.face(%d3) kicker }
  if (%d0 == 3) { set %last-hand Three of a Kind, $convert.face(%d1) $+ 's with $convert.face(%d2) and $convert.face(%d3) odd }
  if (%d0 == 4) { set %last-hand a Straight, $convert.face(%d1) to $convert.face($calc(%d1 - 4)) }
  if (%d0 == 5) { set %last-hand a Flush, $convert.face(%d1) $+ , $convert.face(%d2) $+ , $convert.face(%d3) $+ , $convert.face(%d4) $+ , $convert.face(%d5) }
  if (%d0 == 6) { set %last-hand a Fullhouse, $convert.face(%d1) $+ 's over $convert.face(%d2) $+ 's }
  if (%d0 == 7) { set %last-hand Four of a Kind, $convert.face(%d1) $+ 's with $convert.face(%d2) kicker }
  if (%d0 == 8) { set %last-hand a Straight Flush, $convert.face(%d1) to $convert.face($calc(%d1 - 4)) }
  if (%d0 == 9) { set %last-hand Five of a Kind, $convert.face(%d1) $+ 's }
}
alias -l setcards { %d0 = $1 | %d1 = $2 | %d2 = $3 | %d3 = $4 | %d4 = $5 | %d5 = $6 }
;
;TO DO:
;login to stop stealing
;!top10 somehow
;stop giving $0.xx
;
on *:TEXT:!casinotop:#:{ /topusers }
alias topusers {
  btrunc temp 0
  var %i = 1
  while ($ini(casino.ini,%i)) {
    write temp $v1 - $readini(casino.ini,$v1,money)
    inc %i
  }
  filter -cteuff 2 45 temp temp
  .play -n $nick temp
}

Comments

Sign in to comment.
cptpan   -  Aug 03, 2017

This is fun be extremely poorly implemented.

A guy got $1,066,440,000,000,000,300,000 within the first 2 days of adding this to my channel.

Basically game over.

 Respond  
csgraves28   -  Apr 06, 2011

Thanks napa182,as you see I am new to posting on Hawkee so I was unfamilar with where exactly to post it,but still I need help on putting flood protection on the triggers.

 Respond  
napa182   -  Apr 05, 2011

you should have posted this in the forums for help not in the snippet section.
mIRC Scripting
or here
mIRC Snippet Requests

Daxter_Stacker  -  Dec 24, 2014

when u type !beer ,the sentence is not full

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.