# tanmoy-mondal-07/python-game-bot architecture

> Architecture diagram of the GitHub repository tanmoy-mondal-07/python-game-bot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tanmoy-mondal-07/python-game-bot
- Repository: https://github.com/tanmoy-mondal-07/python-game-bot

## Overview

This is a small Python bot that repeatedly scans a Clash of Clans screen for troop requests, finds nearby donation buttons, and clicks them using simulated human-like movement. Its internal flow is concentrated in `coc.py`; `draw.py` provides the detection-window overlay, while `human_like.py` performs clicks. The README also describes troop templates under `donate_file/`. The graph reflects the sampled code and documented behavior; the template directory’s contents and any separate donation-button image are not present in the supplied tree.

Main entry points: [`COC_Bot_python/coc.py`](https://github.com/tanmoy-mondal-07/python-game-bot/blob/main/COC_Bot_python/coc.py) (Template Matching), [`COC_Bot_python/human_like.py`](https://github.com/tanmoy-mondal-07/python-game-bot/blob/main/COC_Bot_python/human_like.py) (Human-like Clicks), [`COC_Bot_python/draw.py`](https://github.com/tanmoy-mondal-07/python-game-bot/blob/main/COC_Bot_python/draw.py) (Detection Overlay), [`COC_Bot_python/donate_file`](https://github.com/tanmoy-mondal-07/python-game-bot/tree/main/COC_Bot_python/donate_file) (Troop Templates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_automation["Screen Automation"]
  node_loop["Donation Loop<br/>[coc.py]"]
  node_capture["Screen Capture<br/>[coc.py]"]
  node_matching["Template Matching<br/>[coc.py]"]
end

subgraph group_interaction["Visual Feedback"]
  node_overlay["Detection Overlay<br/>[draw.py]"]
  node_click["Human-like Clicks<br/>[human_like.py]"]
end

subgraph group_templates["Recognition Inputs"]
  node_troop_templates["Troop Templates"]
end

node_player(("Game Session"))

node_player -->|"provides screen"| node_capture
node_loop -->|"searches requests"| node_matching
node_matching -->|"captures region"| node_capture
node_matching -->|"matches templates"| node_troop_templates
node_matching -->|"draws scan zone"| node_overlay
node_loop -->|"clicks matches"| node_click
node_click -->|"donates troops"| node_player

click node_loop "https://github.com/tanmoy-mondal-07/python-game-bot/blob/main/COC_Bot_python/coc.py"
click node_capture "https://github.com/tanmoy-mondal-07/python-game-bot/blob/main/COC_Bot_python/coc.py"
click node_matching "https://github.com/tanmoy-mondal-07/python-game-bot/blob/main/COC_Bot_python/coc.py"
click node_troop_templates "https://github.com/tanmoy-mondal-07/python-game-bot/tree/main/COC_Bot_python/donate_file"
click node_overlay "https://github.com/tanmoy-mondal-07/python-game-bot/blob/main/COC_Bot_python/draw.py"
click node_click "https://github.com/tanmoy-mondal-07/python-game-bot/blob/main/COC_Bot_python/human_like.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_loop,node_capture,node_matching toneBlue
class node_overlay,node_click toneAmber
class node_troop_templates toneMint
class node_player toneIndigo
```

## Components

### Screen Automation

- [Donation Loop](https://github.com/tanmoy-mondal-07/python-game-bot/blob/main/COC_Bot_python/coc.py): `COC_Bot_python/coc.py`
- [Screen Capture](https://github.com/tanmoy-mondal-07/python-game-bot/blob/main/COC_Bot_python/coc.py): `COC_Bot_python/coc.py`
- [Template Matching](https://github.com/tanmoy-mondal-07/python-game-bot/blob/main/COC_Bot_python/coc.py): `COC_Bot_python/coc.py`

### Visual Feedback

- [Detection Overlay](https://github.com/tanmoy-mondal-07/python-game-bot/blob/main/COC_Bot_python/draw.py): `COC_Bot_python/draw.py`
- [Human-like Clicks](https://github.com/tanmoy-mondal-07/python-game-bot/blob/main/COC_Bot_python/human_like.py): `COC_Bot_python/human_like.py`

### Recognition Inputs

- [Troop Templates](https://github.com/tanmoy-mondal-07/python-game-bot/tree/main/COC_Bot_python/donate_file): `COC_Bot_python/donate_file`

### Other components

- **Game Session**

## Connections

- Game Session → Screen Capture: provides screen (evidence: `README.md`)
- Donation Loop → Template Matching: searches requests (evidence: `COC_Bot_python/coc.py`)
- Template Matching → Screen Capture: captures region (evidence: `COC_Bot_python/coc.py`)
- Template Matching → Troop Templates: matches templates (evidence: `README.md`)
- Template Matching → Detection Overlay: draws scan zone (evidence: `COC_Bot_python/coc.py`)
- Donation Loop → Human-like Clicks: clicks matches (evidence: `COC_Bot_python/coc.py`)
- Human-like Clicks → Game Session: donates troops (evidence: `README.md`)
