检查是否锁定阵容, 要求在八岐大蛇界面 :param lock: :return:
(self, lock: bool = True)
| 91 | return True |
| 92 | |
| 93 | def check_lock(self, lock: bool = True) -> bool: |
| 94 | """ |
| 95 | 检查是否锁定阵容, 要求在八岐大蛇界面 |
| 96 | :param lock: |
| 97 | :return: |
| 98 | """ |
| 99 | logger.info('Check lock: %s', lock) |
| 100 | if lock: |
| 101 | while 1: |
| 102 | self.screenshot() |
| 103 | if self.appear(self.I_OROCHI_LOCK): |
| 104 | return True |
| 105 | if self.appear_then_click(self.I_OROCHI_UNLOCK, interval=1): |
| 106 | continue |
| 107 | else: |
| 108 | while 1: |
| 109 | self.screenshot() |
| 110 | if self.appear(self.I_OROCHI_UNLOCK): |
| 111 | return True |
| 112 | if self.appear_then_click(self.I_OROCHI_LOCK, interval=1): |
| 113 | continue |
| 114 | |
| 115 | |
| 116 |