(self)
| 20 | class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi, SwitchSoul, OrochiAssets): |
| 21 | |
| 22 | def run(self) -> bool: |
| 23 | # 御魂切换方式一 |
| 24 | if self.config.orochi.switch_soul.enable: |
| 25 | self.ui_get_current_page() |
| 26 | self.ui_goto(page_shikigami_records) |
| 27 | self.run_switch_soul(self.config.orochi.switch_soul.switch_group_team) |
| 28 | |
| 29 | # 御魂切换方式二 |
| 30 | if self.config.orochi.switch_soul.enable_switch_by_name: |
| 31 | self.ui_get_current_page() |
| 32 | self.ui_goto(page_shikigami_records) |
| 33 | self.run_switch_soul_by_name(self.config.orochi.switch_soul.group_name, |
| 34 | self.config.orochi.switch_soul.team_name) |
| 35 | |
| 36 | limit_count = self.config.orochi.orochi_config.limit_count |
| 37 | limit_time = self.config.orochi.orochi_config.limit_time |
| 38 | self.current_count = 0 |
| 39 | self.limit_count: int = limit_count |
| 40 | self.limit_time: timedelta = timedelta(hours=limit_time.hour, minutes=limit_time.minute, seconds=limit_time.second) |
| 41 | |
| 42 | config: Orochi = self.config.orochi |
| 43 | if not self.is_in_battle(True): |
| 44 | self.ui_get_current_page() |
| 45 | self.ui_goto(page_main) |
| 46 | if config.orochi_config.soul_buff_enable: |
| 47 | self.open_buff() |
| 48 | self.soul(is_open=True) |
| 49 | self.close_buff() |
| 50 | |
| 51 | success = True |
| 52 | match config.orochi_config.user_status: |
| 53 | case UserStatus.LEADER: success = self.run_leader() |
| 54 | case UserStatus.MEMBER: success = self.run_member() |
| 55 | case UserStatus.ALONE: self.run_alone() |
| 56 | case UserStatus.WILD: success = self.run_wild() |
| 57 | case _: logger.error('Unknown user status') |
| 58 | |
| 59 | # 记得关掉 |
| 60 | if config.orochi_config.soul_buff_enable: |
| 61 | self.open_buff() |
| 62 | self.soul(is_open=False) |
| 63 | self.close_buff() |
| 64 | # 下一次运行时间 |
| 65 | if success: |
| 66 | self.set_next_run('Orochi', finish=True, success=True) |
| 67 | else: |
| 68 | self.set_next_run('Orochi', finish=False, success=False) |
| 69 | |
| 70 | raise TaskEnd |
| 71 | |
| 72 | |
| 73 |
no test coverage detected