| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- # This Python file uses the following encoding: utf-8
- # @author runhey
- # github https://github.com/runhey
- import time
- from tasks.GameUi.assets import GameUiAssets
- from tasks.base_task import BaseTask
- from tasks.GeneralBattle.general_battle import GeneralBattle
- from tasks.AreaBoss.assets import AreaBossAssets
- from module.logger import logger
- class GameUi(BaseTask, GameUiAssets):
- def home_explore(self) -> bool:
- """
- 使用ocr识别到探索按钮并点击
- :return:
- """
- while 1:
- self.screenshot()
- if self.ocr_appear_click(self.O_HOME_EXPLORE, interval=2):
- continue
- if self.appear(self.I_BACK_BLUE, threshold=0.6):
- break
- logger.info(f'Click {self.O_HOME_EXPLORE.name}')
- return True
- def explore_home(self) -> bool:
- """
- :return:
- """
- while 1:
- self.screenshot()
- if self.appear_then_click(self.I_BACK_BLUE, threshold=0.6, interval=2):
- continue
- if self.appear(self.I_HOME_SHIKIKAMI, threshold=0.6):
- break
- logger.info(f'Click {self.I_HOME_SHIKIKAMI.name}')
- return True
|