actually use the do_chicken on chicken

This commit is contained in:
aeon0
2021-11-13 00:51:35 +01:00
parent abb4cfb97c
commit 65f74acba0
3 changed files with 8 additions and 7 deletions

View File

@@ -83,7 +83,7 @@ class HealthManager:
keyboard.release(self._config.char["stand_still"])
keyboard.release(self._config.char["show_items"])
time.sleep(0.01)
self._ui_manager.save_and_exit()
self._ui_manager.save_and_exit(does_chicken=True)
self._did_chicken = True
kill_thread(run_thread)
self._do_monitor = False

View File

@@ -183,11 +183,12 @@ class TemplateFinder:
success, pos = self.search(x, img, roi=roi, threshold=threshold)
if success:
break
if not is_loading_black_roi and success:
return True, pos
if time_out is not None and (time.time() - start) > time_out:
cv2.imwrite(f"info_wait_for_{ref}_time_out.png", img)
return False, None
if not is_loading_black_roi:
if success:
return True, pos
elif time_out is not None and (time.time() - start) > time_out:
cv2.imwrite(f"info_wait_for_{ref}_time_out.png", img)
return False, None
# Testing: Have whatever you want to find on the screen

View File

@@ -136,7 +136,7 @@ class UiManager():
keyboard.send("esc")
wait(0.1)
exit_btn_pos = (self._config.ui_pos["save_and_exit_x"], self._config.ui_pos["save_and_exit_y"])
x_m, y_m = self._screen.convert_screen_to_monitor(exit_btn_pos)
x_m, y_m = self._screen.convert_screen_to_monitor(exit_btn_pos)
away_x_m, away_y_m = self._screen.convert_screen_to_monitor((200, 450))
while self._template_finder.search_and_wait(["SAVE_AND_EXIT_NO_HIGHLIGHT","SAVE_AND_EXIT_HIGHLIGHT"], roi=self._config.ui_roi["save_and_exit"], time_out=1.5)[0]:
delay = [0.9, 1.1]