Skip to content

Commit

Permalink
Nihlatak test (aeon0#312)
Browse files Browse the repository at this point in the history
* nihlatak eye at a robustness?

* revert stuff
  • Loading branch information
aeon0 authored Dec 21, 2021
1 parent 4a9f4e4 commit bf508d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/char/i_char.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,14 @@ def _pre_buff_cta(self):
wait(0.3, 0.35)
keyboard.send(self._char_config["battle_command"])
wait(0.1, 0.19)
mouse.click(button="right")
wait(self._cast_duration + 0.16, self._cast_duration + 0.18)
for _ in range(2):
mouse.click(button="right")
wait(self._cast_duration + 0.16, self._cast_duration + 0.18)
keyboard.send(self._char_config["battle_orders"])
wait(0.1, 0.19)
mouse.click(button="right")
wait(self._cast_duration + 0.16, self._cast_duration + 0.18)
for _ in range(2):
mouse.click(button="right")
wait(self._cast_duration + 0.16, self._cast_duration + 0.18)
keyboard.send(self._char_config["weapon_switch"])
wait(0.3, 0.35)
# Make sure that we are back at the previous skill
Expand Down
3 changes: 2 additions & 1 deletion src/run/nihlatak.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def battle(self, do_pre_buff: bool) -> Union[bool, tuple[Location, bool]]:
# Wait until templates in lvl 2 entrance are found
if not self._template_finder.search_and_wait(["NI2_SEARCH_0", "NI2_SEARCH_1", "NI2_SEARCH_2"], threshold=0.8, time_out=20).valid:
return False
wait(1.0) # wait to make sure the red writing is gone once we check for the eye
@dataclass
class EyeCheckData:
template_name: list[str]
Expand All @@ -79,7 +80,7 @@ class EyeCheckData:
# Move to spot where eye would be visible
self._pather.traverse_nodes_fixed(data.circle_static_path_key, self._char)
# Search for eye
template_match = self._template_finder.search_and_wait(data.template_name, threshold=0.72, best_match=True, time_out=3)
template_match = self._template_finder.search_and_wait(data.template_name, threshold=0.7, best_match=True, time_out=3)
# If it is found, move down that hallway
if template_match.valid and template_match.name.endswith("_SAFE_DIST"):
self._pather.traverse_nodes_fixed(data.destination_static_path_key, self._char)
Expand Down

0 comments on commit bf508d5

Please sign in to comment.