# kelltom/os-bot-color architecture

> Architecture diagram of the GitHub repository kelltom/os-bot-color, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kelltom/os-bot-color
- Repository: https://github.com/kelltom/os-bot-color

## Overview

##### Main System Components

a) User Interface Layer (Top)
- Home View
- Bot View
- Settings View
- Info Frame
- Output Log Frame
- Title View
- Use blue coloring to distinguish UI components

b) Controller Layer (Middle)
- Bot Controller
- Options Builder
- Use green coloring for controller components

c) Model Layer (Bottom)
- OSRS Bot
- Near Reality Bot
- Zaros Bot
- Use orange coloring for model components

d) Utilities Layer (Side)
- Image Search
- OCR
- Mouse Control
- Window Management
- Game Launcher
- Use purple coloring for utility components

##### Component Relationships
- UI Layer → Controller Layer (User input flow)
- Controller Layer → Model Layer (Bot control flow)
- Model Layer ↔ Utilities Layer (Bot operations)
- Controller Layer ↔ Utilities Layer (System operations)

##### External Integrations
- RuneLite Client
- Game Window
- File System (for images/settings)

##### Key Features Highlight
- Image Recognition System
- Mouse Movement Generator
- OCR System

##### Specific Implementation Details
Small annotations for:
- Bezier curve implementation for mouse movement
- Custom OCR implementation
- Image template matching with transparency support

##### Configuration Components
Configuration management:
- Settings files
- Bot options
- RuneLite settings

- Clear separation of concerns between layers
- Modular design allowing for multiple bot implementations
- Centralized utility services
- Non-invasive nature of the automation (external observation only)

This will provide a clear understanding of how the system operates without direct game client modification, emphasizing its use of external observation and control mechanisms.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef ui fill:#a8d1f0,stroke:#333
    classDef controller fill:#90EE90,stroke:#333
    classDef model fill:#FFB347,stroke:#333
    classDef utility fill:#DDA0DD,stroke:#333
    classDef external fill:#f5f5f5,stroke:#333,stroke-dasharray: 5 5
    classDef config fill:#FFE4B5,stroke:#333

    %% UI Layer
    subgraph ViewLayer["View Layer"]
        HomeView["Home View"]
        BotView["Bot View"]
        SettingsView["Settings View"]
        InfoFrame["Info Frame"]
        OutputLog["Output Log Frame"]
        TitleView["Title View"]
    end

    %% Controller Layer
    subgraph ControllerLayer["Controller Layer"]
        BotController["Bot Controller"]
        OptionsBuilder["Options Builder"]
    end

    %% Model Layer
    subgraph ModelLayer["Model Layer"]
        OSRSBot["OSRS Bot"]
        NRBot["Near Reality Bot"]
        ZarosBot["Zaros Bot"]
    end

    %% Utilities Layer
    subgraph UtilitiesLayer["Utilities Layer"]
        ImageSearch["Image Search"]
        OCR["OCR"]
        MouseControl["Mouse Control"]
        WindowMgmt["Window Management"]
        ColorDetection["Color Detection"]
        GameLauncher["Game Launcher"]
    end

    %% External Components
    RuneLiteClient["RuneLite Client"]:::external
    GameWindow["Game Window"]:::external
    FileSystem["File System"]:::external
    RuneLiteSettings["RuneLite Settings"]:::config

    %% Relationships
    ViewLayer --> ControllerLayer
    ControllerLayer --> ModelLayer
    ModelLayer <--> UtilitiesLayer
    ControllerLayer <--> UtilitiesLayer
    UtilitiesLayer <-.-> GameWindow
    GameWindow <-.-> RuneLiteClient
    UtilitiesLayer <-.-> FileSystem
    RuneLiteClient <-.-> RuneLiteSettings

    %% Click Events
    click HomeView "https://github.com/kelltom/OS-Bot-COLOR/blob/main/src/view/home_view.py"
    click BotView "https://github.com/kelltom/OS-Bot-COLOR/blob/main/src/view/bot_view.py"
    click SettingsView "https://github.com/kelltom/OS-Bot-COLOR/blob/main/src/view/settings_view.py"
    click InfoFrame "https://github.com/kelltom/OS-Bot-COLOR/blob/main/src/view/info_frame.py"
    click OutputLog "https://github.com/kelltom/OS-Bot-COLOR/blob/main/src/view/output_log_frame.py"
    click TitleView "https://github.com/kelltom/OS-Bot-COLOR/blob/main/src/view/title_view.py"
    click BotController "https://github.com/kelltom/OS-Bot-COLOR/blob/main/src/controller/bot_controller.py"
    click OptionsBuilder "https://github.com/kelltom/OS-Bot-COLOR/blob/main/src/utilities/options_builder.py"
    click OSRSBot "https://github.com/kelltom/OS-Bot-COLOR/blob/main/src/model/osrs/osrs_bot.py"
    click NRBot "https://github.com/kelltom/OS-Bot-COLOR/blob/main/src/model/near_reality/nr_bot.py"
    click ZarosBot "https://github.com/kelltom/OS-Bot-COLOR/blob/main/src/model/zaros/zaros_bot.py"
    click ImageSearch "https://github.com/kelltom/OS-Bot-COLOR/blob/main/src/utilities/imagesearch.py"
    click OCR "https://github.com/kelltom/OS-Bot-COLOR/blob/main/src/utilities/ocr.py"
    click MouseControl "https://github.com/kelltom/OS-Bot-COLOR/blob/main/src/utilities/mouse.py"
    click WindowMgmt "https://github.com/kelltom/OS-Bot-COLOR/blob/main/src/utilities/window.py"
    click ColorDetection "https://github.com/kelltom/OS-Bot-COLOR/blob/main/src/utilities/color.py"
    click GameLauncher "https://github.com/kelltom/OS-Bot-COLOR/blob/main/src/utilities/game_launcher.py"
    click RuneLiteSettings "https://github.com/kelltom/OS-Bot-COLOR/blob/main/src/runelite_settings/osrs_settings.properties"

    %% Style Applications
    class HomeView,BotView,SettingsView,InfoFrame,OutputLog,TitleView ui
    class BotController,OptionsBuilder controller
    class OSRSBot,NRBot,ZarosBot model
    class ImageSearch,OCR,MouseControl,WindowMgmt,ColorDetection,GameLauncher utility

    %% Legend
    subgraph Legend
        UI["UI Component"]:::ui
        Controller["Controller Component"]:::controller
        Model["Model Component"]:::model
        Utility["Utility Component"]:::utility
        External["External System"]:::external
        Config["Configuration"]:::config
    end
```
