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

Method run

tasks/Pets/script_task.py:14–35  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

12class ScriptTask(GameUi, PetsAssets):
13
14 def run(self):
15 self.ui_get_current_page()
16 self.ui_goto(page_main)
17 con: PetsConfig = self.config.pets.pets_config
18 # 进入
19 while 1:
20 self.screenshot()
21 if self.appear(self.I_PET_FEAST):
22 break
23 if self.appear_then_click(self.I_PET_HOUSE, interval=1):
24 continue
25 if self.appear_then_click(self.I_PET_CLAW, interval=1):
26 continue
27 logger.info('Enter Pets')
28 if con.pets_happy:
29 self._play()
30 if con.pets_feast:
31 self._feed()
32 self.ui_click(self.I_PET_EXIT, self.I_CHECK_MAIN)
33
34 self.set_next_run(task='Pets', success=True, finish=True)
35 raise TaskEnd('Pets')
36
37 def _feed(self):
38 """

Callers 1

script_task.pyFile · 0.45

Calls 10

_playMethod · 0.95
_feedMethod · 0.95
ui_clickMethod · 0.95
TaskEndClass · 0.90
ui_get_current_pageMethod · 0.80
ui_gotoMethod · 0.80
appearMethod · 0.80
appear_then_clickMethod · 0.80
set_next_runMethod · 0.80
screenshotMethod · 0.45

Tested by

no test coverage detected