diff --git a/src/bot.py b/src/bot.py index 1abd804..6b19d7e 100644 --- a/src/bot.py +++ b/src/bot.py @@ -214,7 +214,7 @@ class Bot: # Handle picking up corpse in case of death if self._pick_corpse: self._pick_corpse = False - time.sleep(0.6) + time.sleep(1.6) DeathManager.pick_up_corpse(self._config, self._screen) wait(1.2, 1.5) self._belt_manager.fill_up_belt_from_inventory(self._config.char["num_loot_columns"]) diff --git a/src/char/hammerdin.py b/src/char/hammerdin.py index 757cb40..5acf0e3 100644 --- a/src/char/hammerdin.py +++ b/src/char/hammerdin.py @@ -21,6 +21,9 @@ class Hammerdin(IChar): # ass most likely we will click on some mobs and already cast hammers if not self._skill_hotkeys["teleport"]: self._do_pre_move = False + else: + # we want to change positions of shenk and eld a bit to be more center for teleport + self._pather.offset_node(149, (70, 10)) def _cast_hammers(self, time_in_s: float, aura: str = "concentration"): if aura in self._skill_hotkeys and self._skill_hotkeys[aura]: @@ -80,7 +83,8 @@ class Hammerdin(IChar): def kill_eldritch(self) -> bool: if self.can_teleport(): - self._pather.traverse_nodes_fixed("eldritch_end", self) + # Custom eld position for teleport that brings us closer to eld + self._pather.traverse_nodes_fixed([(675, 30)], self) else: if not self._do_pre_move: keyboard.send(self._skill_hotkeys["concentration"]) diff --git a/src/char/sorceress/light_sorc.py b/src/char/sorceress/light_sorc.py index 2644f2d..debfb38 100644 --- a/src/char/sorceress/light_sorc.py +++ b/src/char/sorceress/light_sorc.py @@ -21,7 +21,7 @@ class LightSorc(Sorceress): x = cast_pos_abs[0] + (random.random() * 2 * spray - spray) y = cast_pos_abs[1] + (random.random() * 2 * spray - spray) pos_m = self._screen.convert_abs_to_monitor((x, y)) - mouse.move(*pos_m) + mouse.move(*pos_m, delay_factor=[0.3, 0.6]) mouse.press(button="left") wait(delay[0], delay[1]) mouse.release(button="left") @@ -35,7 +35,7 @@ class LightSorc(Sorceress): x = cast_pos_abs[0] + (random.random() * 2 * spray - spray) y = cast_pos_abs[1] + (random.random() * 2 * spray - spray) cast_pos_monitor = self._screen.convert_abs_to_monitor((x, y)) - mouse.move(*cast_pos_monitor) + mouse.move(*cast_pos_monitor, delay_factor=[0.3, 0.6]) mouse.press(button="right") wait(delay[0], delay[1]) mouse.release(button="right") @@ -79,46 +79,43 @@ class LightSorc(Sorceress): atk_len_trav_2 = int(self._char_config["atk_len_trav"] / 2) # Check out the node screenshot in assets/templates/trav/nodes to see where each node is at # Go inside cast stuff in general direction - self._pather.offset_node(229, [250, 130]) - self._pather.traverse_nodes([228, 229], self, time_out=2.5, force_tp=True) - self._pather.offset_node(229, [-250, -130]) - atk_pos_abs = self._pather.find_abs_node_pos(230, self._screen.grab()) - if atk_pos_abs is None: - Logger.debug("Could not find node [230]. Using static attack coordinates instead.") - atk_pos_abs = [-300, -200] - else: - atk_pos_abs = [atk_pos_abs[0], atk_pos_abs[1] + 70] - cast_pos_abs = np.array([atk_pos_abs[0] * 0.9, atk_pos_abs[1] * 0.9]) + # Move to far right position + self._pather.traverse_nodes_fixed([(1210, 90)], self) + self._pather.offset_node(229, [320, 80]) + self._pather.traverse_nodes([229], self, time_out=0.8, force_tp=True) + self._pather.offset_node(229, [-300, -62]) + cast_pos_abs = np.array([-250, 0]) self._chain_lightning(cast_pos_abs, spray=80) self._cast_static() for _ in range(atk_len_trav_2): self._chain_lightning(cast_pos_abs, spray=80) - self._lightning(cast_pos_abs, spray=60) + cast_pos_abs[1] += 50 + for _ in range(atk_len_trav_2): + self._chain_lightning(cast_pos_abs, spray=80) # move a bit back - pos_m = self._screen.convert_abs_to_monitor((160, 30)) + pos_m = self._screen.convert_abs_to_monitor((160, 80)) self.pre_move() self.move(pos_m, force_move=True) - atk_pos_abs = self._pather.find_abs_node_pos(229, self._screen.grab()) - if atk_pos_abs is None: - Logger.debug("Could not find node [229]. Using static attack coordinates instead.") - atk_pos_abs = [-200, -80] + cast_pos_abs = np.array([-220, -95]) self._chain_lightning(cast_pos_abs, spray=60) self._lightning(cast_pos_abs, spray=60) # Move outside # Move a bit back and another round + self._pather.offset_node(226, [0, 150]) self._pather.traverse_nodes([226], self, time_out=2.5, force_tp=True) - cast_pos_abs = np.array([-300, -100]) + self._pather.offset_node(226, [0, -150]) + cast_pos_abs = np.array([-76, -146]) for _ in range(atk_len_trav_2): self._chain_lightning(cast_pos_abs, spray=60) self._cast_static() # move a bit back pos_m = self._screen.convert_abs_to_monitor((100, 0)) - cast_pos_abs = self._pather.find_abs_node_pos(229, self._screen.grab()) - if cast_pos_abs is not None: - self.pre_move() - self.move(pos_m, force_move=True) - for _ in range(atk_len_trav_2): - self._chain_lightning(cast_pos_abs, spray=60) + self.pre_move() + self.move(pos_m, force_move=True) + cast_pos_abs = np.array([-36, -126]) + for _ in range(atk_len_trav_2): + self._chain_lightning(cast_pos_abs, spray=60) + self._lightning(cast_pos_abs, spray=60) return True def kill_nihlatak(self, end_nodes: list[int]) -> bool: @@ -152,7 +149,7 @@ class LightSorc(Sorceress): mouse.move(*pos_m, randomize=80, delay_factor=[0.5, 0.7]) for _ in range(int(self._char_config["atk_len_arc"])): self._chain_lightning(cast_pos_abs, spray=11) - self._lightning(cast_pos_abs, spray=50) + self._lightning(cast_pos_abs, spray=11) wait(self._cast_duration, self._cast_duration + 0.2) return True diff --git a/src/game_recovery.py b/src/game_recovery.py index 5cc9768..7fc055b 100644 --- a/src/game_recovery.py +++ b/src/game_recovery.py @@ -4,6 +4,7 @@ from config import Config from death_manager import DeathManager from ui import UiManager import time +import keyboard from utils.misc import set_d2r_always_on_top