PokerGPT - Poker bot for PokerStars

PokerGPT is an advanced bot designed to play online poker on PokerStars. It uses the OpenAI GPT-4 API to analyze the state of the game in real time and make strategic decisions. Originally, the bot focused on 6-player Texas Hold'em, with a graphical user interface (GUI) to visualize game data and voice support to reproduce actions at the table. In this project, the original code has been adapted so it focuses only on showing probability calculation, optimizing its use for specific analysis without needing to automate the whole game.

In addition, this project can be connected with ChatGPT, which allows a more dynamic and personalized interaction. By integrating ChatGPT, users can receive detailed explanations, real-time recommendations and answers to specific questions about the game state and the calculated probabilities. This integration significantly improves the user experience by providing intelligent and contextualized assistance during the analysis or play session. You can access the original project on GitHub.

If you are interested in exploring this project in more depth and experimenting with the code by yourself, all the work shown here is available for download in this PokerGPT_1938web GitHub repository. Feel free to take a look.

Main features

  • Real-time game event detection from screen pixels.
  • Recognition of cards and player actions through the Tesseract OCR API.
  • Analysis of the game state using a game-prediction algorithm.
  • Simulation of mouse clicks inside the PokerStars client to automate gameplay.

Key parts of the code

1. Game event detection

The bot uses pixel-detection techniques to identify real-time events inside the PokerStars client window. This approach allows the bot to react quickly to changes in the game.

2. OCR text recognition

The Tesseract OCR API is used to recognize cards, pot sizes and other player actions at the table.

3. Game analysis with GPT-4

The bot uses the GPT-4 model to analyze the state of the game and make strategic decisions. This is achieved by sending game data to the OpenAI API and receiving recommendations about the actions to take.

From this moment on, in the project https://github.com/al118345/PokerGPT_1938web, a significant adaptation has been made. Instead of using GPT-4 to make strategic gameplay decisions, it focuses exclusively on calculating hand probabilities during the match. This simplified approach enables a more specific and practical use of the project, removing the need to connect to the OpenAI API and therefore removing any cost associated with GPT-4 usage. In addition, this adaptation is more ethical because it focuses only on probabilistic analysis without directly intervening in automatic decision-making during play.

4. Probability calculation

One of the key components of the bot is its ability to calculate hand probabilities based on the visible cards on the table and the hidden hands. This allows the bot to evaluate its chances of winning the hand and make informed decisions.

Limitations

  • The bot depends on PokerStars window size and may not work across all resolutions.
  • It only works on 6-player PokerStars tables.
  • Image-reading speed through OCR depends on CPU performance.

Conclusion

PokerGPT is a fascinating tool that brings artificial intelligence and image processing into the world of online poker. Although it has some limitations, it provides an exciting foundation for people who want to explore and experiment with automated gaming bots. However, it is important to remember that using bots on online poker platforms such as PokerStars is illegal and strictly prohibited. We recommend using this project only for educational and experimental purposes, and not in real matches.