2026-09-06 18:56:51 +00:00
|
|
|
# Install Instructions
|
|
|
|
|
|
|
|
|
|
## Prerequisites
|
|
|
|
|
- Python 3.8+
|
|
|
|
|
- Ollama installed and running with the `gemm4:12b` model downloaded.
|
|
|
|
|
|
|
|
|
|
## Setup
|
|
|
|
|
1. Navigate to the directory:
|
|
|
|
|
```bash
|
|
|
|
|
cd botagent_ai
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
2. Create a virtual environment (optional but recommended):
|
|
|
|
|
```bash
|
|
|
|
|
python -m venv venv
|
|
|
|
|
source venv/bin/activate # On Windows use: venv\Scripts\activate
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
3. Install dependencies:
|
|
|
|
|
```bash
|
|
|
|
|
pip install -r requirements.txt
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
The bot plays botWebWars using an Ollama model for strategy (voluntary alliances and
|
|
|
|
|
navigation), while rule-mandated outcomes (forced battles/joins) are resolved automatically.
|
|
|
|
|
Configure it via environment variables or CLI flags:
|
|
|
|
|
- `OLLAMA_BASE_URL` / `--ollama-url`: Ollama instance URL (e.g., `http://192.168.1.220:11434`)
|
|
|
|
|
- `OLLAMA_MODEL` / `--ollama-model`: The model name (default is `gemma4:12b`)
|
|
|
|
|
- `BOT_SERVER_URL` / `-u`: botWebWars backend URL (default `http://localhost:8000/api`)
|
|
|
|
|
- `BOT_NAME` / `-n`: Bot display name
|
|
|
|
|
- `BOT_COLOR` / `-c`: Hex color for the bot avatar
|
|
|
|
|
- `BOT_STRENGTH` / `-s`: Starting strength (1-10)
|
2026-09-09 22:11:54 +00:00
|
|
|
- `BOT_HEALTH` / `-H` / `--health`: Starting health points (default: 10)
|
2026-09-06 18:56:51 +00:00
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
```bash
|
|
|
|
|
export OLLAMA_BASE_URL="http://192.168.1.220:11434"
|
|
|
|
|
export OLLAMA_MODEL="gemma4:12b"
|
2026-09-09 22:11:54 +00:00
|
|
|
python bot.py -n MyAIBot -s 5 -H 10
|
2026-09-06 18:56:51 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Running the Bot
|
|
|
|
|
Run the script, then start the game from the frontend UI:
|
|
|
|
|
```bash
|
|
|
|
|
python bot.py
|
|
|
|
|
```
|
2026-09-06 21:25:35 +00:00
|
|
|
|
|
|
|
|
## Example with local LLM
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ OLLAMA_BASE_URL="http://192.168.1.220:11434" python3 ./bot.py -n myAIBot -s 2
|
|
|
|
|
```
|