# iso-bot — Isometric Game Bot Engine

A modular, high-performance bot framework for isometric games. Screen-reading only — no memory injection, no hooking, no client modification.

First game: **Diablo II: Resurrected**

## Architecture

```
cmd/iso-bot/          Entry point (single binary)
pkg/
├── engine/
│   ├── capture/      Screen capture (window, VM, monitor)
│   ├── vision/       Template matching, color detection (GoCV)
│   ├── input/        Mouse (Bézier curves), keyboard, humanization
│   ├── state/        Game state machine with callbacks
│   ├── safety/       Session timing, breaks, pattern randomization
│   ├── navigation/   Pathfinding, click-to-move
│   └── loot/         Declarative rule-based loot filter engine
├── plugin/           Game plugin interface (implement to add a game)
├── api/              REST + WebSocket API for dashboard
└── auth/             License/account validation
plugins/
└── d2r/              Diablo II: Resurrected plugin
    ├── screens/      State detection (menu, in-game, inventory)
    ├── routines/     Farming routines (Mephisto, Pindle, Countess)
    ├── loot/         Default loot filter rules (YAML)
    └── templates/    UI template images
web/                  SolidJS dashboard (future)
config/               YAML configuration
```

## Design Principles

- **Plugin-based**: Engine is game-agnostic. All game logic in plugins implementing `plugin.Plugin`
- **Screen reading only**: Captures screenshots, analyzes pixels/templates, sends inputs
- **Human-like**: Bézier mouse movement, randomized delays, fatigue, scheduled breaks
- **VM-safe**: Engine runs on host, captures VM window — game never sees the bot
- **Declarative loot**: YAML rule engine for item filtering
- **API-first**: REST + WebSocket for remote dashboard control

## Adding a New Game

Implement these interfaces from `pkg/plugin`:
- `GameDetector` — detect game state from screenshots
- `ScreenReader` — extract items, enemies, text from screen
- `Routine` — automated farming sequences
- `LootFilter` — item pickup rules

## Usage

```bash
# Build
go build -o iso-bot ./cmd/iso-bot

# Run
./iso-bot --game d2r --routine mephisto --api :8080
```

## Tech Stack

| Component | Technology |
|-----------|-----------|
| Engine | Go 1.23+ |
| Vision | GoCV (OpenCV bindings) |
| Screen capture | Platform-native (Win32 / X11) |
| Input simulation | Platform-native (SendInput / uinput) |
| API | net/http + gorilla/websocket |
| Dashboard | SolidJS + TypeScript (planned) |
| Config | YAML |
| Loot filter | Declarative YAML rules |

## License

Private — proprietary software.
