LeagueBot is a complete leveling automation for league of legends, it auto-loads RiotClient, login, uses League LCU to start games and uses a CNN model to play until the games ends - repeat it until level 30.
  • C 48.9%
  • C++ 41.9%
  • Python 9%
  • Batchfile 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-23 11:32:44 -03:00
ai First commit 2026-10-23 11:32:44 -03:00
gen First commit 2026-10-23 11:32:44 -03:00
recorder First commit 2026-10-23 11:32:44 -03:00
test First commit 2026-10-23 11:32:44 -03:00
third_party/onnxruntime First commit 2026-10-23 11:32:44 -03:00
train First commit 2026-10-23 11:32:44 -03:00
.gitignore First commit 2026-10-23 11:32:44 -03:00
ai.sln First commit 2026-10-23 11:32:44 -03:00
FORGEJO_DESCRIPTION.txt First commit 2026-10-23 11:32:44 -03:00
README.md First commit 2026-10-23 11:32:44 -03:00

LeagueBot

An automated League of Legends bot. A C++ Windows client plays matches end-to-end using an ONNX vision model and a kernel-level virtual HID driver for input; Python tooling records gameplay and trains the models.

Status: personal / research project. Running game-automation software against Riot's client violates the League of Legends Terms of Service and will get accounts banned. Use at your own risk, on accounts you are willing to lose.


Repository layout

ai/              C++ bot (Visual Studio, x64)
  bot/           capture → ONNX inference → play loop
  client/        League client launcher + screen-coord helpers
  cloud/         GitHub-backed account rotation & config fetch
  hid/           Driver install + user-mode HID I/O
  lcu/           League Client Update API glue
  resource/      Embedded assets (ONNX models, vhidev driver, onnxruntime.dll)
gen/             Small codegen helper
recorder/        Python screen+input recorder for building datasets
train/           PyTorch training + ONNX export
test/            Standalone HID / mouse smoke test
third_party/     Vendored onnxruntime SDK (headers + libs)

Components

ai/ — bot runtime (C++)

Single UAC-elevated Windows executable. On launch it:

  1. Checks whether the vhidev virtual-HID driver is installed; if not, extracts the embedded driver package from its own RCDATA and installs it (persists across reboots).
  2. Opens the HID interface and takes over mouse/keyboard output.
  3. Pulls account credentials and runtime config from a private GitHub repo via a fine-grained PAT (XOR-obfuscated at build time; see ai/cloud/token_secret.h.example).
  4. Launches the League client, logs in, queues, and hands off to the play loop (ai/bot/play.cpp), which runs the ONNX model embedded as ai/resource/{blue,red}.onnx.

recorder/ — dataset capture (Python)

recorder.py captures screen frames with mss plus mouse/keyboard events with pynput, writing side-by-side recordings into recorder/recordings/{blue,red}/.

train/ — model training (Python / PyTorch)

Trains the per-side vision + action model and exports to ONNX for the C++ runtime to consume. Entry points: train.py (training), export.py (PyTorch → ONNX), play_test.py (sanity-check an exported model).

Build

C++ bot

Requirements:

  • Visual Studio 2022 (v143 toolset), Windows 10/11 SDK
  • Target platform: x64, configurations: Debug / Release

Steps:

  1. cp ai/cloud/token_secret.h.example ai/cloud/token_secret.h and paste a GitHub Fine-grained PAT with read access to your private config repo.
  2. Open ai.sln and build ai | x64 | Release.
  3. Run the produced ai.exe as administrator (the manifest already requests elevation).

Python tooling

cd recorder && pip install -r requirements.txt
cd ../train && pip install -r requirements.txt

Python ≥ 3.10 recommended. For GPU training, install a CUDA-matching torch build before running pip install -r train/requirements.txt.

Notes on secrets

  • ai/cloud/token_secret.h is gitignored and must never be committed.
  • The PAT is XOR-scrambled into the exe to resist strings scraping — this is deterrence, not security. Rotate the PAT if the binary leaks.

License

No license granted. All rights reserved. Code is published for reference.