# rroarings/dreambot_scripts architecture

> Architecture diagram of the GitHub repository rroarings/dreambot_scripts, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rroarings/dreambot_scripts
- Repository: https://github.com/rroarings/dreambot_scripts

## Overview

##### Main System Components

a) Core Components:
- DreamBot API Integration (External System)
- Script Management System
- User Interface Layer
- Action Management System
- Data Management Layer
- Paint/Visualization System

b) Individual Script Components:
- PF Dye Maker Script
- PF Cows Script (Legacy)

##### Architectural Pattern

**Root → Branches → Leaves**

##### Detailed Component Breakdown

A. Core Framework Layer (Top Level):
- DreamBot API integration point
- Utility Services (shared components)
- Paint Utilities
- Quantity Formatting
- Price Management

B. Script Implementation Layer (Middle):
For each script (PF Dye Maker as primary example):
- Action Management
- Branch Controllers
- Leaf Actions
- Configuration Management
- UI Components
- Paint Handlers

C. Action Hierarchy (Bottom):
Branching structure for actions:
- Navigation Actions
- Resource Collection Actions
- Processing Actions
- Banking Actions

##### Specific Implementation Details

For the PF Dye Maker script, include these workflows:
##### Ingredient Collection Flow
- Woad Leaves → Banking
- Redberries → Banking
- Onions → Banking

##### Dye Creation Flow
- Blue Dye Production
- Red Dye Production
- Yellow Dye Production

##### Component Relationships

Key interactions:
- Config → Action Management
- Paint Handler → Game State
- Navigation System → World Interaction
- Banking System → Inventory Management

##### Action Execution Layer

- System components (blue)
- Navigation elements (green)
- Resource handling (orange)
- Processing logic (purple)
- Banking operations (yellow)

- Action flow directions
- Component relationships
- State transitions
- Resource paths

Remember to maintain appropriate abstraction while showing the key relationships between components, especially focusing on the branch-leaf pattern that forms the core of the action system.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph External
        DreamBot[DreamBot API]
    end

    subgraph Core["Core Framework Layer"]
        SMS["Script Management System"]:::core
        UIF["User Interface Layer"]:::core
        AMS["Action Management System"]:::core
        DML["Data Management Layer"]:::core
        PVS["Paint/Visualization System"]:::core
        US["Utility Services"]:::core
    end

    subgraph Scripts["Script Implementation Layer"]
        DM["PF Dye Maker"]:::script
        COWS["PF Cows"]:::script
    end

    subgraph Actions["Action Hierarchy Layer"]
        direction TB
        subgraph Navigation
            NAV["Navigation Actions"]:::action
        end

        subgraph Resource
            RCA["Resource Collection Actions"]:::action
            subgraph Resources
                WL["Woad Leaves"]:::resource
                RB["Redberries"]:::resource
                ON["Onions"]:::resource
            end
        end

        subgraph Processing
            PA["Processing Actions"]:::action
            subgraph Dyes
                BD["Blue Dye Production"]:::process
                RD["Red Dye Production"]:::process
                YD["Yellow Dye Production"]:::process
            end
        end

        subgraph Banking
            BA["Banking Actions"]:::action
        end
    end

    %% Relationships
    DreamBot --> SMS
    SMS --> DM
    SMS --> COWS
    DM --> AMS
    COWS --> AMS
    AMS --> NAV
    AMS --> RCA
    AMS --> PA
    AMS --> BA
    
    RCA --> WL
    RCA --> RB
    RCA --> ON
    
    PA --> BD
    PA --> RD
    PA --> YD
    
    DML --> AMS
    UIF --> DML
    PVS --> DML
    US --> PVS

    %% Click Events
    click SMS "https://github.com/rroarings/dreambot_scripts/blob/master/src/pfdyemaker/src/PFDyeMaker.java"
    click COWS "https://github.com/rroarings/dreambot_scripts/blob/master/src/pfcows/src/PFCows.java"
    click UIF "https://github.com/rroarings/dreambot_scripts/blob/master/src/pfdyemaker/src/ui/Frame.java"
    click PVS "https://github.com/rroarings/dreambot_scripts/blob/master/src/pfdyemaker/src/paint/PaintHandler.java"
    click DML "https://github.com/rroarings/dreambot_scripts/blob/master/src/pfdyemaker/src/data/DyeMakerConfig.java"
    click AMS "https://github.com/rroarings/dreambot_scripts/blob/master/src/pfdyemaker/src/action/Root.java"
    click NAV "https://github.com/rroarings/dreambot_scripts/tree/master/src/pfdyemaker/src/action/navigation/"
    click BA "https://github.com/rroarings/dreambot_scripts/blob/master/src/pfdyemaker/src/action/bluedye/leaf/BankBlueDyeLeaf.java"
    click RCA "https://github.com/rroarings/dreambot_scripts/tree/master/src/pfdyemaker/src/action/onions/"
    click PA "https://github.com/rroarings/dreambot_scripts/tree/master/src/pfdyemaker/src/action/bluedye/"
    click US "https://github.com/rroarings/dreambot_scripts/blob/master/src/pfdyemaker/src/util/Utils.java"

    %% Styles
    classDef core fill:#a8d5ff,stroke:#333,stroke-width:2px
    classDef script fill:#95ff95,stroke:#333,stroke-width:2px
    classDef action fill:#ffe595,stroke:#333,stroke-width:2px
    classDef resource fill:#ffc295,stroke:#333,stroke-width:2px
    classDef process fill:#d5a8ff,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[Scripts]:::script
        L3[Actions]:::action
        L4[Resources]:::resource
        L5[Processes]:::process
    end
```
