MCPcopy Create free account
hub / github.com/runhey/OnmyojiAutoScript / battle_wait

Method battle_wait

tasks/Tako/script_task.py:106–128  ·  view source on GitHub ↗
(self, random_click_swipt_enable: bool)

Source from the content-addressed store, hash-verified

104 raise TaskEnd('Tako')
105
106 def battle_wait(self, random_click_swipt_enable: bool) -> bool:
107 # 重写
108 self.device.stuck_record_add('BATTLE_STATUS_S')
109 self.device.click_record_clear()
110 # 战斗过程 随机点击和滑动 防封
111 logger.info("Start battle process")
112 while 1:
113 self.screenshot()
114 if self.appear(self.I_WIN) or self.appear(self.I_REWARD):
115 logger.info('Win battle')
116 self.ui_click_until_disappear(self.I_WIN)
117 while 1:
118 self.screenshot()
119 if self.appear(self.I_CHECK_MAIN) or self.appear(self.I_CHECK_TEAM):
120 break
121 if self.click(self.C_REWARD_2, interval=2):
122 continue
123 return True
124
125 if self.appear(self.I_FALSE):
126 logger.warning('False battle')
127 self.ui_click_until_disappear(self.I_FALSE)
128 return False
129
130if __name__ == '__main__':
131 from module.config.config import Config

Callers

nothing calls this directly

Calls 6

stuck_record_addMethod · 0.80
click_record_clearMethod · 0.80
appearMethod · 0.80
screenshotMethod · 0.45
clickMethod · 0.45

Tested by

no test coverage detected