Python Documentation
For Java documentation
This is the the stripped down version of the full documentation that will help you get started with your first Poker Bot Battle script. If you want the full overview of the documentation you can follow this link.
Getting Started
Basics
The function called 'act' has to return either:
- 0 is to fold, or check if no previous bot has raised
- 1 is to call, or check if no previous bot has raised
- >1 is for raising a specific amount
Get current cards
This will put the bots current hand, with the table taken into account, into a variable called current_bot_hand:
current_bot_hand = obs.get_my_hand_type()
This will put the boards hand type, with the bots hand excluded:
current_board_hand = obs.get_board_hand_type()
Both variables will be of type HandType (enum), which looks like this:
- STRAIGHTFLUSH = 9
- FOUROFAKIND = 8
- FULLHOUSE = 7
- FLUSH = 6
- STRAIGHT = 5
- THREEOFAKIND = 4
- TWOPAIR = 3
- PAIR = 2
- HIGHCARD = 1
- ERROR = 0
if current_bot_hand == HandType.STRAIGHTFLUSH:
some_action()
Or you can check if the current hand is better than a specific handtype:
if current_bot_hand >= HandType.PAIR:
some_action()
If you want to match the hand type to specific hands, you can do it like this:
if (Range("77+, A8s+, K9s+, QTs+, AJo+, KQo").is_hand_in_range(obs.my_hand)):
some_action()
The list above is a list of hands that are generated with the help of the site below:
When you have created the wanted hand range you can copy the range string into your script.
Get current round
If you want to base some action on the specific round of the current game, you can do it like this:
if obs.current_round == 2:
some_action()
The current round is an int and can be interpreted like this:
- 0 = Preflop (no cards on board)
- 1 = Flop (three cards on board)
- 2 = Turn (four cards on board)
- 3 = River (five cards on board)
- 4 = Showdown (last chance to raise)
Testing your bot
If you have any questions just ask us at the event.
Good luck with your bot and have fun!