# adpist/horde architecture

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

- Interactive diagram: https://gitdiagram.com/adpist/horde
- Repository: https://github.com/adpist/horde

## Overview

##### Project type and purpose
- This is a game‐botting system for Diablo II, comprising three tightly integrated components:
– D2BS (native core) that hooks into the Diablo II process and hosts a JavaScript engine
– D2Bot# (C# manager) used to launch, monitor and orchestrate multiple bot instances
– kolbot (JavaScript library) providing battle scripts, configurations, item pickers and helper tools
- There is also a lightweight web component (LimeDrop) for item management.

##### File structure
- Top level:
– D2Bot.exe (manager UI)
– d2bs/ (core engine plus script folder “kolbot”)
– data/, logs/, images/ (configuration, logs, assets)
- d2bs/kolbot/:
– default.dbj and D2Bot*.dbj scripts (entry‐point bot scripts)
– libs/ (core script libraries and bot routines)
– pickit/ (item filtering rules in .nip files)
– sdk/ (static game metadata)
– tools/ (JS helper modules)
- data/: JSON files for account, server, profile, patch, schedules
- logs/: runtime logs for console, exceptions, keyinfo

##### README for additional insights
- Confirms three components (core, manager, scripts)
- Mentions LimeDrop web item manager included by default
- Points to external documentation for manager setup, scripting conventions and LimeDrop usage

– Game Client Process (Diablo II)
– D2BS Core Engine (native DLL)
– JavaScript Host / Script Engine (inside D2BS)
– Script Library (kolbot folder: libs, config, pickit, sdk, tools)
– D2Bot# Manager (C# GUI, process launcher)
– Data Storage (data/*.json, d2bs/d2bs.ini)
– Logs (logs/ and d2bs/kolbot/logs/)
– LimeDrop Web UI / Server (optional web frontend)
– Manager ➔ launches ➔ Core Engine instance
– Core Engine ➔ injects into ➔ Game Client
– Core Engine ➔ hosts ➔ Script Engine ➔ loads ➔ JS Script Library
– JS Scripts ➔ read/write ➔ Data Storage and Logs
– LimeDrop Web UI ↔ API Connector ↔ Core Engine or Data Storage
c. Architectural patterns and principles
– Plugin/script‐based architecture: JS scripts are modular and loaded at runtime
– Separation of concerns: native engine vs. script logic vs. orchestration UI
– Configuration‐driven behavior: JSON/INI inputs and pickit rules drive bot actions
d. Key technologies, frameworks, libraries
– Native C++ DLL injection (D2BS)
– Microsoft .NET/C# for Manager (D2Bot#)
– Mozilla‐spidermonkey or similar JS engine hosted by D2BS
– JSON/INI for configuration, custom .nip file format for item rules
– Optional web tech stack for LimeDrop (Node.js or static HTML/JS)

##### Detail
- Major script folders (libs, config, pickit, sdk, tools) as sub‐components
- How D2BotAccountCleaner.dbj, D2BotHorde.dbj, etc., plug into the engine
- Configuration templates vs. user overrides
- How LimeDrop interacts (direct file read or via a small HTTP API)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Manager Layer
    subgraph "Manager Layer"
        Manager["D2Bot# Manager (C# GUI & Orchestrator)"]:::managed
    end
    click Manager "https://github.com/adpist/horde/blob/master/D2Bot.exe"

    %% Core Engine Layer
    subgraph "Core Engine Layer"
        Core["D2BS Core Engine (Native DLL + Config)"]:::native
        INI["d2bs/d2bs.ini"]:::config
        API["d2bs/api.html"]:::docs
        LICENSE["d2bs/LICENSE.txt"]:::docs
        HISTORY["d2bs/HISTORY.txt"]:::docs
    end
    click Core "https://github.com/adpist/horde/tree/master/d2bs/"
    click INI "https://github.com/adpist/horde/blob/master/d2bs/d2bs.ini"
    click API "https://github.com/adpist/horde/blob/master/d2bs/api.html"
    click LICENSE "https://github.com/adpist/horde/blob/master/d2bs/LICENSE.txt"
    click HISTORY "https://github.com/adpist/horde/blob/master/d2bs/HISTORY.txt"

    %% Game Client
    GameClient["Game Client Process (Diablo II)"]:::external

    %% Script Engine
    subgraph "Script Engine"
        JSHost["JavaScript Host / Script Engine"]:::native
    end
    click JSHost "https://github.com/adpist/horde/tree/master/d2bs/kolbot/"

    %% Entry-point Scripts
    subgraph "Entry-point Scripts"
        EPDefault["default.dbj"]:::script
        EPCleaner["D2BotAccountCleaner.dbj"]:::script
        EPTemplates["D2Bot*.dbj"]:::script
    end
    click EPDefault "https://github.com/adpist/horde/blob/master/d2bs/kolbot/default.dbj"
    click EPCleaner "https://github.com/adpist/horde/blob/master/d2bs/kolbot/D2BotAccountCleaner.dbj"

    %% Script Library (kolbot/libs)
    subgraph "Script Library (kolbot/libs)"
        AutoMule["AutoMule.js"]:::script
        GameAction["GameAction.js"]:::script
        Bots["bots/"]:::dir
        Common["common/"]:::dir
        ConfigLib["config/"]:::dir
        HordeLib["horde/"]:::dir
    end
    click AutoMule "https://github.com/adpist/horde/blob/master/d2bs/kolbot/libs/AutoMule.js"
    click GameAction "https://github.com/adpist/horde/blob/master/d2bs/kolbot/libs/GameAction.js"
    click Bots "https://github.com/adpist/horde/tree/master/d2bs/kolbot/libs/bots/"
    click Common "https://github.com/adpist/horde/tree/master/d2bs/kolbot/libs/common/"
    click ConfigLib "https://github.com/adpist/horde/tree/master/d2bs/kolbot/libs/config/"
    click HordeLib "https://github.com/adpist/horde/tree/master/d2bs/kolbot/libs/horde/"

    %% Pickit Rules
    subgraph "Pickit Rules (d2bs/kolbot/pickit)"
        Pickit["pickit/"]:::dir
        Dispatcher["dispatcher/"]:::dir
        HordePickit["horde/"]:::dir
    end
    click Pickit "https://github.com/adpist/horde/tree/master/d2bs/kolbot/pickit/"
    click Dispatcher "https://github.com/adpist/horde/tree/master/d2bs/kolbot/pickit/dispatcher/"
    click HordePickit "https://github.com/adpist/horde/tree/master/d2bs/kolbot/pickit/horde/"

    %% SDK
    subgraph "Game Metadata SDK"
        SDK["sdk/"]:::dir
    end
    click SDK "https://github.com/adpist/horde/tree/master/d2bs/kolbot/sdk/"

    %% Helper Tools
    subgraph "JS Helper Tools"
        Tools["tools/"]:::dir
    end
    click Tools "https://github.com/adpist/horde/tree/master/d2bs/kolbot/tools/"

    %% Data Storage
    subgraph "Data Storage"
        DataJSON["data/"]:::data
    end
    click DataJSON "https://github.com/adpist/horde/tree/master/data/"

    %% Logs
    subgraph "Logs"
        LogsMgr["logs/"]:::logs
        LogsCore["d2bs/logs/"]:::logs
        LogsScript["d2bs/kolbot/logs/"]:::logs
    end
    click LogsMgr "https://github.com/adpist/horde/tree/master/logs/"
    click LogsCore "https://github.com/adpist/horde/tree/master/d2bs/logs/"
    click LogsScript "https://github.com/adpist/horde/tree/master/d2bs/kolbot/logs/"

    %% LimeDrop Web UI
    subgraph "LimeDrop Web UI"
        LimeDrop["LimeDrop Web UI"]:::web
        LimeConfig["limedrop/config for kolbot"]:::config
    end
    click LimeDrop "https://github.com/adpist/horde/tree/master/limedrop/"
    click LimeConfig "https://github.com/adpist/horde/blob/master/d2bs/kolbot/data/web/limedrop.json"

    %% Relationships
    Manager -->|launches| Core
    Core -->|injects into| GameClient
    Core -->|hosts| JSHost
    JSHost -->|loads| EPDefault
    JSHost -->|loads| EPCleaner
    JSHost -->|loads| EPTemplates
    JSHost -->|loads libs| AutoMule
    JSHost -->|loads libs| GameAction
    JSHost -->|loads libs| Bots
    JSHost -->|loads libs| Common
    JSHost -->|loads libs| ConfigLib
    JSHost -->|loads libs| HordeLib
    JSHost -->|loads pickit| Pickit
    JSHost -->|loads SDK| SDK
    JSHost -->|loads tools| Tools
    EPDefault -->|read/write| DataJSON
    EPCleaner -->|read/write| DataJSON
    EPTemplates -->|read/write| DataJSON
    AutoMule -->|read/write| DataJSON
    GameAction -->|read/write| DataJSON
    Pickit -->|read| DataJSON
    SDK -->|read| DataJSON
    Tools -->|read/write| DataJSON
    EPDefault -->|log to| LogsScript
    EPDefault -->|log to| LogsCore
    Manager -->|log to| LogsMgr
    LimeDrop -->|API ↔| Core
    LimeDrop -->|direct file| DataJSON

    %% Styles
    classDef native fill:#d3d3d3,stroke:#555,stroke-width:1px
    classDef managed fill:#add8e6,stroke:#333,stroke-width:1px
    classDef script fill:#7cfc00,stroke:#333,stroke-width:1px
    classDef data fill:#98fb98,stroke:#333,stroke-width:1px
    classDef logs fill:#ffa500,stroke:#333,stroke-width:1px
    classDef web fill:#ffdead,stroke:#333,stroke-width:1px
    classDef config fill:#90ee90,stroke:#333,stroke-width:1px
    classDef docs fill:#f0e68c,stroke:#333,stroke-width:1px
    classDef external fill:#ffe4e1,stroke:#333,stroke-width:1px
    classDef dir fill:#e6e6fa,stroke:#333,stroke-width:1px
```
