• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Writing a Poker bot
Bots are written in Java using the provided Meerkat API. Check out the opentestbed project on Google Code. In there, you can find some bot examples. For example, here is the source for the ubiquitous AlwaysCallsBot.

To use a bot, you compile the source file into a Java source file. For example, if you had a bot in MyBot.java, the following line would build the class as required for inclusion in Poker Genius. (And, assume that I was not following the standard Java practice of using com.x.y package nesting. MyBot is in the root package.)

javac MyBot.java -cp meerkat-api.jar

Then, given the class file, you need to package it into a jar. Again, given MyBot.class execute:

jar cvf MyBot.jar MyBot.class

At this point, the code has been compiled and packaged but Poker Genius also requires a .pd file. (I think that is an initialism for “Player Definition”.)
You can look through the already present player definition files that are included with Poker Genius.

On OSX, they exist in the directory:

On Windows:

Externally written poker bots are actually plugins, and they have a different class loader. This is specified in the PD file. Continuing the MyBot.java example, here is the relevant MyBot.pd file.

# All plug-ins must run through the following class:

# put your bot's full class name here:

# put the path to your jar file here (relative to the base, I think)

# Your Bot's name:

# Your bot engine name:

# Options for your Bot:

Now, the both MyBot.pd and MyBod.jar need to be copied to:
- for Windows 7/ Windows 8 (32-bit): C:\Program Files\PokerGenius\data\bots\

- for Windows 7/ Windows 8 (64-bit): C:\Program Files (x86)\PokerGenius\data\bots\

- for Mac OS X: copy these files inside the application bundle into Contents\Resources\Java\data\bots\

Now, start Poker Genius, and click “Ring Games” under “Play Games”. Then, navigate to the “Opponent Manager” under:

Window » Opponent Manager

Click the import botton, and find your PD file. I think it was meant to work automatially, but it has been flaky in my experience, so I just start from here. Import your bot, then restart the Poker Genius. Go to “Ring Games” again, and go to the “Full Ring Mixed” game in the “No Limit” section. There will be 10 seats with the types of players to be seated on the right hand side. Click one, and a menu will pop up. Click MyBot. Then, click “Load Table”. Your bot should now be playing poker.
Awesome article! As easy as pie with .pd file. I've read jenu infuser review here, it helped me make up my mind.
For those who aren't programmers it's very simple to make your own player and download it to a file for use on another copy of Pokergenius on another machine. Any of the existing bots inside the program can be copied and reconfigured to the extent possible by clicking the bot name on the menu of the "opponent manager" and adjusting the sliders and starting hand grid (in the case of Xenbots), renaming the new bot, and saving it to a file by the upload/download buttons on the left of the Opponent manager menu. New tournaments and tables can be created in a similar way.

I wanted to attach a sample bot made this way but the forum software wouldn't recognize the Pokergenius file extension as an allowed file type. If the moderator can fix this it would make it possible for forum members to swap their custom-made bots, tournaments, and tables right here in the postings...

Forum Jump:

Users browsing this thread: 1 Guest(s)