diff --git a/src/char/i_char.py b/src/char/i_char.py index bb8cee583..c58651232 100644 --- a/src/char/i_char.py +++ b/src/char/i_char.py @@ -118,7 +118,17 @@ def tp_town(self): wait(0.8, 1.3) # takes quite a while for tp to be visible roi = self._config.ui_roi["tp_search"] start = time.time() - while (time.time() - start) < 8: + retry_count = 0 + while (time.time() - start) < 8: + if time.time() - start > 3.7 and retry_count == 0: + retry_count += 1 + Logger.debug("Move to another position and try to open tp again") + pos_m = self._screen.convert_abs_to_monitor((random.randint(-70, 70), random.randint(-70, 70))) + self.pre_move() + self.move(pos_m) + if self._ui_manager.has_tps(): + mouse.click(button="right") + wait(0.8, 1.3) # takes quite a while for tp to be visible img = self._screen.grab() template_match = self._template_finder.search( ["BLUE_PORTAL","BLUE_PORTAL_2"],