script_task.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # This Python file uses the following encoding: utf-8
  2. # @author runhey
  3. # github https://github.com/runhey
  4. import time
  5. from tasks.GameUi.game_ui import GameUi
  6. from tasks.GameUi.page import page_main, page_daily
  7. from tasks.TalismanPass.assets import TalismanPassAssets
  8. from module.logger import logger
  9. from module.exception import TaskEnd
  10. class ScriptTask(GameUi, TalismanPassAssets):
  11. def run(self):
  12. self.ui_get_current_page()
  13. self.ui_goto(page_main)
  14. self.main_goto_daily()
  15. # 收取全部奖励
  16. self.get_all()
  17. # 收取花合战等级奖励
  18. self.get_flower()
  19. self.set_next_run(task='TalismanPass', success=True, finish=True)
  20. raise TaskEnd('TalismanPass')
  21. def get_all(self):
  22. """
  23. 一键收取所有的
  24. :return:
  25. """
  26. self.screenshot()
  27. if not self.appear(self.I_TP_GET_ALL):
  28. logger.info('No appear get all button')
  29. self.ui_get_reward(self.I_TP_GET_ALL)
  30. logger.info('Get all reward')
  31. def get_flower(self):
  32. """
  33. 收取花合战等级奖励
  34. :return:
  35. """
  36. pass
  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 = ScriptTask(c, d)
  43. t.screenshot()
  44. t.get_all()