initial telekinesis

This commit is contained in:
mgleed
2021-11-24 15:33:22 -05:00
parent 918ccc4f4e
commit bc8aea48a8
5 changed files with 31 additions and 16 deletions
+1
View File
@@ -16,6 +16,7 @@ botty_v*/
custom.ini
*info_*.png
.vscode
.vs/
info_screenshots/
loot_screenshots/
.venv
+1
View File
@@ -66,6 +66,7 @@ skill_right=f3
frozen_armor=
energy_shield=
thunder_storm=
telekinesis=
[hammerdin]
teleport=f1
+16 -10
View File
@@ -30,6 +30,12 @@ class IChar:
# It actually is 0.04s per frame but many people have issues with it (because of lag?)
self._cast_duration = self._char_config["casting_frames"] * 0.05 + 0.04
def pick_up_item(self, pos: Tuple[float, float], item_name: str = ''):
mouse.move(pos[0], pos[1])
time.sleep(0.1)
mouse.click(button="left")
time.sleep(0.2)
def select_by_template(self, template_type: Union[str, List[str]], expect_loading_screen: bool = False) -> bool:
if template_type == "A5_STASH":
# sometimes waypoint is opened and stash not found because of that, check for that
@@ -98,17 +104,17 @@ class IChar:
while (time.time() - start) < 8:
img = self._screen.grab()
success1, pos1 = self._template_finder.search(
"BLUE_PORTAL",
img,
threshold=0.66,
roi=roi,
"BLUE_PORTAL",
img,
threshold=0.66,
roi=roi,
normalize_monitor=True
)
success2, pos2 = self._template_finder.search(
"BLUE_PORTAL_2",
img,
threshold=0.7,
roi=roi,
"BLUE_PORTAL_2",
img,
threshold=0.7,
roi=roi,
normalize_monitor=True
)
if success1 or success2:
@@ -161,11 +167,11 @@ class IChar:
@abstract
def kill_pindle(self) -> bool:
pass
@abstract
def kill_shenk(self) -> bool:
pass
@abstract
def kill_eldritch(self) -> bool:
pass
+10
View File
@@ -19,6 +19,16 @@ class Sorceress(IChar):
super().__init__(skill_hotkeys, char_config, screen, template_finder, ui_manager)
self._pather = pather
def pick_up_item(self, pos: Tuple[float, float], item_name: str = ''):
if self._skill_hotkeys["telekinesis"] and any(x in item_name for x in ['potion', 'misc_gold']):
keyboard.send(self._skill_hotkeys["telekinesis"])
wait(0.1, 0.13)
mouse.move(pos[0], pos[1])
wait(0.1, 0.13)
mouse.click(button="right")
else:
super().pick_up_item((pos[0], pos[1]),item_name)
def pre_buff(self):
if self._char_config["cta_available"]:
self._pre_buff_cta()
+3 -6
View File
@@ -68,14 +68,11 @@ class PickIt:
# if potion is picked up, record it in the belt manager
if "potion" in closest_item.name:
self._belt_manager.picked_up_pot(closest_item.name)
# no need to stash potions, scrolls, or gold
# no need to stash potions, scrolls, or gold
if "potion" not in closest_item.name and "tp_scroll" != closest_item.name and "misc_gold" not in closest_item.name:
found_items = True
Logger.info(f"Picking up: {closest_item.name}")
mouse.move(x_m, y_m)
time.sleep(0.1)
mouse.click(button="left")
time.sleep(0.5)
Logger.info(f"Picking up: {closest_item.name}, score: {closest_item.score}")
char.pick_up_item((x_m, y_m),item_name=closest_item.name)
if self._ui_manager.is_overburdened():
Logger.warning("Inventory full, skipping pickit!")