(self)
| 21 | class ScriptTask(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, SwitchSoul, GoldYoukaiAssets): |
| 22 | |
| 23 | def run(self): |
| 24 | # 切换御魂 |
| 25 | if self.config.gold_youkai.switch_soul.enable: |
| 26 | self.ui_get_current_page() |
| 27 | self.ui_goto(page_shikigami_records) |
| 28 | self.run_switch_soul(self.config.gold_youkai.switch_soul.switch_group_team) |
| 29 | |
| 30 | if self.config.gold_youkai.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.gold_youkai.switch_soul.group_name, |
| 34 | self.config.gold_youkai.switch_soul.team_name) |
| 35 | |
| 36 | # 开启加成 |
| 37 | con = self.config.gold_youkai.gold_youkai |
| 38 | if con.buff_gold_50_click or con.buff_gold_100_click: |
| 39 | self.ui_get_current_page() |
| 40 | self.ui_goto(page_main) |
| 41 | self.open_buff() |
| 42 | if con.buff_gold_50_click: |
| 43 | self.gold_50() |
| 44 | if con.buff_gold_100_click: |
| 45 | self.gold_100() |
| 46 | self.close_buff() |
| 47 | self.ui_get_current_page() |
| 48 | self.ui_goto(page_team) |
| 49 | self.check_zones('金币妖怪') |
| 50 | # 开始 |
| 51 | if not self.create_room(): |
| 52 | self.gold_exit(con) |
| 53 | self.ensure_public() |
| 54 | self.create_ensure() |
| 55 | # 进入到了房间里面 |
| 56 | wait_timer = Timer(60) |
| 57 | wait_timer.start() |
| 58 | while 1: |
| 59 | self.screenshot() |
| 60 | |
| 61 | if not self.is_in_room(): |
| 62 | continue |
| 63 | if wait_timer.reached(): |
| 64 | logger.warning('Wait for too long, exit') |
| 65 | self.exit_room() |
| 66 | break |
| 67 | if not self.appear(self.I_ADD_5_1): |
| 68 | # 有人进来了,可以进行挑战 |
| 69 | logger.info('There is someone in the room and start the challenge') |
| 70 | self.click_fire() |
| 71 | self.run_general_battle() |
| 72 | break |
| 73 | # 退出 (要么是在组队界面要么是在庭院) |
| 74 | self.gold_exit(con) |
| 75 | |
| 76 | |
| 77 | def battle_wait(self, random_click_swipt_enable: bool) -> bool: |
no test coverage detected