| 17 | |
| 18 | |
| 19 | class ScriptTask(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, SwitchSoul): |
| 20 | |
| 21 | def run(self): |
| 22 | conf = self.config.tako |
| 23 | if conf.switch_soul.enable: |
| 24 | self.ui_get_current_page() |
| 25 | self.ui_goto(page_shikigami_records) |
| 26 | self.run_switch_soul(conf.switch_soul.switch_group_team) |
| 27 | |
| 28 | if conf.switch_soul.enable_switch_by_name: |
| 29 | self.ui_get_current_page() |
| 30 | self.ui_goto(page_shikigami_records) |
| 31 | self.run_switch_soul_by_name(conf.switch_soul.group_name, |
| 32 | conf.switch_soul.team_name) |
| 33 | # 加成 |
| 34 | conf_buff = conf.tako_config |
| 35 | if conf_buff.enable: |
| 36 | self.ui_get_current_page() |
| 37 | self.ui_goto(page_main) |
| 38 | self.open_buff() |
| 39 | if conf_buff.buff_gold_50_click: |
| 40 | self.gold_50() |
| 41 | if conf_buff.buff_gold_100_click: |
| 42 | self.gold_100() |
| 43 | if conf_buff.buff_exp_50_click: |
| 44 | self.exp_50() |
| 45 | if conf_buff.buff_exp_100_click: |
| 46 | self.exp_100() |
| 47 | self.close_buff() |
| 48 | |
| 49 | # 进入 |
| 50 | self.ui_get_current_page() |
| 51 | self.ui_goto(page_team) |
| 52 | if 5 <= self.start_time.weekday() <= 6: |
| 53 | # 周末 |
| 54 | self.check_zones('喷怒的石距') |
| 55 | else: |
| 56 | self.check_zones('石距') |
| 57 | if not self.create_room(): |
| 58 | self.exit_task() |
| 59 | self.ensure_public() |
| 60 | self.create_ensure() |
| 61 | # 进入到了房间里面 |
| 62 | wait_timer = Timer(60) |
| 63 | wait_timer.start() |
| 64 | while 1: |
| 65 | self.screenshot() |
| 66 | |
| 67 | if not self.is_in_room(): |
| 68 | continue |
| 69 | if wait_timer.reached(): |
| 70 | logger.warning('Wait for too long, exit') |
| 71 | self.exit_room() |
| 72 | break |
| 73 | if not self.appear(self.I_ADD_1): |
| 74 | # 有人进来了,可以进行挑战 |
| 75 | logger.info('There is someone in the room and start the challenge') |
| 76 | self.click_fire() |