Register
Email: Password:
Forum » A new feature for MageBot - POKER!

A new feature for MageBot - POKER!

MageKing17 14 years ago
So, I spent the night whipping up some code for a somewhat-bizarre not-fully-tested-and-probably-buggy feature: Texas hold 'em poker. It's fairly intuitive (saying "call" calls, saying "check" checks, saying "raise 10" raises the bet by 10, saying "fold" folds, et cetera). The only unintuitive things are how to force a deal of the hand when there are some people who are "in game" but not anted (a majority > 50% of the players that have anted must say "start"), taking that back ("don't start"), and quitting the game (which basically deletes your chip total and makes it so people don't have to vote to start the game with the "start" command), which is done by saying "I'm done".

Here's a quick log to demonstrate:
<!MageKing17> Poker.
<+MageBot> A game of Texas hold 'em poker has begun! Players start with 100 chips. Players can join at any time; two players are required for a hand to start. To start a hand, one player must ante. Any other players wishing to participate must also ante. Play will proceed in the order that players anted. Once all players have anted (or a majority of the participating players have voted to start), the hand begins.
<!MageKing17> Ante 5.
<+MageBot> MageKing17 kicks things off by anteing 5 chips!
<+MageBot> It appears MageKing17 has no friends; with no other antes within 60 seconds, MageKing17's ante of 5 chips is returned.
<!MageKing17> Ante 5.
<+MageBot> MageKing17 kicks things off by anteing 5 chips!
<!MageKing17> Poker.
<+MageBot> MageKing17: You are the only person playing right now, and have 95 chips. A hand cannot begin without at least two players.
<+MageBot> It appears MageKing17 has no friends; with no other antes within 60 seconds, MageKing17's ante of 5 chips is returned.
<%Shingo> Poker.
<+MageBot> Shingo has joined the game with 100 chips!
<%Shingo> Ante 5.
<+MageBot> Shingo kicks things off by anteing 5 chips!
<!MageKing17> Ante 5.
<+MageBot> MageKing17 matches the ante of 5 chips. The pot is now 10 chips.
-MageBot- Your hand: K D and 3 S
<+MageBot> Betting will now begin, starting with Shingo.
<%Shingo> Check.
<+MageBot> Shingo checks.
<+MageBot> MageKing17, it's now your turn to bet (current bet: 5).
<!MageKing17> Raise 2.
<+MageBot> MageKing17 raises to 7! The pot is now 12 chips.
<+MageBot> Shingo, it's now your turn to bet (current bet: 7).
<%Shingo> Call.
<+MageBot> Shingo calls. The pot is now 14 chips.
<+MageBot> Drawing communal cards... 5 S, 10H, 4 S. Betting shall commence once more, starting with SHINGO.
<!MageKing17> Poker.
<+MageBot> MageKing17: The pot has 14 chips in it. Shingo (93 chips, bet 7) and you (93 chips, bet 7)are participating in this hand. are also playing. The communal cards are 5 S, 10H, and 4 S, . The current bet is 7. (As you can see, he still has a couple bugs to be worked out. The problems here are a missing space, a lack of a conditional check for whether or not there are players outside this hand, and fucking up with displaying the communal cards.)
<%Shingo> Check.
<+MageBot> Shingo checks.
<+MageBot> MageKing17, it's now your turn to bet (current bet: 7).
<!MageKing17> Raise 2.
<+MageBot> MageKing17 raises to 9! The pot is now 16 chips.
<+MageBot> Shingo, it's now your turn to bet (current bet: 9).
<!MageKing17> BTW, I'm putting a log of this on the instantkingdom forums to show off the new stuff.
<!MageKing17> So MageBot, you'd better not crash.
<!MageKing17> I think I'll also need a function to remind me of my hand, because I can't remember. >.<
<%Shingo> Poker.
<+MageBot> Shingo: The pot has 16 chips in it. You (93 chips, bet 7) and MageKing17 (91 chips, bet 9)are participating in this hand. are also playing. The communal cards are 5 S, 10H, and 4 S, . The current bet is 9.
<%Shingo> Check.
<+MageBot> Shingo: You haven't matched the current bet, so you can't check (try "call" instead).
<!MageKing17> Poker.
<+MageBot> MageKing17: The pot has 16 chips in it. Shingo (93 chips, bet 7) and you (91 chips, bet 9)are participating in this hand. are also playing. The communal cards are 5 S, 10H, and 4 S, . The current bet is 9.
<%Shingo> Poker.
<+MageBot> Shingo: The pot has 16 chips in it. You (93 chips, bet 7) and MageKing17 (91 chips, bet 9)are participating in this hand. are also playing. The communal cards are 5 S, 10H, and 4 S, . The current bet is 9.
<%Shingo> Ah.
<%Shingo> Check.
<+MageBot> Shingo: You haven't matched the current bet, so you can't check (try "call" instead).
<%Shingo> Call.
<+MageBot> Shingo calls. The pot is now 18 chips.
<+MageBot> Drawing another communal card. The communal cards are now 5 S, 10H, 4 S, 2 D. Betting shall restart with SHINGO.
<%Shingo> ><
<%Shingo> Check.
<+MageBot> Shingo checks.
<+MageBot> MageKing17, it's now your turn to bet (current bet: 9).
<!MageKing17> Raise 1.
<+MageBot> MageKing17 raises to 10! The pot is now 19 chips.
<+MageBot> Shingo, it's now your turn to bet (current bet: 10).
<%Shingo> Raise 20.
<+MageBot> Shingo raises to 30! The pot is now 40 chips.
<+MageBot> MageKing17, it's now your turn to bet (current bet: 30).
<!MageKing17> Call.
<+MageBot> MageKing17 calls. The pot is now 60 chips.
<+MageBot> Drawing another communal card. The communal cards are now 5 S, 10H, 4 S, 2 D, 8 C. The final betting round shall start with SHINGO.
<%Shingo> Bet 7.
<+MageBot> Shingo: You can't bet lower than the current bet unless you're going all in.
<%Shingo> Oh, right.
<%Shingo> Check.
<+MageBot> Shingo checks.
<+MageBot> MageKing17, it's now your turn to bet (current bet: 30).
<!MageKing17> Raise 10.
<+MageBot> MageKing17 raises to 40! The pot is now 70 chips.
<+MageBot> Shingo, it's now your turn to bet (current bet: 40).
<%Shingo> All in.
<+MageBot> Shingo raises to 100! The pot is now 140 chips.
<+MageBot> MageKing17, it's now your turn to bet (current bet: 100).
<!MageKing17> All in.
<%Shingo> Hehe
<+MageBot> MageKing17 calls. The pot is now 200 chips.
<+MageBot> Showdown!
* MageBot has quit (Client closed connection)
<!MageKing17> Oh fuck.
<%Shingo> D'oh.
...Okay, so we're still working out bugs. But it will be awesome, I promise!
#
Grim Reaper 14 years ago
"MageKing17" said:
it will be awesome, I promise!
"MageKing17" said:
So, I spent the night whipping up some code for a somewhat-bizarre not-fully-tested-and-probably-buggy feature: Texas hold 'em poker.
HOLD IT!

There's a contradiction in the witness' testimony!

But yeah, on a purely coding point of view, nicely done.
#
MageKing17 14 years ago
"Grim Reaper" said:
There's a contradiction in the witness' testimony!
I like Red Dead Redemption, okay?

"Grim Reaper" said:
But yeah, on a purely coding point of view, nicely done.
Yeah, and before I went to bed, we even got it to handle a showdown properly.

Of course, it didn't eject the player who busted on all their chips from the game, which is kinda silly, but whatever. I can fix it later.
#
E_net4 14 years ago
"MageKing17" said:
Of course, it didn't eject the player who busted on all their chips from the game, which is kinda silly, but whatever. I can fix it later.
*you bet 9001 chips*
"E_net4 now has -8742 chips!"
I know it doesn't happen, but how fun would it be?
#
Amarth 14 years ago
"E_net4" said:
"MageKing17" said:
Of course, it didn't eject the player who busted on all their chips from the game, which is kinda silly, but whatever. I can fix it later.
*you bet 9001 chips*
"E_net4 now has -8742 chips!"
I know it doesn't happen, but how fun would it be?
Not very fun. Going all-in or forcing other people to go all-in is an important part of poker strategy.
#
MageKing17 14 years ago
"Amarth" said:
"E_net4" said:
"MageKing17" said:
Of course, it didn't eject the player who busted on all their chips from the game, which is kinda silly, but whatever. I can fix it later.
*you bet 9001 chips*
"E_net4 now has -8742 chips!"
I know it doesn't happen, but how fun would it be?
Not very fun. Going all-in or forcing other people to go all-in is an important part of poker strategy.
Not that there's much strategy right now when you can just re-join as soon as you bust out...

I don't want to implement a "global" chip-tracking system, but what other way to introduce... well, caution is there?
#
Murska 14 years ago
If you bust, you get banned from the channel for a few hours?
#
MageKing17 14 years ago
"Murska" said:
If you bust, you get banned from the channel for a few hours?
That's a terrible idea.

Unable to play poker for a few hours, maybe. But not banned from the channel.
#
E_net4 14 years ago
"MageKing17" said:
Unable to play poker for a few hours, maybe.
Now that's a good idea.
#
Venom31 14 years ago
Unable to join this game while it's still going on?
Separate playing rooms? (Losers join a new room with filled back chips)
#
E_net4 14 years ago
He already implemented a game ban of 1 hour for those who get busted.
But indeed, we might need a separate chatroom for playing poker.
#
Venom31 14 years ago
Ok, but why ban for a pre-set time? Like the game will go on for exactly one hour after that, heh...
#
Kario 14 years ago
Since most of the channels are #monkkonenWW chat ect...
i suggest #monkkonenpoker
#
MageKing17 14 years ago
"Venom31" said:
Unable to join this game while it's still going on?
That would be a terrible system. One of the whole points of poker is that new people can bring more chips to the table at any time.
#
Anonymous1157 14 years ago
Doesn't MageBot already keep track of usernames, IIRC? You could just keep track of all of the current game's players and losers, and if someone who lost the current game really wants to rejoin after, say, one or two rounds (I no knows me terminologies for poker), they can be voted in.
#
MageKing17 14 years ago
"Anonymous1157" said:
Doesn't MageBot already keep track of usernames, IIRC? You could just keep track of all of the current game's players and losers, and if someone who lost the current game really wants to rejoin after, say, one or two rounds (I no knows me terminologies for poker), they can be voted in.
No. The hour-long ban system stays. I'm too lazy to do something else.
#
Narvius 14 years ago
"MageKing17" said:
I'm too lazy to do something else.
QFT, regardless of situation
#
Forum » A new feature for MageBot - POKER!

Post Reply


Your email:
Your name: