From 27346bd77d04b362bc15bc5ae8ca987dcd729dc6 Mon Sep 17 00:00:00 2001 From: Ezro Date: Mon, 20 Jun 2022 11:48:16 -0600 Subject: [PATCH] Fix rebase --- src/bot.py | 9 +- src/char/barbarian.py | 12 +-- src/char/bone_necro.py | 4 +- src/char/i_char.py | 44 +++------ src/char/necro.py | 20 ++--- src/char/paladin/fohdin.py | 8 +- src/char/paladin/hammerdin.py | 148 +++++++++++++++---------------- src/char/paladin/paladin.py | 6 +- src/char/poison_necro.py | 24 ++--- src/char/sorceress/blizz_sorc.py | 2 +- src/char/sorceress/hydra_sorc.py | 2 +- src/char/sorceress/light_sorc.py | 6 +- src/char/sorceress/nova_sorc.py | 2 +- src/char/sorceress/sorceress.py | 12 +-- src/char/trapsin.py | 10 +-- src/ui/skills.py | 2 +- 16 files changed, 148 insertions(+), 163 deletions(-) diff --git a/src/bot.py b/src/bot.py index f4f6e1f8a..feb339f57 100644 --- a/src/bot.py +++ b/src/bot.py @@ -35,6 +35,7 @@ from char.basic_ranged import Basic_Ranged from ui_manager import wait_until_hidden, wait_until_visible, ScreenObjects, is_visible, detect_screen_object from ui import meters, skills, view, character_select, main_menu +from ui.skills import SkillName from inventory import personal, vendor, belt, common from run import Pindle, ShenkEld, Trav, Nihlathak, Arcane, Diablo @@ -272,12 +273,12 @@ def on_start_from_town(self): hotkeys.discover_hotkey_mappings(saved_games_folder, key_file) self._hotkeys_discovered = True self._char.discover_capabilities() - teleport_selected = skills.select_tp(hotkeys.right_skill_key_map[skills.SkillName.Teleport]) + teleport_selected = skills.select_tp(hotkeys.right_skill_key_map[SkillName.Teleport]) if corpse_present and self._char.capabilities.can_teleport_with_charges and not teleport_selected: - keybind = hotkeys.right_skill_key_map[skills.SkillName.Teleport] + keybind = hotkeys.right_skill_key_map[SkillName.Teleport] Logger.info(f"Teleport keybind is lost upon death. Rebinding teleport to '{keybind}'") hotkeys.remap_skill_hotkey( - skills.SkillName.Teleport.value, + SkillName.Teleport.value, keybind, Config().ui_roi["skill_right"], Config().ui_roi["skill_right_expanded"] @@ -378,7 +379,7 @@ def on_maintenance(self): # Check if we are out of tps or need repairing need_repair = is_visible(ScreenObjects.NeedRepair) need_routine_repair = False if not Config().char["runs_per_repair"] else self._game_stats._run_counter % Config().char["runs_per_repair"] == 0 - teleport_selected = skills.select_tp(hotkeys.right_skill_key_map[skills.SkillName.Teleport]) + teleport_selected = skills.select_tp(hotkeys.right_skill_key_map[SkillName.Teleport]) need_refill_teleport = self._char.capabilities.can_teleport_with_charges and (not teleport_selected or self._char.is_low_on_teleport_charges()) if need_repair or need_routine_repair or need_refill_teleport or sell_items: if need_repair: diff --git a/src/char/barbarian.py b/src/char/barbarian.py index 132b046e4..3877beb89 100644 --- a/src/char/barbarian.py +++ b/src/char/barbarian.py @@ -27,7 +27,7 @@ def _cast_war_cry(self, time_in_s: float): keyboard.send(hotkeys.d2r_keymap[hotkeys.HotkeyName.StandStill], do_release=False) wait(0.05, 0.1) if SkillName.WarCry in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.WarCry]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.WarCry]) wait(0.05, 0.1) start = time.time() while (time.time() - start) < time_in_s: @@ -45,7 +45,7 @@ def on_capabilities_discovered(self, capabilities: CharacterCapabilities): def _do_hork(self, hork_time: int): wait(0.5) if SkillName.FindItem in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.FindItem]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.FindItem]) wait(0.5, 0.15) pos_m = convert_abs_to_monitor((0, -20)) mouse.move(*pos_m) @@ -56,15 +56,15 @@ def _do_hork(self, hork_time: int): wait(1) def pre_buff(self): - keyboard.send(hotkeys.right_skill_map[SkillName.BattleCommand]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.BattleCommand]) wait(0.08, 0.19) mouse.click(button="right") wait(self._cast_duration + 0.08, self._cast_duration + 0.1) - keyboard.send(hotkeys.right_skill_map[SkillName.BattleOrders]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.BattleOrders]) wait(0.08, 0.19) mouse.click(button="right") wait(self._cast_duration + 0.08, self._cast_duration + 0.1) - keyboard.send(hotkeys.right_skill_map[SkillName.Shout]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Shout]) wait(0.08, 0.19) mouse.click(button="right") wait(self._cast_duration + 0.08, self._cast_duration + 0.1) @@ -76,7 +76,7 @@ def pre_move(self): should_cast_leap = SkillName.Leap in hotkeys.right_skill_key_map and not is_left_skill_selected(SkillName.Leap.value) can_teleport = self.capabilities.can_teleport_natively and is_right_skill_active() if should_cast_leap and not can_teleport: - keyboard.send(hotkeys.right_skill_map[SkillName.Leap]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Leap]) wait(0.15, 0.25) def _move_and_attack(self, abs_move: tuple[int, int], atk_len: float): diff --git a/src/char/bone_necro.py b/src/char/bone_necro.py index b3cc7ac1a..aafd37052 100644 --- a/src/char/bone_necro.py +++ b/src/char/bone_necro.py @@ -35,7 +35,7 @@ def bone_wall(self, cast_pos_abs: tuple[float, float], spray: int): if SkillName.BoneWall not in hotkeys.right_skill_key_map: raise ValueError("You did not set bone_wall hotkey!") keyboard.send(hotkeys.d2r_keymap[hotkeys.HotkeyName.StandStill], do_release=False) - keyboard.send(hotkeys.right_skill_map[SkillName.BoneWall]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.BoneWall]) wait(0.02, 0.08) x = cast_pos_abs[0] + (random.random() * 2*spray - spray) y = cast_pos_abs[1] + (random.random() * 2*spray - spray) @@ -84,7 +84,7 @@ def _corpse_explosion(self, cast_pos_abs: tuple[float, float], spray: int = 10,c Logger.debug(f'casting corpse explosion {cast_count} times with spray = {spray}') for _ in range(cast_count): if SkillName.CorpseExplosion in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.CorpseExplosion]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.CorpseExplosion]) x = cast_pos_abs[0] + (random.random() * 2*spray - spray) y = cast_pos_abs[1] + (random.random() * 2*spray - spray) cast_pos_monitor = convert_abs_to_monitor((x, y)) diff --git a/src/char/i_char.py b/src/char/i_char.py index f8f4c3f96..4cfa3acb4 100644 --- a/src/char/i_char.py +++ b/src/char/i_char.py @@ -9,7 +9,9 @@ from char.capabilities import CharacterCapabilities from ui_manager import is_visible, wait_until_visible from ui import skills +from ui.skills import SkillName from utils import hotkeys +from utils.hotkeys import HotkeyName from utils.custom_mouse import mouse from utils.misc import wait, cut_roi, is_in_roi, color_filter, arc_spread from logger import Logger @@ -37,11 +39,11 @@ def __init__(self, skill_hotkeys: dict): def _set_active_skill(self, mouse_click_type: str = "left", skill: str =""): self._active_skill[mouse_click_type] = skill - def _select_skill(self, skill: skills.SkillName, mouse_click_type: str = "left", delay: float | list | tuple = None): + def _select_skill(self, skill: SkillName, mouse_click_type: str = "left", delay: float | list | tuple = None): if skill not in hotkeys.right_skill_key_map: Logger.warning(f"No hotkey for skill: {skill.value}") return False - keyboard.send(hotkeys.d2r_keymap[skill]) + keyboard.send(hotkeys.right_skill_key_map[skill]) self._set_active_skill(mouse_click_type, skill.value) if delay: try: @@ -56,8 +58,8 @@ def _select_skill(self, skill: skills.SkillName, mouse_click_type: str = "left", def _discover_capabilities(self) -> CharacterCapabilities: override = Config().advanced_options["override_capabilities"] if override is None: - if skills.SkillName.Teleport in hotkeys.right_skill_key_map: - if skills.select_tp(hotkeys.right_skill_key_map[skills.SkillName.Teleport]): + if SkillName.Teleport in hotkeys.right_skill_key_map: + if skills.select_tp(hotkeys.right_skill_key_map[SkillName.Teleport]): if self.skill_is_charged(): return CharacterCapabilities(can_teleport_natively=False, can_teleport_with_charges=True) else: @@ -146,36 +148,18 @@ def is_low_on_teleport_charges(self): Logger.error("is_low_on_teleport_charges: unable to determine skill charges, assume zero") return True - def _remap_skill_hotkey(self, skill_asset, hotkey, skill_roi, expanded_skill_roi): - x, y, w, h = skill_roi - x, y = convert_screen_to_monitor((x, y)) - mouse.move(x + w/2, y + h / 2) - mouse.click("left") - wait(0.3) - match = template_finder.search(skill_asset, grab(), threshold=0.84, roi=expanded_skill_roi) - if match.valid: - mouse.move(*match.center_monitor) - wait(0.3) - keyboard.send(hotkey) - wait(0.3) - mouse.click("left") - wait(0.3) - - def remap_right_skill_hotkey(self, skill_asset, hotkey): - return self._remap_skill_hotkey(skill_asset, hotkey, Config().ui_roi["skill_right"], Config().ui_roi["skill_right_expanded"]) - def select_teleport(self): return skills.select_tp(hotkeys.right_skill_key_map[SkillName.Teleport]) def pre_move(self): # if teleport hotkey is set and if teleport is not already selected - if skills.SkillName.Teleport in hotkeys.right_skill_key_map: - skills.select_tp(hotkeys.right_skill_key_map[skills.SkillName.Teleport]) + if SkillName.Teleport in hotkeys.right_skill_key_map: + skills.select_tp(hotkeys.right_skill_key_map[SkillName.Teleport]) self._set_active_skill("right", "teleport") def move(self, pos_monitor: tuple[float, float], force_tp: bool = False, force_move: bool = False): factor = Config().advanced_options["pathing_delay_factor"] - if skills.SkillName.Teleport in hotkeys.right_skill_key_map and force_tp: + if SkillName.Teleport in hotkeys.right_skill_key_map and force_tp: self._set_active_skill("right", "teleport") mouse.move(pos_monitor[0], pos_monitor[1], randomize=3, delay_factor=[factor*0.1, factor*0.14]) wait(0.012, 0.02) @@ -264,14 +248,14 @@ def _pre_buff_cta(self): # Try to switch weapons and select bo until we find the skill on the right skill slot start = time.time() switch_sucess = False - if skills.SkillName.BattleCommand not in hotkeys.right_skill_key_map: + if SkillName.BattleCommand not in hotkeys.right_skill_key_map: return while time.time() - start < 4: keyboard.send(hotkeys.d2r_keymap[HotkeyName.SwapWeapons]) wait(0.3, 0.35) - keyboard.send(hotkeys.right_skill_key_map[skills.SkillName.BattleCommand]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.BattleCommand]) wait(0.15) - if skills.is_right_skill_selected([skills.SkillName.BattleCommand.value, skills.SkillName.BattleOrders.value]): + if skills.is_right_skill_selected([SkillName.BattleCommand.value, SkillName.BattleOrders.value]): switch_sucess = True break if not switch_sucess: @@ -281,7 +265,7 @@ def _pre_buff_cta(self): # We switched succesfully, let's pre buff mouse.click(button="right") wait(self._cast_duration + 0.16, self._cast_duration + 0.18) - self._select_skill(skill = skills.SkillName.BattleOrders, mouse_click_type="right", delay=(0.1, 0.2)) + self._select_skill(skill = SkillName.BattleOrders, mouse_click_type="right", delay=(0.1, 0.2)) mouse.click(button="right") wait(self._cast_duration + 0.16, self._cast_duration + 0.18) @@ -306,7 +290,7 @@ def vec_to_monitor(self, target): def _lerp(self,a: float,b: float, f:float): return a + f * (b - a) - def cast_in_arc(self, skill_name: skills.SkillName, cast_pos_abs: tuple[float, float] = [0,-100], time_in_s: float = 3, spread_deg: float = 10, hold=True): + def cast_in_arc(self, skill_name: SkillName, cast_pos_abs: tuple[float, float] = [0,-100], time_in_s: float = 3, spread_deg: float = 10, hold=True): #scale cast time by damage_scaling time_in_s *= self.damage_scaling Logger.debug(f'Casting {skill_name.value} for {time_in_s:.02f}s at {cast_pos_abs} with {spread_deg}°') diff --git a/src/char/necro.py b/src/char/necro.py index 53fca606d..191e7ae8b 100644 --- a/src/char/necro.py +++ b/src/char/necro.py @@ -158,7 +158,7 @@ def _revive(self, cast_pos_abs: tuple[float, float], spray: int = 10, cast_count return keyboard.send(hotkeys.d2r_keymap[hotkeys.HotkeyName.StandStill], do_release=False) for _ in range(cast_count): - keyboard.send(hotkeys.right_skill_map[SkillName.Revive]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Revive]) #Logger.info("revive -> cast") x = cast_pos_abs[0] + (random.random() * 2*spray - spray) y = cast_pos_abs[1] + (random.random() * 2*spray - spray) @@ -188,7 +188,7 @@ def _raise_skeleton(self, cast_pos_abs: tuple[float, float], spray: int = 10, ca return keyboard.send(hotkeys.d2r_keymap[hotkeys.HotkeyName.StandStill], do_release=False) for _ in range(cast_count): - keyboard.send(hotkeys.right_skill_map[SkillName.RaiseSkeleton]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.RaiseSkeleton]) #Logger.info("raise skeleton -> cast") x = cast_pos_abs[0] + (random.random() * 2*spray - spray) y = cast_pos_abs[1] + (random.random() * 2*spray - spray) @@ -218,7 +218,7 @@ def _raise_mage(self, cast_pos_abs: tuple[float, float], spray: int = 10, cast_c return keyboard.send(hotkeys.d2r_keymap[hotkeys.HotkeyName.StandStill], do_release=False) for _ in range(cast_count): - keyboard.send(hotkeys.right_skill_map[SkillName.RaiseSkeletalMage]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.RaiseSkeletalMage]) #Logger.info("raise skeleton -> cast") x = cast_pos_abs[0] + (random.random() * 2*spray - spray) y = cast_pos_abs[1] + (random.random() * 2*spray - spray) @@ -255,14 +255,14 @@ def pre_buff(self): def _heart_of_wolverine(self): Logger.info('\033[94m'+"buff ~> heart_of_wolverine"+'\033[0m') - keyboard.send(hotkeys.right_skill_map[SkillName.HeartOfWolverine]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.HeartOfWolverine]) wait(0.05, 0.2) mouse.click(button="right") wait(self._cast_duration) def _clay_golem(self): Logger.info('\033[94m'+"cast ~> clay golem"+'\033[0m') - keyboard.send(hotkeys.right_skill_map[SkillName.ClayGolem]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.ClayGolem]) wait(0.05, 0.2) mouse.click(button="right") wait(self._cast_duration) @@ -270,19 +270,19 @@ def _clay_golem(self): def bone_armor(self): if SkillName.BoneArmor in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.BoneArmor]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.BoneArmor]) wait(0.04, 0.1) mouse.click(button="right") wait(self._cast_duration) if SkillName.ClayGolem in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.ClayGolem]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.ClayGolem]) wait(0.04, 0.1) mouse.click(button="right") wait(self._cast_duration) def _bone_armor(self): if SkillName.BoneArmor in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.BoneArmor]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.BoneArmor]) wait(0.04, 0.1) mouse.click(button="right") wait(self._cast_duration) @@ -321,7 +321,7 @@ def _left_attack_single(self, cast_pos_abs: tuple[float, float], spray: int = 10 def _amp_dmg(self, cast_pos_abs: tuple[float, float], spray: float = 10): if SkillName.AmplifyDamage in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.AmplifyDamage]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.AmplifyDamage]) x = cast_pos_abs[0] + (random.random() * 2*spray - spray) y = cast_pos_abs[1] + (random.random() * 2*spray - spray) @@ -336,7 +336,7 @@ def _corpse_explosion(self, cast_pos_abs: tuple[float, float], spray: int = 10,c Logger.info('\033[93m'+"corpse explosion~> random cast"+'\033[0m') for _ in range(cast_count): if SkillName.CorpseExplosion in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.CorpseExplosion]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.CorpseExplosion]) x = cast_pos_abs[0] + (random.random() * 2*spray - spray) y = cast_pos_abs[1] + (random.random() * 2*spray - spray) cast_pos_monitor = convert_abs_to_monitor((x, y)) diff --git a/src/char/paladin/fohdin.py b/src/char/paladin/fohdin.py index e3fb9e62f..463e9bab9 100644 --- a/src/char/paladin/fohdin.py +++ b/src/char/paladin/fohdin.py @@ -110,7 +110,7 @@ def kill_pindle(self) -> bool: if not self._pather.traverse_nodes([103], self, timeout=1.0, do_pre_move=False, force_move=True, force_tp=False, use_tp_charge=False): return False else: - keyboard.send(hotkeys.right_skill_map[SkillName.Conviction]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Conviction]) wait(0.15) self._pather.traverse_nodes([103], self, timeout=1.0, do_pre_move=False) @@ -120,7 +120,7 @@ def kill_pindle(self) -> bool: if self.capabilities.can_teleport_natively: self._pather.traverse_nodes_fixed("pindle_end", self) else: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.15) self._pather.traverse_nodes((Location.A5_PINDLE_SAFE_DIST, Location.A5_PINDLE_END), self, timeout=1.0, do_pre_move=False) @@ -134,7 +134,7 @@ def kill_pindle(self) -> bool: def kill_council(self) -> bool: atk_len_dur = float(Config().char["atk_len_trav"]) - keyboard.send(hotkeys.right_skill_map[SkillName.Conviction]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Conviction]) wait(.15) # traverse to nodes and attack nodes = [225, 226, 300] @@ -175,7 +175,7 @@ def kill_shenk(self): atk_len_dur = float(Config().char["atk_len_shenk"]) # traverse to shenk - keyboard.send(hotkeys.right_skill_map[SkillName.Conviction]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Conviction]) wait(0.15) self._pather.traverse_nodes((Location.A5_SHENK_SAFE_DIST, Location.A5_SHENK_END), self, timeout=1.0, do_pre_move=False, force_tp=True, use_tp_charge=True) wait(0.05, 0.1) diff --git a/src/char/paladin/hammerdin.py b/src/char/paladin/hammerdin.py index 1715feeae..19cc5f747 100644 --- a/src/char/paladin/hammerdin.py +++ b/src/char/paladin/hammerdin.py @@ -30,7 +30,7 @@ def _cast_hammers(self, time_in_s: float, aura: SkillName = SkillName.Concentrat wait(0.05, 0.1) keyboard.send(hotkeys.d2r_keymap[hotkeys.HotkeyName.StandStill], do_release=False) wait(0.05, 0.1) - keyboard.send(hotkeys.right_skill_map[SkillName.BlessedHammer]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.BlessedHammer]) wait(0.05, 0.1) start = time.time() while (time.time() - start) < time_in_s: @@ -44,7 +44,7 @@ def _cast_hammers(self, time_in_s: float, aura: SkillName = SkillName.Concentrat def pre_buff(self): if Config().char["cta_available"]: self._pre_buff_cta() - keyboard.send(hotkeys.right_skill_map[SkillName.HolyShield]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.HolyShield]) wait(0.04, 0.1) mouse.click(button="right") wait(self._cast_duration, self._cast_duration + 0.06) @@ -53,10 +53,10 @@ def pre_move(self): # select teleport if available super().pre_move() # in case teleport hotkey is not set or teleport can not be used, use vigor if set - should_cast_vigor = SkillName.Vigor in hotkeys.right_skill_key_map and not is_right_skill_selected(SkillName.Vigor) + should_cast_vigor = SkillName.Vigor in hotkeys.right_skill_key_map and not is_right_skill_selected([SkillName.Vigor]) can_teleport = self.capabilities.can_teleport_natively and is_right_skill_active() if should_cast_vigor and not can_teleport: - keyboard.send(hotkeys.right_skill_map[SkillName.Vigor]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Vigor]) wait(0.15, 0.25) def _move_and_attack(self, abs_move: tuple[int, int], atk_len: float): @@ -74,7 +74,7 @@ def kill_pindle(self) -> bool: if not self._pather.traverse_nodes_fixed("pindle_end", self): return False else: - keyboard.send(hotkeys.right_skill_map[SkillName.Concentration]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Concentration]) wait(0.15) self._pather.traverse_nodes((Location.A5_PINDLE_SAFE_DIST, Location.A5_PINDLE_END), self, timeout=1.0, do_pre_move=False, force_tp=True, use_tp_charge=True) self._cast_hammers(Config().char["atk_len_pindle"]) @@ -87,7 +87,7 @@ def kill_eldritch(self) -> bool: # Custom eld position for teleport that brings us closer to eld self._pather.traverse_nodes_fixed([(675, 30)], self) else: - keyboard.send(hotkeys.right_skill_map[SkillName.Concentration]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Concentration]) wait(0.15) # Traverse without pre_move, because we don't want to activate vigor when walking! self._pather.traverse_nodes((Location.A5_ELDRITCH_SAFE_DIST, Location.A5_ELDRITCH_END), self, timeout=1.0, do_pre_move=False, force_tp=True, use_tp_charge=True) @@ -98,7 +98,7 @@ def kill_eldritch(self) -> bool: return True def kill_shenk(self): - keyboard.send(hotkeys.right_skill_map[SkillName.Concentration]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Concentration]) wait(0.15) self._pather.traverse_nodes((Location.A5_SHENK_SAFE_DIST, Location.A5_SHENK_END), self, timeout=1.0, do_pre_move=False, force_tp=True, use_tp_charge=True) wait(0.05, 0.1) @@ -108,7 +108,7 @@ def kill_shenk(self): return True def kill_council(self) -> bool: - keyboard.send(hotkeys.right_skill_map[SkillName.Concentration]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Concentration]) wait(.15) # Check out the node screenshot in assets/templates/trav/nodes to see where each node is at atk_len = Config().char["atk_len_trav"] @@ -179,10 +179,10 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"] * 0.5) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.5, 1.0) #clear seal from corpses ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -206,10 +206,10 @@ def kill_cs_trash(self, location:str) -> bool: self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"]) ### LOOT ### if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -228,10 +228,10 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"]) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -248,10 +248,10 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"]) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -269,10 +269,10 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"]) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -294,10 +294,10 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"]) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -313,10 +313,10 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"]) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -333,10 +333,10 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"]) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -356,10 +356,10 @@ def kill_cs_trash(self, location:str) -> bool: self._move_and_attack((-50, -150), Config().char["atk_len_cs_trashmobs"]) self._move_and_attack((50, 150), Config().char["atk_len_cs_trashmobs"] * 0.5) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -376,10 +376,10 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"]) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -398,10 +398,10 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"]) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -423,10 +423,10 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"]) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -452,10 +452,10 @@ def kill_cs_trash(self, location:str) -> bool: self._move_and_attack((250, -150), Config().char["atk_len_cs_trashmobs"] * 0.5) self._move_and_attack((-250, -150), Config().char["atk_len_cs_trashmobs"] * 0.2) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -479,10 +479,10 @@ def kill_cs_trash(self, location:str) -> bool: self._move_and_attack((-30, -100), Config().char["atk_len_cs_trashmobs"]) self._move_and_attack((30, 100), Config().char["atk_len_cs_trashmobs"] * 0.5) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -498,10 +498,10 @@ def kill_cs_trash(self, location:str) -> bool: self._move_and_attack((-30, -100), Config().char["atk_len_cs_trashmobs"]) self._move_and_attack((30, 100), Config().char["atk_len_cs_trashmobs"] * 0.5) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -517,10 +517,10 @@ def kill_cs_trash(self, location:str) -> bool: self._move_and_attack((-30, -100), Config().char["atk_len_cs_trashmobs"]) self._move_and_attack((30, 100), Config().char["atk_len_cs_trashmobs"]) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -539,10 +539,10 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"] * 0.5) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -558,10 +558,10 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"] * 0.5) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -576,10 +576,10 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"] * 0.5) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -604,10 +604,10 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"] * 0.5) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -622,10 +622,10 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"] * 0.5) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) @@ -646,10 +646,10 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"] * 0.5) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### # we loot at boss @@ -660,7 +660,7 @@ def kill_cs_trash(self, location:str) -> bool: ### ATTACK ### if not Config().char['cs_mob_detect'] or get_visible_targets(): if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) pos_m = convert_abs_to_monitor((0, 0)) mouse.move(*pos_m, randomize=80, delay_factor=[0.5, 0.7]) @@ -670,10 +670,10 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._cast_hammers(0.5, SkillName.Cleansing) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### # we loot at boss @@ -693,10 +693,10 @@ def kill_cs_trash(self, location:str) -> bool: ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) case "A1-L_seal1": #node 613 seal layout A1-L: fake_seal @@ -705,7 +705,7 @@ def kill_cs_trash(self, location:str) -> bool: if not self._pather.traverse_nodes([614], self): return False ### ATTACK ### if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### # we loot at boss @@ -715,7 +715,7 @@ def kill_cs_trash(self, location:str) -> bool: if not self._pather.traverse_nodes([613, 615], self): return False # , timeout=3): ### ATTACK ### if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### # we loot at boss @@ -733,7 +733,7 @@ def kill_cs_trash(self, location:str) -> bool: wait(1)#give merc the chance to activate holy freeze if not Config().char['cs_mob_detect'] or get_visible_targets(): if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### ATTACK ### pos_m = convert_abs_to_monitor((0, 0)) @@ -742,10 +742,10 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"] * 0.5) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### # we loot at boss @@ -761,10 +761,10 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"] * 0.5) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### # we loot at boss @@ -783,7 +783,7 @@ def kill_cs_trash(self, location:str) -> bool: # we loot at boss if not self._pather.traverse_nodes([625], self): return False # , timeout=3): if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) case "A2-Y_seal2": @@ -793,7 +793,7 @@ def kill_cs_trash(self, location:str) -> bool: # we loot at boss self._pather.traverse_nodes_fixed("dia_a2y_sealfake_sealboss", self) #instead of traversing node 626 which causes issues if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ########### @@ -826,7 +826,7 @@ def kill_cs_trash(self, location:str) -> bool: if not self._pather.traverse_nodes([634], self): return False # , timeout=3): ### ATTACK ### if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### @@ -864,7 +864,7 @@ def kill_cs_trash(self, location:str) -> bool: ### LOOT ### # we loot at boss if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) @@ -907,16 +907,16 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"] * 0.5) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) if not self._pather.traverse_nodes([655], self): return False # , timeout=3): if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) case "C1-F_seal2": @@ -931,16 +931,16 @@ def kill_cs_trash(self, location:str) -> bool: self._cast_hammers(0.75, SkillName.Redemption) self._move_and_attack((-30, -15), Config().char["atk_len_cs_trashmobs"] * 0.5) if SkillName.Cleansing in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Cleansing]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Cleansing]) wait(0.1, 0.2) if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ### LOOT ### self._picked_up_items |= self._pickit.pick_up_items(self) if not self._pather.traverse_nodes([652], self): return False # , timeout=3): if SkillName.Redemption in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Redemption]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Redemption]) wait(0.3, 0.6) ########### diff --git a/src/char/paladin/paladin.py b/src/char/paladin/paladin.py index e88a2a9dc..0b14411c0 100644 --- a/src/char/paladin/paladin.py +++ b/src/char/paladin/paladin.py @@ -25,7 +25,7 @@ def __init__(self, skill_hotkeys: dict, pather: Pather, pickit: PickIt): def pre_buff(self): if Config().char["cta_available"]: self._pre_buff_cta() - keyboard.send(hotkeys.right_skill_map[SkillName.HolyShield]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.HolyShield]) wait(0.04, 0.1) mouse.click(button="right") wait(self._cast_duration, self._cast_duration + 0.06) @@ -34,10 +34,10 @@ def pre_move(self): # select teleport if available super().pre_move() # in case teleport hotkey is not set or teleport can not be used, use vigor if set - should_cast_vigor = SkillName.Vigor in hotkeys.right_skill_key_map and not is_right_skill_selected(SkillName.Vigor.value) + should_cast_vigor = SkillName.Vigor in hotkeys.right_skill_key_map and not is_right_skill_selected([SkillName.Vigor.value]) can_teleport = self.capabilities.can_teleport_natively and is_right_skill_active() if should_cast_vigor and not can_teleport: - keyboard.send(hotkeys.right_skill_map[SkillName.Vigor]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Vigor]) wait(0.15, 0.25) def _log_cast(self, skill_name: str, cast_pos_abs: tuple[float, float], spray: int, min_duration: float, aura: str): diff --git a/src/char/poison_necro.py b/src/char/poison_necro.py index 2c03c0eca..04faf4717 100644 --- a/src/char/poison_necro.py +++ b/src/char/poison_necro.py @@ -96,7 +96,7 @@ def _count_revives(self): def poison_nova(self, time_in_s: float): if SkillName.PoisonNova not in hotkeys.right_skill_key_map: raise ValueError("You did not set poison nova hotkey!") - keyboard.send(hotkeys.right_skill_map[SkillName.PoisonNova]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.PoisonNova]) wait(0.05, 0.1) start = time.time() while (time.time() - start) < time_in_s: @@ -166,7 +166,7 @@ def _revive(self, cast_pos_abs: tuple[float, float], spray: int = 10, cast_count return keyboard.send(hotkeys.d2r_keymap[hotkeys.HotkeyName.StandStill], do_release=False) for _ in range(cast_count): - keyboard.send(hotkeys.right_skill_map[SkillName.Revive]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Revive]) #Logger.info("revive -> cast") x = cast_pos_abs[0] + (random.random() * 2*spray - spray) y = cast_pos_abs[1] + (random.random() * 2*spray - spray) @@ -196,7 +196,7 @@ def _raise_skeleton(self, cast_pos_abs: tuple[float, float], spray: int = 10, ca return keyboard.send(hotkeys.d2r_keymap[hotkeys.HotkeyName.StandStill], do_release=False) for _ in range(cast_count): - keyboard.send(hotkeys.right_skill_map[SkillName.RaiseSkeleton]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.RaiseSkeleton]) #Logger.info("raise skeleton -> cast") x = cast_pos_abs[0] + (random.random() * 2*spray - spray) y = cast_pos_abs[1] + (random.random() * 2*spray - spray) @@ -226,7 +226,7 @@ def _raise_mage(self, cast_pos_abs: tuple[float, float], spray: int = 10, cast_c return keyboard.send(hotkeys.d2r_keymap[hotkeys.HotkeyName.StandStill], do_release=False) for _ in range(cast_count): - keyboard.send(hotkeys.right_skill_map[SkillName.RaiseSkeletalMage]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.RaiseSkeletalMage]) #Logger.info("raise skeleton -> cast") x = cast_pos_abs[0] + (random.random() * 2*spray - spray) y = cast_pos_abs[1] + (random.random() * 2*spray - spray) @@ -263,14 +263,14 @@ def pre_buff(self): def _heart_of_wolverine(self): Logger.info('\033[94m'+"buff ~> heart_of_wolverine"+'\033[0m') - keyboard.send(hotkeys.right_skill_map[SkillName.HeartOfWolverine]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.HeartOfWolverine]) wait(0.05, 0.2) mouse.click(button="right") wait(self._cast_duration) def _clay_golem(self): Logger.info('\033[94m'+"cast ~> clay golem"+'\033[0m') - keyboard.send(hotkeys.right_skill_map[SkillName.ClayGolem]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.ClayGolem]) wait(0.05, 0.2) mouse.click(button="right") wait(self._cast_duration) @@ -278,19 +278,19 @@ def _clay_golem(self): def bone_armor(self): if SkillName.BoneArmor in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.BoneArmor]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.BoneArmor]) wait(0.04, 0.1) mouse.click(button="right") wait(self._cast_duration) if SkillName.ClayGolem in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.ClayGolem]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.ClayGolem]) wait(0.04, 0.1) mouse.click(button="right") wait(self._cast_duration) def _bone_armor(self): if SkillName.BoneArmor in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.BoneArmor]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.BoneArmor]) wait(0.04, 0.1) mouse.click(button="right") wait(self._cast_duration) @@ -330,7 +330,7 @@ def _left_attack_single(self, cast_pos_abs: tuple[float, float], spray: int = 10 def _amp_dmg(self, cast_pos_abs: tuple[float, float], spray: float = 10): if SkillName.AmplifyDamage not in hotkeys.right_skill_key_map: return - keyboard.send(hotkeys.right_skill_map[SkillName.AmplifyDamage]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.AmplifyDamage]) x = cast_pos_abs[0] + (random.random() * 2*spray - spray) y = cast_pos_abs[1] + (random.random() * 2*spray - spray) @@ -343,7 +343,7 @@ def _amp_dmg(self, cast_pos_abs: tuple[float, float], spray: float = 10): def _lower_res(self, cast_pos_abs: tuple[float, float], spray: float = 10): if SkillName.LowerResist not in hotkeys.right_skill_key_map: return - keyboard.send(hotkeys.right_skill_map[SkillName.LowerResist]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.LowerResist]) x = cast_pos_abs[0] + (random.random() * 2*spray - spray) y = cast_pos_abs[1] + (random.random() * 2*spray - spray) @@ -359,7 +359,7 @@ def _corpse_explosion(self, cast_pos_abs: tuple[float, float], spray: int = 10,c return Logger.info('\033[93m'+"corpse explosion~> random cast"+'\033[0m') for _ in range(cast_count): - keyboard.send(hotkeys.right_skill_map[SkillName.CorpseExplosion]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.CorpseExplosion]) x = cast_pos_abs[0] + (random.random() * 2*spray - spray) y = cast_pos_abs[1] + (random.random() * 2*spray - spray) cast_pos_monitor = screen.convert_abs_to_monitor((x, y)) diff --git a/src/char/sorceress/blizz_sorc.py b/src/char/sorceress/blizz_sorc.py index cbb4e3dbd..dcc9523c5 100644 --- a/src/char/sorceress/blizz_sorc.py +++ b/src/char/sorceress/blizz_sorc.py @@ -32,7 +32,7 @@ def __init__(self, *args, **kwargs): def _ice_blast(self, cast_pos_abs: tuple[float, float], delay: tuple[float, float] = (0.16, 0.23), spray: float = 10): keyboard.send(hotkeys.d2r_keymap[hotkeys.HotkeyName.StandStill], do_release=False) if SkillName.IceBlast in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.IceBlast]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.IceBlast]) for _ in range(5): x = cast_pos_abs[0] + (random.random() * 2*spray - spray) y = cast_pos_abs[1] + (random.random() * 2*spray - spray) diff --git a/src/char/sorceress/hydra_sorc.py b/src/char/sorceress/hydra_sorc.py index fcdd42dd5..29b89b398 100644 --- a/src/char/sorceress/hydra_sorc.py +++ b/src/char/sorceress/hydra_sorc.py @@ -40,7 +40,7 @@ def _hydra(self, cast_pos_abs: tuple[float, float], spray: float = 10): if self._hydra_time is None or time.time() - self._hydra_time > 10: if SkillName.Hydra not in hotkeys.right_skill_key_map: raise ValueError("You did not set a hotkey for hydra!") - keyboard.send(hotkeys.right_skill_map[SkillName.Hydra]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Hydra]) self._hydra_time = time.time() x = cast_pos_abs[0] + (random.random() * 2 * spray - spray) y = cast_pos_abs[1] + (random.random() * 2 * spray - spray) diff --git a/src/char/sorceress/light_sorc.py b/src/char/sorceress/light_sorc.py index a4596eedd..9a3411146 100644 --- a/src/char/sorceress/light_sorc.py +++ b/src/char/sorceress/light_sorc.py @@ -20,7 +20,7 @@ def __init__(self, *args, **kwargs): def _chain_lightning(self, cast_pos_abs: tuple[float, float], delay: tuple[float, float] = (0.2, 0.3), spray: int = 10): keyboard.send(hotkeys.d2r_keymap[hotkeys.HotkeyName.StandStill], do_release=False) if SkillName.ChainLightning in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.ChainLightning]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.ChainLightning]) for _ in range(4): x = cast_pos_abs[0] + (random.random() * 2 * spray - spray) y = cast_pos_abs[1] + (random.random() * 2 * spray - spray) @@ -34,7 +34,7 @@ def _chain_lightning(self, cast_pos_abs: tuple[float, float], delay: tuple[float def _lightning(self, cast_pos_abs: tuple[float, float], delay: tuple[float, float] = (0.2, 0.3), spray: float = 10): if SkillName.Lightning not in hotkeys.right_skill_key_map: raise ValueError("You did not set lightning hotkey!") - keyboard.send(hotkeys.right_skill_map[SkillName.Lightning]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Lightning]) for _ in range(3): x = cast_pos_abs[0] + (random.random() * 2 * spray - spray) y = cast_pos_abs[1] + (random.random() * 2 * spray - spray) @@ -46,7 +46,7 @@ def _lightning(self, cast_pos_abs: tuple[float, float], delay: tuple[float, floa def _frozen_orb(self, cast_pos_abs: tuple[float, float], delay: tuple[float, float] = (0.2, 0.3), spray: float = 10): if SkillName.FrozenOrb in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.FrozenOrb]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.FrozenOrb]) for _ in range(3): x = cast_pos_abs[0] + (random.random() * 2 * spray - spray) y = cast_pos_abs[1] + (random.random() * 2 * spray - spray) diff --git a/src/char/sorceress/nova_sorc.py b/src/char/sorceress/nova_sorc.py index 0579a9adc..3a9068d3c 100644 --- a/src/char/sorceress/nova_sorc.py +++ b/src/char/sorceress/nova_sorc.py @@ -22,7 +22,7 @@ def __init__(self, *args, **kwargs): def _nova(self, time_in_s: float): if SkillName.Nova in hotkeys.right_skill_key_map: raise ValueError("You did not set nova hotkey!") - keyboard.send(hotkeys.right_skill_map[SkillName.Nova]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Nova]) wait(0.05, 0.1) start = time.time() while (time.time() - start) < time_in_s: diff --git a/src/char/sorceress/sorceress.py b/src/char/sorceress/sorceress.py index 76e4de6f9..a182034c7 100644 --- a/src/char/sorceress/sorceress.py +++ b/src/char/sorceress/sorceress.py @@ -20,7 +20,7 @@ def __init__(self, skill_hotkeys: dict, pather: Pather): def pick_up_item(self, pos: tuple[float, float], item_name: str = None, prev_cast_start: float = 0): if SkillName.Telekinesis in hotkeys.right_skill_key_map and any(x in item_name for x in ['potion', 'misc_gold', 'tp_scroll']): - keyboard.send(hotkeys.right_skill_map[SkillName.Telekinesis]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Telekinesis]) wait(0.1, 0.2) mouse.move(pos[0], pos[1]) wait(0.1, 0.2) @@ -54,7 +54,7 @@ def select_by_template( while timeout is None or (time.time() - start) < timeout: template_match = template_finder.search(template_type, grab(), threshold=threshold) if template_match.valid: - keyboard.send(hotkeys.right_skill_map[SkillName.Telekinesis]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Telekinesis]) wait(0.1, 0.2) mouse.move(*template_match.center_monitor) wait(0.2, 0.3) @@ -71,24 +71,24 @@ def pre_buff(self): if Config().char["cta_available"]: self._pre_buff_cta() if SkillName.EnergyShield in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.EnergyShield]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.EnergyShield]) wait(0.1, 0.13) mouse.click(button="right") wait(self._cast_duration) if SkillName.ThunderStorm in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.ThunderStorm]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.ThunderStorm]) wait(0.1, 0.13) mouse.click(button="right") wait(self._cast_duration) if SkillName.FrozenArmor in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.FrozenArmor]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.FrozenArmor]) wait(0.1, 0.13) mouse.click(button="right") wait(self._cast_duration) def _cast_static(self, duration: float = 1.4): if SkillName.StaticField in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.StaticField]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.StaticField]) wait(0.1, 0.13) start = time.time() while time.time() - start < duration: diff --git a/src/char/trapsin.py b/src/char/trapsin.py index d76efb67f..bc89df2d7 100644 --- a/src/char/trapsin.py +++ b/src/char/trapsin.py @@ -23,17 +23,17 @@ def pre_buff(self): if Config().char["cta_available"]: self._pre_buff_cta() if SkillName.Fade in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.Fade]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.Fade]) wait(0.1, 0.13) mouse.click(button="right") wait(self._cast_duration) if SkillName.ShadowWarrior in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.ShadowWarrior]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.ShadowWarrior]) wait(0.1, 0.13) mouse.click(button="right") wait(self._cast_duration) if SkillName.BurstOfSpeed in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.BurstOfSpeed]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.BurstOfSpeed]) wait(0.1, 0.13) mouse.click(button="right") wait(self._cast_duration) @@ -54,7 +54,7 @@ def _left_attack(self, cast_pos_abs: tuple[float, float], spray: int = 10): def _right_attack(self, cast_pos_abs: tuple[float, float], spray: float = 10): - keyboard.send(hotkeys.right_skill_map[SkillName.LightningSentry]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.LightningSentry]) x = cast_pos_abs[0] + (random.random() * 2 * spray - spray) y = cast_pos_abs[1] + (random.random() * 2 * spray - spray) cast_pos_monitor = convert_abs_to_monitor((x, y)) @@ -66,7 +66,7 @@ def atk(num: int): mouse.release(button="right") wait(0.15) atk(4) - keyboard.send(hotkeys.right_skill_map[SkillName.DeathSentry]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.DeathSentry]) atk(1) def kill_pindle(self) -> bool: diff --git a/src/ui/skills.py b/src/ui/skills.py index cf3ccb761..80702d72f 100644 --- a/src/ui/skills.py +++ b/src/ui/skills.py @@ -217,7 +217,7 @@ def has_tps() -> bool: """ from utils import hotkeys if SkillName.TownPortal in hotkeys.right_skill_key_map: - keyboard.send(hotkeys.right_skill_map[SkillName.TownPortal]) + keyboard.send(hotkeys.right_skill_key_map[SkillName.TownPortal]) if not (tps_remain := wait_until_visible(ScreenObjects.TownPortalSkill, timeout=4).valid): Logger.warning("You are out of tps") if Config().general["info_screenshots"]: