{"id":16814980,"url":"https://github.com/nanguanlin6/GOP3-blackjack-bot","last_synced_at":"2026-07-06T20:01:20.261Z","repository":{"id":240544457,"uuid":"802847802","full_name":"lng2020/GOP3-blackjack-bot","owner":"lng2020","description":"GOP3 Blackjack Bot","archived":false,"fork":false,"pushed_at":"2025-04-18T06:30:26.000Z","size":1727,"stargazers_count":19,"open_issues_count":7,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-18T18:38:00.278Z","etag":null,"topics":["bot","gop3","opencv","pyautogui","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lng2020.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-19T12:37:22.000Z","updated_at":"2025-04-18T06:29:17.000Z","dependencies_parsed_at":"2025-02-18T13:35:44.122Z","dependency_job_id":"ad7a53e2-4106-4825-aff4-2ab0e0cdc8c7","html_url":"https://github.com/lng2020/GOP3-blackjack-bot","commit_stats":null,"previous_names":["lng2020/gop3-blackjack-bot"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lng2020/GOP3-blackjack-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lng2020%2FGOP3-blackjack-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lng2020%2FGOP3-blackjack-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lng2020%2FGOP3-blackjack-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lng2020%2FGOP3-blackjack-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lng2020","download_url":"https://codeload.github.com/lng2020/GOP3-blackjack-bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lng2020%2FGOP3-blackjack-bot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259610130,"owners_count":22884197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","gop3","opencv","pyautogui","python"],"created_at":"2024-10-13T10:32:00.156Z","updated_at":"2026-07-06T20:01:20.252Z","avatar_url":"https://github.com/lng2020.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# If You Want to Buy Chips\r\n\r\ncontact me at t.me/dumbass2002\r\n\r\n# GOP3 Blackjack Bot\r\nThis is a simple blackjack bot for the game \"Governor of Poker 3\". \r\n\r\nIt uses `pyautogui` to take screenshots and click buttons, and `opencv` to recognize the cards and buttons. Then it uses a [strategy configuration cheatsheet](./assets/cheatsheet.png) to decide the next move. To self-define strategy, you can replace the const `CHEAT_SHEET` in `constant.py`. The self-defined strategy in GUI is on [TODO](#todo).\r\n\r\nThe `v2` tag is a quite stable version. From my several 10000 hand tests, the expectation is around 0.98. The main branch is for more features and improvements but the expectation will not change much.\r\n\r\n![demo](./assets/demo.png)\r\n## Binary\r\nYou can download the binary version and use it directly. The binary version is built with `pyinstaller` and contains all the dependencies. You can find the binary version in the GitHub release page.\r\n\r\n## Usage\r\n1. Requirements in GOP3:\r\n    - The game must be in fullscreen mode(1920*1080).\r\n    - The game must be in English or Chinese([other language contributions are welcome!](#translation)).\r\n    - The game must be in the personal blackjack room.\r\n2. Run the bot:\r\n```bash\r\npip install -r requirements.txt\r\npython main.py\r\n```\r\n## TODO\r\n- [x] Add i18n support(supported languages: English, Chinese)\r\n- [ ] Self-defined strategy in GUI\r\n- [ ] Adapt different resolutions\r\n- [x] Better distinguish win/draw conditions\r\n- [x] Better splitting cards recognitions\r\n\r\n## Known issues\r\n1. if this hand contains more than 5 cards, the bot will not recognize the cards correctly. That's because the cards begin to overlap, making recognition difficult.\r\n2. the win/lose recognition is not right after splitting cards. After splitting cards, there are two win/lose hands on the table but the bot only recognizes one. So the behavior is (win, win) or (win, lose) detect a single win and (lose, lose) detect a single loss. This probably causes the `net win` to be about 10% higher than the actual net win from my tests.\r\n\r\n## Translation\r\nThis is a guide for translating the bot to other languages. If you want to contribute, please follow the steps below:\r\n1. screenshot the game interface and save it to `image/{language_name}` folder. Required images are:\r\n    - `hit.png`\r\n    - `stand.png`\r\n    - `double.png`\r\n    - `split.png`\r\n    - `win.png`\r\n    - `lose.png`\r\n    - `draw.png`\r\n    - `blackjack.png`\r\n    - `bust.png`\r\n2. Add this language to the constants in `main.py`:\r\n```python\r\nSUPPORTED_LANGUAGE = [\"English\", \"Chinese\"]\r\nLANGUAGE_MAP = {\r\n    \"English\": \"en-us\",\r\n    \"Chinese\": \"zh-cn\",\r\n}\r\n```\r\n\r\nyou can see the `image/zh-cn` folder for reference.\r\n## Credits\r\nhttps://github.com/weeeeeesterly/GOP3blackjack-21-\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanguanlin6%2FGOP3-blackjack-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnanguanlin6%2FGOP3-blackjack-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanguanlin6%2FGOP3-blackjack-bot/lists"}