cptpan commented on a Page, Blackjack Race  -  Jul 22, 2017

THIS IS SO GOOD. Finally a blackjack script that works and looks good. Thanks so much for this!

How can you check how many coins you have outside of a game?

Degausser  -  Jul 24, 2017

I've updated the script, giving you a few settings and commands to show some statistics. The command list was also getting bulky, so i also added a !commands trigger to view the list of commands. Enjoy Captain xD

cptpan  -  Jul 25, 2017

I kept editing this post so I sorted it into sections.


Does it keep a tally of how many total coins (games x 150 coins) that you've won?

You should also give 2nd and 3rd place coins too!

And maybe coins can be used to by items for the game or just to show off what you've bought? (Not sure how coins are actually used or work in the game, maybe now it just works off the stats and coins are just used to win a round).

I thought you should also have a !pause command (but I think the update means it waits for everyone's turn now anyway)


It says: /mkdir: unable to create 'my folder\stats\blackjack' (line 112, script18.mrc)

(I manually made the \stats folder and it seemed to then make the files inside it in a stats\blackjack\ folder on its own)


Not sure what this one is about


This script is so awesome. Thanks for making it and thanks for updating it so quick!

We've wanted a decent Blackjack script for so long. This is epic.

Degausser  -  Jul 25, 2017

Edited about 3 hours after original post. The source has been edited. I've done most things for you.

Okie day. I suspect the directory isn't being constructed properly because you're using an older version of windows which does not let you create a folder named: stats\blackjack, if a folder named stats\ doesn't already exist. I now create the directories piece by piece, so it should be working. I'm also using mIRC version 7.46 if it helps.

PROCESSCOMMAND.STATS Unknown command <-- I have no idea how you get this. Maybe it was related to the malfunction within the directory structure. If you still get random errors like this, let me know. It's very hard to diagnose without a line number though.

About !pause. Each round, everyone has 30 seconds to complete their actions. Rounds conclude after all players have made their actions, or time is up. If Player A splits his hand, then the most hands per person is Player A with 2 hands. This adds 10 seconds to the clock, so now all players have 40 seconds. If Player B makes 3 splits in the same round, he now has the most hands with 4, so 30 seconds are added to the clock instead of 10. Each additional 'layer' of splits any of the active players reach, 10 seconds are added, but if ALL players reach the next layer, it's still just 10 seconds which are added.

It's a little hard to explain, but basically time remaining = 30 seconds + ((numberOfHandsFromPlayerWithMostSplits - 1) * 10)

The statistics - maybe i wasn't so clear in my explanations here. Firstly, there are flags. -u indicates a user, -a indiciates AI. If you specify -u, and no user under the name is found, it will try to resolve an AI opponent under this name before indicating no users are found. Here are some things you can do with user stats / top 5 lists / comparisons.

!stat -a Degausser - searches for AI opponent named Degausser and displays stats. Fallback is a user
!stat -u Degausser - searches for user named Degausser and displays stats. Fallback is an AI opponent
!stat Degausser - searches for user named Degausser and displays stats. Fallback is an AI opponent

!top5 - displays a list of top 5 players by Coins Per Hand
!top5 -a - displays a list of top 5 AI opponents by Coins Per Hand
!top5 -u - displays a list of top5 Users by Coins Per Hand
!top5 wr - displays a list of players by Win Rate
!top5 -a cpg - displays a list of top5 AI opponents by Coins Per Game
!top5 -u gr - displays a list of top5 Users by Game Rank

CPH = coins per hand
CPG = coins per game
WR = win rate
GR = game rank
H2H = head to head

!compare -a Degausser -u Bob - Compares AI opponent Degausser to user Bob
!compare Degausser -a Bob - Searches for user Degausser and AI opponent Bob, before falling back on AI Opponent Degausser and user Bob

I've also added a !coins command, so that you can see exactly how many coins you have. It works the same way as !stat, but just displays total coins. This is exclusive to users, not AI. All coins accumulated during games will be saved into a file named coins.ini

Finally, the use of coins. This game was made with the purpose of being a fairly robust solution to blackjack on IRC, but only as a base. The script uses the information saved in external files to calculate statistics, so "using coins to buy items" would effectively damage the statistics. I did try and make the script as clear as possible, divided into sections, so that you can navigate your way around and either add or extend functionality. However, I added a couple of global functions at the bottom of the script to help you along.

returns the number of coins this user has in his "coin bank". 0 is returned if no coins are found, whether the user exists or not.

/blackjackDelCoins user N
deletes N coins from nickname specified, even if nickname doesn't yet exist.

$blackjackDelCoins(user, N)
works as above, but returns the new number of coins AFTER taking away N coins.

So i guess like this, it can help tie together external scripts which make use of the saved coins.

cptpan  -  Jul 26, 2017

I'm using windows 8.1 but a really old version of mIRC for the bot, but everything is working fine now.

Thanks for being so diligent on updates, this is probably one of the best games on this entire site, and I've been here for YEARS.

Awesome stuff!

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.