# joshua-fonseca/ro-test architecture

> Architecture diagram of the GitHub repository joshua-fonseca/ro-test, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/joshua-fonseca/ro-test
- Repository: https://github.com/joshua-fonseca/ro-test

## Overview

ro-test is a Windows screen-reading scanner for S.Arena market listings, with optional automated purchasing. The main workflow loads configured targets, navigates to each skin’s results, captures and interprets listing cards, checks price/serial criteria, and records matches. With `--snipe`, the run follows a separate seller-visit and purchase flow; optional Discord updates report progress. The graph follows documented capabilities and source-index references; unsampled implementations are represented only where the README or index supports them.

Main entry points: [`main.py`](https://github.com/joshua-fonseca/ro-test/blob/main/main.py) (Run scanner), [`scan_once.py`](https://github.com/joshua-fonseca/ro-test/blob/main/scan_once.py) (Scan results), [`scanner/windows/snipe.py`](https://github.com/joshua-fonseca/ro-test/blob/main/scanner/windows/snipe.py) (Seller purchase flow), [`scanner/windows/navigate.py`](https://github.com/joshua-fonseca/ro-test/blob/main/scanner/windows/navigate.py) (Market navigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_run["Run orchestration"]
  node_main["Run scanner<br/>[main.py]"]
  node_single_scan["Scan results<br/>[scan_once.py]"]
  node_config["Run settings<br/>[config.py]"]
end

subgraph group_vision["Screen reading"]
  node_screen_finding["Screen detection<br/>[screens.py]"]
  node_layout["Screen layout<br/>[layout.py]"]
  node_card_reading["Listing OCR<br/>[vision.py]"]
end

subgraph group_domain["Matching and records"]
  node_targets["Target models<br/>[models.py]"]
  node_parsing["Value parsing<br/>[parsing.py]"]
  node_matching["Target matching<br/>[matcher.py]"]
  node_cropper["Image crops<br/>[cropper.py]"]
  node_storage[("Scan history<br/>[storage.py]")]
end

subgraph group_actions["Game actions and updates"]
  node_navigation["Market navigation<br/>[navigate.py]"]
  node_window["Window capture<br/>[screen.py]"]
  node_input["Mouse and keys<br/>[controller.py]"]
  node_sniping["Seller purchase flow<br/>[snipe.py]"]
  node_updates["Run notifications<br/>[discord.py]"]
end

node_user(("Operator"))
node_game["Roblox game"]
node_discord_service["Discord"]

node_user -->|"starts run"| node_main
node_main -->|"loads settings"| node_config
node_main -->|"loads targets"| node_targets
node_main -->|"runs scans"| node_single_scan
node_main -->|"navigates market"| node_navigation
node_main -->|"finds window"| node_window
node_main -->|"sets up history"| node_storage
node_main -->|"starts updates"| node_updates
node_single_scan -->|"reads screens"| node_screen_finding
node_single_scan -->|"reads listings"| node_card_reading
node_single_scan -->|"checks targets"| node_matching
node_single_scan -->|"records results"| node_storage
node_single_scan -->|"saves crops"| node_cropper
node_single_scan -->|"starts snipe"| node_sniping
node_single_scan -->|"reports matches"| node_updates
node_navigation -->|"captures window"| node_window
node_navigation -->|"checks screen"| node_screen_finding
node_navigation -->|"sends input"| node_input
node_screen_finding -->|"uses layout"| node_layout
node_screen_finding -->|"uses OCR"| node_card_reading
node_card_reading -->|"parses values"| node_parsing
node_card_reading -->|"uses listing types"| node_targets
node_matching -->|"checks target data"| node_targets
node_matching -->|"uses parsed values"| node_parsing
node_storage -->|"stores listing data"| node_targets
node_storage -->|"formats serials"| node_parsing
node_sniping -->|"sends game input"| node_input
node_sniping -->|"returns to search"| node_navigation
node_sniping -->|"checks game state"| node_screen_finding
node_window -.->|"captures screen"| node_game
node_input -->|"controls game"| node_game
node_sniping -->|"teleports and buys"| node_game
node_updates -->|"posts updates"| node_discord_service
node_main -.->|"enables optional flow"| node_sniping

click node_main "https://github.com/joshua-fonseca/ro-test/blob/main/main.py"
click node_single_scan "https://github.com/joshua-fonseca/ro-test/blob/main/scan_once.py"
click node_config "https://github.com/joshua-fonseca/ro-test/blob/main/scanner/logic/config.py"
click node_targets "https://github.com/joshua-fonseca/ro-test/blob/main/scanner/logic/models.py"
click node_navigation "https://github.com/joshua-fonseca/ro-test/blob/main/scanner/windows/navigate.py"
click node_window "https://github.com/joshua-fonseca/ro-test/blob/main/scanner/windows/screen.py"
click node_input "https://github.com/joshua-fonseca/ro-test/blob/main/scanner/windows/controller.py"
click node_screen_finding "https://github.com/joshua-fonseca/ro-test/blob/main/scanner/reading/screens.py"
click node_layout "https://github.com/joshua-fonseca/ro-test/blob/main/scanner/reading/layout.py"
click node_card_reading "https://github.com/joshua-fonseca/ro-test/blob/main/scanner/reading/vision.py"
click node_parsing "https://github.com/joshua-fonseca/ro-test/blob/main/scanner/logic/parsing.py"
click node_matching "https://github.com/joshua-fonseca/ro-test/blob/main/scanner/logic/matcher.py"
click node_cropper "https://github.com/joshua-fonseca/ro-test/blob/main/scanner/logic/cropper.py"
click node_storage "https://github.com/joshua-fonseca/ro-test/blob/main/scanner/logic/storage.py"
click node_sniping "https://github.com/joshua-fonseca/ro-test/blob/main/scanner/windows/snipe.py"
click node_updates "https://github.com/joshua-fonseca/ro-test/blob/main/scanner/logic/discord.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_main,node_single_scan,node_config toneBlue
class node_screen_finding,node_layout,node_card_reading toneAmber
class node_targets,node_parsing,node_matching,node_cropper,node_storage toneMint
class node_navigation,node_window,node_input,node_sniping,node_updates toneRose
class node_user,node_game,node_discord_service toneIndigo
```

## Components

### Run orchestration

- [Run scanner](https://github.com/joshua-fonseca/ro-test/blob/main/main.py): `main.py`
- [Scan results](https://github.com/joshua-fonseca/ro-test/blob/main/scan_once.py): `scan_once.py`
- [Run settings](https://github.com/joshua-fonseca/ro-test/blob/main/scanner/logic/config.py): `scanner/logic/config.py`

### Screen reading

- [Screen detection](https://github.com/joshua-fonseca/ro-test/blob/main/scanner/reading/screens.py): `scanner/reading/screens.py`
- [Screen layout](https://github.com/joshua-fonseca/ro-test/blob/main/scanner/reading/layout.py): `scanner/reading/layout.py`
- [Listing OCR](https://github.com/joshua-fonseca/ro-test/blob/main/scanner/reading/vision.py): `scanner/reading/vision.py`

### Matching and records

- [Target models](https://github.com/joshua-fonseca/ro-test/blob/main/scanner/logic/models.py): `scanner/logic/models.py`
- [Value parsing](https://github.com/joshua-fonseca/ro-test/blob/main/scanner/logic/parsing.py): `scanner/logic/parsing.py`
- [Target matching](https://github.com/joshua-fonseca/ro-test/blob/main/scanner/logic/matcher.py): `scanner/logic/matcher.py`
- [Image crops](https://github.com/joshua-fonseca/ro-test/blob/main/scanner/logic/cropper.py): `scanner/logic/cropper.py`
- [Scan history](https://github.com/joshua-fonseca/ro-test/blob/main/scanner/logic/storage.py): `scanner/logic/storage.py`

### Game actions and updates

- [Market navigation](https://github.com/joshua-fonseca/ro-test/blob/main/scanner/windows/navigate.py): `scanner/windows/navigate.py`
- [Window capture](https://github.com/joshua-fonseca/ro-test/blob/main/scanner/windows/screen.py): `scanner/windows/screen.py`
- [Mouse and keys](https://github.com/joshua-fonseca/ro-test/blob/main/scanner/windows/controller.py): `scanner/windows/controller.py`
- [Seller purchase flow](https://github.com/joshua-fonseca/ro-test/blob/main/scanner/windows/snipe.py): `scanner/windows/snipe.py`
- [Run notifications](https://github.com/joshua-fonseca/ro-test/blob/main/scanner/logic/discord.py): `scanner/logic/discord.py`

### Other components

- **Operator**
- **Roblox game**
- **Discord**

## Connections

- Operator → Run scanner: starts run (evidence: `README.md`)
- Run scanner → Run settings: loads settings (evidence: `main.py`)
- Run scanner → Target models: loads targets (evidence: `main.py`)
- Run scanner → Scan results: runs scans (evidence: `main.py`)
- Run scanner → Market navigation: navigates market (evidence: `main.py`)
- Run scanner → Window capture: finds window (evidence: `main.py`)
- Run scanner → Scan history: sets up history (evidence: `main.py`)
- Run scanner → Run notifications: starts updates (evidence: `main.py`)
- Scan results → Screen detection: reads screens (evidence: `scan_once.py`)
- Scan results → Listing OCR: reads listings (evidence: `scan_once.py`)
- Scan results → Target matching: checks targets (evidence: `scan_once.py`)
- Scan results → Scan history: records results (evidence: `scan_once.py`)
- Scan results → Image crops: saves crops (evidence: `scan_once.py`)
- Scan results → Seller purchase flow: starts snipe (evidence: `scan_once.py`)
- Scan results → Run notifications: reports matches (evidence: `scan_once.py`)
- Market navigation → Window capture: captures window (evidence: `scanner/windows/navigate.py`)
- Market navigation → Screen detection: checks screen (evidence: `scanner/windows/navigate.py`)
- Market navigation → Mouse and keys: sends input (evidence: `scanner/windows/navigate.py`)
- Screen detection → Screen layout: uses layout (evidence: `scanner/reading/screens.py`)
- Screen detection → Listing OCR: uses OCR (evidence: `scanner/reading/screens.py`)
- Listing OCR → Value parsing: parses values (evidence: `scanner/reading/vision.py`)
- Listing OCR → Target models: uses listing types (evidence: `scanner/reading/vision.py`)
- Target matching → Target models: checks target data (evidence: `scanner/logic/matcher.py`)
- Target matching → Value parsing: uses parsed values (evidence: `scanner/logic/matcher.py`)
- Scan history → Target models: stores listing data (evidence: `scanner/logic/storage.py`)
- Scan history → Value parsing: formats serials (evidence: `scanner/logic/storage.py`)
- Seller purchase flow → Mouse and keys: sends game input (evidence: `scanner/windows/snipe.py`)
- Seller purchase flow → Market navigation: returns to search (evidence: `scanner/windows/snipe.py`)
- Seller purchase flow → Screen detection: checks game state (evidence: `scanner/windows/snipe.py`)
- Window capture → Roblox game: captures screen (evidence: `README.md`)
- Mouse and keys → Roblox game: controls game (evidence: `scanner/windows/controller.py`)
- Seller purchase flow → Roblox game: teleports and buys (evidence: `README.md`)
- Run notifications → Discord: posts updates (evidence: `scanner/logic/discord.py`)
- Run scanner → Seller purchase flow: enables optional flow (evidence: `README.md`)
