| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- # 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 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
|