 ----------------------------------------------------------------------
                     Doctor Po's Draw Poker v2.0

 Author: Greg McNeil <gmcneil@yahoo.com>          Date: August 16, 2003

Doctor Po's Draw Poker is a Tcl script for Eggdrop bots on IRC. The script
plays a quick game of face-up 5 card draw poker. As many as five players
can participate in a hand, and the game can be played on multiple channels
simultaneously. This version was written for Eggdrop 1.6.15, Tcl 8.3.5,
and for use on the Undernet IRC network.

This simple "draw poker" game was designed to run as an occasional
diversion on channels that normally have social chat, and not as a game
dealer on specialized game channels. It has nowhere near the capabilities
needed for that. While playing, the bot talks using patter made from
appropriate random phrases, adding variety to the presentation. The poker
game can be activated or deactivated with a command from a channel OP.

The script is pretty thoroughly commented. It uses the "after" command as
its mechanism for timing the sequence of steps. This allows all the active
timers and variables to simply "fade away" in case of unnatural
interuptions (net splits, excessive lag, etc.). It has been tested with
nicknames and channel names containing a variety of Tcl's special
characters, and seems to work under some extreme conditions.

The game was designed to run on the Undernet IRC network, so it was made
to display nicknames up to nine characters long. It should work with
(nearly) any length of nicknames, but the display won't line up as nicely.

The author will probably not continue public development of this script,
so there is no reason to send "bug reports" or lists of channel names that
hose the script, etc. ;) Thanks for trying it, and I hope you enjoy it. If
you do, that's cool. If you don't enjoy it, delete it. :)

 ----------------------------------------------------------------------
Directions:

Source the drpoker.tcl script into the bot then start the game with this
command on the IRC channel:

    !poker

The bot responds with a request for players. Anyone who wants to play then
sends this command to the channel:

    !deal

First 5 to respond will get in the game. The bot will deal itself a static
hand IF only one player !deal's in. It doesn't modify its hand at draw
time. The bot won't play if there are two or more real players.

The bot deals five face up cards to each player then offers a chance for
players to discard and draw. Players may draw new cards by entering this
command to the channel:

    !draw <positions of cards to discard>

The first card on the left is card number 1, and card number 5 is the one
furthest to the right. In other words, to discard the second and fourth
cards in his hand a player would enter: !draw 2 4

The opposite of the !draw command is the !keep command:

    !keep <positions of cards to hold>

To hold the first and third cards in a hand enter: !keep 1 3

To hold all cards a player may simply enter !draw or !keep by itself. This
speeds the game because the bot moves along once all players have !draw'n,
even if some have drawn zero cards.

Spaces aren't necessary between the numbers in the !draw and !keep
commands, and any non-numeric characters are ignored. For example, you
could use a command like "!draw 14 looking for the straight" to discard
the first and fourth cards.

A player who keeps an Ace may draw up to 4 cards, otherwise a maximum of 3
new cards is allowed. If 4 cards are drawn to a WILD card, the wild card
becomes an Ace with a wild suit after the draw.

After a short period for drawing, or as soon as all players have drawn,
the bot will re-deal the cards to display each player's final hand.

At any point a player may end their participation in the hand by entering
the command:

    !fold

The bot gives occasional instructions during play, and when not playing it
will provide a short line of help by typing:

    !poker help <command>

... where <command> is one of deal, draw, keep, or fold.

The bot can be activated or deactivated by any OP on the channel. To turn
off the poker game in the bot, use the command:

    !poker off

... after which the bot wraps up its current hand (if playing), then
ceases responding to !poker commands. The poker bot may be re-activated by
a channel OP using the command:

    !poker on

The sub-commands !deal !draw !keep and !fold should not respond unless a
game is in play. Any incorrect poker commands or args sent to the bot will
probably result in no response.

 ----------------------------------------------------------------------
