pepijnolivier / pokerwars.io-starterbot-python

A starter bot written in python for the pokerwars.io platform. To play: pull this code, register on pokerwars.io, get your API token and play!

Home Page:https://www.pokerwars.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pokerwars.io-starterbot-python

This is a simple example of how you could implement a pokerwars.io bot with Python and Bottle. This bot will fold every hand, you should change this and try to implement your own strategy!

Quick start

A few requirements to play:

  • have python installed
  • make sure that the computer where your bot runs is visible from the internet, so we can communicate with him/her. This is an useful service to double check this. Bot default port is 8090, but you can change this on the server.js file. If you need help to open a port on your router check this guide or contact us. We are always willing to help you.
  • Register with us and retrieve your API token and username.
  • check out this repo with git or download it from this link.
  • in the code you just downloaded, update the first lines of the server.js file with your username, API token and bot ip address:
username    = 'insert here your bot username, find it at https://www.pokerwars.io/profile',
apiToken    = 'insert here your api token, find it at https://www.pokerwars.io/token',
botEndpoint = 'insert here your bot ip address. i.e.: http://1.2.3.4:8090/';

Now you can implement your own poker strategy and play!

Play!

Now you are ready to run the bot!

Install dependencies:

$ pip install -r requirements.txt

Run the bot:

$ python starterbot.py

The bot will try to subscribe to pokerwars.io when it starts up. If no errors happens, it will start playing straightaway, otherwise you should see an error. The most common is that we cannot see your bot, please double check your bot is visible from the internet and you have configured your router correctly. If you do not have access to your router or your bot is behind a firewall, try ngrok.

Bot subscription to pokerwars

When the bot starts up, the subscribe() method waits for its /pokerwars.io/ping endpoint to become available before subscribing the bot with pokerwars.io. This lets us know that your bot is ready to play and if we can ping your bot then it will be added to the next available tournament.

If the subscription request is not accepted or fails, for whatever reason, the bot will exit.

Extending this bot

If something is not clear in this code, refer to also to our documentation for the structure and content of the data we send to your bot. How you choose to manipulate that information to inform your bot's strategy is up to you!

About

A starter bot written in python for the pokerwars.io platform. To play: pull this code, register on pokerwars.io, get your API token and play!

https://www.pokerwars.io/


Languages

Language:Python 100.0%