Files
my-botty/docs/melee_hunt_test_log.md
alexpolo1 c26f249268 fix(input): snap cursor to exact target before click (SetCursorPos can land 1-2px off)
D2R UI hitboxes are tight; a 1px offset on the Join Game tab click was
enough to miss the button. Final SetCursorPos pass after the existing
verification check.
2026-08-25 00:26:44 +02:00

6.3 KiB

Paladalla Melee Hunt Test Log

Date: 2026-08-23
Workspace: C:\Users\alex\my-botty
Character/profile: paladalla
Script: tools/melee_hunt.py

Current State

  • Testing was stopped at the user's request.
  • No melee_hunt Python process was running when checked.
  • Paladalla was alive in the Rogue Encampment at the end of the session.
  • The four visible belt potions were manually consumed. The last screenshot shows partial life and an empty belt, so refill and fully heal before the next run.
  • The game must not be controlled automatically until the user asks to resume.

Final-state screenshot: healed_from_belt.png

Commands Used

The successful short run used:

C:\Users\alex\miniforge3\envs\botty\python.exe tools\melee_hunt.py --debug --button left

The later long tests used:

C:\Users\alex\miniforge3\envs\botty\python.exe tools\melee_hunt.py --debug --button left --minutes 1440

F12 is intended to stop the script. It worked during one run but was not reliable while an in-game overlay was open. Ctrl+C in the script terminal was the reliable emergency stop.

Verified Results

Initial ten-minute run

  • Started outside town and completed its configured timer normally.
  • Result: engaged 107, roamed 15.
  • XP changed from 261/500 to 357/500.
  • Final reported life was 69%.
  • The process then exited because the default duration is ten minutes. Paladalla later died because nothing was controlling or protecting the character.

Corpse recovery and level gain

  • The death prompt was cleared and the game was cycled through Save and Exit.
  • The corpse appeared beside Paladalla in town and was recovered successfully.
  • Weapon and attack slots were restored.
  • Paladalla was manually routed across the bridge into the Blood Moor.
  • Manual movement/attack clicks later produced a level-up. The next script start read XP as 564/1500, confirming level 2 and working melee damage.

Evidence:

Failures Found

1. Ten-minute default looked like a crash

The first hunt was not dead or hung. It reached its default ten-minute deadline and exited cleanly. Long unattended tests must pass an explicit --minutes value or implement a true continuous mode.

2. Friendly bridge NPC was treated as motion target

The first 24-hour attempt remained near the town bridge. At the two-minute checkpoint it showed repeated attacks, full life, and unchanged XP (357/500). The screenshot showed it attacking the friendly rogue near the bridge. Motion alone cannot distinguish that NPC from a monster.

Evidence: hunt_2min_checkpoint.png

Workaround used: stop the script and move several screens deeper into the Blood Moor before restarting. A permanent NPC rejection/stall detector is still needed.

3. Animated HUD controls were treated as targets

After reaching level 2, the pulsing new-stat/new-skill controls appeared above the original HUD mask. The motion detector could target that region. During the second long attempt an in-game Loot Filter overlay opened and the script kept issuing clicks behind it.

Evidence: restart_live_40s.png

4. No-potion condition was unsafe

Life fell through 18%, 14%, 10%, 8%, and eventually 0%. The script logged no healing potion in belt! but continued its loop. Belt detection also reported no potion even though red potions were visibly present, so belt detection or its profile assumptions need separate investigation.

5. XP OCR became invalid after level-up/UI changes

The log reported XP OCR values such as '-' and '', then incorrectly printed *** LEVEL UP *** now 0/0. Invalid OCR should not be interpreted as a level-up, and xp_last should retain the last valid sample.

Code Changes Made

tools/melee_hunt.py was changed in two ways:

  1. The target scan bottom boundary was raised from 640 to 510, excluding the animated level-up/stat controls and the interactive HUD from motion targets.
  2. Failure to detect or use a healing potion at the configured health threshold now raises SafetyStop, exits the hunt loop, and prints a safety-stop reason.

The edited script passed:

C:\Users\alex\miniforge3\envs\botty\python.exe -m py_compile tools\melee_hunt.py

These changes were not runtime-verified after editing because testing was stopped. The narrower scan may ignore monsters near the bottom of the viewport; that tradeoff must be checked visually.

Next Test Checklist

  1. Confirm no old hunt process is running.
  2. Refill the belt with healing potions and fully heal at Akara.
  3. Save and Exit, re-enter, and recover any corpse if one appears.
  4. Spend or dismiss the new stat/skill notifications if practical.
  5. Walk across the bridge and several screens into the Blood Moor before launch.
  6. Start with a short five-minute test, not a 24-hour run:
C:\Users\alex\miniforge3\envs\botty\python.exe tools\melee_hunt.py --debug --button left --minutes 5
  1. Capture and inspect screenshots at launch, two minutes, and five minutes.
  2. At each checkpoint verify: outside town, no modal open, attacking a hostile, XP increasing, life stable, movement occurring, and no repeated target lock.
  3. Force a controlled low-health/no-potion condition only after normal combat is proven, and verify SAFETY STOP exits immediately.
  4. Use Ctrl+C if any modal opens, XP remains unchanged across two checkpoints, life drops rapidly, or the character approaches the town bridge NPC.

Follow-up Engineering Work

  • Add a stall detector based on unchanged XP plus repeated target coordinates.
  • Temporarily blacklist a target position after excessive swings without XP.
  • Reject invalid XP samples instead of converting them into 0/0 level-ups.
  • Investigate why belt.drink_potion("health", ...) missed visible red potions.
  • Detect death and modal overlays explicitly and stop before sending more input.
  • Consider an explicit --continuous option instead of using a large minute count.