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

Method run

tasks/EvoZone/script_task.py:20–55  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

18class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi, EvoZoneAssets):
19
20 def run(self) -> bool:
21
22 limit_count = self.config.evo_zone.evo_zone_config.limit_count
23 limit_time = self.config.evo_zone.evo_zone_config.limit_time
24 self.current_count = 0
25 self.limit_count: int = limit_count
26 self.limit_time: timedelta = timedelta(hours=limit_time.hour, minutes=limit_time.minute, seconds=limit_time.second)
27
28 self.ui_get_current_page()
29 self.ui_goto(page_main)
30 config: EvoZone = self.config.evo_zone
31 if config.evo_zone_config.soul_buff_enable:
32 self.open_buff()
33 self.awake(is_open=True)
34 self.close_buff()
35
36 success = True
37 match config.evo_zone_config.user_status:
38 case UserStatus.LEADER: success = self.run_leader()
39 case UserStatus.MEMBER: success = self.run_member()
40 case UserStatus.ALONE: self.run_alone()
41 case UserStatus.WILD: self.run_wild()
42 case _: logger.error('Unknown user status')
43
44 # 记得关掉
45 if config.evo_zone_config.soul_buff_enable:
46 self.open_buff()
47 self.awake(is_open=False)
48 self.close_buff()
49 # 下一次运行时间
50 if success:
51 self.set_next_run('EvoZone', finish=True, success=True)
52 else:
53 self.set_next_run('EvoZone', finish=False, success=False)
54
55 raise TaskEnd
56
57 def evozone_enter(self) -> bool:
58 logger.info('Enter evozone')

Callers

nothing calls this directly

Calls 10

run_leaderMethod · 0.95
run_memberMethod · 0.95
run_aloneMethod · 0.95
run_wildMethod · 0.95
ui_get_current_pageMethod · 0.80
ui_gotoMethod · 0.80
open_buffMethod · 0.80
awakeMethod · 0.80
close_buffMethod · 0.80
set_next_runMethod · 0.80

Tested by

no test coverage detected