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

Method switch

tasks/ActivityShikigami/script_task.py:160–181  ·  view source on GitHub ↗

切换体力 :param current_ap: :return:

(self, current_ap: ApMode)

Source from the content-addressed store, hash-verified

158 return True
159
160 def switch(self, current_ap: ApMode) -> None:
161 """
162 切换体力
163 :param current_ap:
164 :return:
165 """
166 if current_ap == ApMode.AP_ACTIVITY:
167 logger.info("Select activity ap")
168 while 1:
169 self.screenshot()
170 if self.appear(self.I_AP_ACTIVITY):
171 break
172 if self.appear(self.I_AP, interval=1):
173 self.appear_then_click(self.I_SWITCH, interval=2) # 点击切换
174 else:
175 logger.info("Select game ap")
176 while 1:
177 self.screenshot()
178 if self.appear(self.I_AP):
179 break
180 if self.appear(self.I_AP_ACTIVITY, interval=1):
181 self.appear_then_click(self.I_SWITCH, interval=2)
182
183 # def battle_wait(self, random_click_swipt_enable: bool) -> bool:
184 # # 重写

Callers 1

runMethod · 0.95

Calls 3

appearMethod · 0.80
appear_then_clickMethod · 0.80
screenshotMethod · 0.45

Tested by

no test coverage detected