Giter Club home page Giter Club logo

pokerwars / pokerwars.io-starterbot-python Goto Github PK

View Code? Open in Web Editor NEW
44.0 5.0 11.0 13 KB

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/

Python 99.43% Shell 0.57%
artificial-intelligence bot poker games strategy machine-learning poker-game poker-engine artificial-intelligence-algorithms artificialintelligence

pokerwars.io-starterbot-python's Introduction

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 it. This is a useful service to double check this. Bot default port is 3000, 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, rename .env_example as .env and update with your username, API token and bot ip address:
USERNAME=insert here your bot username, find it at https://www.pokerwars.io/profile
API_TOKEN=insert here your api token, find it at https://www.pokerwars.io/token
BOT_ENDPOINT=insert here your bot ip address. i.e.: http://1.2.3.4:3000

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.

Playing on Glitch.com?

It's easy:

  • Import this repo into a new Glitch project
  • Check the Live App URL for your project under Share (it will look like https://<MY_POKERWARS_BOT>.glitch.me), you will use it as your BOT_ENDPOINT
  • Update your .env file as described above
  • Start remixing!

Have fun!

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!

pokerwars.io-starterbot-python's People

Contributors

francescopeloi avatar plopcas avatar pokerwars avatar ribbybibby avatar squarific avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pokerwars.io-starterbot-python's Issues

[Bug] Folded players should not be able to win the hand

Tournament #3104243664658844770, hand 5

As the small blind player, I fold preflop after 1 player limped.
In the next hand, it looks like I have won 3 chips after my fold, which should be impossible according to the rules of poker (my hand is dead because I folded).

Notes

This should be solved after #6

Question

Hi,
I am trying to use your code but I get only this:
Bottle v0.12.18 server starting up (using WSGIRefServer())...
Listening on http://127.0.0.1:3000/
Hit Ctrl-C to quit.

Trying to subscribe to pokerwars.io ...

Is it correct?

Best regards!

Amazing Service

Hi folks, we started recently to use your API and found it very convenient. Its quite funny to watch the bots fighting.

I wonder whether there is a way to connect to other developers by mailing or chatting in order to exchange experiences. Also, is there a way to download his or her hand logs in a standard format? And maybe voluntarily open source them? And finally can you provide more agent stats (MBB, FR, total earnings, and over time performance)? Let us know if we can help.

Thanks for all the work you have already done!

Best,
Simon

PS: we power deep_pot, pokeras, and poker_eye in case you are eager to exchange insights.

[Bug] Ties are not handled correctly

Tournament 1041892307916901006, hand 29

Context: I have AK, there is a 45678 straight on the board (no flushes are possible). Every player checked to the showdown.

There is an all-in player, so it is not possible that all players except me have folded.

Expected: The hand should be a tie unless another player has 9x or T9, then the best straight wins.

Actual: I won the pot.

Can you give an example for .env?

Hi,I interested in your code
But it can't work ,maybe I don't get the right .env
And I'm sure I have visible from the internet.

not an issue

Yo check out my novotec book of ra bot at https://github.com/maksimonishchenko/uitesterboranewhewuinea
+its super lightweight 17.4 kbyte codebase settings layout screenshot - just 1 picture
+its multiplatform run on all windows base console cmd based oprational systems
+its super flexible - could be edited in runtime in any computer text editor

[Bug] BigBlind cannot act preflop after only SmallBlind has limped

Tournament 3104243664658844770, hands 12, 16, 45

Context

There are 4 players in the tournament (SB, BB, CO, BU)
CO and BU fold
SB limps

Behaviour

Expected: BB should be able to check or bet before the flop is revealed.

Actual: When BB receives his first play request for the hand, the flop is already revealed, as if BB was forced to check preflop.

[Bug] All-in players should not be marked as having folded

For what I understand from the rules of poker:

  • "All-in" means a player has bet all their chips in the current hand ; they will not act in the betting phase but they can still win a side pot during the showdown
  • "Folded" means a player has made the fold action: they are out of the hand and cannot win anything during the showdown

In Texas Hold'em, I think it is impossible for a player to be simultaneously all-in and folded, yet Pokerwars marks all-in players as folded.

Notes

This may be the root cause of #7

Game genres

What game genres do you like the most and why? Have you tried any new genres lately that have impressed you?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.