BlackJack V 1.1

By Weasel on Aug 21, 2009

Play BlackJack against your bot!
!bj (resets)
!freeze (stop/hold)
!hm (hitme)

V 1.1 Minor Updates ```mirc ;Blackjack, against bot, !bj (start) !hm (hit me) !freeze (freeze/hold); ;Made By Weasel/Twango ;Tested on mIRC v6.35 ;server ;room #whipersnapper ;V 1.0 on *:text:!bj*:#: { unset %cards unset %bcards unset %ctotal unset %btotal set %cards $rand(1,9) $rand(1,9) set %ctotal $calc($left(%cards,1) + $right(%cards,1)) set %bcards $rand(1,9) $rand(1,9) set %btotal $calc($left(%bcards,1) + $right(%bcards,2)) notice $nick Your Cards: %cards :total %ctotal $+ : } on *:text:!hm*:#: { set %tempcard $rand(1,9) set %ctotal $calc(%ctotal + %tempcard) set %cards %cards $+ $chr(32) $+ %tempcard notice $nick you cards: %cards :total %ctotal $+ : if (%ctotal >= 22) { msg # $nick Bust, I win ( $+ my score: %btotal $nick $+ 's score: %ctotal $+ ) | halt } if (%ctotal == 21) { msg # $nick got BLACKJACK!!! ( $+ my score: %btotal $nick $+ 's score: %ctotal $+ ) | mode # +o $nick | halt } set %btemp $rand(1,9) set %btotal $calc(%btotal + %btemp) set %bcards %bcards $+ $chr(32) $+ %btemp if (%btotal >= 22) { msg # I bust $nick Wins ( $+ my score: %btotal $nick $+ 's score: %ctotal $+ ) | mode # +o $nick | halt } if (%btotal == 21) { msg # I got BlackJack! i win ( $+ my score: %btotal $nick $+ 's score: %ctotal $+ ) | halt } } on *:text:!freeze*:#: { if (%btotal >= %ctotal) { msg # $nick froze, i win ( $+ my score: %btotal $nick $+ 's score: %ctotal $+ ) } if (%ctotal >= %btotal) { msg # $nick froze, $nick won ( $+ my score: %btotal $nick $+ 's score: %ctotal $+ ) | mode # +h $nick } } ```


Sign in to comment.
illhawkthat   -  Dec 18, 2012

I created a different version of this script that uses card values 1-13 (including aces and face cards) - here it is
NOTE: This version does include personalized hash table commands that you will need to remove.

However, parts of the script may be useful. PM for questions if you are new to editing scripts.

cptpan  -  May 11, 2015

How do I make this work? How do I get players to have chips so they can actually play?

illhawkthat  -  May 11, 2015

@cptpan It runs off of a CasinoChips.txt text file - to start this off you can type /write CasinoChips.txt NICKNAME 500
/write CasinoChips.txt NICKNAME2 500

Sign in to comment

RevJohn Straub   -  Jul 06, 2010

do you mean Weasel made a script thar actualy works

Priest   -  Jan 24, 2010

He has some really good points though. Basically your not really playing blackjack.

As for the cards. Theres what, 14, 15? card faces, each with 4 suits, I think there was a generic card-hash released sometime before, But still.

Weasel   -  Aug 21, 2009

right, but. the 10 thing makes the $calc a lot harder, but, it functions correctly, it might not be how YOU like it. but it functions

Aucun50   -  Aug 21, 2009

Do i even want to get started on this?....

First off blackjack HAS WAY! WAY! MORE THINGS then just "Hit me". Second $rand(1,9)...? in blackjack Ace can be 1 or 11 and there is no "1" card unless you make a ace 1, also there is more then one card that is ten making the odds of getting a ten are greater then getting say a 5 or 6. What is with the freeze? it's called stand.

Now for your scripting, there is no need for all the unsets like that you can use:

unset %cards %bcards %ctotal %btotal

same for all the global vars by using:

var -g %cards = w/e, %bcards = w/e, %ctotal = w/e

For your if statements you use halt at the end when putting in the second if elseif making it not check the elseif unless the if was = to $false.

Overall this script could be a lot better and have more of the blackjack options like really blackjack does.

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.