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

Method do_battle

tasks/Exploration/script_task.py:181–204  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

179
180 # 探索战斗流程
181 def do_battle(self):
182 while 1:
183 self.screenshot()
184 # 战后奖励
185 if self.appear(self.I_BATTLE_REWARD) and not self.appear(self.I_GET_REWARD):
186 self.click(self.I_BATTLE_REWARD)
187 # boss 战
188 if self.appear_then_click(self.I_BOSS_BATTLE_BUTTON):
189 if self.wait_until_appear(self.I_BATTLE_START, wait_time=5):
190 self.run_general_battle(self.config.exploration.general_battle_config)
191 else:
192 continue
193 # 小怪 战
194 if self.appear_then_click(self.I_NORMAL_BATTLE_BUTTON):
195 if self.wait_until_appear(self.I_BATTLE_START, wait_time=5):
196 self.run_general_battle(self.config.exploration.general_battle_config)
197 else:
198 continue
199 # 滑动
200 elif self.appear(self.I_E_AUTO_ROTATE_ON) or self.appear(self.I_GET_REWARD):
201 self.swipe(self.S_SWIPE_BACKGROUND_RIGHT)
202 # 结束流程
203 if self.appear(self.I_E_EXPLORATION_CLICK) or self.appear(self.I_EXPLORATION_TITLE):
204 break
205
206 # 战斗流程
207 def battle_process(self):

Callers 1

battle_processMethod · 0.95

Calls 7

appearMethod · 0.80
appear_then_clickMethod · 0.80
wait_until_appearMethod · 0.80
run_general_battleMethod · 0.80
screenshotMethod · 0.45
clickMethod · 0.45
swipeMethod · 0.45

Tested by

no test coverage detected