{"id":31761249,"url":"https://github.com/pmariglia/foul-play","last_synced_at":"2025-10-09T21:48:44.289Z","repository":{"id":40490276,"uuid":"177430843","full_name":"pmariglia/foul-play","owner":"pmariglia","description":"A Pokemon Showdown Battle AI","archived":false,"fork":false,"pushed_at":"2025-10-05T21:28:30.000Z","size":6538,"stargazers_count":308,"open_issues_count":6,"forks_count":196,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-10-05T22:21:59.082Z","etag":null,"topics":["ai","asyncio","pokemon","pokemon-showdown","pokemon-showdown-bot","pokemonshowdown","python","python3","websockets"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pmariglia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-03-24T15:09:15.000Z","updated_at":"2025-10-05T21:28:34.000Z","dependencies_parsed_at":"2023-02-16T02:01:07.539Z","dependency_job_id":"0f5a65c0-1910-4dba-9d77-cde34aca9b01","html_url":"https://github.com/pmariglia/foul-play","commit_stats":null,"previous_names":["pmariglia/foul-play","pmariglia/showdown"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pmariglia/foul-play","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmariglia%2Ffoul-play","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmariglia%2Ffoul-play/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmariglia%2Ffoul-play/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmariglia%2Ffoul-play/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pmariglia","download_url":"https://codeload.github.com/pmariglia/foul-play/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmariglia%2Ffoul-play/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002051,"owners_count":26083286,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ai","asyncio","pokemon","pokemon-showdown","pokemon-showdown-bot","pokemonshowdown","python","python3","websockets"],"created_at":"2025-10-09T21:48:21.040Z","updated_at":"2025-10-09T21:48:44.284Z","avatar_url":"https://github.com/pmariglia.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Foul Play ![umbreon](https://play.pokemonshowdown.com/sprites/xyani/umbreon.gif)\nA Pokémon battle-bot that can play battles on [Pokemon Showdown](https://pokemonshowdown.com/).\n\nFoul Play can play single battles in all generations\nthough currently dynamax and z-moves are not supported.\n\n![badge](https://github.com/pmariglia/foul-play/actions/workflows/ci.yml/badge.svg)\n\n## Python version\nRequires Python 3.11+.\n\n## Getting Started\n\n### Configuration\n\nCommand-line arguments are used to configure Foul Play\n\nuse `python run.py --help` to see all options.\n\n### Running Locally\n\n**1. Clone**\n\nClone the repository with `git clone https://github.com/pmariglia/foul-play.git`\n\n**2. Install Requirements**\n\nInstall the requirements with `pip install -r requirements.txt`.\n\nNote: Requires Rust to be installed on your machine to build the engine.\n\n**4. Run**\n\nRun with `python run.py`\n\nHere is a minimal example that plays a gen9randombattle on Pokemon Showdown:\n```bash\npython run.py \\\n--websocket-uri wss://sim3.psim.us/showdown/websocket \\\n--ps-username 'My Username' \\\n--ps-password sekret \\\n--bot-mode search_ladder \\\n--pokemon-format gen9randombattle\n```\n\n### Running with Docker\n\n**1. Clone the repository**\n\n`git clone https://github.com/pmariglia/foul-play.git`\n\n**2. Build the Docker image**\n\nUse the `Makefile` to build a Docker image\n```shell\nmake docker\n```\n\nor for a specific generation:\n```shell\nmake docker GEN=gen4\n```\n\n**3. Run the Docker Image**\n```bash\ndocker run --rm --network host foul-play:latest \\\n--websocket-uri wss://sim3.psim.us/showdown/websocket \\\n--ps-username 'My Username' \\\n--ps-password sekret \\\n--bot-mode search_ladder \\\n--pokemon-format gen9randombattle\n```\n\n## Engine\n\nThis project uses [poke-engine](https://github.com/pmariglia/poke-engine) to search through battles.\nSee [the engine docs](https://poke-engine.readthedocs.io/en/latest/) for more information.\n\nThe engine must be built from source if installing locally so you must have rust installed on your machine.\n\n### Re-Installing the Engine\n\nIt is common to want to re-install the engine for different generations of Pokémon.\n\n`pip` will used cached .whl artifacts when installing packages\nand cannot detect the `--config-settings` flag that was used to build the engine.\n\nThe following command will ensure that the engine is re-installed properly:\n```shell\npip uninstall -y poke-engine \u0026\u0026 pip install -v --force-reinstall --no-cache-dir poke-engine --config-settings=\"build-args=--features poke-engine/\u003cGENERATION\u003e --no-default-features\"\n```\n\nOr using the Makefile:\n```shell\nmake poke_engine GEN=\u003cgeneration\u003e\n```\n\nFor example, to re-install the engine for generation 4:\n```shell\nmake poke_engine GEN=gen4\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmariglia%2Ffoul-play","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpmariglia%2Ffoul-play","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmariglia%2Ffoul-play/lists"}