# blizzhackers/kolbot architecture

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

- Interactive diagram: https://gitdiagram.com/blizzhackers/kolbot
- Repository: https://github.com/blizzhackers/kolbot

## Overview

##### Project type and purpose
- This is an open-source Diablo II botting system (“d2bs”) with three distinct components:
- D2BS (core, written in C++) – hooks the game process and exposes a scripting API
- D2Bot# (manager, written in C#) – a Windows GUI/CLI that launches and monitors bot instances
- kolbot (script library, written in JavaScript/Node) – a set of JS modules, systems, and user scripts that drive the bot’s behavior
- There is also a “limedrop” web component (Node/TypeScript) for item management and remote monitoring.

##### File structure
- Top-level:
- D2Bot.exe (C# manager binary)
- d2bs/ (native core + embedded JS engine, config, SDK, logs)
- limedrop/ (web UI code, probably a small Node/TS app)
- package.json, tsconfig.json, .eslintrc.js, etc. (tooling for JS/TS code)
- d2bs/kolbot/:
- libs/ (core modules, config templates, manual-play overrides, extension points)
- modules/ (higher-level plumbing: HTTP, Socket, Worker, Team, etc.)
- systems/ (prebuilt “systems” like automule, autorush, crafting, mulelogger, etc.)
- scripts/ (dozens of user-facing automation scripts, e.g. “Act bosses,” “MFHelper,” “ShopBot”)
- pickit/ (NIP files for item pick-up rules)
- sdk/ (statically shipped data files and TypeScript definitions for the JS API)
- threads/ (JS code run in parallel threads within the bot runtime)
- data/ and logs/ store JSON settings, schedules, key info, and runtime logs.

##### README for additional insights
- Confirms three main components, community-supported, meant for offline or private servers
- Mentions dependencies: MSVC++ 2010, .NET 4.x for the manager, Node.js/TS for kolbot tooling and limedrop
- Points to live documentation, guides on setup, multi-botting, manual play, character config

##### Elements
- Blue = Native layer (C++, Game Process)
- Green = Manager & tooling (.NET, Node)
- Orange = Scripting layer (JS modules, systems, scripts)
- Gray = Data/config/log files

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Native Layer
    subgraph "Native Layer"
        direction TB
        A["Game Process (Diablo II.exe)"]:::native
        B["D2BS Core (C++, hooks)"]:::native
    end

    %% Scripting Layer
    subgraph "kolbot Script Library & JS Engine"
        direction TB
        C["JS Engine & kolbot Script Library"]:::script
        subgraph "kolbot Script Library"
            direction TB
            libs["Core Libraries"]:::script
            modules["Higher-level Modules"]:::script
            systems["Prebuilt Systems"]:::script
            scripts["User Automation Scripts"]:::script
            pickit["Item Pickup Rules"]:::script
            sdk["SDK Definitions & Data"]:::script
            threads["Parallel Threads Code"]:::script
        end
    end

    %% Manager & Tooling
    subgraph "Manager & Tooling"
        direction TB
        D["D2Bot# Manager (C# GUI/CLI)"]:::manager
        E["limedrop Web UI (Node/TS)"]:::manager
        F["Tooling & Build Config"]:::manager
    end

    %% Data / Config / Logs
    data1(("Global JSON Settings")):::data
    data2(("Core INI Config")):::data
    data3(("kolbot Data Folders")):::data
    data4(("Bot Runtime Logs")):::data
    data5(("Manager & Tool Logs")):::data

    %% Connections
    B -->|inject/attach| A
    A -->|hook callbacks| B

    B -->|loads scripts| C
    C -->|uses| libs
    C -->|uses| modules
    C -->|uses| systems
    C -->|runs| scripts
    C -->|reads rules| pickit
    C -->|reads SDK| sdk
    C -->|spawns threads| threads

    D -->|launch/attach| B
    D -->|poll status| B
    E -->|HTTP API / read files| B

    C -->|read config| data1
    C -->|read config| data2
    C -->|read config| data3
    C -->|log events| data4

    D -->|log events| data5
    E -->|read/write config| data1
    E -->|read/write data| data3
    E -->|view logs| data4

    %% Click Events
    click B "https://github.com/blizzhackers/kolbot/tree/restructure/d2bs/"
    click D "https://github.com/blizzhackers/kolbot/blob/restructure/D2Bot.exe"
    click libs "https://github.com/blizzhackers/kolbot/tree/restructure/d2bs/kolbot/libs/"
    click modules "https://github.com/blizzhackers/kolbot/tree/restructure/d2bs/kolbot/libs/modules/"
    click systems "https://github.com/blizzhackers/kolbot/tree/restructure/d2bs/kolbot/libs/systems/"
    click scripts "https://github.com/blizzhackers/kolbot/tree/restructure/d2bs/kolbot/libs/scripts/"
    click pickit "https://github.com/blizzhackers/kolbot/tree/restructure/d2bs/kolbot/pickit/"
    click sdk "https://github.com/blizzhackers/kolbot/tree/restructure/d2bs/kolbot/sdk/"
    click threads "https://github.com/blizzhackers/kolbot/tree/restructure/d2bs/kolbot/threads/"
    click E "https://github.com/blizzhackers/kolbot/tree/restructure/limedrop/"
    click data1 "https://github.com/blizzhackers/kolbot/tree/restructure/data/"
    click data2 "https://github.com/blizzhackers/kolbot/blob/restructure/d2bs/d2bs.ini"
    click data3 "https://github.com/blizzhackers/kolbot/tree/restructure/d2bs/kolbot/data/"
    click data4 "https://github.com/blizzhackers/kolbot/tree/restructure/d2bs/kolbot/logs/"
    click data5 "https://github.com/blizzhackers/kolbot/tree/restructure/logs/"
    click F "https://github.com/blizzhackers/kolbot/blob/restructure/package.json"

    %% Styles
    classDef native fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef manager fill:#d4edda,stroke:#333,stroke-width:1px
    classDef script fill:#ffe5b4,stroke:#333,stroke-width:1px
    classDef data fill:#e2e3e5,stroke:#666,stroke-width:1px,stroke-dasharray: 5 5
```
