Enhancement: Reposition teleport and rename tp to town_portal in params

This commit is contained in:
mgleed
2022-06-13 13:46:19 -04:00
committed by GitHub
parent 237dfd6f34
commit 0fcddd2aed
5 changed files with 22 additions and 26 deletions
+2 -2
View File
@@ -269,9 +269,9 @@ class Bot:
belt.fill_up_belt_from_inventory(Config().char["num_loot_columns"])
self._char.discover_capabilities()
if corpse_present and self._char.capabilities.can_teleport_with_charges and not self._char.select_tp():
keybind = self._char._skill_hotkeys["teleport"]
keybind = Config().char["teleport"]
Logger.info(f"Teleport keybind is lost upon death. Rebinding teleport to '{keybind}'")
self._char.remap_right_skill_hotkey("TELE_ACTIVE", self._char._skill_hotkeys["teleport"])
self._char.remap_right_skill_hotkey("TELE_ACTIVE", Config().char["teleport"])
# Check for the current game ip and pause if we are able to obtain the hot ip
if Config().dclone["region_ips"] != "" and Config().dclone["dclone_hotip"] != "":
+3 -3
View File
@@ -62,7 +62,7 @@ class IChar:
def _discover_capabilities(self) -> CharacterCapabilities:
override = Config().advanced_options["override_capabilities"]
if override is None:
if self._skill_hotkeys["teleport"]:
if Config().char["teleport"]:
if self.select_tp():
if self.skill_is_charged():
return CharacterCapabilities(can_teleport_natively=False, can_teleport_with_charges=True)
@@ -171,7 +171,7 @@ class IChar:
return self._remap_skill_hotkey(skill_asset, hotkey, Config().ui_roi["skill_right"], Config().ui_roi["skill_right_expanded"])
def select_tp(self):
return skills.select_tp(self._skill_hotkeys["teleport"])
return skills.select_tp(Config().char["teleport"])
def pre_move(self):
# if teleport hotkey is set and if teleport is not already selected
@@ -181,7 +181,7 @@ class IChar:
def move(self, pos_monitor: tuple[float, float], force_tp: bool = False, force_move: bool = False):
factor = Config().advanced_options["pathing_delay_factor"]
if "teleport" in self._skill_hotkeys and self._skill_hotkeys["teleport"] and (
if "teleport" in Config().char and Config().char["teleport"] and (
force_tp
or (
skills.is_right_skill_selected(["TELE_ACTIVE"])
+2 -1
View File
@@ -256,6 +256,7 @@ class Config:
"type": self._select_val("char", "type"),
"show_items": self._select_val("char", "show_items"),
"inventory_screen": self._select_val("char", "inventory_screen"),
"teleport": self._select_val("char", "teleport"),
"stand_still": self._select_val("char", "stand_still"),
"force_move": self._select_val("char", "force_move"),
"num_loot_columns": int(self._select_val("char", "num_loot_columns")),
@@ -267,7 +268,7 @@ class Config:
"heal_rejuv_merc": float(self._select_val("char", "heal_rejuv_merc")),
"chicken": float(self._select_val("char", "chicken")),
"merc_chicken": float(self._select_val("char", "merc_chicken")),
"tp": self._select_val("char", "tp"),
"town_portal": self._select_val("char", "town_portal"),
"belt_rows": int(self._select_val("char", "belt_rows")),
"show_belt": self._select_val("char", "show_belt"),
"potion1": self._select_val("char", "potion1"),
+2 -2
View File
@@ -23,8 +23,8 @@ def has_tps() -> bool:
"""
:return: Returns True if botty has town portals available. False otherwise
"""
if Config().char["tp"]:
keyboard.send(Config().char["tp"])
if Config().char["town_portal"]:
keyboard.send(Config().char["town_portal"])
if not (tps_remain := wait_until_visible(ScreenObjects.TownPortalSkill, timeout=4).valid):
Logger.warning("You are out of tps")
if Config().general["info_screenshots"]: