l103.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. from module.logger import logger
  2. from tasks.SixRealms.moon_sea.skills import MoonSeaSkills
  3. class MoonSeaL103(MoonSeaSkills):
  4. def run_103(self):
  5. # 宝箱还是精英
  6. logger.hr('Island 103')
  7. self.wait_until_appear(self.I_ISLAND_TAG_FLAG, wait_time=2)
  8. is_box: bool = self.appear(self.I_L103_EXIT)
  9. if is_box:
  10. logger.info('Access to Box')
  11. while 1:
  12. self.screenshot()
  13. if self.appear(self.I_M_STORE):
  14. logger.info('Not punched the treasure box')
  15. return
  16. if self.appear_then_click(self.I_UI_UNCHECK, interval=0.5):
  17. continue
  18. if self.appear_then_click(self.I_UI_CONFIRM, interval=1):
  19. continue
  20. if self.appear_then_click(self.I_L103_EXIT, interval=4):
  21. continue
  22. self.battle_l103()
  23. logger.info('Island 103 Finished')
  24. def battle_l103(self):
  25. # 打精英
  26. logger.info('Start Island battle')
  27. while 1:
  28. self.screenshot()
  29. if self.appear(self.I_NPC_FIRE):
  30. break
  31. if self.click(self.C_NPC_FIRE_CENTER, interval=4):
  32. continue
  33. self.battle_lock_team()
  34. self.island_battle()
  35. logger.info('Island battle finished')
  36. self.select_skill(refresh=True)
  37. if __name__ == '__main__':
  38. from module.config.config import Config
  39. from module.device.device import Device
  40. c = Config('oas1')
  41. d = Device(c)
  42. t = MoonSeaL103(c, d)
  43. t.screenshot()
  44. t.run_103()