Files
my-botty/docs/broken_runs_plan.md
T
alex 77f2092572 Refactor bot behavior on TP failure, enhance item processing logic, and improve game stats logging
- Updated bot behavior to end the game when no TP charges are left, instead of attempting to walk back to town.
- Refined item processing logic in `processing_helpers.py` to use identity checks for item comparisons and improved item removal methods.
- Enhanced game stats logging to include failure reasons and send Discord notifications for failed games.
- Improved health management logic to trigger chicken behavior based on health percentage after rapid rejuvination.
- Added error handling for item pickup failures in `pickit.py` to blacklist items that cannot be picked up.
- Introduced walking fallback nodes for Countess, Andariel, Mephisto, and Baal runs in `pather.py`.
- Implemented path data validation in run scripts for Countess, Andariel, Mephisto, and Baal to ensure paths are correctly defined.
- Enhanced item identification and stash processes in `diablo.py` with retry logic for failures.
- Updated town management to handle identification failures gracefully and log appropriate warnings.
- Improved character selection logic to provide clearer logging messages.
- Modified game restart logic to launch the game via PowerShell for better session handling.
- Added documentation for recording paths for the Countess run and created a PowerShell script for scheduled task management.
2026-06-05 14:58:50 +02:00

5.2 KiB

Broken Runs - Setup Guide

Current Status

All 4 boss runs (Countess, Andariel, Mephisto, Baal) have code structure in place but require path recording before they can run.

Run Code Guards Path Coords Templates Walking Fallback
Countess OK (0,0) check 0,0 placeholder Empty dir Nodes 1000-1004
Andariel OK (0,0) check 0,0 placeholder Empty dir Nodes 1010-1012
Mephisto OK (0,0) check 0,0 placeholder Empty dir Nodes 1020-1021
Baal OK (0,0) check 0,0 placeholder Empty dir Nodes 1030-1031

What's Done

  • Run classes: countess.py, andariel.py, mephisto.py, baal.py - all wired in bot.py
  • Kill methods: kill_countess(), kill_andariel(), kill_mephisto(), kill_baal(), kill_baal_waves() - implemented in Hammerdin/FoHdin/Warlock
  • Path guards: All 4 runs check for (0,0) paths and refuse to run with a clear error message
  • Walking fallback: pather.py has node definitions (1000-1031) and path routes for walking fallback
  • Template dirs: assets/templates/countess/, andariel/, mephisto/, baal/ created (empty)

What's Needed to Enable Each Run

Record path coordinates in config/game.ini using node_recorder.py:

cd C:\Users\alex\Downloads\my-botty
python src/utils/node_recorder.py

Then follow the on-screen instructions:

  • F8: Capture template ROI (top-left, then bottom-right) -> saves PNG
  • F9: Record node position at cursor -> generates path coordinates
  • F10: Update all nodes with visible templates

Option B: Walking (slower, needs templates + nodes)

Same as above, but also requires creating template PNGs for each landmark.


1. COUNTESS (Act 1 Forgotten Tower)

game.ini keys to record (5):

Key What to Record
a1_tower_level2_enter First click inside tower after entering from Black Marsh
a1_tower_level3_enter Top of stairs from L2 to L3
a1_tower_level4_enter Top of stairs from L3 to L4
a1_tower_level5_enter Top of stairs from L4 to L5
a1_countess_safe_dist Position near Countess at safe hammer range

Templates for walking fallback (in assets/templates/countess/):

Template File Template Key Purpose
countess_tower_l2.png COUNTESS_TOWER_L2 Tower L2 entrance
countess_tower_l3.png COUNTESS_TOWER_L3 Stairs L2->L3
countess_tower_l4.png COUNTESS_TOWER_L4 Stairs L3->L4
countess_tower_l5.png COUNTESS_TOWER_L5 Stairs L4->L5
countess_boss.png COUNTESS_BOSS Countess boss area

Nodes in pather.py: 1000-1004 (placeholder coords (0,0) - update after recording)


2. ANDARIEL (Act 1 Catacombs)

game.ini keys to record (3):

Key What to Record
a1_andy_level3_enter Catacombs L3 entrance (from L2)
a1_andy_level4_enter Catacombs L4 entrance (from L3)
a1_andy_safe_dist Position near Andariel's cage at safe hammer range

Templates for walking fallback (in assets/templates/andariel/):

Template File Template Key Purpose
andy_l3_stairs.png ANDY_L3_STAIRS Stairs from L2 to L3
andy_l4_stairs.png ANDY_L4_STAIRS Stairs from L3 to L4
andy_cage.png ANDY_CAGE Andariel cage area

Nodes in pather.py: 1010-1012 (placeholder coords (0,0) - update after recording)


3. MEPHISTO (Act 3 Durance of Hate)

game.ini keys to record (2):

Key What to Record
a3_meph_level3_enter Durance of Hate L3 entrance (from L2)
a3_meph_safe_dist Position near Mephisto's cage at safe hammer range

Templates for walking fallback (in assets/templates/mephisto/):

Template File Template Key Purpose
meph_l3_stairs.png MEPH_L3_STAIRS Stairs from L2 to L3
meph_cage.png MEPH_CAGE Mephisto cage area

Nodes in pather.py: 1020-1021 (placeholder coords (0,0) - update after recording)


4. BAAL (Act 5 Throne of Destruction)

game.ini keys to record (2):

Key What to Record
a5_baal_throne_entry Throne of Destruction entrance (from Worldstone Keep L2)
a5_baal_safe_dist Position near Baal at safe hammer range (after wave clear)

Templates for walking fallback (in assets/templates/baal/):

Template File Template Key Purpose
baal_throne_entry.png BAAL_THRONE_ENTRY Entrance to Throne area
baal_arena.png BAAL_ARENA Baal arena / boss position

Nodes in pather.py: 1030-1031 (placeholder coords (0,0) - update after recording)


Quick Start: Record Paths for One Run

  1. Launch D2R and navigate to the boss area
  2. Run python src/utils/node_recorder.py from the botty directory
  3. Enter the run name when prompted (e.g., countess)
  4. Position your cursor at the target location in-game
  5. Press F8 to capture a template, F9 to record a node
  6. Press F10 to update all nodes with visible templates
  7. Copy the generated path coordinates to config/game.ini
  8. Copy the generated template PNGs to assets/templates/<run>/
  9. Update pather.py node definitions with real coordinates from the recorder output