diff --git a/config/params.ini b/config/params.ini index 2a494e1..fc9f5e2 100644 --- a/config/params.ini +++ b/config/params.ini @@ -1,6 +1,6 @@ ; There is detailed documentation for each parameter in the README.md [general] -difficulty=normal +difficulty=hell name=bigfont randomize_runs=0 target_tz=1 @@ -20,7 +20,7 @@ max_runtime_before_break_m=0 ; timers / fail handling d2r_path=C:\Program Files (x86)\Diablo II Resurrected max_consecutive_fails=5 -max_game_length_s=200 +max_game_length_s=160 ; if you set this field to 1, botty will attempt to restart d2 after a crash or failure restart_d2r_when_stuck=0 @@ -40,18 +40,22 @@ pickit_screenshots=0 ; run_arcane ; run_diablo ; run_vizier -order=run_pindle +order=run_trav,run_eldritch [char] ; ========================== ; ==== Mandatory Fields ==== ; ========================== ; These configs have to be alligned with your d2r settings and char build -type=blizzorb_sorc +type=nova_sorc belt_rows=4 -casting_frames=10 +casting_frames=8 +cta_casting_frames=8 attack_frames=15 -cta_available=0 +cta_available=1 +;Do we want to cast non-cta buffs (ex energy shield) with cta +buff_with_cta=1 + ; safer_routines: enable for optional defensive maneuvers/etc during combat/runs at the cost of increased runtime (ex. hardcore players) safer_routines=1 @@ -87,9 +91,9 @@ use_merc=1 ; Attack length for barbarians should be as high as 8-10 and even 10-12 for trav/shenk atk_len_arc=2.5 -atk_len_eldritch=10.0 +atk_len_eldritch=3.0 atk_len_nihlathak=8.0 -atk_len_pindle=8.0 +atk_len_pindle=5.0 atk_len_shenk=8.0 atk_len_trav=3.0 @@ -110,14 +114,14 @@ belt_mp_columns=1 belt_rejuv_columns=2 ; Potion/chicken settings -take_health_potion=0.97 -take_mana_potion=0.5 +take_health_potion=0.90 +take_mana_potion=0.80 take_rejuv_potion_health=0.75 -take_rejuv_potion_mana=0.05 +take_rejuv_potion_mana=0.50 heal_merc=0.7 -heal_rejuv_merc=0.3 -chicken=0.5 -merc_chicken=0 +heal_rejuv_merc=0.25 +chicken=0.75 +merc_chicken=0.25 ; Misc. ; helps reduce accidental pickups when enabled especially on walking characters @@ -138,7 +142,7 @@ stash_destination=3,2,1,0 ; chipped, flawed, standard, flawless transmute=flawless ;how often we want to run transmute routine(e.g. every 100 games) -transmute_every_x_game=0 +transmute_every_x_game=200 ; =========================== ; ==== Builds: Sorceress ==== @@ -173,7 +177,7 @@ glacial_spike=f2 [nova_sorc] ; nova must be right skill, hotkey required -nova= +nova=f1 [hydra_sorc] ; only supports Pindle and Eldritch currently diff --git a/src/char/amazon/amazon.py b/src/char/amazon/amazon.py index 77865c8..3fd8426 100644 --- a/src/char/amazon/amazon.py +++ b/src/char/amazon/amazon.py @@ -17,11 +17,6 @@ class Amazon(IChar): super().__init__(skill_hotkeys) self._pather = pather - def pre_buff(self): - if Config().char["cta_available"]: - self._pre_buff_cta() - - def _cast_valkyrie(self, cast_pos_abs: tuple[float, float], spray: float = 10): if self._skill_hotkeys["valkyrie"]: keyboard.send(self._skill_hotkeys["valkyrie"]) diff --git a/src/char/barbarian.py b/src/char/barbarian.py index 4d13c08..3ccc14a 100644 --- a/src/char/barbarian.py +++ b/src/char/barbarian.py @@ -74,27 +74,27 @@ class Barbarian(IChar): mouse.click(button="right") wait(self._cast_duration + 0.02,self._cast_duration + 0.02) - def pre_buff(self): + def cast_buffs(self, casting_delay: float): if self._skill_hotkeys["howl"]: keyboard.send(self._skill_hotkeys["howl"]) wait(0.05,0.05) mouse.click(button="right") - wait(self._cast_duration + 0.02, self._cast_duration + 0.02) + wait(casting_delay + 0.02, casting_delay + 0.02) if Config().char["battle_command"]: keyboard.send(Config().char["battle_command"]) wait(0.05,0.05) mouse.click(button="right") - wait(self._cast_duration + 0.02, self._cast_duration + 0.02) + wait(casting_delay + 0.02, casting_delay + 0.02) if Config().char["battle_orders"]: keyboard.send(Config().char["battle_orders"]) wait(0.05,0.05) mouse.click(button="right") - wait(self._cast_duration + 0.02, self._cast_duration + 0.02) + wait(casting_delay + 0.02, casting_delay + 0.02) if self._skill_hotkeys["shout"]: keyboard.send(self._skill_hotkeys["shout"]) wait(0.05,0.05) mouse.click(button="right") - wait(self._cast_duration + 0.02, self._cast_duration + 0.02) + wait(casting_delay + 0.02, casting_delay + 0.02) def pre_move(self, wait_tp: bool = False): # select teleport if available diff --git a/src/char/basic.py b/src/char/basic.py index 6703094..4c0b15e 100644 --- a/src/char/basic.py +++ b/src/char/basic.py @@ -42,19 +42,17 @@ class Basic(IChar): wait(0.01, 0.05) keyboard.send(Config().char["stand_still"], do_press=False) - def pre_buff(self): - if Config().char["cta_available"]: - self._pre_buff_cta() + def cast_buffs(self, casting_delay: float): if self._skill_hotkeys["buff_1"]: keyboard.send(self._skill_hotkeys["buff_1"]) wait(0.5, 0.15) mouse.click(button="right") - wait(0.5, 0.15) + wait(casting_delay, casting_delay) if self._skill_hotkeys["buff_2"]: keyboard.send(self._skill_hotkeys["buff_2"]) wait(0.5, 0.15) mouse.click(button="right") - wait(0.5, 0.15) + wait(casting_delay, casting_delay) def pre_move(self): # select teleport if available diff --git a/src/char/basic_ranged.py b/src/char/basic_ranged.py index 50215ad..fb56928 100644 --- a/src/char/basic_ranged.py +++ b/src/char/basic_ranged.py @@ -42,19 +42,17 @@ class Basic_Ranged(IChar): mouse.move(*cast_pos_monitor) mouse.click(button="right") - def pre_buff(self): - if Config().char["cta_available"]: - self._pre_buff_cta() + def cast_buffs(self, casting_delay: float): if self._skill_hotkeys["buff_1"]: keyboard.send(self._skill_hotkeys["buff_1"]) wait(0.5, 0.15) mouse.click(button="right") - wait(0.5, 0.15) + wait(casting_delay, casting_delay) if self._skill_hotkeys["buff_2"]: keyboard.send(self._skill_hotkeys["buff_2"]) wait(0.5, 0.15) mouse.click(button="right") - wait(0.5, 0.15) + wait(casting_delay, casting_delay) #bosses diff --git a/src/char/bone_necro.py b/src/char/bone_necro.py index b45f97b..ed8b11a 100644 --- a/src/char/bone_necro.py +++ b/src/char/bone_necro.py @@ -44,12 +44,17 @@ class Bone_Necro(IChar): mouse.release(button="right") keyboard.send(Config().char["stand_still"], do_press=False) - def pre_buff(self): - self.bone_armor() - #only CTA if pre trav - if Config().char["cta_available"]: - self._pre_buff_cta() - Logger.info("prebuff/cta") + def cast_buffs(self, casting_delay: float): + if self._skill_hotkeys["bone_armor"]: + keyboard.send(self._skill_hotkeys["bone_armor"]) + wait(0.04, 0.1) + mouse.click(button="right") + wait(casting_delay) + if self._skill_hotkeys["clay_golem"]: + keyboard.send(self._skill_hotkeys["clay_golem"]) + wait(0.04, 0.1) + mouse.click(button="right") + wait(casting_delay) def _clay_golem(self): Logger.debug('Casting clay golem') @@ -58,18 +63,6 @@ class Bone_Necro(IChar): mouse.click(button="right") wait(self._cast_duration) - def bone_armor(self): - if self._skill_hotkeys["bone_armor"]: - keyboard.send(self._skill_hotkeys["bone_armor"]) - wait(0.04, 0.1) - mouse.click(button="right") - wait(self._cast_duration) - if self._skill_hotkeys["clay_golem"]: - keyboard.send(self._skill_hotkeys["clay_golem"]) - wait(0.04, 0.1) - mouse.click(button="right") - wait(self._cast_duration) - def _bone_armor(self): if self._skill_hotkeys["bone_armor"]: keyboard.send(self._skill_hotkeys["bone_armor"]) diff --git a/src/char/i_char.py b/src/char/i_char.py index be43ec4..6db4633 100644 --- a/src/char/i_char.py +++ b/src/char/i_char.py @@ -26,6 +26,7 @@ class IChar: self._stationary = False #Are we guaranteed stationary while picking up items # Add a bit to be on the save side self._cast_duration = Config().char["casting_frames"] * 0.04 + 0.01 + self._cta_cast_duration = Config().char["cta_casting_frames"] * 0.04 + 0.01 self._attack_duration = Config().char["attack_frames"] * 0.04 + 0.01 self.damage_scaling = float(Config().char.get("damage_scaling", 1.0)) self.capabilities = None @@ -320,28 +321,33 @@ class IChar: skill_before = cut_roi(grab(), Config().ui_roi["skill_right"]) if not switch_sucess: - Logger.warning("You dont have Battle Command bound, or you do not have CTA. ending CTA buff") - Config().char["cta_available"] = 0 + Logger.error("You dont have Battle Command bound, or you do not have CTA. Ending CTA buff") + return False else: # We switched succesfully, let's pre buff mouse.click(button="right") - wait(self._cast_duration + 0.16, self._cast_duration + 0.18) + wait(self._cta_cast_duration, self._cta_cast_duration) self._select_skill(skill = "battle_orders", mouse_click_type="right", delay=(0.1, 0.2)) mouse.click(button="right") - wait(self._cast_duration + 0.16, self._cast_duration + 0.18) + wait(self._cta_cast_duration, self._cta_cast_duration) + if Config().char["buff_with_cta"]: + self.cast_buffs(self._cta_cast_duration) # Make sure the switch back to the original weapon is good start = time.time() + switch_sucess = False while time.time() - start < 4: keyboard.send(Config().char["weapon_switch"]) wait(0.3, 0.35) skill_after = cut_roi(grab(), Config().ui_roi["skill_right"]) _, max_val, _, _ = cv2.minMaxLoc(cv2.matchTemplate(skill_after, skill_before, cv2.TM_CCOEFF_NORMED)) if max_val > 0.9: + switch_sucess = True break else: Logger.warning("Failed to switch weapon, try again") wait(0.5) + return switch_sucess def vec_to_monitor(self, target): @@ -383,6 +389,15 @@ class IChar: def pre_buff(self): + if Config().char["cta_available"]: + if not self._pre_buff_cta(): + return False + #If we are not buffing with CTA, we buff now that we swapped cta out + if not Config().char["buff_with_cta"]: + self.cast_buffs(self._cast_duration) + return True + + def cast_buffs(self, casting_delay: float): pass def kill_pindle(self) -> bool: diff --git a/src/char/necro.py b/src/char/necro.py index 02535d7..17f5233 100644 --- a/src/char/necro.py +++ b/src/char/necro.py @@ -238,10 +238,7 @@ class Necro(IChar): keyboard.send(Config().char["stand_still"], do_press=False) - def pre_buff(self): - #only CTA if pre trav - if Config().char["cta_available"]: - self._pre_buff_cta() + def cast_buffs(self, casting_delay: float): if self._shenk_dead==1: Logger.info("trav buff?") #self._heart_of_wolverine() diff --git a/src/char/paladin/hammerdin.py b/src/char/paladin/hammerdin.py index 68be88c..9aeb8a7 100644 --- a/src/char/paladin/hammerdin.py +++ b/src/char/paladin/hammerdin.py @@ -40,13 +40,11 @@ class Hammerdin(Paladin): wait(0.01, 0.05) keyboard.send(Config().char["stand_still"], do_press=False) - def pre_buff(self): - if Config().char["cta_available"]: - self._pre_buff_cta() + def cast_buffs(self, casting_delay: float): keyboard.send(self._skill_hotkeys["holy_shield"]) wait(0.04, 0.1) mouse.click(button="right") - wait(self._cast_duration, self._cast_duration + 0.06) + wait(casting_delay, casting_delay + 0.06) def pre_move(self, wait_tp: bool = False): # select teleport if available diff --git a/src/char/paladin/paladin.py b/src/char/paladin/paladin.py index cbf10b4..653d30f 100644 --- a/src/char/paladin/paladin.py +++ b/src/char/paladin/paladin.py @@ -29,13 +29,11 @@ class Paladin(IChar): elif Config().char["casting_frames"] == 9: self._action_frame = 6 - def pre_buff(self): - if Config().char["cta_available"]: - self._pre_buff_cta() + def cast_buffs(self, casting_delay: float): keyboard.send(self._skill_hotkeys["holy_shield"]) wait(0.04, 0.1) mouse.click(button="right") - wait(self._cast_duration, self._cast_duration + 0.06) + wait(casting_delay, casting_delay + 0.06) def pre_move(self, wait_tp: bool = False): # select teleport if available diff --git a/src/char/poison_necro.py b/src/char/poison_necro.py index 72ae64c..b262a81 100644 --- a/src/char/poison_necro.py +++ b/src/char/poison_necro.py @@ -246,10 +246,7 @@ class Poison_Necro(IChar): keyboard.send(Config().char["stand_still"], do_press=False) - def pre_buff(self): - #only CTA if pre trav - if Config().char["cta_available"]: - self._pre_buff_cta() + def cast_buffs(self, casting_delay: float): if self._shenk_dead==1: Logger.info("trav buff?") #self._heart_of_wolverine() diff --git a/src/char/sorceress/sorceress.py b/src/char/sorceress/sorceress.py index e389f22..fe3d8e4 100644 --- a/src/char/sorceress/sorceress.py +++ b/src/char/sorceress/sorceress.py @@ -69,24 +69,22 @@ class Sorceress(IChar): # In case telekinesis fails, try again with the base implementation return super().select_by_template(template_type, success_func, timeout, threshold) - def pre_buff(self): - if Config().char["cta_available"]: - self._pre_buff_cta() + def cast_buffs(self, casting_delay: float): if self._skill_hotkeys["energy_shield"]: keyboard.send(self._skill_hotkeys["energy_shield"]) wait(0.1, 0.13) mouse.click(button="right") - wait(self._cast_duration) + wait(casting_delay) if self._skill_hotkeys["thunder_storm"]: keyboard.send(self._skill_hotkeys["thunder_storm"]) wait(0.1, 0.13) mouse.click(button="right") - wait(self._cast_duration) + wait(casting_delay) if self._skill_hotkeys["frozen_armor"]: keyboard.send(self._skill_hotkeys["frozen_armor"]) wait(0.1, 0.13) mouse.click(button="right") - wait(self._cast_duration) + wait(casting_delay) def _cast_static(self, duration: float = 1.4): if self._skill_hotkeys["static_field"]: diff --git a/src/char/trapsin.py b/src/char/trapsin.py index fa93f76..cd05991 100644 --- a/src/char/trapsin.py +++ b/src/char/trapsin.py @@ -19,14 +19,12 @@ class Trapsin(IChar): super().__init__(skill_hotkeys) self._pather = pather - def pre_buff(self): - if Config().char["cta_available"]: - self._pre_buff_cta() + def cast_buffs(self, casting_delay: float): if self._skill_hotkeys["fade"]: keyboard.send(self._skill_hotkeys["fade"]) wait(0.1, 0.13) mouse.click(button="right") - wait(self._cast_duration) + wait(casting_delay) def pre_move(self, wait_tp: bool = False): super().pre_move(wait_tp=wait_tp) diff --git a/src/char/warlock/echo_lock.py b/src/char/warlock/echo_lock.py index 87165fa..2a03c33 100644 --- a/src/char/warlock/echo_lock.py +++ b/src/char/warlock/echo_lock.py @@ -19,16 +19,16 @@ class EchoLock(Warlock): Logger.info("Setting up EchoLock") super().__init__(*args, **kwargs) - def pre_buff(self): - super().pre_buff() + def cast_buffs(self, casting_delay: float): + super().cast_buffs(casting_delay) if self._skill_hotkeys["hex_bane"]: keyboard.send(self._skill_hotkeys["hex_bane"]) mouse.click(button="right") - wait(self._cast_duration) + wait(casting_delay) if self._skill_hotkeys["eldritch_blast"]: keyboard.send(self._skill_hotkeys["eldritch_blast"]) mouse.click(button="right") - wait(self._cast_duration) + wait(casting_delay) def _cast_echo_blast(self): n_move = (0, -10) diff --git a/src/char/warlock/warlock.py b/src/char/warlock/warlock.py index 5e2ac20..943ddf6 100644 --- a/src/char/warlock/warlock.py +++ b/src/char/warlock/warlock.py @@ -30,28 +30,22 @@ class Warlock(IChar): elif Config().char["casting_frames"] == 9: self._action_frame = 5 - def pre_buff(self): - n_move = (0, -10) - pos_n = convert_abs_to_monitor(n_move) - mouse.move(*pos_n) - if Config().char["cta_available"]: - self._pre_buff_cta() - + def cast_buffs(self, casting_delay: float): if self._skill_hotkeys["psychic_ward"]: keyboard.send(self._skill_hotkeys["psychic_ward"]) wait(0.04) mouse.click(button="right") - wait(self._cast_duration) + wait(casting_delay) if self._skill_hotkeys["summon_demon"]: keyboard.send(self._skill_hotkeys["summon_demon"]) wait(0.04) mouse.click(button="right") - wait(self._cast_duration) + wait(casting_delay) if self._skill_hotkeys["summon_demon2"]: keyboard.send(self._skill_hotkeys["summon_demon2"]) wait(0.04) mouse.click(button="right") - wait(self._cast_duration) + wait(casting_delay) def _cast_deathmark(self, cast_pos_abs: tuple[float, float]): if self._skill_hotkeys["deathmark"]: diff --git a/src/config.py b/src/config.py index 440b185..dbe203d 100644 --- a/src/config.py +++ b/src/config.py @@ -191,10 +191,12 @@ class Config: "fill_shared_stash_first": bool(int(self._select_val("char", "fill_shared_stash_first"))), "pre_buff_every_run": bool(int(self._select_val("char", "pre_buff_every_run"))), "cta_available": bool(int(self._select_val("char", "cta_available"))), + "buff_with_cta": bool(int(self._select_val("char", "buff_with_cta"))), "weapon_switch": self._select_val("char", "weapon_switch"), "battle_orders": self._select_val("char", "battle_orders"), "battle_command": self._select_val("char", "battle_command"), "casting_frames": int(self._select_val("char", "casting_frames")), + "cta_casting_frames": int(self._select_val("char", "cta_casting_frames")), "attack_frames": int(self._select_val("char", "attack_frames")), "atk_len_arc": float(self._select_val("char", "atk_len_arc")), "atk_len_trav": float(self._select_val("char", "atk_len_trav")), diff --git a/src/run/arcane.py b/src/run/arcane.py index d9403b8..fd2634e 100644 --- a/src/run/arcane.py +++ b/src/run/arcane.py @@ -81,7 +81,8 @@ class Arcane: for i, data in enumerate(path_arr): set_pause_state(False) if do_pre_buff: - self._char.pre_buff() + if not self._char.pre_buff(): + return False # calibrating at start and moving towards the end of the arm self._pather.traverse_nodes([data.calib_node_start], self._char, force_tp=True) if not self._pather.traverse_nodes_fixed(data.static_path_forward, self._char): diff --git a/src/run/diablo.py b/src/run/diablo.py index 5fabe69..2488fb9 100644 --- a/src/run/diablo.py +++ b/src/run/diablo.py @@ -451,7 +451,9 @@ class Diablo: def battle(self, do_pre_buff: bool) -> bool | tuple[Location, bool]: self._picked_up_items = False self.used_tps = 0 - if do_pre_buff: self._char.pre_buff() + if do_pre_buff: + if not self._char.pre_buff(): + return False #Clear Trash in CS @@ -471,21 +473,27 @@ class Diablo: if Config().char["kill_cs_trash"]: self._char.kill_cs_trash("pent_before_a") if not self._pather.traverse_nodes([602], self._char): return False if Config().char["cs_town_visits"]: self._cs_town_visit("A") - if Config().char["kill_cs_trash"] and do_pre_buff: self._char.pre_buff() + if Config().char["kill_cs_trash"] and do_pre_buff: + if not self._char.pre_buff(): + return False if not self._layoutcheck("A", "Vizier", "dia_a_layout", "layoutcheck_a", [610620], 0.81 , None, ["DIA_A2Y_LAYOUTCHECK0", "DIA_A2Y_LAYOUTCHECK1", "DIA_A2Y_LAYOUTCHECK2", "DIA_A2Y_LAYOUTCHECK4", "DIA_A2Y_LAYOUTCHECK5", "DIA_A2Y_LAYOUTCHECK6"], ["DIA_A1L_LAYOUTCHECK0", "DIA_A1L_LAYOUTCHECK4", "DIA_A1L_LAYOUTCHECK4LEFT", "DIA_A1L_LAYOUTCHECK1", "DIA_A1L_LAYOUTCHECK2", "DIA_A1L_LAYOUTCHECK3","DIA_A1L_LAYOUTCHECK4RIGHT","DIA_A1L_LAYOUTCHECK5"]): return False # Maintenance at Pentagram after Trash & clear Seal B: DeSeis (to the top) self._char.kill_cs_trash("pent_before_b") if not self._pather.traverse_nodes([602] , self._char): return False if Config().char["cs_town_visits"]: self._cs_town_visit("B") - if do_pre_buff: self._char.pre_buff() + if do_pre_buff: + if not self._char.pre_buff(): + return False if not self._layoutcheck("B", "De Seis", "dia_b_layout_bold", "layoutcheck_b", None, 0.78, [647], ["DIA_B1S_BOSS_CLOSED_LAYOUTCHECK1", "DIA_B1S_BOSS_CLOSED_LAYOUTCHECK2", "DIA_B1S_BOSS_CLOSED_LAYOUTCHECK3", "DIA_B1S_BOSS_CLOSED_LAYOUTCHECK4", "DIA_B1S_BOSS_CLOSED_LAYOUTCHECK5", "DIA_B1S_BOSS_CLOSED_LAYOUTCHECK6", "DIA_B1S_BOSS_CLOSED_LAYOUTCHECK7", "DIA_B1S_BOSS_CLOSED_LAYOUTCHECK8"],["DIA_B2U_LAYOUTCHECK2", "DIA_B2U_LAYOUTCHECK1", "DIA_B2U_LAYOUTCHECK2SMALL","DIA_B2U_LAYOUTCHECK3", "DIA_B2U_LAYOUTCHECK4", "DIA_B2U_LAYOUTCHECK5","DIA_B2U_LAYOUTCHECK6","DIA_B2U_LAYOUTCHECK7","DIA_B2U_LAYOUTCHECK8","DIA_B2U_LAYOUTCHECK9"]): return False # Maintenance at Pentagram after Trash & clear Seal C: Infector (to the right) self._char.kill_cs_trash("pent_before_c") if not self._pather.traverse_nodes([602], self._char): return False if Config().char["cs_town_visits"]: self._cs_town_visit("C") - if do_pre_buff: self._char.pre_buff() + if do_pre_buff: + if not self._char.pre_buff(): + return False if not self._layoutcheck("C", "Infector", "dia_c_layout_bold", "layoutcheck_c", [650660], 0.83, None, ["DIA_C2G_BOSS_CLOSED_LAYOUTCHECK1", "DIA_C2G_BOSS_CLOSED_LAYOUTCHECK4", "DIA_C2G_BOSS_CLOSED_LAYOUTCHECK5", "DIA_C2G_BOSS_CLOSED_LAYOUTCHECK2", "DIA_C2G_BOSS_CLOSED_LAYOUTCHECK3",], ["DIA_C1F_LAYOUTCHECK1", "DIA_C1F_LAYOUTCHECK2", "DIA_C1F_LAYOUTCHECK3"]): return False Logger.info("Waiting for Diablo to spawn") if not self._pather.traverse_nodes([602], self._char): return False diff --git a/src/run/nihlathak.py b/src/run/nihlathak.py index fc2f1d3..1347a6a 100644 --- a/src/run/nihlathak.py +++ b/src/run/nihlathak.py @@ -47,7 +47,8 @@ class Nihlathak: if not template_match.valid: return False if do_pre_buff: - self._char.pre_buff() + if not self._char.pre_buff(): + return False # Depending on what template is found we do static pathing to the stairs on level1. # Its xpects that the static routes defined in game.ini are named: "ni1_a", "ni1_b", "ni1_c" diff --git a/src/run/pindle.py b/src/run/pindle.py index 5eb6d07..e946a46 100644 --- a/src/run/pindle.py +++ b/src/run/pindle.py @@ -44,7 +44,8 @@ class Pindle: if not template_finder.search_and_wait(["PINDLE_0", "PINDLE_1"], threshold=0.65, timeout=20).valid: return False if do_pre_buff: - self._char.pre_buff() + if not self._char.pre_buff(): + return False # move to pindle if self._char.capabilities.can_teleport_natively: self._pather.traverse_nodes_fixed("pindle_safe_dist", self._char) diff --git a/src/run/shenk_eld.py b/src/run/shenk_eld.py index 612451a..6946339 100644 --- a/src/run/shenk_eld.py +++ b/src/run/shenk_eld.py @@ -41,7 +41,8 @@ class ShenkEld: if not template_finder.search_and_wait(["ELDRITCH_0", "ELDRITCH_0_V2", "ELDRITCH_0_V3", "ELDRITCH_START", "ELDRITCH_START_V2"], threshold=0.65, timeout=20).valid: return False if do_pre_buff: - self._char.pre_buff() + if not self._char.pre_buff(): + return False if self._char.capabilities.can_teleport_natively: self._pather.traverse_nodes_fixed("eldritch_safe_dist", self._char) else: diff --git a/src/run/trav.py b/src/run/trav.py index 7b1babd..9616d6e 100644 --- a/src/run/trav.py +++ b/src/run/trav.py @@ -41,7 +41,8 @@ class Trav: if not template_finder.search_and_wait(["TRAV_0", "TRAV_1", "TRAV_20"], threshold=0.65, timeout=20).valid: return False if do_pre_buff: - self._char.pre_buff() + if not self._char.pre_buff(): + return False if self._char.capabilities.can_teleport_natively: self._pather.traverse_nodes_fixed("trav_safe_dist", self._char) self._pather.traverse_nodes([226], self._char, timeout=2.2, do_pre_move=False, force_tp=True, use_tp_charge=True) diff --git a/src/run/vizier.py b/src/run/vizier.py index 7307a0b..3329a0c 100644 --- a/src/run/vizier.py +++ b/src/run/vizier.py @@ -300,7 +300,9 @@ class Vizier: def battle(self, do_pre_buff: bool) -> bool | tuple[Location, bool]: self._picked_up_items = False self.used_tps = 0 - if do_pre_buff: self._char.pre_buff() + if do_pre_buff: + if not self._char.pre_buff(): + return False #Skip to pentagram ignoring trash at enterance until clearing enterance can be made more reliable if not self._river_of_flames(): return False @@ -314,7 +316,9 @@ class Vizier: # After clearing trash around pentagram, attack and recalibrate at pentagram node and finally rebuff. if Config().char["kill_cs_trash"]: self._char.kill_cs_trash("pent_before_a") if not self._pather.traverse_nodes([602], self._char): return False - if Config().char["kill_cs_trash"] and do_pre_buff: self._char.pre_buff() + if Config().char["kill_cs_trash"] and do_pre_buff: + if not self._char.pre_buff(): + return False #Perform layout check and clear Vizier seal if not self._layoutcheck("A", "Vizier", "dia_a_layout", "layoutcheck_a", [610620], 0.81 , None, ["DIA_A2Y_LAYOUTCHECK0", "DIA_A2Y_LAYOUTCHECK1", "DIA_A2Y_LAYOUTCHECK2", "DIA_A2Y_LAYOUTCHECK4", "DIA_A2Y_LAYOUTCHECK5", "DIA_A2Y_LAYOUTCHECK6"], ["DIA_A1L_LAYOUTCHECK0", "DIA_A1L_LAYOUTCHECK4", "DIA_A1L_LAYOUTCHECK4LEFT", "DIA_A1L_LAYOUTCHECK1", "DIA_A1L_LAYOUTCHECK2", "DIA_A1L_LAYOUTCHECK3","DIA_A1L_LAYOUTCHECK4RIGHT","DIA_A1L_LAYOUTCHECK5"]): return False