Fix show_belt key, post-attack wait, and pickit variable scope
- config/params.ini: show_belt k->n matches the actual D2R keybind so the bot can now correctly read and manage belt potion inventory. pickit_screenshots=1 enables per-run loot scan evidence. - blizz_sorc.py: kill_pindle() now waits 1.5-2.0s (was ~0.33s) after the attack loop before teleporting to the loot area. Blizzard has an ~1.8s fall duration, so the old wait left enemies alive when the sorc arrived. Also adds _cast_static() at the start to reduce pack HP immediately. - pickit.py: rename loop var i->ground_item (fixes potential NameError when items list is empty) and improve tele-fail warning message. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
9ee102a0f1
commit
af06d8aff4
+6
-6
@@ -1,7 +1,7 @@
|
||||
; There is detailed documentation for each parameter in the README.md
|
||||
[general]
|
||||
difficulty=normal
|
||||
name=botty
|
||||
name=zapzap
|
||||
randomize_runs=0
|
||||
target_tz=1
|
||||
saved_games_folder=
|
||||
@@ -40,7 +40,7 @@ hardcore=0
|
||||
; screenshots
|
||||
info_screenshots=1
|
||||
loot_screenshots=0
|
||||
pickit_screenshots=0
|
||||
pickit_screenshots=1
|
||||
|
||||
[stealth]
|
||||
; Multiplies all wait() calls by a random value in this range each call
|
||||
@@ -147,7 +147,7 @@ potion2=2
|
||||
potion3=3
|
||||
potion4=4
|
||||
; show_belt is different from the default hotkey as "~" is for many keyboards not reachable without also pressing altgr
|
||||
show_belt=k
|
||||
show_belt=n
|
||||
show_items=alt
|
||||
; stand_still cannot be the default "shift" as it would interfere with merc healing
|
||||
stand_still=capslock
|
||||
@@ -232,7 +232,7 @@ transmute_every_x_game=2000
|
||||
; ==== Builds: Sorceress ====
|
||||
; ===========================
|
||||
[sorceress]
|
||||
energy_shield=f3
|
||||
energy_shield=
|
||||
frozen_armor=f4
|
||||
static_field=f5
|
||||
telekinesis=f6
|
||||
@@ -250,14 +250,14 @@ frozen_orb=
|
||||
; blizzard must be right skill, hotkey required
|
||||
blizzard=f1
|
||||
; ice_blast must be left skill (hotkey optional as it shouldnt change)
|
||||
ice_blast=
|
||||
ice_blast=f2
|
||||
|
||||
[blizzorb_sorc]
|
||||
; frozen orb must be left skill and preselected (no hotkey required)
|
||||
|
||||
;All others must be right skill and hotkey required!
|
||||
blizzard=f1
|
||||
glacial_spike=f2
|
||||
glacial_spike=f7
|
||||
|
||||
[nova_sorc]
|
||||
; nova must be right skill, hotkey required
|
||||
|
||||
@@ -58,11 +58,14 @@ class BlizzSorc(Sorceress):
|
||||
def kill_pindle(self) -> bool:
|
||||
pindle_pos_abs = convert_screen_to_abs(Config().path["pindle_end"][0])
|
||||
cast_pos_abs = [pindle_pos_abs[0] * 0.9, pindle_pos_abs[1] * 0.9]
|
||||
# Static reduces pack HP immediately so the sorc isn't standing in them for 9 full attack cycles
|
||||
self._cast_static()
|
||||
for _ in range(int(Config().char["atk_len_pindle"])):
|
||||
self._blizzard(cast_pos_abs, spray=11)
|
||||
self._ice_blast(cast_pos_abs, spray=11)
|
||||
# Move to items
|
||||
wait(self._cast_duration, self._cast_duration + 0.2)
|
||||
# Wait for the last blizzard to fully land (~1.8s fall duration) and all
|
||||
# enemies to die before teleporting into the loot area.
|
||||
wait(1.5, 2.0)
|
||||
self._pather.traverse_nodes_fixed("pindle_end", self)
|
||||
return True
|
||||
|
||||
|
||||
+5
-5
@@ -90,17 +90,17 @@ class PickIt:
|
||||
wait(0.16, 0.16) #wait 4 frames for items to refresh
|
||||
items, img = PickIt._locate_items()
|
||||
tele_success = False
|
||||
for i in items:
|
||||
if item.Name == i.Name:
|
||||
for ground_item in items:
|
||||
if item.Name == ground_item.Name:
|
||||
tele_success = True
|
||||
Logger.info(f"Teled to pickup item {i.Name} and now at distance {i.Distance}")
|
||||
char.pick_up_item((i.CenterMonitor['x'], i.CenterMonitor['y']), item_name=i.Name, distance=i.Distance, force_run=True)
|
||||
Logger.info(f"Teled to pickup item {ground_item.Name} and now at distance {ground_item.Distance}")
|
||||
char.pick_up_item((ground_item.CenterMonitor['x'], ground_item.CenterMonitor['y']), item_name=ground_item.Name, distance=ground_item.Distance, force_run=True)
|
||||
# Wait for the pickup animation to complete before moving on
|
||||
# Issue #939: bot was teleporting away before item was actually grabbed
|
||||
wait(0.2, 0.3)
|
||||
break
|
||||
if not tele_success:
|
||||
Logger.warning(f"Failed to scan item {i.Name} after tele.")
|
||||
Logger.warning(f"Failed to scan item '{item.Name}' after tele. Items visible: {len(items)}")
|
||||
return PickedUpResult.PickedUp
|
||||
|
||||
def _pick_up_item(self, char: IChar, item: GroundItem) -> PickedUpResult:
|
||||
|
||||
Reference in New Issue
Block a user