{"id":21670448,"url":"https://github.com/rafaelnogueiraxd/lugo-bot","last_synced_at":"2026-05-19T15:38:14.567Z","repository":{"id":257459717,"uuid":"857596861","full_name":"RafaelNogueiraXD/lugo-bot","owner":"RafaelNogueiraXD","description":"This is bot in python to play in a competition of Lugobots","archived":false,"fork":false,"pushed_at":"2024-09-23T16:03:48.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T09:09:21.893Z","etag":null,"topics":["bot","python3"],"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/RafaelNogueiraXD.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-09-15T04:43:02.000Z","updated_at":"2024-10-22T14:59:00.000Z","dependencies_parsed_at":"2024-09-16T22:46:54.678Z","dependency_job_id":null,"html_url":"https://github.com/RafaelNogueiraXD/lugo-bot","commit_stats":null,"previous_names":["rafaelnogueiraxd/lugo-bot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafaelNogueiraXD%2Flugo-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafaelNogueiraXD%2Flugo-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafaelNogueiraXD%2Flugo-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafaelNogueiraXD%2Flugo-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RafaelNogueiraXD","download_url":"https://codeload.github.com/RafaelNogueiraXD/lugo-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244574181,"owners_count":20474814,"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","python3"],"created_at":"2024-11-25T12:32:17.694Z","updated_at":"2026-05-19T15:38:09.517Z","avatar_url":"https://github.com/RafaelNogueiraXD.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lugo - The Dummies Py\n\nThe Dummies PY is a Python implementation of a player (bot) for [Lugo](https://lugobots.dev) game.\n\nThis bot was made using the [Python Client Player](https://github.com/lugobots/lugo4py).\n\nUse this bot as a starting point to a new one. \n\n## Dependencies\n\n* Docker ([https://docs.docker.com/get-docker/](https://docs.docker.com/get-docker/))\n* Docker Compose ([https://docs.docker.com/compose/install/](https://docs.docker.com/compose/install/))\n\n\n### (optional) Dependencies for IDE intellisense \n\nYou must install the projects requirements if you want to have the IDE intellisense working correctly in your environment.\n\n### On Windows\n1. Download the Python 3.9 installer [https://www.python.org/downloads/release/python-3912/](https://www.python.org/downloads/release/python-3912/)\n2. On the Python installing wizard, remember to check the option to install the **Pip** tool\n3. On the project directory, run:\n```\npip install virtualenv\npython.exe -m venv venv\npip install -r requirements.txt\n\n```\n\n### On Linux or Mac\n```shell\ncd /path/to/your/project\nsudo apt install python3.9-venv\npython3.9 -m venv venv\n. venv/bin/activate\npip install -r requirements.txt\n```\n\n### Configure VS Code\n\n1. `ctrl + p`\n2. \"Python: Create Environment\"\n3. Venv\n4. Select Python3.9 \n\n#### Configure IntellyJ IDE family (PyCharm, Idea, and others)\n\n(see [https://www.jetbrains.com/help/idea/configuring-local-python-interpreters.html](https://www.jetbrains.com/help/idea/configuring-local-python-interpreters.html))\n\n1. Click on File\n2. Project Structure\n3. Click on Project\n4. Select Python3.9 in the SDK list\n\nThe IDE will ask you if you want to install the dependencies. \n\n## Are you familiar with Lugo? \nIf not, before continuing, please visit [the project website](https://lugobots.dev) and read about the game.\n\n## Quick setup (if you do not want to download or clone the code)\n\nYou may use the [SetupEnvPy](https://hub.docker.com/r/lugobots/setup-env-py) Docker image to set up the environment for you:\n\n## How to use this source code\n1. (optional to speed up next steps) Download the images that you will need\n   ```shell\n   docker pull lugobots/server\n   docker pull lugobots/the-dummies-go:latest\n   docker pull python:3.9-slim-buster\n   ```\n2. Run the builder service that will install the depencencies you need (**wait for the service to finish**):\n   ```sell \n   docker compose up builder\n   ```\n3. **Test it out**: Before any change, make the Dummies Py play to ensure you are not working on a broken code.\n\n   ```shell \n   docker compose up\n   ```\n   and open [http://localhost:8080/](http://localhost:8080/) to watch the game.\n4. **Now, make your changes**: (see :question:[How to change the bot](#how-to-edit-the-bot))\n5. Play again to see your changes results: \n\n   ```sh \n   docker compose up\n   ```\n6. **Are you ready to compete? Build your Docker image:** \n    \n    ```sh \n   docker build -f .lugo/Dockerfile -t repo.lugobots.ai/[bot handle]:[version] .\n   ```\n\n## How to edit the bot   \n\n### Main file [main.py](src/main.py)\n\nYou will not change this file. It only initializes the bot.\n\n### Settings file [settings.py](src/settings.py)\n\nSettings file only stores configurations that will affect the player behaviour, e.g. positions, tactic, etc.\n\n### My bot [my_bot.py](src/my_bot.py)\n\n:eyes: This is the most important file!\n\nThere will be 5 important methods that you must edit to change the bot behaviour.\n\n```python\n    def on_disputing(self, inspector: GameSnapshotInspector) -\u003e List[Order]:\n        # on_disputing is called when no one has the ball possession\n        pass\n\n    @abstractmethod\n    def on_defending(self, inspector: GameSnapshotInspector) -\u003e List[Order]:\n        # OnDefending is called when an opponent player has the ball possession\n        pass\n\n    @abstractmethod\n    def on_holding(self, inspector: GameSnapshotInspector) -\u003e List[Order]:\n        # OnHolding is called when this bot has the ball possession\n        pass\n\n    @abstractmethod\n    def on_holding(self, inspector: GameSnapshotInspector) -\u003e List[Order]:\n        # OnSupporting is called when a teammate player has the ball possession\n        pass\n\n    @abstractmethod\n    def as_goalkeeper(self, inspector: GameSnapshotInspector, state: PLAYER_STATE) -\u003e List[Order]:\n        # AsGoalkeeper is only called when this bot is the goalkeeper (number 1). This method is called on every turn,\n        # and the player state is passed at the last parameter.\n        pass\n\n    @abstractmethod\n    def getting_ready(self, inspector: GameSnapshotInspector):\n        # getting_ready will be called before the game starts and after a goal event. You will only need to implement\n        # this method in very rare cases.\n        pass\n```\n\n## Running directly in your machine (:ninja: advanced) \n\nIf you want to run the Python code in your machine instead of inside the container, you definitely can do this.\n\nThe command to start locally is `BOT_TEAM=home BOT_NUMBER=1 python3.9 main.py`. However, when you run the Docker compose \nfile, all players from both teams will start. Then, if you run another bot directly from your machine, it will not\nbe allowed to join the game.\n\nBut you also cannot start your bot before the game server has started.\n\nYou have two options to run your bot locally.\n\n### Option 1 - comment out the bot from the Docker compose file\n\nYou can edit the file `docker-compose.yml` and comment out the player 2 of the home team.\n\nThe game server will wait all 11 players from both teams to connect before starting the game.\n\n### Option 2 - starting the game server first\n\nYou can start _only_ the game server with the command `docker compose up -d game_server`. The game will wait for the players. Then, you\nstart your local bot (`BOT_TEAM=home BOT_NUMBER=1 python3.9 main.py`), and finally start the rest of the players with the\ncommand `docker compose up`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelnogueiraxd%2Flugo-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafaelnogueiraxd%2Flugo-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelnogueiraxd%2Flugo-bot/lists"}