This is a bot that plays Tempest (aka Push/Fold) poker using OCR and image matching. Push/Fold poker is pretty simple, you are dealt 2 cards and you only have 2 options push(all in) or fold.
The app then uses precalculated Nash push/fold tables to recommend a action(push/fold). Also I precalculated the hand win % in a seperate table to also pull in and give you a bit more info about your hand.
Heres some useful reading for more details:
Heres a simple run down of how it works:
- Keep scanning the center bottom player postion for new cards.
- Once new cards appear read the suit and value of both cards.
- Wait for your turn, by looking for the timer bar to appear below your profile picture.
- Read the pot value and see if any other players have pushed in.
- Fetch the Nash recommendation and hand win % from DB.
- Print all your hand information and recommendation to the console.
- Repeat.
Installation is 3 basic steps first install all the reqs:
pip install -r requirements.txt
Next you will need to install Tesseract-OCR:
Tesseract Download/Install Guide
Lastly after tesseract is installed you will need to update the ocr.pytesseract.tesseract_cmd in vision.py file with the installation path of tesseract.
All configurations can be fonud in the config.py file. The big setup challenge will be getting the positions setup for the player. I was using a 2k screen and the game board was snapped to he left using the Windows tile manager and thats how I calculated where everything is. Also your small blind and max push value can be set here also.
In the vision.py file I have a popup_image function that will show any screenshot you pass it so you can use that norrow in your X/Y positions of everything.
This project is provided as is, and is intended for educational purposes only and should not be used to actual gambling.
Created by Wyatt Ferguson
For any questions or comments you can send them to me on my socials:
🍧 Follow on Mastodon @wyattxdev@mastodon.social
🍹 Follow on Twitter @wyattxdev
If you find this useful and want to tip me a little coffee money: