From 78bc195bd9955401688d46cccf32e3ed2248240b Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 10 Jun 2026 20:28:23 +0200 Subject: [PATCH] fix: vendor failure non-fatal so maintenance always reaches stash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CRITICAL loot-loss bug: buy_consumables failure called end_game and returned BEFORE the stash step, so Pindle runes/items piled in inventory and were never banked (zero stash events across a whole session). Buying pots is optional (belt refills from drops); stashing loot is the point. Now warn + re-anchor + fall through to stash. Also raise max_maintenance_time_s 120->240 so the A5 vendor thrash completes and reaches stash instead of timing out first (transitional — disappears once a Diablo run shifts spawns to A4). Co-Authored-By: Claude Fable 5 --- config/params.ini | 2 +- src/bot.py | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/config/params.ini b/config/params.ini index 7ee363f..040c1e5 100644 --- a/config/params.ini +++ b/config/params.ini @@ -78,7 +78,7 @@ max_game_length_s=900 ; max_maintenance_time_s: if the town maintenance loop (heal/buy/stash/repair) takes ; longer than this many seconds, save-and-exit and rejoin a fresh game. ; Prevents the bot staying stuck in A5 town forever when NPCs or pathing fail. -max_maintenance_time_s=120 +max_maintenance_time_s=240 ; auto_downgrade_threshold: if combined chickens+deaths exceed this number within 1 hour, ; bot automatically lowers difficulty by one tier (hell->nightmare->normal) and restarts. ; Set to 0 to disable. (NOTE: feature is parsed but not yet active in bot logic) diff --git a/src/bot.py b/src/bot.py index a025fa2..99bdab3 100644 --- a/src/bot.py +++ b/src/bot.py @@ -587,13 +587,14 @@ class Bot: sell_items = any([item.sell for item in items]) if items else None Logger.debug(f"Needs: {consumables.get_needs()}") else: - reason = "Maintenance failed [step: buy_consumables] — vendor NPC not found after retry" - Logger.error(reason) + # NON-FATAL: buying pots is optional (belt refills from drops), but + # STASHING loot is the whole point of the run. Do NOT end the game + # here — that skips the stash step and strands picked-up runes/items + # in inventory forever. Re-anchor and fall through to stash. + reason = "Buy consumables failed (vendor not found) — continuing to stash without buying" + Logger.warning(reason) self._save_error_screenshot("maintenance", reason) - if not self._game_stats.get_failure_reason(): - self._game_stats.set_failure_reason(reason) - self.trigger_or_stop("end_game", failed=True) - return + self._curr_loc = self._verify_town_location(prev_buy_loc) elif meters.get_health(img) <= Config().char["take_rejuv_potion_health"] or meters.get_mana(img) <= Config().char["take_rejuv_potion_mana"]: Logger.info("Healing at next possible Vendor") self._maintenance_step = "heal"