script_task.py 937 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # This Python file uses the following encoding: utf-8
  2. # @author runhey
  3. # github https://github.com/runhey
  4. from tasks.base_task import BaseTask
  5. from tasks.Component.GeneralBattle.general_battle import GeneralBattle
  6. from tasks.GameUi.game_ui import GameUi
  7. from tasks.Orochi.assets import OrochiAssets
  8. from module.logger import logger
  9. class ScriptTask(GeneralBattle, GameUi, OrochiAssets):
  10. def run(self) -> bool:
  11. pass
  12. def check_layer(self, layer: str) -> bool:
  13. """
  14. 检查挑战的层数, 并选中挑战的层
  15. :return:
  16. """
  17. pos = self.list_find(self.L_LAYER_LIST, layer)
  18. if pos:
  19. self.device.click(x=pos[0], y=pos[1])
  20. return True
  21. if __name__ == '__main__':
  22. from module.config.config import Config
  23. from module.device.device import Device
  24. c = Config('oas1')
  25. d = Device(c)
  26. t = ScriptTask(c, d)
  27. t.check_layer('陆')