This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

TCL Poker

Old posts that have not been replied to for several years.
Locked
F
FreakyComputer
Voice
Posts: 22
Joined: Fri May 10, 2002 8:00 pm
Location: South Africa

TCL Poker

Post by FreakyComputer »

Hiya,

I was wondering if there is an eggdrop Poker script somewhere. If would be something in the likes of...

Everyone joins in and the bot gives everyone their cards (as a notice ofcourse) and then the person can exchange the cards, eg. !change a c e would exchange his first, third and fifth card. Then the person with the highest hand wins the betted hand

I think this is called 5 Card Stud, not 100% of the variation's name

Is there some kind of this out there? Or should I try code for myself. My problem is, I dont know how to check for who has the highest hand.

So, it will be multiplayer :)

Thanks,
FC
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

I haven't heard of one.

To check for who has the highest hand, you simply need to keep track of who is playing and who has what cards. The easiest way is to store the information in one or more global variables. You should have a "players" variable that is a list of players. Then perhaps a "hands" array, which has an entry for each player. The entry would be the list of cards the player has.

To calculate who has the highest hand, you have to program in the rules of poker. Check each hand for pairs, 3 of a kind, 4 of a kind. If you're using jokers/wildcards it will be harder -- calculate the highest group of non-wild cards, or the highest face card value, and add the number of wilds to it.

Next check for straights. That's pretty easy.. sort the cards from low to high, then check for how many gaps there are. If the length of gaps is greater than the number of wilds, it's not a straight.

Check for a straight flush.

Store the highest valued card of each hand, so that if there's a tie you can determine a winner.

I don't know all the rules but I'm guessing you do. Most rules are pretty straightforward to program into a computer, since computers follow rules very well.

My advice is to create this scoring function first. Let each card be represented by a letter and a number, like C1 = ace of clubs, C2 = two of clubs, H3 = three of hearts. Then make a simple dcc or public bind to report a score when you say !score C3 C4 C5 C6 C7
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

hehe... sounds interesting...
sounds like my next project when avote2 is finished :D
aVote page back online!
Check out the most popular voting script for eggdrop bots.

Join the metal tavern!
Locked