Просмотр исходного кода

fix(task): Make mistakes when starting unfinished tasks

runhey 3 лет назад
Родитель
Сommit
747b1f6d64

+ 40 - 0
tasks/EternitySea/script_task.py

@@ -0,0 +1,40 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+from cached_property import cached_property
+
+from module.exception import TaskEnd
+from module.logger import logger
+from module.base.timer import Timer
+
+from tasks.GameUi.game_ui import GameUi
+from tasks.GameUi.page import page_main, page_soul_zones, page_shikigami_records
+from tasks.Component.GeneralBattle.general_battle import GeneralBattle
+from tasks.Component.GeneralBattle.config_general_battle import GeneralBattleConfig
+from tasks.Component.GeneralRoom.general_room import GeneralRoom
+from tasks.Component.GeneralInvite.general_invite import GeneralInvite
+from tasks.Component.SwitchSoul.switch_soul import SwitchSoul
+from tasks.EternitySea.assets import EternitySeaAssets
+
+class ScriptTask(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, SwitchSoul, EternitySeaAssets):
+
+    def run(self):
+        con = self.config.eternity_sea.eternity_sea_config
+        self.ui_get_current_page()
+        self.ui_goto(page_soul_zones)
+
+        self.set_next_run(task='EternitySea', success=True, finish=False)
+        raise TaskEnd('EternitySea')
+
+
+
+
+if __name__ == '__main__':
+    from module.config.config import Config
+    from module.device.device import Device
+    c = Config('oas1')
+    d = Device(c)
+    t = ScriptTask(c, d)
+    t.screenshot()
+
+    t.run()

+ 31 - 0
tasks/ExperienceYoukai/script_task.py

@@ -16,5 +16,36 @@ from tasks.Component.GeneralInvite.general_invite import GeneralInvite
 from tasks.Component.SwitchSoul.switch_soul import SwitchSoul
 from tasks.ExperienceYoukai.assets import ExperienceYoukaiAssets
 
+class ScriptTask(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, SwitchSoul, ExperienceYoukaiAssets):
 
+    def run(self):
+        con = self.config.experience_youkai
+        self.ui_get_current_page()
+        self.ui_goto(page_team)
+        self.check_zones('经验妖怪')
 
+        self.exp_exit()
+
+    def exp_exit(self, con=None):
+        self.ui_get_current_page()
+        self.ui_goto(page_main)
+        # if con.buff_gold_50_click or con.buff_gold_100_click:
+        #     self.open_buff()
+        #     if con.buff_gold_50_click:
+        #         self.gold_50(False)
+        #     if con.buff_gold_100_click:
+        #         self.gold_100(False)
+        #     self.close_buff()
+
+        self.set_next_run(task='ExperienceYoukai', success=True, finish=False)
+        raise TaskEnd('ExperienceYoukai')
+
+if __name__ == '__main__':
+    from module.config.config import Config
+    from module.device.device import Device
+    c = Config('oas1')
+    d = Device(c)
+    t = ScriptTask(c, d)
+    t.screenshot()
+
+    t.run()

+ 1 - 0
tasks/GoldYoukai/script_task.py

@@ -110,6 +110,7 @@ class ScriptTask(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, SwitchSoul,
         self.set_next_run(task='GoldYoukai', success=True, finish=False)
         raise TaskEnd('GoldYoukai')
 
+
 if __name__ == '__main__':
     from module.config.config import Config
     from module.device.device import Device