diff --git a/aas.py b/aas.py index 1069bb5..79425b1 100644 --- a/aas.py +++ b/aas.py @@ -66,6 +66,10 @@ class ArisuAutoSweeper(AzurLaneAutoScript): from tasks.schedule.schedule import Schedule Schedule(config=self.config, device=self.device).run() + def auto_mission(self): + from tasks.auto_mission.auto_mission import AutoMission + AutoMission(config=self.config, device=self.device).run() + def data_update(self): from tasks.item.data_update import DataUpdate DataUpdate(config=self.config, device=self.device).run() diff --git a/assets/en/auto_mission/ACCELERATE.png b/assets/en/auto_mission/ACCELERATE.png new file mode 100644 index 0000000..10dfbea Binary files /dev/null and b/assets/en/auto_mission/ACCELERATE.png differ diff --git a/assets/en/auto_mission/AUTO.png b/assets/en/auto_mission/AUTO.png new file mode 100644 index 0000000..bd91c01 Binary files /dev/null and b/assets/en/auto_mission/AUTO.png differ diff --git a/assets/en/auto_mission/AUTO_END_OFF.png b/assets/en/auto_mission/AUTO_END_OFF.png new file mode 100644 index 0000000..0f8bb07 Binary files /dev/null and b/assets/en/auto_mission/AUTO_END_OFF.png differ diff --git a/assets/en/auto_mission/AUTO_END_ON.png b/assets/en/auto_mission/AUTO_END_ON.png new file mode 100644 index 0000000..f2d51ea Binary files /dev/null and b/assets/en/auto_mission/AUTO_END_ON.png differ diff --git a/assets/en/auto_mission/BATTLE_COMPLETE.png b/assets/en/auto_mission/BATTLE_COMPLETE.png new file mode 100644 index 0000000..49599c9 Binary files /dev/null and b/assets/en/auto_mission/BATTLE_COMPLETE.png differ diff --git a/assets/en/auto_mission/BEGIN_MISSION.png b/assets/en/auto_mission/BEGIN_MISSION.png new file mode 100644 index 0000000..f97bac3 Binary files /dev/null and b/assets/en/auto_mission/BEGIN_MISSION.png differ diff --git a/assets/en/auto_mission/CHEST.png b/assets/en/auto_mission/CHEST.png new file mode 100644 index 0000000..8b66a03 Binary files /dev/null and b/assets/en/auto_mission/CHEST.png differ diff --git a/assets/en/auto_mission/END_PHASE.png b/assets/en/auto_mission/END_PHASE.png new file mode 100644 index 0000000..d05cad9 Binary files /dev/null and b/assets/en/auto_mission/END_PHASE.png differ diff --git a/assets/en/auto_mission/END_PHASE_POPUP.BUTTON.png b/assets/en/auto_mission/END_PHASE_POPUP.BUTTON.png new file mode 100644 index 0000000..1e390fe Binary files /dev/null and b/assets/en/auto_mission/END_PHASE_POPUP.BUTTON.png differ diff --git a/assets/en/auto_mission/END_PHASE_POPUP.png b/assets/en/auto_mission/END_PHASE_POPUP.png new file mode 100644 index 0000000..8590c7a Binary files /dev/null and b/assets/en/auto_mission/END_PHASE_POPUP.png differ diff --git a/assets/en/auto_mission/ENTER_SUB.png b/assets/en/auto_mission/ENTER_SUB.png new file mode 100644 index 0000000..e898680 Binary files /dev/null and b/assets/en/auto_mission/ENTER_SUB.png differ diff --git a/assets/en/auto_mission/LAYOUT.png b/assets/en/auto_mission/LAYOUT.png new file mode 100644 index 0000000..1211fb4 Binary files /dev/null and b/assets/en/auto_mission/LAYOUT.png differ diff --git a/assets/en/auto_mission/MISSION_COMPLETE.png b/assets/en/auto_mission/MISSION_COMPLETE.png new file mode 100644 index 0000000..e7dc892 Binary files /dev/null and b/assets/en/auto_mission/MISSION_COMPLETE.png differ diff --git a/assets/en/auto_mission/MISSION_INFO.png b/assets/en/auto_mission/MISSION_INFO.png new file mode 100644 index 0000000..b329072 Binary files /dev/null and b/assets/en/auto_mission/MISSION_INFO.png differ diff --git a/assets/en/auto_mission/MISSION_INFO_POPUP.BUTTON.png b/assets/en/auto_mission/MISSION_INFO_POPUP.BUTTON.png new file mode 100644 index 0000000..4e1228c Binary files /dev/null and b/assets/en/auto_mission/MISSION_INFO_POPUP.BUTTON.png differ diff --git a/assets/en/auto_mission/MISSION_INFO_POPUP.png b/assets/en/auto_mission/MISSION_INFO_POPUP.png new file mode 100644 index 0000000..947eb9b Binary files /dev/null and b/assets/en/auto_mission/MISSION_INFO_POPUP.png differ diff --git a/assets/en/auto_mission/MOBILIZE.png b/assets/en/auto_mission/MOBILIZE.png new file mode 100644 index 0000000..4c46944 Binary files /dev/null and b/assets/en/auto_mission/MOBILIZE.png differ diff --git a/assets/en/auto_mission/MOVE_UNIT.BUTTON.png b/assets/en/auto_mission/MOVE_UNIT.BUTTON.png new file mode 100644 index 0000000..f24daf6 Binary files /dev/null and b/assets/en/auto_mission/MOVE_UNIT.BUTTON.png differ diff --git a/assets/en/auto_mission/MOVE_UNIT.png b/assets/en/auto_mission/MOVE_UNIT.png new file mode 100644 index 0000000..dc1d8d8 Binary files /dev/null and b/assets/en/auto_mission/MOVE_UNIT.png differ diff --git a/assets/en/auto_mission/OCR_AREA.png b/assets/en/auto_mission/OCR_AREA.png new file mode 100644 index 0000000..c7b6f50 Binary files /dev/null and b/assets/en/auto_mission/OCR_AREA.png differ diff --git a/assets/en/auto_mission/OCR_UNIT.png b/assets/en/auto_mission/OCR_UNIT.png new file mode 100644 index 0000000..d5dd6e9 Binary files /dev/null and b/assets/en/auto_mission/OCR_UNIT.png differ diff --git a/assets/en/auto_mission/ONE_STAR.png b/assets/en/auto_mission/ONE_STAR.png new file mode 100644 index 0000000..315f3ef Binary files /dev/null and b/assets/en/auto_mission/ONE_STAR.png differ diff --git a/assets/en/auto_mission/PRESET1_ON.png b/assets/en/auto_mission/PRESET1_ON.png new file mode 100644 index 0000000..a1f1865 Binary files /dev/null and b/assets/en/auto_mission/PRESET1_ON.png differ diff --git a/assets/en/auto_mission/PRESET2_ON.png b/assets/en/auto_mission/PRESET2_ON.png new file mode 100644 index 0000000..4ee0bff Binary files /dev/null and b/assets/en/auto_mission/PRESET2_ON.png differ diff --git a/assets/en/auto_mission/PRESET3_ON.png b/assets/en/auto_mission/PRESET3_ON.png new file mode 100644 index 0000000..f1a4e5f Binary files /dev/null and b/assets/en/auto_mission/PRESET3_ON.png differ diff --git a/assets/en/auto_mission/PRESET4_ON.png b/assets/en/auto_mission/PRESET4_ON.png new file mode 100644 index 0000000..7ea3b4b Binary files /dev/null and b/assets/en/auto_mission/PRESET4_ON.png differ diff --git a/assets/en/auto_mission/PRESET_FIRST_ITEM.png b/assets/en/auto_mission/PRESET_FIRST_ITEM.png new file mode 100644 index 0000000..a7a36e8 Binary files /dev/null and b/assets/en/auto_mission/PRESET_FIRST_ITEM.png differ diff --git a/assets/en/auto_mission/PRESET_LIST.png b/assets/en/auto_mission/PRESET_LIST.png new file mode 100644 index 0000000..7cc86d2 Binary files /dev/null and b/assets/en/auto_mission/PRESET_LIST.png differ diff --git a/assets/en/auto_mission/PRESET_WINDOW.png b/assets/en/auto_mission/PRESET_WINDOW.png new file mode 100644 index 0000000..3c6b126 Binary files /dev/null and b/assets/en/auto_mission/PRESET_WINDOW.png differ diff --git a/assets/en/auto_mission/RANK.png b/assets/en/auto_mission/RANK.png new file mode 100644 index 0000000..fc0c5a7 Binary files /dev/null and b/assets/en/auto_mission/RANK.png differ diff --git a/assets/en/auto_mission/RECEIVED_CHEST.BUTTON.png b/assets/en/auto_mission/RECEIVED_CHEST.BUTTON.png new file mode 100644 index 0000000..e67c879 Binary files /dev/null and b/assets/en/auto_mission/RECEIVED_CHEST.BUTTON.png differ diff --git a/assets/en/auto_mission/RECEIVED_CHEST.png b/assets/en/auto_mission/RECEIVED_CHEST.png new file mode 100644 index 0000000..42cc109 Binary files /dev/null and b/assets/en/auto_mission/RECEIVED_CHEST.png differ diff --git a/assets/en/auto_mission/REWARD_ACQUIRED.BUTTON.png b/assets/en/auto_mission/REWARD_ACQUIRED.BUTTON.png new file mode 100644 index 0000000..27a82b6 Binary files /dev/null and b/assets/en/auto_mission/REWARD_ACQUIRED.BUTTON.png differ diff --git a/assets/en/auto_mission/REWARD_ACQUIRED.png b/assets/en/auto_mission/REWARD_ACQUIRED.png new file mode 100644 index 0000000..0d9c743 Binary files /dev/null and b/assets/en/auto_mission/REWARD_ACQUIRED.png differ diff --git a/assets/en/auto_mission/SKIP_BATTLE_OFF.png b/assets/en/auto_mission/SKIP_BATTLE_OFF.png new file mode 100644 index 0000000..e200b0e Binary files /dev/null and b/assets/en/auto_mission/SKIP_BATTLE_OFF.png differ diff --git a/assets/en/auto_mission/SKIP_BATTLE_ON.png b/assets/en/auto_mission/SKIP_BATTLE_ON.png new file mode 100644 index 0000000..e336076 Binary files /dev/null and b/assets/en/auto_mission/SKIP_BATTLE_ON.png differ diff --git a/assets/en/auto_mission/THREE_STARS.png b/assets/en/auto_mission/THREE_STARS.png new file mode 100644 index 0000000..e82c4b8 Binary files /dev/null and b/assets/en/auto_mission/THREE_STARS.png differ diff --git a/assets/en/auto_mission/UNIT1_OFF.png b/assets/en/auto_mission/UNIT1_OFF.png new file mode 100644 index 0000000..14a4e5c Binary files /dev/null and b/assets/en/auto_mission/UNIT1_OFF.png differ diff --git a/assets/en/auto_mission/UNIT1_ON.png b/assets/en/auto_mission/UNIT1_ON.png new file mode 100644 index 0000000..dd39775 Binary files /dev/null and b/assets/en/auto_mission/UNIT1_ON.png differ diff --git a/assets/en/auto_mission/UNIT2_OFF.png b/assets/en/auto_mission/UNIT2_OFF.png new file mode 100644 index 0000000..b1d6b68 Binary files /dev/null and b/assets/en/auto_mission/UNIT2_OFF.png differ diff --git a/assets/en/auto_mission/UNIT2_ON.png b/assets/en/auto_mission/UNIT2_ON.png new file mode 100644 index 0000000..26c4ae8 Binary files /dev/null and b/assets/en/auto_mission/UNIT2_ON.png differ diff --git a/assets/en/auto_mission/UNIT3_OFF.png b/assets/en/auto_mission/UNIT3_OFF.png new file mode 100644 index 0000000..f7e6c47 Binary files /dev/null and b/assets/en/auto_mission/UNIT3_OFF.png differ diff --git a/assets/en/auto_mission/UNIT3_ON.png b/assets/en/auto_mission/UNIT3_ON.png new file mode 100644 index 0000000..08cc8c9 Binary files /dev/null and b/assets/en/auto_mission/UNIT3_ON.png differ diff --git a/assets/en/auto_mission/UNIT4_OFF.png b/assets/en/auto_mission/UNIT4_OFF.png new file mode 100644 index 0000000..4a85d56 Binary files /dev/null and b/assets/en/auto_mission/UNIT4_OFF.png differ diff --git a/assets/en/auto_mission/UNIT4_ON.png b/assets/en/auto_mission/UNIT4_ON.png new file mode 100644 index 0000000..50f68aa Binary files /dev/null and b/assets/en/auto_mission/UNIT4_ON.png differ diff --git a/assets/zht/auto_mission/ACCELERATE.png b/assets/zht/auto_mission/ACCELERATE.png new file mode 100644 index 0000000..964f298 Binary files /dev/null and b/assets/zht/auto_mission/ACCELERATE.png differ diff --git a/assets/zht/auto_mission/AUTO.png b/assets/zht/auto_mission/AUTO.png new file mode 100644 index 0000000..5751284 Binary files /dev/null and b/assets/zht/auto_mission/AUTO.png differ diff --git a/assets/zht/auto_mission/AUTO_END_OFF.png b/assets/zht/auto_mission/AUTO_END_OFF.png new file mode 100644 index 0000000..53f33a4 Binary files /dev/null and b/assets/zht/auto_mission/AUTO_END_OFF.png differ diff --git a/assets/zht/auto_mission/AUTO_END_ON.png b/assets/zht/auto_mission/AUTO_END_ON.png new file mode 100644 index 0000000..d5b69d4 Binary files /dev/null and b/assets/zht/auto_mission/AUTO_END_ON.png differ diff --git a/assets/zht/auto_mission/BATTLE_COMPLETE.png b/assets/zht/auto_mission/BATTLE_COMPLETE.png new file mode 100644 index 0000000..98e1b4d Binary files /dev/null and b/assets/zht/auto_mission/BATTLE_COMPLETE.png differ diff --git a/assets/zht/auto_mission/BEGIN_MISSION.png b/assets/zht/auto_mission/BEGIN_MISSION.png new file mode 100644 index 0000000..60211c7 Binary files /dev/null and b/assets/zht/auto_mission/BEGIN_MISSION.png differ diff --git a/assets/zht/auto_mission/CHEST.png b/assets/zht/auto_mission/CHEST.png new file mode 100644 index 0000000..7cbd05d Binary files /dev/null and b/assets/zht/auto_mission/CHEST.png differ diff --git a/assets/zht/auto_mission/END_PHASE.png b/assets/zht/auto_mission/END_PHASE.png new file mode 100644 index 0000000..f8b68a9 Binary files /dev/null and b/assets/zht/auto_mission/END_PHASE.png differ diff --git a/assets/zht/auto_mission/END_PHASE_POPUP.BUTTON.png b/assets/zht/auto_mission/END_PHASE_POPUP.BUTTON.png new file mode 100644 index 0000000..b05f7ca Binary files /dev/null and b/assets/zht/auto_mission/END_PHASE_POPUP.BUTTON.png differ diff --git a/assets/zht/auto_mission/END_PHASE_POPUP.png b/assets/zht/auto_mission/END_PHASE_POPUP.png new file mode 100644 index 0000000..326fc54 Binary files /dev/null and b/assets/zht/auto_mission/END_PHASE_POPUP.png differ diff --git a/assets/zht/auto_mission/ENTER_SUB.png b/assets/zht/auto_mission/ENTER_SUB.png new file mode 100644 index 0000000..390accc Binary files /dev/null and b/assets/zht/auto_mission/ENTER_SUB.png differ diff --git a/assets/zht/auto_mission/LAYOUT.png b/assets/zht/auto_mission/LAYOUT.png new file mode 100644 index 0000000..1211fb4 Binary files /dev/null and b/assets/zht/auto_mission/LAYOUT.png differ diff --git a/assets/zht/auto_mission/MISSION_COMPLETE.png b/assets/zht/auto_mission/MISSION_COMPLETE.png new file mode 100644 index 0000000..5cf268e Binary files /dev/null and b/assets/zht/auto_mission/MISSION_COMPLETE.png differ diff --git a/assets/zht/auto_mission/MISSION_INFO.png b/assets/zht/auto_mission/MISSION_INFO.png new file mode 100644 index 0000000..99c68f9 Binary files /dev/null and b/assets/zht/auto_mission/MISSION_INFO.png differ diff --git a/assets/zht/auto_mission/MISSION_INFO_POPUP.BUTTON.png b/assets/zht/auto_mission/MISSION_INFO_POPUP.BUTTON.png new file mode 100644 index 0000000..0fbf87e Binary files /dev/null and b/assets/zht/auto_mission/MISSION_INFO_POPUP.BUTTON.png differ diff --git a/assets/zht/auto_mission/MISSION_INFO_POPUP.png b/assets/zht/auto_mission/MISSION_INFO_POPUP.png new file mode 100644 index 0000000..d1b2f0c Binary files /dev/null and b/assets/zht/auto_mission/MISSION_INFO_POPUP.png differ diff --git a/assets/zht/auto_mission/MOBILIZE.png b/assets/zht/auto_mission/MOBILIZE.png new file mode 100644 index 0000000..11a982c Binary files /dev/null and b/assets/zht/auto_mission/MOBILIZE.png differ diff --git a/assets/zht/auto_mission/MOVE_UNIT.BUTTON.png b/assets/zht/auto_mission/MOVE_UNIT.BUTTON.png new file mode 100644 index 0000000..8769605 Binary files /dev/null and b/assets/zht/auto_mission/MOVE_UNIT.BUTTON.png differ diff --git a/assets/zht/auto_mission/MOVE_UNIT.png b/assets/zht/auto_mission/MOVE_UNIT.png new file mode 100644 index 0000000..279d8b0 Binary files /dev/null and b/assets/zht/auto_mission/MOVE_UNIT.png differ diff --git a/assets/zht/auto_mission/OCR_AREA.png b/assets/zht/auto_mission/OCR_AREA.png new file mode 100644 index 0000000..196b91d Binary files /dev/null and b/assets/zht/auto_mission/OCR_AREA.png differ diff --git a/assets/zht/auto_mission/OCR_UNIT.png b/assets/zht/auto_mission/OCR_UNIT.png new file mode 100644 index 0000000..186284b Binary files /dev/null and b/assets/zht/auto_mission/OCR_UNIT.png differ diff --git a/assets/zht/auto_mission/ONE_STAR.png b/assets/zht/auto_mission/ONE_STAR.png new file mode 100644 index 0000000..315f3ef Binary files /dev/null and b/assets/zht/auto_mission/ONE_STAR.png differ diff --git a/assets/zht/auto_mission/PRESET1_OFF.png b/assets/zht/auto_mission/PRESET1_OFF.png new file mode 100644 index 0000000..3d91231 Binary files /dev/null and b/assets/zht/auto_mission/PRESET1_OFF.png differ diff --git a/assets/zht/auto_mission/PRESET1_ON.png b/assets/zht/auto_mission/PRESET1_ON.png new file mode 100644 index 0000000..a1f1865 Binary files /dev/null and b/assets/zht/auto_mission/PRESET1_ON.png differ diff --git a/assets/zht/auto_mission/PRESET2_OFF.png b/assets/zht/auto_mission/PRESET2_OFF.png new file mode 100644 index 0000000..6c52159 Binary files /dev/null and b/assets/zht/auto_mission/PRESET2_OFF.png differ diff --git a/assets/zht/auto_mission/PRESET2_ON.png b/assets/zht/auto_mission/PRESET2_ON.png new file mode 100644 index 0000000..4ee0bff Binary files /dev/null and b/assets/zht/auto_mission/PRESET2_ON.png differ diff --git a/assets/zht/auto_mission/PRESET3_OFF.png b/assets/zht/auto_mission/PRESET3_OFF.png new file mode 100644 index 0000000..dc5ebe7 Binary files /dev/null and b/assets/zht/auto_mission/PRESET3_OFF.png differ diff --git a/assets/zht/auto_mission/PRESET3_ON.png b/assets/zht/auto_mission/PRESET3_ON.png new file mode 100644 index 0000000..f1a4e5f Binary files /dev/null and b/assets/zht/auto_mission/PRESET3_ON.png differ diff --git a/assets/zht/auto_mission/PRESET4_OFF.png b/assets/zht/auto_mission/PRESET4_OFF.png new file mode 100644 index 0000000..2dabfc9 Binary files /dev/null and b/assets/zht/auto_mission/PRESET4_OFF.png differ diff --git a/assets/zht/auto_mission/PRESET4_ON.png b/assets/zht/auto_mission/PRESET4_ON.png new file mode 100644 index 0000000..7ea3b4b Binary files /dev/null and b/assets/zht/auto_mission/PRESET4_ON.png differ diff --git a/assets/zht/auto_mission/PRESET_FIRST_ITEM.png b/assets/zht/auto_mission/PRESET_FIRST_ITEM.png new file mode 100644 index 0000000..a7a36e8 Binary files /dev/null and b/assets/zht/auto_mission/PRESET_FIRST_ITEM.png differ diff --git a/assets/zht/auto_mission/PRESET_LIST.png b/assets/zht/auto_mission/PRESET_LIST.png new file mode 100644 index 0000000..018fe6f Binary files /dev/null and b/assets/zht/auto_mission/PRESET_LIST.png differ diff --git a/assets/zht/auto_mission/PRESET_WINDOW.png b/assets/zht/auto_mission/PRESET_WINDOW.png new file mode 100644 index 0000000..3c6b126 Binary files /dev/null and b/assets/zht/auto_mission/PRESET_WINDOW.png differ diff --git a/assets/zht/auto_mission/RANK.png b/assets/zht/auto_mission/RANK.png new file mode 100644 index 0000000..0da8fba Binary files /dev/null and b/assets/zht/auto_mission/RANK.png differ diff --git a/assets/zht/auto_mission/RECEIVED_CHEST.BUTTON.png b/assets/zht/auto_mission/RECEIVED_CHEST.BUTTON.png new file mode 100644 index 0000000..e6ad65d Binary files /dev/null and b/assets/zht/auto_mission/RECEIVED_CHEST.BUTTON.png differ diff --git a/assets/zht/auto_mission/RECEIVED_CHEST.png b/assets/zht/auto_mission/RECEIVED_CHEST.png new file mode 100644 index 0000000..0c0a8b3 Binary files /dev/null and b/assets/zht/auto_mission/RECEIVED_CHEST.png differ diff --git a/assets/zht/auto_mission/REWARD_ACQUIRED.BUTTON.png b/assets/zht/auto_mission/REWARD_ACQUIRED.BUTTON.png new file mode 100644 index 0000000..4a58516 Binary files /dev/null and b/assets/zht/auto_mission/REWARD_ACQUIRED.BUTTON.png differ diff --git a/assets/zht/auto_mission/REWARD_ACQUIRED.png b/assets/zht/auto_mission/REWARD_ACQUIRED.png new file mode 100644 index 0000000..e472cc9 Binary files /dev/null and b/assets/zht/auto_mission/REWARD_ACQUIRED.png differ diff --git a/assets/zht/auto_mission/SKIP_BATTLE_OFF.png b/assets/zht/auto_mission/SKIP_BATTLE_OFF.png new file mode 100644 index 0000000..02ffc6e Binary files /dev/null and b/assets/zht/auto_mission/SKIP_BATTLE_OFF.png differ diff --git a/assets/zht/auto_mission/SKIP_BATTLE_ON.png b/assets/zht/auto_mission/SKIP_BATTLE_ON.png new file mode 100644 index 0000000..b1bd498 Binary files /dev/null and b/assets/zht/auto_mission/SKIP_BATTLE_ON.png differ diff --git a/assets/zht/auto_mission/THREE_STARS.png b/assets/zht/auto_mission/THREE_STARS.png new file mode 100644 index 0000000..e82c4b8 Binary files /dev/null and b/assets/zht/auto_mission/THREE_STARS.png differ diff --git a/assets/zht/auto_mission/UNIT1_OFF.png b/assets/zht/auto_mission/UNIT1_OFF.png new file mode 100644 index 0000000..3df5947 Binary files /dev/null and b/assets/zht/auto_mission/UNIT1_OFF.png differ diff --git a/assets/zht/auto_mission/UNIT1_ON.png b/assets/zht/auto_mission/UNIT1_ON.png new file mode 100644 index 0000000..b9f40cb Binary files /dev/null and b/assets/zht/auto_mission/UNIT1_ON.png differ diff --git a/assets/zht/auto_mission/UNIT2_OFF.png b/assets/zht/auto_mission/UNIT2_OFF.png new file mode 100644 index 0000000..4427195 Binary files /dev/null and b/assets/zht/auto_mission/UNIT2_OFF.png differ diff --git a/assets/zht/auto_mission/UNIT2_ON.png b/assets/zht/auto_mission/UNIT2_ON.png new file mode 100644 index 0000000..e73a334 Binary files /dev/null and b/assets/zht/auto_mission/UNIT2_ON.png differ diff --git a/assets/zht/auto_mission/UNIT3_OFF.png b/assets/zht/auto_mission/UNIT3_OFF.png new file mode 100644 index 0000000..9007930 Binary files /dev/null and b/assets/zht/auto_mission/UNIT3_OFF.png differ diff --git a/assets/zht/auto_mission/UNIT3_ON.png b/assets/zht/auto_mission/UNIT3_ON.png new file mode 100644 index 0000000..34e31d9 Binary files /dev/null and b/assets/zht/auto_mission/UNIT3_ON.png differ diff --git a/assets/zht/auto_mission/UNIT4_OFF.png b/assets/zht/auto_mission/UNIT4_OFF.png new file mode 100644 index 0000000..1fe37cd Binary files /dev/null and b/assets/zht/auto_mission/UNIT4_OFF.png differ diff --git a/assets/zht/auto_mission/UNIT4_ON.png b/assets/zht/auto_mission/UNIT4_ON.png new file mode 100644 index 0000000..730fdc7 Binary files /dev/null and b/assets/zht/auto_mission/UNIT4_ON.png differ diff --git a/config/template.json b/config/template.json index 294d80c..791d9d7 100644 --- a/config/template.json +++ b/config/template.json @@ -49,6 +49,36 @@ "TacticalChallengeTicket": {} } }, + "Auto_Mission": { + "Scheduler": { + "Enable": false, + "NextRun": "2020-01-01 00:00:00", + "Command": "Auto_Mission", + "ServerUpdate": "04:00" + }, + "Formation": { + "burst1": "1-1", + "burst2": "1-2", + "pierce1": "1-3", + "pierce2": "1-4", + "mystic1": "1-5", + "mystic2": "2-1", + "Substitute": false + }, + "ManualBoss": { + "Enable": false + }, + "Normal": { + "Enable": false, + "Area": null, + "Completion": "clear" + }, + "Hard": { + "Enable": false, + "Area": null, + "Completion": "clear" + } + }, "Cafe": { "Scheduler": { "Enable": true, diff --git a/module/config/argument/args.json b/module/config/argument/args.json index 99a356b..61e07ee 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -246,6 +246,106 @@ } } }, + "Auto_Mission": { + "Scheduler": { + "Enable": { + "type": "checkbox", + "value": false, + "option": [ + true, + false + ] + }, + "NextRun": { + "type": "datetime", + "value": "2020-01-01 00:00:00", + "validate": "datetime" + }, + "Command": { + "type": "input", + "value": "Auto_Mission", + "display": "hide" + }, + "ServerUpdate": { + "type": "input", + "value": "04:00", + "display": "hide" + } + }, + "Formation": { + "burst1": { + "type": "input", + "value": "1-1" + }, + "burst2": { + "type": "input", + "value": "1-2" + }, + "pierce1": { + "type": "input", + "value": "1-3" + }, + "pierce2": { + "type": "input", + "value": "1-4" + }, + "mystic1": { + "type": "input", + "value": "1-5" + }, + "mystic2": { + "type": "input", + "value": "2-1" + }, + "Substitute": { + "type": "checkbox", + "value": false + } + }, + "ManualBoss": { + "Enable": { + "type": "checkbox", + "value": false + } + }, + "Normal": { + "Enable": { + "type": "checkbox", + "value": false + }, + "Area": { + "type": "textarea", + "value": null + }, + "Completion": { + "type": "select", + "value": "clear", + "option": [ + "clear", + "three_stars" + ] + } + }, + "Hard": { + "Enable": { + "type": "checkbox", + "value": false + }, + "Area": { + "type": "textarea", + "value": null + }, + "Completion": { + "type": "select", + "value": "clear", + "option": [ + "clear", + "three_stars", + "three_stars_chest" + ] + } + } + }, "Cafe": { "Scheduler": { "Enable": { diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index c83b1aa..20c69ae 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -242,6 +242,36 @@ TacticalChallengeShop: "14": false "15": false +Formation: + burst1: 1-1 + burst2: 1-2 + pierce1: 1-3 + pierce2: 1-4 + mystic1: 1-5 + mystic2: 2-1 + Substitute: false + +ManualBoss: + Enable: false + +Normal: + Enable: false + Area: + value: null + type: textarea + Completion: + value: clear + option: [ clear, three_stars] + +Hard: + Enable: false + Area: + value: null + type: textarea + Completion: + value: clear + option: [ clear, three_stars, three_stars_chest] + ItemStorage: AP: stored: StoredAP diff --git a/module/config/argument/menu.json b/module/config/argument/menu.json index 9f562ec..06b1bef 100644 --- a/module/config/argument/menu.json +++ b/module/config/argument/menu.json @@ -8,6 +8,13 @@ "DataUpdate" ] }, + "Copilot": { + "menu": "collapse", + "page": "setting", + "tasks": [ + "Auto_Mission" + ] + }, "Daily": { "menu": "collapse", "page": "setting", diff --git a/module/config/argument/task.yaml b/module/config/argument/task.yaml index acf129b..1c10ba4 100644 --- a/module/config/argument/task.yaml +++ b/module/config/argument/task.yaml @@ -19,6 +19,19 @@ Alas: - Scheduler - ItemStorage +# ==================== Copilot ==================== + +Copilot: + menu: 'collapse' + page: 'setting' + tasks: + Auto_Mission: + - Scheduler + - Formation + - ManualBoss + - Normal + - Hard + # ==================== Daily ==================== Daily: diff --git a/module/config/config_generated.py b/module/config/config_generated.py index 2d6a249..c414261 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -159,6 +159,28 @@ class GeneratedConfig: TacticalChallengeShop_14 = False TacticalChallengeShop_15 = False + # Group `Formation` + Formation_burst1 = '1-1' + Formation_burst2 = '1-2' + Formation_pierce1 = '1-3' + Formation_pierce2 = '1-4' + Formation_mystic1 = '1-5' + Formation_mystic2 = '2-1' + Formation_Substitute = False + + # Group `ManualBoss` + ManualBoss_Enable = False + + # Group `Normal` + Normal_Enable = False + Normal_Area = None + Normal_Completion = 'clear' # clear, three_stars + + # Group `Hard` + Hard_Enable = False + Hard_Area = None + Hard_Completion = 'clear' # clear, three_stars, three_stars_chest + # Group `ItemStorage` ItemStorage_AP = {} ItemStorage_Credit = {} diff --git a/module/config/config_manual.py b/module/config/config_manual.py index 071ced1..cddc533 100644 --- a/module/config/config_manual.py +++ b/module/config/config_manual.py @@ -9,7 +9,7 @@ class ManualConfig: SCHEDULER_PRIORITY = """ Restart > Cafe > TacticalChallenge > Circle > Mail - > DataUpdate > Bounty > Scrimmage > Schedule > Task > Shop > Mission > Momotalk + > DataUpdate > Bounty > Scrimmage > Schedule > Task > Shop > Mission > Momotalk > Auto_Mission """ """ diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index 899eeb1..10b03c4 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -4,6 +4,10 @@ "name": "AAS", "help": "" }, + "Copilot": { + "name": "Copilot", + "help": "" + }, "Daily": { "name": "Daily", "help": "" @@ -30,6 +34,10 @@ "name": "Dashboard Upd", "help": "" }, + "Auto_Mission": { + "name": "Auto-Mission", + "help": "" + }, "Cafe": { "name": "Cafe", "help": "" @@ -816,6 +824,91 @@ "help": "x125k Credits - 100 Coins" } }, + "Formation": { + "_info": { + "name": "Formation", + "help": "AAS will choose the unit from the Preset List in the Layout after entering the Unit Formation Page. The format is preset-row, for example 1-1 means choose preset 1 row 1. Please make sure the presets are set to their original names (1,2,3,4). It is highly recommended that you set them up to be unique." + }, + "burst1": { + "name": "Explosive 1", + "help": "" + }, + "burst2": { + "name": "Explosive 2", + "help": "" + }, + "pierce1": { + "name": "Piercing 1", + "help": "" + }, + "pierce2": { + "name": "Piercing 2", + "help": "" + }, + "mystic1": { + "name": "Mystic 1", + "help": "" + }, + "mystic2": { + "name": "Mystic 2", + "help": "" + }, + "Substitute": { + "name": "Find Alternatives", + "help": "In case you set the preset for some types to be the same and the stage requires all of those types, AAS will try to find alternatives. For example, if you set Explosive 1 and Explosive 2 to be the same and the stage requires both of them, AAS will replace Explosive 2 with Piercing 1." + } + }, + "ManualBoss": { + "_info": { + "name": "Manual Boss", + "help": "AAS will wait for the user to take over when encountering the boss" + }, + "Enable": { + "name": "Enable", + "help": "" + } + }, + "Normal": { + "_info": { + "name": "Normal", + "help": "" + }, + "Enable": { + "name": "Enable", + "help": "" + }, + "Area": { + "name": "Area", + "help": "Currently only between 4 and 16. Use > to connect multiple areas. Example: 6 > 7 > 8" + }, + "Completion": { + "name": "Completion level", + "help": "", + "clear": "Clear", + "three_stars": "3 Stars" + } + }, + "Hard": { + "_info": { + "name": "Hard", + "help": "" + }, + "Enable": { + "name": "Enable", + "help": "" + }, + "Area": { + "name": "Area", + "help": "Currently only between 6 and 16. Use > to connect multiple areas. Example: 6 > 7 > 8" + }, + "Completion": { + "name": "Completion level", + "help": "", + "clear": "Clear", + "three_stars": "3 Stars", + "three_stars_chest": "3 Stars + Chest" + } + }, "ItemStorage": { "_info": { "name": "ItemStorage._info.name", diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index 1f1e0da..b4b76fb 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -4,6 +4,10 @@ "name": "AAS", "help": "" }, + "Copilot": { + "name": "Menu.Copilot.name", + "help": "Menu.Copilot.help" + }, "Daily": { "name": "每日", "help": "" @@ -30,6 +34,10 @@ "name": "仪表盘更新", "help": "" }, + "Auto_Mission": { + "name": "Task.Auto_Mission.name", + "help": "Task.Auto_Mission.help" + }, "Cafe": { "name": "咖啡厅", "help": "" @@ -816,6 +824,91 @@ "help": "x125k 信用点 - 100 战术硬币" } }, + "Formation": { + "_info": { + "name": "Formation._info.name", + "help": "Formation._info.help" + }, + "burst1": { + "name": "Formation.burst1.name", + "help": "Formation.burst1.help" + }, + "burst2": { + "name": "Formation.burst2.name", + "help": "Formation.burst2.help" + }, + "pierce1": { + "name": "Formation.pierce1.name", + "help": "Formation.pierce1.help" + }, + "pierce2": { + "name": "Formation.pierce2.name", + "help": "Formation.pierce2.help" + }, + "mystic1": { + "name": "Formation.mystic1.name", + "help": "Formation.mystic1.help" + }, + "mystic2": { + "name": "Formation.mystic2.name", + "help": "Formation.mystic2.help" + }, + "Substitute": { + "name": "Formation.Substitute.name", + "help": "Formation.Substitute.help" + } + }, + "ManualBoss": { + "_info": { + "name": "ManualBoss._info.name", + "help": "ManualBoss._info.help" + }, + "Enable": { + "name": "ManualBoss.Enable.name", + "help": "ManualBoss.Enable.help" + } + }, + "Normal": { + "_info": { + "name": "Normal._info.name", + "help": "Normal._info.help" + }, + "Enable": { + "name": "Normal.Enable.name", + "help": "Normal.Enable.help" + }, + "Area": { + "name": "Normal.Area.name", + "help": "Normal.Area.help" + }, + "Completion": { + "name": "Normal.Completion.name", + "help": "Normal.Completion.help", + "clear": "clear", + "three_stars": "three_stars" + } + }, + "Hard": { + "_info": { + "name": "Hard._info.name", + "help": "Hard._info.help" + }, + "Enable": { + "name": "Hard.Enable.name", + "help": "Hard.Enable.help" + }, + "Area": { + "name": "Hard.Area.name", + "help": "Hard.Area.help" + }, + "Completion": { + "name": "Hard.Completion.name", + "help": "Hard.Completion.help", + "clear": "clear", + "three_stars": "three_stars", + "three_stars_chest": "three_stars_chest" + } + }, "ItemStorage": { "_info": { "name": "ItemStorage._info.name", diff --git a/tasks/schedule/scroll_select.py b/module/ui/scroll_select.py similarity index 96% rename from tasks/schedule/scroll_select.py rename to module/ui/scroll_select.py index ef85395..c681817 100644 --- a/tasks/schedule/scroll_select.py +++ b/module/ui/scroll_select.py @@ -13,8 +13,6 @@ class ScrollSelect: Parameters ---------- - targetind : int - Index of the target level window_starty: Y-coordinate of the upper edge of the window first_item_endy: @@ -31,7 +29,7 @@ class ScrollSelect: Whether to click on clickx and the last row after the sliding ends """ - def __init__(self, window_button, first_item_button, expected_button, clickx, swipeoffsetx=-100, + def __init__(self, window_button, first_item_button, expected_button, clickx, swipeoffsetx=-100, responsey=40, finalclick=True) -> None: # TODO: Actually, only concerned about the height of one element, completely displaying the Y of the first button, completely displaying the Y of the bottom button, the number of complete elements that the window can contain, the height of the last element in the window, and the left offset and response distance. self.window_starty = window_button.area[1] @@ -42,7 +40,7 @@ class ScrollSelect: self.clickx = clickx self.expected_button = expected_button self.swipeoffsetx = swipeoffsetx - self.responsey = 40 + self.responsey = responsey self.finalclick = finalclick def compute_swipe(self, main, x1, y1, distance, responsey): @@ -59,7 +57,7 @@ class ScrollSelect: main.device.swipe((x1, y1), (x1, int(y1 - (distance + responsey - 4 * (1 + distance / 100)))), duration=1 + distance / 100) - def select_location(self, main, target_index) -> None: + def select_index(self, main, target_index, clickoffsety=0) -> None: click_coords = main.device.click_methods.get(main.config.Emulator_ControlMethod, main.device.click_adb) logger.info("Scroll and select the {}-th level".format(target_index + 1)) self.scroll_right_up(main, scrollx=self.clickx + self.swipeoffsetx) @@ -110,8 +108,10 @@ class ScrollSelect: self.responsey) if self.finalclick: # Click on the last row + clicky = (self.window_endy - self.itemheight // 2) + clickoffsety + logger.info(clicky) self.run_until(main, - lambda: click_coords(self.clickx, self.window_endy - self.itemheight // 2), + lambda: click_coords(self.clickx, clicky), lambda: main.appear(self.expected_button) ) diff --git a/tasks/auto_mission/assets/assets_auto_mission.py b/tasks/auto_mission/assets/assets_auto_mission.py new file mode 100644 index 0000000..281e9f5 --- /dev/null +++ b/tasks/auto_mission/assets/assets_auto_mission.py @@ -0,0 +1,773 @@ +from module.base.button import Button, ButtonWrapper + +# This file was auto-generated, do not modify it manually. To generate: +# ``` python -m dev_tools.button_extract ``` + +ACCELERATE = ButtonWrapper( + name='ACCELERATE', + jp=None, + en=Button( + file='./assets/en/auto_mission/ACCELERATE.png', + area=(1170, 604, 1257, 643), + search=(1150, 584, 1277, 663), + color=(244, 208, 26), + button=(1170, 604, 1257, 643), + ), + zht=Button( + file='./assets/zht/auto_mission/ACCELERATE.png', + area=(1176, 607, 1248, 641), + search=(1156, 587, 1268, 661), + color=(239, 200, 12), + button=(1176, 607, 1248, 641), + ), +) +AUTO = ButtonWrapper( + name='AUTO', + jp=None, + en=Button( + file='./assets/en/auto_mission/AUTO.png', + area=(1164, 655, 1254, 698), + search=(1144, 635, 1274, 718), + color=(236, 209, 17), + button=(1164, 655, 1254, 698), + ), + zht=Button( + file='./assets/zht/auto_mission/AUTO.png', + area=(1170, 660, 1252, 693), + search=(1150, 640, 1272, 713), + color=(227, 196, 14), + button=(1170, 660, 1252, 693), + ), +) +AUTO_END_OFF = ButtonWrapper( + name='AUTO_END_OFF', + jp=None, + en=Button( + file='./assets/en/auto_mission/AUTO_END_OFF.png', + area=(1028, 580, 1069, 620), + search=(1008, 560, 1089, 640), + color=(91, 132, 166), + button=(1028, 580, 1069, 620), + ), + zht=Button( + file='./assets/zht/auto_mission/AUTO_END_OFF.png', + area=(1040, 578, 1076, 621), + search=(1020, 558, 1096, 641), + color=(93, 134, 167), + button=(1040, 578, 1076, 621), + ), +) +AUTO_END_ON = ButtonWrapper( + name='AUTO_END_ON', + jp=None, + en=Button( + file='./assets/en/auto_mission/AUTO_END_ON.png', + area=(1028, 579, 1065, 620), + search=(1008, 559, 1085, 640), + color=(88, 146, 182), + button=(1028, 579, 1065, 620), + ), + zht=Button( + file='./assets/zht/auto_mission/AUTO_END_ON.png', + area=(1037, 581, 1078, 618), + search=(1017, 561, 1098, 638), + color=(89, 146, 181), + button=(1037, 581, 1078, 618), + ), +) +BATTLE_COMPLETE = ButtonWrapper( + name='BATTLE_COMPLETE', + jp=None, + en=Button( + file='./assets/en/auto_mission/BATTLE_COMPLETE.png', + area=(1115, 638, 1228, 694), + search=(1095, 618, 1248, 714), + color=(104, 199, 235), + button=(1115, 638, 1228, 694), + ), + zht=Button( + file='./assets/zht/auto_mission/BATTLE_COMPLETE.png', + area=(1117, 638, 1228, 692), + search=(1097, 618, 1248, 712), + color=(105, 202, 238), + button=(1117, 638, 1228, 692), + ), +) +BEGIN_MISSION = ButtonWrapper( + name='BEGIN_MISSION', + jp=None, + en=Button( + file='./assets/en/auto_mission/BEGIN_MISSION.png', + area=(1097, 637, 1244, 694), + search=(1077, 617, 1264, 714), + color=(241, 216, 65), + button=(1097, 637, 1244, 694), + ), + zht=Button( + file='./assets/zht/auto_mission/BEGIN_MISSION.png', + area=(1093, 642, 1248, 690), + search=(1073, 622, 1268, 710), + color=(237, 209, 62), + button=(1093, 642, 1248, 690), + ), +) +CHEST = ButtonWrapper( + name='CHEST', + jp=None, + en=Button( + file='./assets/en/auto_mission/CHEST.png', + area=(150, 539, 206, 578), + search=(130, 519, 226, 598), + color=(150, 204, 233), + button=(150, 539, 206, 578), + ), + zht=Button( + file='./assets/zht/auto_mission/CHEST.png', + area=(151, 544, 185, 576), + search=(131, 524, 205, 596), + color=(144, 206, 238), + button=(151, 544, 185, 576), + ), +) +END_PHASE = ButtonWrapper( + name='END_PHASE', + jp=None, + en=Button( + file='./assets/en/auto_mission/END_PHASE.png', + area=(1095, 640, 1251, 696), + search=(1075, 620, 1271, 716), + color=(228, 207, 64), + button=(1095, 640, 1251, 696), + ), + zht=Button( + file='./assets/zht/auto_mission/END_PHASE.png', + area=(1093, 642, 1246, 691), + search=(1073, 622, 1266, 711), + color=(219, 198, 62), + button=(1093, 642, 1246, 691), + ), +) +END_PHASE_POPUP = ButtonWrapper( + name='END_PHASE_POPUP', + jp=None, + en=Button( + file='./assets/en/auto_mission/END_PHASE_POPUP.png', + area=(433, 335, 842, 401), + search=(413, 315, 862, 421), + color=(222, 223, 223), + button=(663, 473, 875, 535), + ), + zht=Button( + file='./assets/zht/auto_mission/END_PHASE_POPUP.png', + area=(488, 298, 785, 371), + search=(468, 278, 805, 391), + color=(199, 200, 200), + button=(663, 470, 876, 533), + ), +) +ENTER_SUB = ButtonWrapper( + name='ENTER_SUB', + jp=None, + en=Button( + file='./assets/en/auto_mission/ENTER_SUB.png', + area=(541, 494, 737, 528), + search=(521, 474, 757, 548), + color=(201, 182, 59), + button=(541, 494, 737, 528), + ), + zht=Button( + file='./assets/zht/auto_mission/ENTER_SUB.png', + area=(553, 490, 712, 538), + search=(533, 470, 732, 558), + color=(209, 191, 62), + button=(553, 490, 712, 538), + ), +) +LAYOUT = ButtonWrapper( + name='LAYOUT', + jp=None, + en=Button( + file='./assets/en/auto_mission/LAYOUT.png', + area=(1179, 461, 1226, 504), + search=(1159, 441, 1246, 524), + color=(189, 198, 210), + button=(1179, 461, 1226, 504), + ), + zht=Button( + file='./assets/zht/auto_mission/LAYOUT.png', + area=(1179, 461, 1226, 504), + search=(1159, 441, 1246, 524), + color=(189, 198, 210), + button=(1179, 461, 1226, 504), + ), +) +MISSION_COMPLETE = ButtonWrapper( + name='MISSION_COMPLETE', + jp=None, + en=Button( + file='./assets/en/auto_mission/MISSION_COMPLETE.png', + area=(926, 635, 1116, 696), + search=(906, 615, 1136, 716), + color=(231, 216, 69), + button=(926, 635, 1116, 696), + ), + zht=Button( + file='./assets/zht/auto_mission/MISSION_COMPLETE.png', + area=(921, 633, 1140, 696), + search=(901, 613, 1160, 716), + color=(235, 220, 69), + button=(921, 633, 1140, 696), + ), +) +MISSION_INFO = ButtonWrapper( + name='MISSION_INFO', + jp=None, + en=Button( + file='./assets/en/auto_mission/MISSION_INFO.png', + area=(928, 637, 1059, 697), + search=(908, 617, 1079, 717), + color=(106, 202, 238), + button=(928, 637, 1059, 697), + ), + zht=Button( + file='./assets/zht/auto_mission/MISSION_INFO.png', + area=(926, 642, 1057, 690), + search=(906, 622, 1077, 710), + color=(101, 191, 226), + button=(926, 642, 1057, 690), + ), +) +MISSION_INFO_POPUP = ButtonWrapper( + name='MISSION_INFO_POPUP', + jp=None, + en=Button( + file='./assets/en/auto_mission/MISSION_INFO_POPUP.png', + area=(545, 78, 739, 115), + search=(525, 58, 759, 135), + color=(193, 201, 209), + button=(767, 560, 970, 626), + ), + zht=Button( + file='./assets/zht/auto_mission/MISSION_INFO_POPUP.png', + area=(575, 82, 704, 115), + search=(555, 62, 724, 135), + color=(164, 175, 187), + button=(770, 562, 963, 622), + ), +) +MOBILIZE = ButtonWrapper( + name='MOBILIZE', + jp=None, + en=Button( + file='./assets/en/auto_mission/MOBILIZE.png', + area=(1076, 618, 1239, 697), + search=(1056, 598, 1259, 717), + color=(226, 208, 67), + button=(1076, 618, 1239, 697), + ), + zht=Button( + file='./assets/zht/auto_mission/MOBILIZE.png', + area=(1080, 622, 1236, 696), + search=(1060, 602, 1256, 716), + color=(231, 215, 69), + button=(1080, 622, 1236, 696), + ), +) +MOVE_UNIT = ButtonWrapper( + name='MOVE_UNIT', + jp=None, + en=Button( + file='./assets/en/auto_mission/MOVE_UNIT.png', + area=(534, 304, 739, 363), + search=(514, 284, 759, 383), + color=(225, 225, 225), + button=(657, 471, 877, 535), + ), + zht=Button( + file='./assets/zht/auto_mission/MOVE_UNIT.png', + area=(529, 298, 763, 363), + search=(509, 278, 783, 383), + color=(215, 216, 216), + button=(663, 473, 875, 529), + ), +) +OCR_AREA = ButtonWrapper( + name='OCR_AREA', + jp=None, + en=Button( + file='./assets/en/auto_mission/OCR_AREA.png', + area=(119, 194, 166, 243), + search=(99, 174, 186, 263), + color=(228, 230, 232), + button=(119, 194, 166, 243), + ), + zht=Button( + file='./assets/zht/auto_mission/OCR_AREA.png', + area=(123, 192, 183, 240), + search=(103, 172, 203, 260), + color=(223, 225, 228), + button=(123, 192, 183, 240), + ), +) +OCR_UNIT = ButtonWrapper( + name='OCR_UNIT', + jp=None, + en=Button( + file='./assets/en/auto_mission/OCR_UNIT.png', + area=(114, 535, 141, 576), + search=(94, 515, 161, 596), + color=(238, 238, 240), + button=(114, 535, 141, 576), + ), + zht=Button( + file='./assets/zht/auto_mission/OCR_UNIT.png', + area=(55, 540, 92, 573), + search=(35, 520, 112, 593), + color=(234, 235, 237), + button=(55, 540, 92, 573), + ), +) +ONE_STAR = ButtonWrapper( + name='ONE_STAR', + jp=None, + en=Button( + file='./assets/en/auto_mission/ONE_STAR.png', + area=(148, 349, 183, 390), + search=(128, 329, 203, 410), + color=(240, 235, 215), + button=(148, 349, 183, 390), + ), + zht=Button( + file='./assets/zht/auto_mission/ONE_STAR.png', + area=(148, 349, 183, 390), + search=(128, 329, 203, 410), + color=(240, 235, 215), + button=(148, 349, 183, 390), + ), +) +PRESET1_OFF = ButtonWrapper( + name='PRESET1_OFF', + jp=None, + en=None, + zht=Button( + file='./assets/zht/auto_mission/PRESET1_OFF.png', + area=(52, 143, 197, 181), + search=(32, 123, 217, 201), + color=(253, 253, 254), + button=(52, 143, 197, 181), + ), +) +PRESET1_ON = ButtonWrapper( + name='PRESET1_ON', + jp=None, + en=Button( + file='./assets/en/auto_mission/PRESET1_ON.png', + area=(54, 146, 200, 182), + search=(34, 126, 220, 202), + color=(48, 77, 115), + button=(54, 146, 200, 182), + ), + zht=Button( + file='./assets/zht/auto_mission/PRESET1_ON.png', + area=(54, 146, 200, 182), + search=(34, 126, 220, 202), + color=(48, 77, 115), + button=(54, 146, 200, 182), + ), +) +PRESET2_OFF = ButtonWrapper( + name='PRESET2_OFF', + jp=None, + en=None, + zht=Button( + file='./assets/zht/auto_mission/PRESET2_OFF.png', + area=(214, 144, 355, 180), + search=(194, 124, 375, 200), + color=(252, 253, 253), + button=(214, 144, 355, 180), + ), +) +PRESET2_ON = ButtonWrapper( + name='PRESET2_ON', + jp=None, + en=Button( + file='./assets/en/auto_mission/PRESET2_ON.png', + area=(211, 147, 355, 182), + search=(191, 127, 375, 202), + color=(50, 78, 116), + button=(211, 147, 355, 182), + ), + zht=Button( + file='./assets/zht/auto_mission/PRESET2_ON.png', + area=(211, 147, 355, 182), + search=(191, 127, 375, 202), + color=(50, 78, 116), + button=(211, 147, 355, 182), + ), +) +PRESET3_OFF = ButtonWrapper( + name='PRESET3_OFF', + jp=None, + en=None, + zht=Button( + file='./assets/zht/auto_mission/PRESET3_OFF.png', + area=(369, 143, 516, 186), + search=(349, 123, 536, 206), + color=(251, 252, 252), + button=(369, 143, 516, 186), + ), +) +PRESET3_ON = ButtonWrapper( + name='PRESET3_ON', + jp=None, + en=Button( + file='./assets/en/auto_mission/PRESET3_ON.png', + area=(365, 146, 517, 184), + search=(345, 126, 537, 204), + color=(49, 78, 116), + button=(365, 146, 517, 184), + ), + zht=Button( + file='./assets/zht/auto_mission/PRESET3_ON.png', + area=(365, 146, 517, 184), + search=(345, 126, 537, 204), + color=(49, 78, 116), + button=(365, 146, 517, 184), + ), +) +PRESET4_OFF = ButtonWrapper( + name='PRESET4_OFF', + jp=None, + en=None, + zht=Button( + file='./assets/zht/auto_mission/PRESET4_OFF.png', + area=(527, 146, 675, 183), + search=(507, 126, 695, 203), + color=(252, 252, 253), + button=(527, 146, 675, 183), + ), +) +PRESET4_ON = ButtonWrapper( + name='PRESET4_ON', + jp=None, + en=Button( + file='./assets/en/auto_mission/PRESET4_ON.png', + area=(528, 148, 676, 178), + search=(508, 128, 696, 198), + color=(50, 78, 117), + button=(528, 148, 676, 178), + ), + zht=Button( + file='./assets/zht/auto_mission/PRESET4_ON.png', + area=(528, 148, 676, 178), + search=(508, 128, 696, 198), + color=(50, 78, 117), + button=(528, 148, 676, 178), + ), +) +PRESET_FIRST_ITEM = ButtonWrapper( + name='PRESET_FIRST_ITEM', + jp=None, + en=Button( + file='./assets/en/auto_mission/PRESET_FIRST_ITEM.png', + area=(28, 184, 1252, 397), + search=(8, 164, 1272, 417), + color=(214, 224, 231), + button=(28, 184, 1252, 397), + ), + zht=Button( + file='./assets/zht/auto_mission/PRESET_FIRST_ITEM.png', + area=(28, 184, 1252, 397), + search=(8, 164, 1272, 417), + color=(214, 224, 231), + button=(28, 184, 1252, 397), + ), +) +PRESET_LIST = ButtonWrapper( + name='PRESET_LIST', + jp=None, + en=Button( + file='./assets/en/auto_mission/PRESET_LIST.png', + area=(556, 85, 726, 120), + search=(536, 65, 746, 140), + color=(197, 205, 213), + button=(556, 85, 726, 120), + ), + zht=Button( + file='./assets/zht/auto_mission/PRESET_LIST.png', + area=(567, 83, 708, 120), + search=(547, 63, 728, 140), + color=(177, 187, 197), + button=(567, 83, 708, 120), + ), +) +PRESET_WINDOW = ButtonWrapper( + name='PRESET_WINDOW', + jp=None, + en=Button( + file='./assets/en/auto_mission/PRESET_WINDOW.png', + area=(28, 184, 1252, 649), + search=(8, 164, 1272, 669), + color=(215, 226, 233), + button=(28, 184, 1252, 649), + ), + zht=Button( + file='./assets/zht/auto_mission/PRESET_WINDOW.png', + area=(28, 184, 1252, 649), + search=(8, 164, 1272, 669), + color=(215, 226, 233), + button=(28, 184, 1252, 649), + ), +) +RANK = ButtonWrapper( + name='RANK', + jp=None, + en=Button( + file='./assets/en/auto_mission/RANK.png', + area=(540, 625, 740, 690), + search=(520, 605, 760, 710), + color=(232, 214, 68), + button=(540, 625, 740, 690), + ), + zht=Button( + file='./assets/zht/auto_mission/RANK.png', + area=(540, 628, 738, 689), + search=(520, 608, 758, 709), + color=(233, 216, 69), + button=(540, 628, 738, 689), + ), +) +RECEIVED_CHEST = ButtonWrapper( + name='RECEIVED_CHEST', + jp=None, + en=Button( + file='./assets/en/auto_mission/RECEIVED_CHEST.png', + area=(502, 188, 774, 226), + search=(482, 168, 794, 246), + color=(198, 208, 217), + button=(547, 487, 738, 547), + ), + zht=Button( + file='./assets/zht/auto_mission/RECEIVED_CHEST.png', + area=(569, 192, 704, 226), + search=(549, 172, 724, 246), + color=(177, 187, 197), + button=(549, 488, 736, 543), + ), +) +REWARD_ACQUIRED = ButtonWrapper( + name='REWARD_ACQUIRED', + jp=None, + en=Button( + file='./assets/en/auto_mission/REWARD_ACQUIRED.png', + area=(529, 133, 562, 183), + search=(509, 113, 582, 203), + color=(170, 176, 96), + button=(682, 628, 871, 693), + ), + zht=Button( + file='./assets/zht/auto_mission/REWARD_ACQUIRED.png', + area=(593, 132, 628, 155), + search=(573, 112, 648, 175), + color=(230, 228, 92), + button=(673, 627, 872, 687), + ), +) +SKIP_BATTLE_OFF = ButtonWrapper( + name='SKIP_BATTLE_OFF', + jp=None, + en=Button( + file='./assets/en/auto_mission/SKIP_BATTLE_OFF.png', + area=(1076, 525, 1120, 563), + search=(1056, 505, 1140, 583), + color=(90, 131, 165), + button=(1076, 525, 1120, 563), + ), + zht=Button( + file='./assets/zht/auto_mission/SKIP_BATTLE_OFF.png', + area=(1097, 523, 1135, 563), + search=(1077, 503, 1155, 583), + color=(94, 136, 170), + button=(1097, 523, 1135, 563), + ), +) +SKIP_BATTLE_ON = ButtonWrapper( + name='SKIP_BATTLE_ON', + jp=None, + en=Button( + file='./assets/en/auto_mission/SKIP_BATTLE_ON.png', + area=(1078, 524, 1115, 566), + search=(1058, 504, 1135, 586), + color=(87, 145, 181), + button=(1078, 524, 1115, 566), + ), + zht=Button( + file='./assets/zht/auto_mission/SKIP_BATTLE_ON.png', + area=(1100, 528, 1136, 561), + search=(1080, 508, 1156, 581), + color=(96, 161, 196), + button=(1100, 528, 1136, 561), + ), +) +THREE_STARS = ButtonWrapper( + name='THREE_STARS', + jp=None, + en=Button( + file='./assets/en/auto_mission/THREE_STARS.png', + area=(158, 357, 177, 441), + search=(138, 337, 197, 461), + color=(234, 222, 173), + button=(158, 357, 177, 441), + ), + zht=Button( + file='./assets/zht/auto_mission/THREE_STARS.png', + area=(158, 357, 177, 441), + search=(138, 337, 197, 461), + color=(234, 222, 173), + button=(158, 357, 177, 441), + ), +) +UNIT1_OFF = ButtonWrapper( + name='UNIT1_OFF', + jp=None, + en=Button( + file='./assets/en/auto_mission/UNIT1_OFF.png', + area=(2, 157, 152, 219), + search=(0, 137, 172, 239), + color=(248, 249, 249), + button=(2, 157, 152, 219), + ), + zht=Button( + file='./assets/zht/auto_mission/UNIT1_OFF.png', + area=(1, 160, 147, 219), + search=(0, 140, 167, 239), + color=(240, 242, 243), + button=(1, 160, 147, 219), + ), +) +UNIT1_ON = ButtonWrapper( + name='UNIT1_ON', + jp=None, + en=Button( + file='./assets/en/auto_mission/UNIT1_ON.png', + area=(2, 157, 149, 217), + search=(0, 137, 169, 237), + color=(53, 75, 97), + button=(2, 157, 149, 217), + ), + zht=Button( + file='./assets/zht/auto_mission/UNIT1_ON.png', + area=(0, 159, 142, 214), + search=(0, 139, 162, 234), + color=(62, 81, 94), + button=(0, 159, 142, 214), + ), +) +UNIT2_OFF = ButtonWrapper( + name='UNIT2_OFF', + jp=None, + en=Button( + file='./assets/en/auto_mission/UNIT2_OFF.png', + area=(1, 235, 152, 295), + search=(0, 215, 172, 315), + color=(247, 248, 249), + button=(1, 235, 152, 295), + ), + zht=Button( + file='./assets/zht/auto_mission/UNIT2_OFF.png', + area=(4, 240, 151, 297), + search=(0, 220, 171, 317), + color=(240, 241, 243), + button=(4, 240, 151, 297), + ), +) +UNIT2_ON = ButtonWrapper( + name='UNIT2_ON', + jp=None, + en=Button( + file='./assets/en/auto_mission/UNIT2_ON.png', + area=(3, 237, 151, 297), + search=(0, 217, 171, 317), + color=(54, 76, 97), + button=(3, 237, 151, 297), + ), + zht=Button( + file='./assets/zht/auto_mission/UNIT2_ON.png', + area=(4, 240, 154, 291), + search=(0, 220, 174, 311), + color=(63, 82, 94), + button=(4, 240, 154, 291), + ), +) +UNIT3_OFF = ButtonWrapper( + name='UNIT3_OFF', + jp=None, + en=Button( + file='./assets/en/auto_mission/UNIT3_OFF.png', + area=(0, 317, 153, 373), + search=(0, 297, 173, 393), + color=(247, 248, 248), + button=(0, 317, 153, 373), + ), + zht=Button( + file='./assets/zht/auto_mission/UNIT3_OFF.png', + area=(5, 320, 149, 374), + search=(0, 300, 169, 394), + color=(238, 240, 242), + button=(5, 320, 149, 374), + ), +) +UNIT3_ON = ButtonWrapper( + name='UNIT3_ON', + jp=None, + en=Button( + file='./assets/en/auto_mission/UNIT3_ON.png', + area=(4, 313, 149, 375), + search=(0, 293, 169, 395), + color=(54, 76, 97), + button=(4, 313, 149, 375), + ), + zht=Button( + file='./assets/zht/auto_mission/UNIT3_ON.png', + area=(0, 318, 151, 371), + search=(0, 298, 171, 391), + color=(63, 82, 94), + button=(0, 318, 151, 371), + ), +) +UNIT4_OFF = ButtonWrapper( + name='UNIT4_OFF', + jp=None, + en=Button( + file='./assets/en/auto_mission/UNIT4_OFF.png', + area=(1, 395, 154, 451), + search=(0, 375, 174, 471), + color=(247, 247, 248), + button=(1, 395, 154, 451), + ), + zht=Button( + file='./assets/zht/auto_mission/UNIT4_OFF.png', + area=(0, 396, 145, 449), + search=(0, 376, 165, 469), + color=(238, 240, 241), + button=(0, 396, 145, 449), + ), +) +UNIT4_ON = ButtonWrapper( + name='UNIT4_ON', + jp=None, + en=Button( + file='./assets/en/auto_mission/UNIT4_ON.png', + area=(3, 395, 147, 454), + search=(0, 375, 167, 474), + color=(54, 76, 96), + button=(3, 395, 147, 454), + ), + zht=Button( + file='./assets/zht/auto_mission/UNIT4_ON.png', + area=(3, 396, 153, 451), + search=(0, 376, 173, 471), + color=(62, 81, 94), + button=(3, 396, 153, 451), + ), +) diff --git a/tasks/auto_mission/auto_mission.py b/tasks/auto_mission/auto_mission.py new file mode 100644 index 0000000..296df8b --- /dev/null +++ b/tasks/auto_mission/auto_mission.py @@ -0,0 +1,303 @@ +from tasks.mission.mission import Mission +from tasks.mission.ui import SWITCH_NORMAL, SWITCH_HARD +from tasks.auto_mission.stage import Stage +from tasks.auto_mission.ui import AutoMissionUI +from enum import Enum + +from module.base.timer import Timer +from module.exception import RequestHumanTakeover +from module.logger import logger +from tasks.item.data_update import DataUpdate + +import re + +class AutoMissionStatus(Enum): + AP = 0 # Calculate AP and decide to terminate Auto-Mission module or not + STAGES_DATA = 1 # Retrieve stages data for the area and resolve conflicts for type_to_preset + NAVIGATE = 2 # Navigate to the area and select mode + ENTER = 3 # Enter the first stage in the stage list + CHECK = 4 # Check stages and find a stage that requires to be completed + START = 5 # Start the stage + FORMATION = 6 # Select units based on the types required by the stage + FIGHT = 7 # Fight the stage + END = 8 # Update task + FINISH = -1 # Indicate termination of Auto-Mission module + +class AutoMission(AutoMissionUI, Mission): + def __init__(self, config, device): + super().__init__(config, device) + self.task: list[str, list[int], bool] = None + self.previous_mode: str = None + self.previous_area: int = None + self._stage: Stage = None + self.stages_data: dict = None + self.default_type_to_preset: dict = self.get_default_type_to_preset() + self.current_type_to_preset: dict = None + + def get_default_type_to_preset(self) -> dict[str, list[int, int]]: + """ + Validate preset settings and returs a dictionary + mapping each type to its preset e.g {burst1: [1, 1]} + """ + type_to_preset: dict[str, str] = { + "burst1": self.config.Formation_burst1, + "burst2": self.config.Formation_burst2, + "pierce1": self.config.Formation_pierce1, + "pierce2": self.config.Formation_pierce2, + "mystic1": self.config.Formation_mystic1, + "mystic2": self.config.Formation_mystic2 + } + valid = True + for type, preset in type_to_preset.items(): + preset_list = [] + if isinstance(preset, str): + preset = re.sub(r'[ \t\r\n]', '', preset) + preset = preset.split("-") + if len(preset) == 2: + column = preset[0] + row = preset[1] + if (column.isdigit() and 1 <= int(column) <= 4) and (row.isdigit() and 1 <= int(row) <= 5): + preset_list = [int(num) for num in preset] + if not preset_list: + logger.error(f"Failed to read {type}'s preset settings") + valid = False + continue + type_to_preset[type] = preset_list + + if not valid: + raise RequestHumanTakeover + return type_to_preset + + def validate_area(self, mode, area_input) -> list[int]: + """ + Validate the area input and returns the area as a list of integers + """ + area_list: list[int] = [] + if isinstance(area_input, str): + area_input = re.sub(r'[ \t\r\n]', '', area_input) + area_input = (re.sub(r'[>﹥›˃ᐳ❯]', '>', area_input)).split('>') + # tried to convert to set to remove duplicates but doesn't maintain order + [area_list.append(x) for x in area_input if x not in area_list] + elif isinstance(area_input, int): + area_list = [str(area_input)] + + if area_list and len([x for x in area_list if x.isdigit()]) == len(area_list): + return [int(x) for x in area_list] + else: + mode_name = "Normal" if mode == "N" else "H" + logger.error(f"Failed to read Mission {mode_name}'s area settings") + return None + + def find_alternative(self, type: str, preset_list: list[list[int, int]]) -> list[list[int, int]]: + if not self.config.Formation_Substitute: + return None + + alternatives_dictionary = { + 'pierce1': ['pierce2', 'burst1', 'burst2', 'mystic1', 'mystic2'], + 'pierce2': ['burst1', 'burst2', 'mystic1', 'mystic2'], + 'burst1': ['burst2', 'pierce1', 'pierce2', 'mystic1', 'mystic2'], + 'burst2': ['pierce1', 'pierce2', 'mystic1', 'mystic2'], + 'mystic1': ['mystic2', 'burst1', 'burst2', 'pierce1', 'pierce2'], + 'mystic2': ['burst1', 'burst2', 'pierce1', 'pierce2'], + } + alternatives = alternatives_dictionary[type] + for alternative in alternatives: + alternative_preset = self.default_type_to_preset[alternative] + if alternative_preset not in preset_list: + preset_list.append(alternative_preset) + logger.warning(f"{type} was replaced by {alternative}") + return preset_list + logger.error(f"Unable to find replacements for {type}") + return None + + @property + def mission_info(self) -> list[str, list[int], bool]: + """ + Generate task, a list of list where each inner list is defined as + [mode, area_list, completion_level] e.g ["H", [6,7,8], "clear"] + """ + valid = True + mode = ("N", "H") + enable: tuple[bool] = (self.config.Normal_Enable, self.config.Hard_Enable) + area: tuple[str] = (self.config.Normal_Area, self.config.Hard_Area) + area_list: list[list[int]] = [None, None] + completion_level: tuple[bool] = (self.config.Normal_Completion, self.config.Hard_Completion) + + for index in range(2): + if enable[index]: + area_list[index] = self.validate_area(mode[index], area[index]) + valid = valid if area_list[index] else False + + if valid: + info = zip(mode, area_list, completion_level) + return list(filter(lambda x: x[1], info)) + return None + + @property + def current_mode(self): + return self.task[0][0] + + @property + def current_area(self): + return self.task[0][1][0] + + @property + def current_stage(self): + return self._stage + + @current_stage.setter + def current_stage(self, value: Stage): + self._stage = value + + @property + def current_completion_level(self): + return self.task[0][2] + + @property + def current_count(self): + # required to use update_ap() and get_realistic_count() + return 1 + + def update_stages_data(self) -> bool: + if [self.previous_mode, self.previous_area] != [self.current_mode, self.current_area]: + self.stages_data = self.get_stages_data(self.current_mode, self.current_area) + if self.stages_data: + return True + return False + + def update_current_type_to_preset(self) -> bool: + if [self.previous_mode, self.previous_area] == [self.current_mode, self.current_area]: + # set it to None. This will skip changing preset in self.formation + self.current_type_to_preset = None + return True + + mode_name = "Normal" if self.current_mode == "N" else "Hard" + use_alternative = False + for stage, info in self.stages_data.items(): + if "start" not in info: + continue + + list_preset: list[list[int, int]] = [] + list_type : list[str] = [] + for type in info["start"]: + preset = self.default_type_to_preset[type] + list_type.append(type) + + if preset not in list_preset: + list_preset.append(preset) + continue + logger.error(f"Mission {mode_name} {self.current_area} requires\ + {list_type} but they are both set to preset {preset}") + list_preset = self.find_alternative(type, list_preset) + use_alternative = True + if list_preset: + continue + return False + + if use_alternative: + alt_type_to_preset: dict[str, list[list[int, int]]] = {} + for index in range(len(list_type)): + type, preset = list_type[index], list_preset[index] + alt_type_to_preset[type] = preset + self.current_type_to_preset = alt_type_to_preset + else: + self.current_type_to_preset = self.default_type_to_preset + return True + + return False + + def update_task(self): + self.previous_mode = self.current_mode + self.previous_area = self.current_area + area_list = self.task[0][1] + area_list.pop(0) + if not area_list: + self.task.pop(0) + + def handle_auto_mission(self, status): + match status: + case AutoMissionStatus.AP: + if self.task: + self.realistic_count = self.get_realistic_count() + if self.realistic_count != 0: + return AutoMissionStatus.STAGES_DATA + return AutoMissionStatus.FINISH + + case AutoMissionStatus.STAGES_DATA: + if self.update_stages_data() and self.update_current_type_to_preset(): + return AutoMissionStatus.NAVIGATE + return AutoMissionStatus.END + + case AutoMissionStatus.NAVIGATE: + switch = SWITCH_NORMAL if self.current_mode == "N" else SWITCH_HARD + self.navigate(self.previous_mode, self.current_mode) + if self.select_area(self.current_area) and self.select_mode(switch): + return AutoMissionStatus.ENTER + raise RequestHumanTakeover + + case AutoMissionStatus.ENTER: + if self.wait_mission_info(self.current_mode, open_task=True): + return AutoMissionStatus.CHECK + raise RequestHumanTakeover + + case AutoMissionStatus.CHECK: + self.current_stage: Stage = self.check_stages( + self.current_mode, self.current_area, self.stages_data, self.current_completion_level + ) + if self.current_stage: + return AutoMissionStatus.START + return AutoMissionStatus.END + + case AutoMissionStatus.START: + self.start_stage(self.current_stage) + return AutoMissionStatus.FORMATION + + case AutoMissionStatus.FORMATION: + self.formation(self.current_stage, self.current_type_to_preset) + return AutoMissionStatus.FIGHT + + case AutoMissionStatus.FIGHT: + self.fight(self.current_stage, manual_boss=self.config.ManualBoss_Enable) + self.update_ap() + self.previous_mode = self.current_mode + self.previous_area = self.current_area + return AutoMissionStatus.AP + + case AutoMissionStatus.END: + self.update_task() + return AutoMissionStatus.AP + + case AutoMissionStatus.FINISH: + return status + + case _: + logger.warning(f'Invalid status: {status}') + + return status + + def run(self): + self.task = self.valid_task + if self.task: + action_timer = Timer(0.5, 1) + status = AutoMissionStatus.AP + + """Update the dashboard to accurately calculate AP""" + DataUpdate(config=self.config, device=self.device).run() + + while 1: + self.device.screenshot() + + if self.ui_additional(): + continue + + if action_timer.reached_and_reset(): + logger.attr('Status', status) + status = self.handle_auto_mission(status) + + if status == AutoMissionStatus.FINISH: + break + else: + raise RequestHumanTakeover + + self.config.task_delay(server_update=True) + \ No newline at end of file diff --git a/tasks/auto_mission/copilot.py b/tasks/auto_mission/copilot.py new file mode 100644 index 0000000..6188208 --- /dev/null +++ b/tasks/auto_mission/copilot.py @@ -0,0 +1,345 @@ +from module.base.timer import Timer +from module.logger import logger +from module.ui.switch import Switch +from module.ocr.ocr import Digit +from tasks.base.ui import UI +from tasks.base.assets.assets_base_page import MISSION_CHECK +from tasks.auto_mission.assets.assets_auto_mission import * +from tasks.auto_mission.stage import StageState, Stage + +PRESETS = [PRESET1_ON, PRESET2_ON, PRESET3_ON, PRESET4_ON] + +SWITCH_UNIT1 = Switch('Unit1_Switch') +SWITCH_UNIT1.add_state('on', UNIT1_ON) +SWITCH_UNIT1.add_state('off', UNIT1_OFF) + +SWITCH_UNIT2 = Switch('Unit2_Switch') +SWITCH_UNIT2.add_state('on', UNIT2_ON) +SWITCH_UNIT2.add_state('off', UNIT2_OFF) + +SWITCH_UNIT3 = Switch('Unit3_Switch') +SWITCH_UNIT3.add_state('on', UNIT3_ON) +SWITCH_UNIT3.add_state('off', UNIT3_OFF) + +SWITCH_UNIT4 = Switch('Unit4_Switch') +SWITCH_UNIT4.add_state('on', UNIT4_ON) +SWITCH_UNIT4.add_state('off', UNIT4_OFF) + +UNIT_SWITCHES = [SWITCH_UNIT1, SWITCH_UNIT2, SWITCH_UNIT3, SWITCH_UNIT4] + +SWITCH_AUTO_END = Switch('Auto_End_Switch') +SWITCH_AUTO_END.add_state('on', AUTO_END_ON) +SWITCH_AUTO_END.add_state('off', AUTO_END_OFF) + +SWITCH_SKIP_BATTLE = Switch('Skip_Battle_Switch') +SWITCH_SKIP_BATTLE.add_state('on', SKIP_BATTLE_ON) +SWITCH_SKIP_BATTLE.add_state('off', SKIP_BATTLE_OFF) + +class Copilot(UI): + """A class dedicated to automate fights""" + def __init__(self, config, device): + super().__init__(config, device) + self.ocr_unit = Digit(OCR_UNIT) + + """---------------------- UTILITY METHODS ------------------------""" + def sleep(self, num: int): + timer = Timer(num).start() + while not timer.reached(): + pass + + def click(self, x, y, interval=1): + self.device.click_methods.get(self.config.Emulator_ControlMethod, self.device.click_adb)(x, y) + if interval: + # sleep because clicks can be too fast when executing actions + self.sleep(interval) + + def click_then_check(self, coords: tuple[int, int], dest_check: ButtonWrapper): + while 1: + self.device.screenshot() + if self.appear(dest_check): + return True + self.click(*coords, interval=2) + + def select_then_check(self, dest_enter: ButtonWrapper, dest_check: ButtonWrapper): + while 1: + self.device.screenshot() + self.appear_then_click(dest_enter, interval=1) + if self.appear(dest_check): + return True + self.sleep(2) + + def set_switch(self, switch: Switch): + """ + Set skip switch to on + Returns: + True if switch is set, False if switch not found + """ + while 1: + self.device.screenshot() + if not switch.appear(main=self): + logger.info(f'{switch.name} not found') + continue + switch.set('on', main=self) + return True + + """---------------------- FORMATION METHODS ------------------------""" + def choose_from_preset(self, type: str, type_to_preset: dict): + preset, row = type_to_preset[type] + preset_index = preset - 1 + self.select_then_check(LAYOUT, PRESET_LIST) + PRESET = PRESETS[preset_index] + while not self.match_color(PRESET, threshold=50): + self.device.screenshot() + self.click_with_interval(PRESET, interval=1) + + click_first = lambda : self.click_then_check((1145, 320), MOBILIZE) + click_second = lambda : self.click_then_check((1145, 530), MOBILIZE) + swipe = lambda : self.device.swipe((500, 625), (500, 350)) + wait = lambda : self.wait_until_stable( + PRESET_WINDOW, + timer=Timer(3, 0), + timeout=Timer(1.5, 5) + ) + match row: + case 1: + click_first() + case 2: + click_second() + case 3: + swipe() + wait() + click_first() + case 4: + swipe() + wait() + click_second() + case 5: + swipe() + swipe() + wait() + click_second() + + def choose_unit(self, unit: int): + unit_index = unit - 1 + unit_switch = UNIT_SWITCHES[unit_index] + self.set_switch(unit_switch) + + def goto_formation_page(self, start_coords: tuple[int, int]): + self.click_then_check(start_coords, MOBILIZE) + + def formation(self, stage: Stage, type_to_preset: dict): + if stage.state == StageState.SUB: + # Select a unit to start the battle + self.choose_unit(1) + if type_to_preset: + type = stage.formation_info + self.choose_from_preset(type, type_to_preset) + self.click_with_interval(MOBILIZE, interval=1) + else: + unit = 1 + for type, start_coords in stage.formation_start_info: + self.goto_formation_page(start_coords) + self.choose_unit(unit) + if type_to_preset: + self.choose_from_preset(type, type_to_preset) + self.select_then_check(MOBILIZE, MISSION_INFO) + unit += 1 + + """---------------------- FIGHT METHODS ------------------------""" + def begin_mission(self): + # start the fight after formation. Not needed for SUB mission. + self.select_then_check(BEGIN_MISSION, END_PHASE) + + def check_skip_auto_over(self): + # set skip battle and auto end when entering the map + self.set_switch(SWITCH_SKIP_BATTLE) + self.set_switch(SWITCH_AUTO_END) + + def get_force(self) -> int: + # detect the current active unit in the map + self.device.screenshot() + current_unit = self.ocr_unit.ocr_single_line(self.device.image) + if current_unit == 0: + return self.get_force() + return current_unit + + def wait_formation_change(self, force_index: int) -> int: + logger.info("Wait formation change") + origin = force_index + while force_index == origin: + force_index = self.get_force() + self.sleep(1) + return force_index + + def handle_all_mission_popup(self): + self.sleep(2) + while not self.match_color(MISSION_INFO): + self.device.screenshot() + if self.match_color(MISSION_INFO): + break + if self.appear_then_click(MISSION_INFO_POPUP): + continue + if self.appear_then_click(MOVE_UNIT): + continue + if self.appear_then_click(RECEIVED_CHEST): + continue + + def handle_mission_popup(self, button: ButtonWrapper, skip_first_screenshot=True): + while 1: + if skip_first_screenshot: + skip_first_screenshot = False + else: + self.device.screenshot() + if self.match_color(MISSION_INFO): + break + if self.appear_then_click(button, interval=2): + continue + + def confirm_teleport(self): + # Detect and confirm the end of the phase + while 1: + self.device.screenshot() + if self.appear(MOVE_UNIT): + self.handle_mission_popup(MOVE_UNIT) + break + + def end_turn(self): + # Detect and confirm the end of the phase + while 1: + self.device.screenshot() + if not self.match_color(END_PHASE): + self.handle_all_mission_popup() + break + self.appear_then_click(END_PHASE) + self.sleep(2) + + def wait_over(self): + #self.sleep(2) + self.select_then_check(MISSION_INFO, MISSION_INFO_POPUP) + self.handle_mission_popup(MISSION_INFO_POPUP) + + def start_action(self, actions, manual_boss: bool): + for i, act in enumerate(actions): + if manual_boss and i == len(actions) - 1: + logger.warning("Actions completed. Waiting for manual boss...") + return + desc = "start " + str(i + 1) + " operation : " + if 'desc' in act: + desc += act['desc'] + logger.info(desc) + force_index = self.get_force() + op = act['t'] + if type(op) is str: + op = [op] + if 'p' in act: + if type(act['p']) is tuple: + act['p'] = [act['p']] + for j in range(0, len(op)): + self.sleep(1) + if op[j] == 'click': + self.click(act['p'][0][0], act['p'][0][1]) + act['p'].pop(0) + elif op[j] == 'teleport': + self.confirm_teleport() + elif op[j] == 'exchange': + self.click(83, 557) + force_index = self.wait_formation_change(force_index) + elif op[j] == 'exchange_twice': + self.click(83, 557) + force_index = self.wait_formation_change(force_index) + self.click(83, 557) + force_index = self.wait_formation_change(force_index) + elif op[j] == 'end-turn': + self.end_turn() + if i != len(actions) - 1: + self.wait_over() + elif op[j] == 'click_and_teleport': + self.click(act['p'][0][0], act['p'][0][1]) + act['p'].pop(0) + self.confirm_teleport() + elif op[j] == 'choose_and_change': + self.click(act['p'][0][0], act['p'][0][1]) + self.click(act['p'][0][0] - 100, act['p'][0][1]) + act['p'].pop(0) + elif op[j] == 'exchange_and_click': + self.click(83, 557) + force_index = self.wait_formation_change(force_index) + #self.sleep(0.5) + self.sleep(1) + self.click(act['p'][0][0], act['p'][0][1]) + act['p'].pop(0) + elif op[j] == 'exchange_twice_and_click': + self.click(83, 557) + force_index = self.wait_formation_change(force_index) + self.click(83, 557) + force_index = self.wait_formation_change(force_index) + #self.sleep(0.5) + self.sleep(1) + self.click(act['p'][0], act['p'][1]) + act['p'].pop(0) + + if 'ec' in act: + self.wait_formation_change(force_index) + if 'wait-over' in act: + self.wait_over() + self.sleep(2) + if i != len(actions) - 1: + self.handle_all_mission_popup() + + logger.warning("Actions completed, waiting to enter the battle...") + + def auto_accelerate(self): + # click on the accelerate and auto button during the fight + while 1: + self.device.screenshot() + self.device.click_record_clear() + self.device.stuck_record_clear() + if self.appear(BATTLE_COMPLETE): + break + elif not self.match_color(AUTO, threshold=50): + self.device.click(AUTO) + elif not self.match_color(ACCELERATE, threshold=50): + self.device.click(ACCELERATE) + elif self.match_color(AUTO, threshold=50) and self.match_color(ACCELERATE, threshold=50): + break + self.sleep(1) + + def auto_fight(self): + # Pause for 3 seconds + self.sleep(3) + # Wait for the game stage to finish loading + self.handle_loading() + # Change the settings for automatic fighting + self.auto_accelerate() + # Log a warning message indicating that the check for automatic skill release is completed + logger.warning("Check for automatic skill release completed") + + def goto_mission_page(self): + # go back to mission page after fight + while 1: + self.device.screenshot() + if self.appear(MISSION_CHECK): + break + if self.appear_then_click(BATTLE_COMPLETE, interval=1): + continue + if self.appear_then_click(RANK, interval=1): + continue + if self.appear_then_click(MISSION_COMPLETE, interval=1): + continue + if self.appear_then_click(REWARD_ACQUIRED, interval=1): + continue + self.device.click_record_clear() + self.device.stuck_record_clear() + + def fight(self, stage: Stage, manual_boss: bool): + if stage.state != StageState.SUB: + # Click to start the task + self.begin_mission() + # Check for skip auto over + self.check_skip_auto_over() + # Start moving through the grid + self.start_action(stage.action_info, manual_boss) + # Auto battle + if not manual_boss or stage.state == StageState.SUB: + self.auto_fight() + self.goto_mission_page() diff --git a/tasks/auto_mission/hard_task/__init__.py b/tasks/auto_mission/hard_task/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tasks/auto_mission/hard_task/hard_task_10.py b/tasks/auto_mission/hard_task/hard_task_10.py new file mode 100644 index 0000000..ee77b79 --- /dev/null +++ b/tasks/auto_mission/hard_task/hard_task_10.py @@ -0,0 +1,134 @@ +stage_data = { + '10-1-task-present': { + 'start': { + 'burst1': (757, 260), + 'mystic1': (501, 284), + }, + 'action': [ + {'t': 'click', 'p': (701, 386), 'ec': True, "desc": "1 lower left"}, + {'t': 'click', 'p': (463, 384), 'wait-over': True, "desc": "2 lower left"}, + + {'t': 'exchange_and_click', 'p': (441, 475), 'ec': True, "desc": "change to 2 and lower left"}, + {'t': 'click', 'p': (764, 398), 'wait-over': True, "desc": "1 lower right"}, + + {'t': 'click', 'p': (825, 476), "desc": "1 lower right"}, + {'t': 'end-turn'}, + + {'t': 'click', 'p': (832, 342), "desc": "1 upper right"}, + ] + }, + '10-1-sss': { + 'start': { + 'burst1': (757, 260), + 'mystic1': (501, 284), + }, + 'action': [ + {'t': 'click', 'p': (642, 296), 'ec': True, "desc": "1 left"}, + {'t': 'click', 'p': (460, 386), 'ec': True, "desc": "2 lower left"}, + + {'t': 'click', 'p': (739, 396), 'ec': True, "desc": "1 lower right"}, + {'t': 'click', 'p': (440, 473), 'ec': True, "desc": "2 lower left"}, + + {'t': 'click', 'p': (645, 396), 'ec': True, "desc": "1 lower left"}, + {'t': 'end-turn'}, + + {'t': 'click', 'p': (849, 394), 'ec': True, "desc": "1 right"}, + {'t': 'end-turn'}, + + {'t': 'click', 'p': (901, 388), "desc": "1 right"}, + ] + }, + + '10-2-sss-present': { + 'start': { + 'burst1': (463, 260), + 'mystic1': (637, 305), + }, + 'action': [ + {'t': 'exchange_and_click', 'p': (577, 472), 'ec': True, "desc": "2 lower left"}, + {'t': 'choose_and_change', 'p': (583, 468), "desc": "swap 1 2"}, + {'t': 'click', 'p': (640, 555), 'wait-over': True, "desc": "1 lower right"}, + + {'t': 'exchange_and_click', 'p': (463, 425), 'ec': True, "desc": "2 lower left"}, + {'t': 'click', 'p': (743, 424), 'wait-over': True, "desc": "1 right"}, + + {'t': 'exchange_and_click', 'p': (469, 234), 'ec': True, "desc": "2 upper left"}, + {'t': 'click', 'p': (773, 387), 'wait-over': True, "desc": "1 right"}, + + {'t': 'click', 'p': (773, 265), "desc": "1 upper right"}, + {'t': 'end-turn'}, + + {'t': 'click', 'p': (897, 399), "desc": "1 right"}, + {'t': 'end-turn'}, + + {'t': 'click', 'p': (721, 490), "desc": "1 lower left"}, + ] + }, + '10-2-task': { + 'start': { + 'burst1': (463, 260), + 'mystic1': (637, 305), + }, + 'action': [ + {'t': 'exchange_and_click', 'p': (577, 472), 'ec': True, "desc": "2 lower left"}, + {'t': 'choose_and_change', 'p': (583, 468), "desc": "swap 1 2"}, + {'t': 'click', 'p': (640, 555), 'wait-over': True, "desc": "1 lower right"}, + + {'t': 'exchange_and_click', 'p': (463, 425), 'ec': True, "desc": "2 lower left"}, + {'t': 'click', 'p': (743, 424), 'wait-over': True, "desc": "1 right"}, + + {'t': 'exchange_and_click', 'p': (469, 234), 'ec': True, "desc": "2 upper left"}, + {'t': 'click', 'p': (773, 387), 'wait-over': True, "desc": "1 right"}, + + {'t': 'click', 'p': (833, 349), "desc": "1 right"}, + ] + }, + + '10-3-sss-present': { + 'start': { + 'burst1': (697, 473), + 'mystic1': (328, 460), + }, + 'action': [ + {'t': 'click', 'p': (663, 406), 'ec': True, "desc": "1 left"}, + {'t': 'click', 'p': (558, 317), 'wait-over': True, "desc": "2 upper right"}, + + {'t': 'exchange_and_click', 'p': (672, 320), 'ec': True, "desc": "2 right"}, + {'t': 'choose_and_change', 'p': (481, 389), "desc": "swap 1 2"}, + {'t': 'click', 'p': (554, 306), 'wait-over': True, "desc": "1 upper right"}, + + {'t': 'click', 'p': (499, 224), 'ec': True, "desc": "1 upper left"}, + {'t': 'click', 'p': (742, 505), 'wait-over': True, "desc": "2 right"}, + + {'t': 'exchange_and_click', 'p': (750, 416), 'ec': True, "desc": "2 upper right"}, + {'t': 'click', 'p': (567, 214), 'wait-over': True, "desc": "1 upper left"}, + {'t': 'click', 'p': (468, 393), "desc": "1 lower left"}, + {'t': 'end-turn'}, + + {'t': 'click', 'p': (391, 349), "desc": "1 left"}, + ] + }, + '10-3-task': { + 'start': { + 'burst1': (697, 473), + 'mystic1': (328, 460), + }, + 'action': [ + {'t': 'click', 'p': (663, 406), 'ec': True, "desc": "1 left"}, + {'t': 'click', 'p': (558, 317), 'wait-over': True, "desc": "2 upper right"}, + + {'t': 'exchange_and_click', 'p': (672, 320), 'ec': True, "desc": "2 right"}, + {'t': 'choose_and_change', 'p': (481, 389), "desc": "swap 1 2"}, + {'t': 'click', 'p': (554, 306), 'wait-over': True, "desc": "1 upper right"}, + + {'t': 'click', 'p': (499, 224), 'ec': True, "desc": "1 upper left"}, + {'t': 'click', 'p': (742, 505), 'wait-over': True, "desc": "2 right"}, + + {'t': 'exchange_and_click', 'p': (750, 416), 'ec': True, "desc": "2 upper right"}, + {'t': 'click', 'p': (506, 293), 'wait-over': True, "desc": "1 left"}, + {'t': 'click', 'p': (387, 347), "desc": "1 left"}, + + ] + }, + +} diff --git a/tasks/auto_mission/hard_task/hard_task_11.py b/tasks/auto_mission/hard_task/hard_task_11.py new file mode 100644 index 0000000..cc25860 --- /dev/null +++ b/tasks/auto_mission/hard_task/hard_task_11.py @@ -0,0 +1,86 @@ +stage_data = { + '11-1-sss-present-task': { + 'start': { + 'pierce1': (795, 470), + 'mystic1': (865, 445), + }, + 'action': [ + {'t': 'click', 'p': (530, 425), 'ec': True, 'desc': "1 left"}, + {'t': 'click', 'p': (650, 420), 'ec': True, 'wait-over': True, 'desc': "2 left"}, + + {'t': ['exchange', 'choose_and_change'], 'p': (535, 420), 'desc': "swap 1 2"}, + {'t': 'click', 'p': (475, 340), 'ec': True, 'desc': "2 upper left"}, + {'t': 'click', 'p': (560, 430), 'wait-over': True, 'desc': "1 left"}, + + {'t': 'exchange_and_click', 'p': (570, 280), 'ec': True, 'desc': "2 upper right"}, + {'t': 'click', 'p': (515, 360), 'wait-over': True, 'desc': "1 upper left"}, + + {'t': 'exchange_and_click', 'p': (515, 200), 'wait-over': True, 'desc': "2 upper left"}, + {'t': 'click', 'p': (450, 450), 'desc': "1 left"}, + ] + }, + '11-2-sss-present': { + 'start': { + 'pierce1': (395, 390), + 'mystic1': (620, 560), + }, + 'action': [ + {'t': 'click', 'p': (570, 245), 'ec': True, 'desc': "1 upper right"}, + {'t': 'click_and_teleport', 'wait-over': True, 'p': (705, 415), 'desc': "2 upper right"}, + + {'t': 'click', 'p': (680, 190), 'ec': True, 'desc': "1 upper right"}, + {'t': 'click', 'p': (655, 430), 'ec': True, 'wait-over': True, 'desc': "2 left"}, + + {'t': 'click', 'p': (700, 285), 'ec': True, 'wait-over': True, 'desc': "1 right"}, + {'t': 'click', 'p': (700, 540), 'wait-over': True, 'desc': "2 lower left"}, + + {'t': 'exchange_and_click', 'p': (720, 420), 'ec': True, 'wait-over': True, 'desc': "2 upper right"}, + {'t': 'end-turn'}, + + {'t': 'exchange_and_click', 'p': (665, 405), 'ec': True, 'wait-over': True, 'desc': "2 upper left"}, + {'t': 'click', 'p': (635, 370), 'wait-over': True, 'desc': "1 lower right"}, + + {'t': 'exchange_and_click', 'p': (760, 365), 'ec': True, 'desc': "2 upper right"}, + {'t': 'choose_and_change', 'p': (760, 360), 'desc': "swap 1 2"}, + {'t': 'click', 'p': (875, 375), 'desc': "1 right"}, + ] + }, + '11-2-task': { + 'start': { + 'pierce1': (395, 390), + 'mystic1': (620, 560), + }, + 'action': [ + {'t': 'click', 'p': (570, 245), 'ec': True, 'desc': "1 upper right"}, + {'t': 'click_and_teleport', 'wait-over': True, 'p': (705, 415), 'desc': "2 upper right and tp"}, + + {'t': 'click', 'p': (680, 190), 'ec': True, 'desc': "1 upper right"}, + {'t': 'click', 'p': (655, 430), 'ec': True, 'wait-over': True, 'desc': "2 left"}, + + {'t': 'click', 'p': (700, 285), 'ec': True, 'desc': "1 right"}, + {'t': 'click', 'p': (700, 375), 'ec': True, 'wait-over': True, 'desc': "2 upper left"}, + + {'t': 'click', 'p': (650, 415), 'ec': True, 'desc': "1 right"}, + {'t': 'click', 'p': (765, 410), 'ec': True, 'wait-over': True, 'desc': "2 upper left"}, + + {'t': 'choose_and_change', 'p': (765, 415), 'desc': "swap 1 2"}, + {'t': 'click', 'p': (885, 415), 'desc': "1 right"}, + ] + }, + '11-3-sss-present-task': { + 'start': { + 'pierce1': (790, 305), + 'mystic1': (530, 490), + }, + 'action': [ + {'t': 'click', 'p': (820, 400), 'ec': True, 'desc': "1 lower right"}, + {'t': 'click_and_teleport', 'wait-over': True, 'p': (470, 370), 'desc': "2 upper left and tp"}, + + {'t': 'click', 'p': (715, 505), 'ec': True, 'desc': "1 lower left"}, + {'t': 'click', 'p': (630, 335), 'ec': True, 'wait-over': True, 'desc': "2 right"}, + + {'t': 'click', 'p': (695, 550), 'wait-over': True, 'desc': "1 lower left"}, + {'t': 'click', 'p': (670, 295), 'desc': "2 right"}, + ] + }, +} diff --git a/tasks/auto_mission/hard_task/hard_task_12.py b/tasks/auto_mission/hard_task/hard_task_12.py new file mode 100644 index 0000000..73fd6b4 --- /dev/null +++ b/tasks/auto_mission/hard_task/hard_task_12.py @@ -0,0 +1,88 @@ +stage_data = { + '12-1-sss-present-task': { + 'start': { + 'mystic1': (335, 555), + 'burst1': (1130, 455), + }, + 'action': [ + {'t': 'click', 'p': (610, 395), 'wait-over': True, 'desc': "1 right"}, + {'t': 'click', 'p': (665, 390), 'wait-over': True, 'desc': "2 left"}, + + {'t': 'click', 'p': (550, 310), 'ec': True, 'desc': "1 upper right"}, + {'t': 'click', 'p': (725, 315), 'ec': True, 'wait-over': True, 'desc': "2 upper left"}, + + {'t': 'click', 'p': (560, 345), 'ec': True, 'desc': "1 upper right"}, + {'t': 'click', 'p': (680, 510), 'ec': True, 'wait-over': True, 'desc': "2 lower left"}, + + {'t': 'exchange_and_click', 'p': (555, 505), 'wait-over': True, 'desc': "2 left"}, + {'t': 'click', 'p': (510, 250), 'desc': "1 upper left"}, + ] + }, + '12-2-sss-present-task': { + 'start': { + 'mystic1': (365, 385), + 'burst1': (620, 390), + }, + 'action': [ + {'t': 'click', 'p': (578, 475), 'wait-over': True, 'desc': "1 lower right"}, + {'t': 'choose_and_change', 'p': (585, 480), 'desc': "swap 1 2"}, + {'t': 'click', 'p': (640, 560), 'wait-over': True, 'desc': "2 lower right"}, + + {'t': 'exchange_and_click', 'p': (785, 485), 'ec': True, 'desc': "2 right"}, + {'t': 'click', 'p': (685, 235), 'wait-over': True, 'desc': "1 upper right"}, + + {'t': 'click', 'p': (745, 270), 'ec': True, 'desc': "1 upper right"}, + {'t': 'click', 'p': (800, 500), 'ec': True, 'wait-over': True, 'desc': "2 right"}, + + {'t': 'exchange_and_click', 'p': (640, 415), 'wait-over': True, 'desc': "2 upper left"}, + {'t': 'click', 'p': (730, 275), 'desc': "1 right"}, + ] + }, + '12-3-sss-present': { + 'start': { + 'mystic1': (610, 385), + 'burst1': (580, 305), + }, + 'action': [ + {'t': 'exchange_and_click', 'p': (760, 390), 'ec': True, 'desc': "2 right"}, + {'t': 'choose_and_change', 'p': (760, 390), 'desc': "swap 1 2"}, + {'t': 'click_and_teleport', 'wait-over': True, 'p': (815, 310), 'desc': "2 upper right and tp"}, + + {'t': 'click', 'p': (895, 400), 'wait-over': True, 'desc': "1 right"}, + {'t': 'end-turn'}, + + {'t': 'click', 'p': (730, 310), 'ec': True, 'desc': "1 upper left"}, + {'t': 'click', 'p': (505, 390), 'ec': True, 'wait-over': True, 'desc': "2 lower left"}, + + {'t': 'click_and_teleport', 'wait-over': True, 'p': (705, 250), 'desc': "1 upper left"}, + {'t': 'click', 'p': (725, 595), 'ec': True, 'wait-over': True, 'desc': "2 lower right"}, + + {'t': 'click', 'p': (455, 290), 'ec': True, 'desc': "1 left"}, + {'t': 'click', 'p': (605, 485), 'ec': True, 'wait-over': True, 'desc': "2 left"}, + + {'t': 'click', 'p': (495, 380), 'desc': "1 lower left"} + ] + }, + '12-3-task': { + 'start': { + 'mystic1': (610, 385), + 'burst1': (580, 305), + }, + 'action': [ + {'t': 'exchange_and_click', 'p': (760, 390), 'ec': True, 'desc': "2 right"}, + {'t': 'choose_and_change', 'p': (760, 390), 'desc': "swap 1 2"}, + {'t': 'click_and_teleport', 'wait-over': True, 'p': (815, 310), 'desc': "2 upper right and tp"}, + + {'t': 'click', 'p': (830, 315), 'desc': "1 upper right"}, + {'t': 'end-turn'}, + + {'t': 'click_and_teleport', 'wait-over': True, 'p': (710, 255), 'desc': "1 upper left and tp"}, + {'t': 'end-turn'}, + + {'t': 'click', 'p': (400, 335), 'desc': "1 left"}, + {'t': 'end-turn'}, + + {'t': 'click', 'p': (465, 400), 'desc': "1 lower left"}, + ] + }, +} diff --git a/tasks/auto_mission/hard_task/hard_task_13.py b/tasks/auto_mission/hard_task/hard_task_13.py new file mode 100644 index 0000000..795646b --- /dev/null +++ b/tasks/auto_mission/hard_task/hard_task_13.py @@ -0,0 +1,78 @@ +stage_data = { + '13-1-sss-present-task': { + 'start': { + 'pierce1': (730, 260), + 'pierce2': (845, 440), + }, + 'action': [ + {'t': 'click', 'p': (585, 340), 'wait-over': True, 'desc': "1 lower left"}, + {'t': 'click', 'p': (645, 420), 'wait-over': True, 'desc': "2 left"}, + + {'t': 'exchange_and_click', 'p': (555, 430), 'ec': True, 'desc': "2 left"}, + {'t': 'choose_and_change', 'p': (560, 430), 'desc': "swap 1 2"}, + {'t': 'click', 'p': (500, 515), 'wait-over': True, 'desc': "1 upper left"}, + + {'t': 'click', 'p': (430, 475), 'ec': True, 'desc': "1 left"}, + {'t': 'click', 'p': (840, 290), 'ec': True, 'wait-over': True, 'desc': "2 right"}, + + {'t': 'exchange_and_click', 'p': (885, 340), 'wait-over': True, 'desc': "2 right"}, + {'t': 'click', 'p': (400, 465), 'desc': "1 right"}, + ] + }, + '13-2-sss-present': { + 'start': { + 'pierce1': (758, 222), + 'pierce2': (845, 445), + }, + 'action': [ + {'t': 'click', 'p': (590, 340), 'ec': True, 'desc': "1 lower left"}, + {'t': 'click', 'p': (650, 425), 'ec': True, 'wait-over': True, 'desc': "2 left"}, + + {'t': 'exchange_and_click', 'p': (600, 350), 'ec': True, 'desc': "2 left"}, + {'t': 'choose_and_change', 'p': (600, 350), 'desc': "swap 1 2"}, + {'t': 'click', 'p': (480, 350), 'wait-over': True, 'desc': "1 left"}, + + {'t': 'exchange_and_click', 'p': (825, 290), 'ec': True, 'desc': "2 right"}, + {'t': 'click', 'p': (455, 365), 'wait-over': True, 'desc': "1 upper left"}, + + {'t': 'click', 'p': (440, 450), 'desc': "1 lower left"}, + ] + }, + '13-2-task': { + 'start': { + 'pierce1': (758, 222), + 'pierce2': (845, 445), + }, + 'action': [ + {'t': 'click', 'p': (590, 340), 'ec': True, 'desc': "1 lower left"}, + {'t': 'click', 'p': (650, 425), 'ec': True, 'wait-over': True, 'desc': "2 left"}, + + {'t': 'exchange_and_click', 'p': (600, 350), 'ec': True, 'desc': "2 left"}, + {'t': 'choose_and_change', 'p': (600, 350), 'desc': "swap 1 2"}, + {'t': 'click', 'p': (480, 350), 'wait-over': True, 'desc': "1 left"}, + + {'t': 'exchange_and_click', 'p': (825, 290), 'ec': True, 'desc': "2 right"}, + {'t': 'click', 'p': (395, 445), 'desc': "1 left"}, + ] + }, + '13-3-sss-present-task': { + 'start': { + 'pierce1': (785, 185), + 'pierce2': (365, 275), + }, + 'action': [ + {'t': 'click', 'p': (660, 355), 'ec': True, 'desc': "1 left"}, + {'t': 'click', 'p': (615, 370), 'ec': True, 'wait-over': True, 'desc': "2 right"}, + + {'t': 'exchange_and_click', 'p': (675, 450), 'ec': True, 'desc': "2 lower right"}, + {'t': 'choose_and_change', 'p': (675, 445), 'desc': "swap 1 2"}, + {'t': 'click', 'p': (615, 535), 'wait-over': True, 'desc': "1 upper left"}, + + {'t': 'click', 'p': (590, 535), 'ec': True, 'desc': "1 lower right"}, + {'t': 'click', 'p': (795, 380), 'ec': True, 'wait-over': True, 'desc': "2 lower right"}, + + {'t': 'exchange_and_click', 'p': (840, 435), 'wait-over': True, 'desc': "2 lower right"}, + {'t': 'click', 'p': (595, 560), 'desc': "1 lower right"}, + ] + }, +} diff --git a/tasks/auto_mission/hard_task/hard_task_14.py b/tasks/auto_mission/hard_task/hard_task_14.py new file mode 100644 index 0000000..efd3eeb --- /dev/null +++ b/tasks/auto_mission/hard_task/hard_task_14.py @@ -0,0 +1,64 @@ +stage_data = { + '14-1-sss-present-task': { + 'start': { + 'burst1': (550, 305), + 'mystic1': (581, 686), + }, + 'action': [ + {'t': 'click', 'p': (785, 275), 'ec': True, 'desc': "1 right"}, + {'t': 'click', 'p': (715, 500), 'ec': True, 'wait-over': True, 'desc': "2 right"}, + + {'t': 'click', 'p': (780, 375), 'ec': True, 'desc': "1 lower right"}, + {'t': 'click', 'p': (715, 420), 'ec': True, 'wait-over': True, 'desc': "2 upper right"}, + + {'t': 'click', 'p': (895, 340), 'ec': True, 'desc': "1 right"}, + {'t': 'click', 'p': (665, 365), 'ec': True, 'wait-over': True, 'desc': "2 upper right"}, + + {'t': 'exchange_and_click', 'p': (412, 322), 'ec': True, 'desc': "2 left"}, + {'t': 'click', 'p': (760, 405), 'wait-over': True, 'desc': "1 lower right"}, + + {'t': 'exchange_and_click', 'p': (450, 420), 'wait-over': True, 'desc': "2 lower left"}, + {'t': 'click', 'p': (715, 515), 'desc': "1 lower left"}, + ] + }, + '14-2-sss-present-task': { + 'start': { + 'burst1': (875, 305), + 'mystic1': (475, 585), + }, + 'action': [ + {'t': 'click', 'p': (690, 390), 'ec': True, 'desc': "1 lower left"}, + {'t': 'click', 'p': (605, 395), 'ec': True, 'wait-over': True, 'desc': "2 upper right"}, + + {'t': 'click', 'p': (640, 320), 'ec': True, 'desc': "1 left"}, + {'t': 'choose_and_change', 'p': (643, 323), 'desc': "swap 1 2"}, + {'t': 'click', 'p': (580, 235), 'wait-over': True, 'desc': "2 upper left"}, + + {'t': 'exchange_and_click', 'p': (520, 275), 'ec': True, 'desc': "2 left"}, + {'t': 'click', 'p': (565, 445), 'wait-over': True, 'desc': "1 left"}, + + {'t': 'exchange_and_click', 'p': (620, 200), 'wait-over': True, 'desc': "2 upper left"}, + {'t': 'click', 'p': (575, 425), 'desc': "1 upper left"}, + ] + }, + '14-3-sss-present-task': { + 'start': { + 'burst1': (875, 345), + 'mystic1': (425, 200), + }, + 'action': [ + {'t': 'click', 'p': (655, 430), 'ec': True, 'desc': "1 left"}, + {'t': 'click', 'p': (460, 405), 'ec': True, 'wait-over': True, 'desc': "2 lower left"}, + + {'t': 'click', 'p': (630, 465), 'ec': True, 'desc': "1 left"}, + {'t': 'click', 'p': (550, 465), 'ec': True, 'wait-over': True, 'desc': "2 lower right"}, + + {'t': 'exchange_and_click', 'p': (625, 460), 'ec': True, 'desc': "2 lower right"}, + {'t': 'choose_and_change', 'p': (625, 460), 'desc': "swap 1 2"}, + {'t': 'click', 'p': (565, 545), 'wait-over': True, 'desc': "1 lower left"}, + + {'t': 'click', 'p': (390, 435), 'wait-over': True, 'desc': "1 left"}, + {'t': 'click', 'p': (825, 250), 'desc': "2 upper right"}, + ] + }, +} diff --git a/tasks/auto_mission/hard_task/hard_task_15.py b/tasks/auto_mission/hard_task/hard_task_15.py new file mode 100644 index 0000000..a1469f7 --- /dev/null +++ b/tasks/auto_mission/hard_task/hard_task_15.py @@ -0,0 +1,73 @@ +stage_data = { + '15-1-sss-present-task': { + 'start': { + 'mystic1': (795, 560), + 'mystic2': (350, 470), + }, + 'action': [ + {'t': 'click_and_teleport', 'wait-over': True, 'p': (900, 410), 'desc': "1 right and tp"}, + {'t': 'click', 'p': (555, 315), 'ec': True, 'wait-over': True, 'desc': "2 upper right"}, + + {'t': 'click', 'p': (685, 230), 'ec': True, 'desc': "1 upper left"}, + {'t': 'click', 'p': (555, 340), 'ec': True, 'wait-over': True, 'desc': "2 upper right"}, + + {'t': 'exchange_and_click', 'p': (565, 355), 'ec': True, 'desc': "2 upper right"}, + {'t': 'choose_and_change', 'p': (570, 355), 'desc': "swap 1 2"}, + {'t': 'click', 'p': (510, 275), 'wait-over': True, 'desc': "1 upper left"}, + + {'t': 'exchange_and_click', 'p': (655, 410), 'wait-over': True, 'desc': "2 lower left"}, + {'t': 'click', 'p': (450, 290), 'desc': "1 left"}, + ] + }, + '15-2-sss-present-task': { + 'start': { + 'mystic1': (400, 475), + 'mystic2': (700, 515), + }, + 'action': [ + {'t': 'click_and_teleport', 'wait-over': True, 'p': (445, 485), 'desc': "1 lower left and tp"}, + {'t': 'click', 'p': (700, 320), 'ec': True, 'wait-over': True, 'desc': "2 upper right"}, + + {'t': 'click_and_teleport', 'wait-over': True, 'p': (790, 475), 'desc': "1 lower right and tp"}, + {'t': 'click', 'p': (630, 270), 'ec': True, 'wait-over': True, 'desc': "2 upper right"}, + + {'t': 'exchange_and_click', 'p': (670, 220), 'ec': True, 'desc': "2 upper right"}, + {'t': 'choose_and_change', 'p': (670, 275), 'desc': "swap 1 2"}, + {'t': 'click', 'p': (725, 195), 'wait-over': True, 'desc': "1 upper right"}, + + {'t': 'exchange_and_click', 'p': (765, 535), 'wait-over': True, 'desc': "2 lower right"}, + {'t': 'click', 'p': (775, 280), 'desc': "1 right"}, + ] + }, + '15-3-sss-present-task': { + 'start': { + 'mystic1': (425, 600), + 'mystic2': (385, 225), + 'pierce1': (645, 155), + }, + 'action': [ + {'t': 'click_and_teleport', 'wait-over': True, 'p': (545, 505), 'desc': "1 left and tp"}, + {'t': 'click', 'p': (670, 300), 'ec': True, 'desc': "2 right"}, + {'t': 'click_and_teleport', 'wait-over': True, 'p': (765, 270), 'desc': "3 right and tp"}, + + {'t': 'exchange_and_click', 'p': (705, 370), 'ec': True, 'desc': "2 right"}, + {'t': ['exchange_twice', 'choose_and_change'], 'p': (705, 370), 'desc': "swap 2 3"}, + {'t': 'click', 'p': (820, 370), 'ec': True, 'desc': "3 right"}, + {'t': 'choose_and_change', 'p': (785, 375), 'desc': "swap 1 3"}, + {'t': 'click', 'p': (905, 375), 'wait-over': True, 'desc': "1 right"}, + + {'t': 'click', 'p': (905, 380), 'ec': True, 'desc': "1 right"}, + {'t': 'click_and_teleport', 'p': (500, 425), "wait-over":True ,'desc': "2 tp"}, + {'t': 'click_and_teleport', 'p': (645, 155), 'wait-over': True, 'desc': "2 upper right and tp"}, + {'t': 'click', 'p': (695, 595), 'wait-over': True, 'desc': "3 upper right"}, + + {'t': 'click', 'p': (815, 405), 'ec': True, 'desc': "1 lower right"}, + {'t': 'click', 'p': (635, 205), 'ec': True, 'desc': "2 upper right"}, + {'t': 'end-turn'}, + + {'t': 'exchange_and_click', 'p': (675, 355), 'ec': True, 'desc': "2 lower right"}, + {'t': 'exchange_twice_and_click', 'p': (465, 550), 'wait-over': True, 'desc': "2 lower right"}, + {'t': 'click', 'p': (715, 425), 'desc': "1 lower left"}, + ] + }, +} diff --git a/tasks/auto_mission/hard_task/hard_task_16.py b/tasks/auto_mission/hard_task/hard_task_16.py new file mode 100644 index 0000000..d760e22 --- /dev/null +++ b/tasks/auto_mission/hard_task/hard_task_16.py @@ -0,0 +1,69 @@ +stage_data = { + '16-1-sss-present-task': { + 'start': { + 'pierce1': (670, 470), + 'mystic1': (370, 215), + }, + 'action': [ + {'t': 'click', 'p': (605, 475), 'ec': True, 'desc': "1 left"}, + {'t': 'click', 'p': (590, 385), 'ec': True, 'wait-over': True, 'desc': "2 lower right"}, + + {'t': 'click', 'p': (565, 500), 'ec': True, 'desc': "1 left"}, + {'t': 'click', 'p': (515, 410), 'ec': True, 'wait-over': True, 'desc': "2 lower left"}, + + {'t': 'click', 'p': (508, 580), 'ec': True, 'desc': "1 lower left"}, + {'t': 'click', 'p': (630, 410), 'ec': True, 'wait-over': True, 'desc': "2 lower right"}, + + {'t': 'click', 'p': (395, 450), 'ec': True, 'desc': "1 left"}, + {'t': 'click', 'p': (900, 365), 'ec': True, 'wait-over': True, 'desc': "2 right"}, + + {'t': 'exchange_and_click', 'p': (725, 450), 'wait-over': True, 'desc': "1 upper left"}, + {'t': 'click', 'p': (445, 330), 'desc': "2 lower left"}, + ] + }, + '16-2-sss-present-task': { + 'start': { + 'pierce1': (550, 385), + 'mystic1': (520, 560), + }, + 'action': [ + {'t': 'click', 'p': (565, 325), 'ec': True, 'desc': "1 left"}, + {'t': 'click', 'p': (505, 410), 'ec': True, 'wait-over': True, 'desc': "2 upper right"}, + + {'t': 'exchange_and_click', 'p': (455, 330), 'ec': True, 'desc': "1 upper left"}, + {'t': 'choose_and_change', 'p': (510, 345), 'desc': "swap 1 2"}, + {'t': 'click', 'p': (395, 340), 'wait-over': True, 'desc': "1 left"}, + + {'t': 'click', 'p': (440, 445), 'ec': True, 'desc': "1 lower left"}, + {'t': 'click', 'p': (845, 455), 'ec': True, 'wait-over': True, 'desc': "2 lower right"}, + + {'t': 'exchange_and_click', 'p': (728, 468), 'wait-over': True, 'desc': "2 lower left"}, + {'t': 'click', 'p': (555, 475), 'desc': "1 lower right"}, + ] + }, + '16-3-sss-present-task': { + 'start': { + 'pierce1': (940, 470), + 'mystic1': (170, 425), + 'pierce2': (380, 240), + }, + 'action': [ + {'t': 'click', 'p': (665, 415), 'ec': True, 'desc': "1 left"}, + {'t': 'click', 'p': (550, 315), 'ec': True, 'desc': "2 upper right"}, + {'t': 'click', 'p': (640, 320), 'ec': True, 'wait-over': True, 'desc': "3 right"}, + + {'t': 'click', 'p': (720, 280), 'ec': True, 'desc': "1 upper left"}, + {'t': 'click', 'p': (565, 265), 'ec': True, 'desc': "2 upper right"}, + {'t': 'choose_and_change', 'p': (645, 320), 'desc': "swap 2 3"}, + {'t': 'click', 'p': (760, 315), 'ec': True, 'wait-over': True, 'desc': "3 right"}, + + {'t': 'exchange_and_click', 'p': (440, 445), 'ec': True, 'desc': "2 lower left"}, + {'t': 'exchange_twice_and_click', 'p': (835, 430), 'wait-over': True, 'desc': "3 lower right"}, + {'t': 'choose_and_change', 'p': (665, 410), 'desc': "swap 1 2"}, + {'t': 'click', 'p': (605, 495), 'wait-over': True, 'desc': "1 lower left"}, + + {'t': 'exchange_twice_and_click', 'p': (845, 325), 'ec': True, 'desc': "3 upper left"}, + {'t': 'click', 'p': (435, 490), 'desc': "1 lower left"}, + ] + }, +} diff --git a/tasks/auto_mission/hard_task/hard_task_6.py b/tasks/auto_mission/hard_task/hard_task_6.py new file mode 100644 index 0000000..955c46c --- /dev/null +++ b/tasks/auto_mission/hard_task/hard_task_6.py @@ -0,0 +1,88 @@ +stage_data = { + '6-1-sss-present': { + 'start': { + 'pierce1': (555, 220), + 'pierce2': (454, 432), + }, + 'action': [ + {'t': 'click', 'p': (693, 333), 'ec': True, 'desc': "1 lower right"}, + {'t': 'click', 'p': (569, 508), 'ec': True, 'wait-over': True, 'desc': "2 lower right"}, + + {'t': 'exchange_and_click', 'p': (711, 455), 'ec': True, 'desc': "2 right"}, + {'t': 'click', 'p': (777, 308), 'wait-over': True, 'desc': "1 right"}, + + {'t': 'click', 'p': (800, 227), 'wait-over': True, 'desc': "1 upper right"}, + {'t': 'end-turn'}, + + {'t': 'click', 'p': (774, 371), 'desc': "1 lower right"}, + ] + }, + '6-1-task': { + 'start': { + 'pierce1': (555, 220), + 'pierce2': (454, 432), + }, + 'action': [ + {'t': 'click', 'p': (693, 333), 'ec': True, 'desc': "1 lower right"}, + {'t': 'click', 'p': (569, 508), 'ec': True, 'wait-over': True, 'desc': "2 lower right"}, + + {'t': 'exchange_and_click', 'p': (711, 455), 'ec': True, 'desc': "2 right"}, + {'t': 'click', 'p': (777, 308), 'wait-over': True, 'desc': "1 right"}, + + {'t': 'click', 'p': (860, 305), 'desc': "1 right"}, + ] + }, + '6-2-sss-present': { + 'start': { + 'pierce1': (556, 265), + 'pierce2': (436, 441), + }, + 'action': [ + {'t': 'click', 'p': (534, 356), 'ec': True, 'desc': "1 lower left"}, + {'t': 'click', 'p': (552, 484), 'ec': True, 'wait-over': True, 'desc': "2 lower right"}, + + {'t': 'click', 'p': (670, 316), 'ec': True, 'desc': "1 right"}, + {'t': 'click', 'p': (674, 482), 'wait-over': True, 'desc': "2 right"}, + + {'t': 'exchange_and_click', 'p': (698, 382), 'ec': True, 'desc': "2 upper right"}, + {'t': 'choose_and_change', 'p': (696, 387), 'desc': "swap 1 2"}, + {'t': 'click', 'p': (811, 373), 'wait-over': True, 'desc': "1 right"}, + + {'t': 'click', 'p': (842, 301), 'wait-over': True, 'desc': "1 upper right"}, + {'t': 'end-turn'}, + ] + }, + '6-2-task': { + 'start': { + 'pierce1': (556, 265), + 'pierce2': (436, 441), + }, + 'action': [ + {'t': 'click', 'p': (694, 343), 'ec': True, 'desc': "1 lower right"}, + {'t': 'click', 'p': (571, 508), 'ec': True, 'wait-over': True, 'desc': "2 lower right"}, + + {'t': 'exchange_and_click', 'p': (711, 485), 'ec': True, 'desc': "2 right"}, + {'t': 'click', 'p': (787, 316), 'desc': "1 right"}, + ] + }, + '6-3-sss-present-task': { + 'start': { + 'pierce1': (855, 515), + 'pierce2': (569, 203), + }, + 'action': [ + {'t': 'click', 'p': (611, 477), 'ec': True, 'desc': "1 left"}, + {'t': 'click', 'p': (741, 271), 'ec': True, 'wait-over': True, 'desc': "2 right"}, + + {'t': 'click', 'p': (533, 505), 'ec': True, 'desc': "1 left"}, + {'t': 'click', 'p': (639, 369), 'ec': True, 'wait-over': True, 'desc': "2 right"}, + + {'t': 'exchange_and_click', 'p': (643, 408), 'ec': True, 'desc': "2 lower left"}, + {'t': 'choose_and_change', 'p': (645, 408), 'desc': "swap 1 2"}, + {'t': 'click', 'p': (530, 412), 'wait-over': True, 'desc': "1 left"}, + + {'t': 'exchange_and_click', 'p': (553, 485), 'wait-over': True, 'desc': "2 left"}, + {'t': 'click', 'p': (560, 321), 'desc': "1 upper left"}, + ] + }, +} diff --git a/tasks/auto_mission/hard_task/hard_task_7.py b/tasks/auto_mission/hard_task/hard_task_7.py new file mode 100644 index 0000000..e8f4a92 --- /dev/null +++ b/tasks/auto_mission/hard_task/hard_task_7.py @@ -0,0 +1,61 @@ +stage_data = { + '7-1-sss-present': { + 'start': { + 'burst1': (697, 473), + 'mystic1': (328, 460), + }, + 'action': [ + {'t': 'click', 'p': (663, 406), 'ec': True, "desc": "1 left"}, + {'t': 'click', 'p': (558, 317), 'wait-over': True, "desc": "2 upper right"}, + {'t': 'exchange_and_click', 'p': (672, 320), 'ec': True, "desc": "2 right"}, + {'t': 'choose_and_change', 'p': (481, 389), "desc": "swap 1 2"}, + {'t': 'click', 'p': (554, 306), 'wait-over': True, "desc": "1 upper right"}, + {'t': 'click', 'p': (499, 224), 'ec': True, "desc": "1 upper left"}, + {'t': 'click', 'p': (742, 505), 'wait-over': True, "desc": "2 right"}, + {'t': 'exchange_and_click', 'p': (750, 416), 'ec': True, "desc": "2 upper right"}, + {'t': 'click', 'p': (506, 293), 'wait-over': True, "desc": "1 left"}, + {'t': 'click', 'p': (387, 347), "desc": "1 left"}, + ] + }, + '7-2-sss-present': { + 'start': { + 'burst1': (469, 229), + 'burst2': (650, 296), + }, + 'action': [ + {'t': 'click', 'p': (583, 474), 'ec': True, "desc": "1 lower right"}, + {'t': 'click', 'p': (760, 394), 'ec': True, 'wait-over': True, "desc": "2 right"}, + {'t': 'click_and_teleport', 'ec': True, 'p': (523, 560), "desc": "1 lower left and tp"}, + {'t': 'click', 'p': (758, 365), 'wait-over': True, "desc": "2 lower right"}, + {'t': 'click', 'p': (737, 411), "desc": "1 upper right"}, + {'t': 'end-turn'}, + ] + }, + '7-2-task': { + 'start': { + 'burst1': (469, 229), + 'burst2': (650, 296), + }, + 'action': [ + {'t': 'exchange_and_click', 'p': (578, 473), 'ec': True, "desc": "2 lower left"}, + {'t': 'choose_and_change', 'p': (578, 473), "desc": "swap 1 2"}, + {'t': 'click_and_teleport', 'p': (520, 560), 'wait-over': True, "desc": "1 lower left"}, + {'t': 'click', 'p': (716, 378), "desc": "1 upper right"}, + {'t': 'end-turn'}, + ] + }, + '7-3-sss-present-task': { + 'start': { + 'burst1': (943, 471), + 'burst2': (182, 260), + }, + 'action': [ + {'t': 'click', 'p': (659, 433), 'ec': True, "desc": "1 left"}, + {'t': 'click', 'p': (626, 350), 'wait-over': True, 'ec': True, "desc": "2 right"}, + {'t': 'click_and_teleport', 'ec': True, 'p': (667, 384), "desc": "1 left and tp"}, + {'t': 'click_and_teleport', 'ec': True, 'wait-over': True, 'p': (596, 382), "desc": "2 lower right and tp"}, + {'t': 'exchange_and_click', 'p': (451, 494), "wait-over": True, "desc": "2 left"}, + {'t': 'click', 'p': (841, 294), "desc": "1 right"}, + ] + }, +} diff --git a/tasks/auto_mission/hard_task/hard_task_8.py b/tasks/auto_mission/hard_task/hard_task_8.py new file mode 100644 index 0000000..ce1da9b --- /dev/null +++ b/tasks/auto_mission/hard_task/hard_task_8.py @@ -0,0 +1,111 @@ +stage_data = { + '8-1-sss-present': { + 'start': { + 'pierce1': (613, 180), + 'pierce2': (563, 684), + }, + 'action': [ + {'t': 'click_and_teleport', 'p': (712, 351), 'ec': True, "desc": "1 lower right and tp"}, + {'t': 'click_and_teleport', 'p': (649, 410), 'ec': True, 'wait-over': True, 'desc': "2 upper left and tp"}, + {'t': 'click', 'p': (613, 389), "ec": True, "desc": "1 right"}, + {'t': 'click', 'p': (850, 474), "ec": True, 'wait-over': True, "desc": "2 lower right"}, + {'t': 'click', 'p': (556, 495), "ec": True, "desc": "1 lower right"}, + {'t': 'click', 'p': (896, 423), "wait-over": True, "desc": "2 right"}, + {'t': 'click', 'p': (614, 399), "desc": "1 right"}, + {'t': 'end-turn'}, + {'t': 'click', 'p': (614, 390), "desc": "1 right"}, + ] + }, + '8-1-task': { + 'start': { + 'pierce1': (613, 180), + 'pierce2': (563, 684), + }, + 'action': [ + {'t': 'click_and_teleport', 'ec': True, 'p': (712, 351), "desc": "1 lower right and tp"}, + {'t': 'click_and_teleport', 'ec': True, 'wait-over': True, 'p': (649, 410), 'desc': "2 upper left and tp"}, + {'t': 'click', 'p': (613, 389), "ec": True, "desc": "1 right"}, + {'t': 'click', 'p': (850, 474), "ec": True, 'wait-over': True, "desc": "2 lower right"}, + {'t': 'click', 'p': (556, 495), "ec": True, "desc": "1 lower right"}, + {'t': 'click_and_teleport', 'ec': True, 'wait-over': True, 'p': (722, 339), "desc": "2 upper left and tp"}, + {'t': 'exchange_and_click', 'p': (626, 345), "ec": True, "desc": "2 upper right"}, + {'t': 'choose_and_change', 'p': (626, 345), "desc": "swap 1 2"}, + {'t': 'click', 'p': (743, 347), "desc": "1 right"}, + ] + }, + '8-2-sss-present': { + 'start': { + 'pierce1': (1000, 342), + 'pierce2': (71, 373), + }, + 'action': [ + {'t': 'click', 'p': (728, 474), 'ec': True, "desc": "1 lower left"}, + {'t': 'click', 'p': (553, 477), 'wait-over': True, 'ec': True, "desc": "2 lower right"}, + {'t': 'click', 'p': (664, 414), 'ec': True, "desc": "1 left"}, + {'t': 'click', 'p': (616, 395), 'ec': True, 'wait-over': True, "desc": "2 right"}, + {'t': 'exchange_and_click', 'p': (560, 333), "ec": True, "desc": "2 upper right"}, + {'t': 'click', 'p': (668, 410), 'wait-over': True, "desc": "1 left"}, + {'t': 'click_and_teleport', 'ec': True, 'p': (692, 553), "desc": "1 lower left and tp"}, + {'t': 'click', 'p': (592, 232), 'wait-over': True, 'ec': True, "desc": "2 upper right"}, + {'t': ['exchange_and_click', 'teleport'], 'ec': True, 'p': (613, 236), "desc": "2 upper right and tp"}, + {'t': 'end-turn'}, + {'t': 'exchange_and_click', 'p': (433, 297), 'wait-over': True, "desc": "2 left"}, + {'t': 'click', 'p': (613, 490), "desc": "1 left"}, + ] + }, + '8-2-sss-task': { + 'start': { + 'pierce1': (1000, 342), + 'pierce2': (71, 373), + }, + 'action': [ + {'t': 'click', 'p': (728, 474), 'ec': True, "desc": "1 lower left"}, + {'t': 'click', 'p': (553, 477), 'wait-over': True, 'ec': True, "desc": "2 lower right"}, + {'t': 'click', 'p': (664, 414), 'ec': True, "desc": "1 left"}, + {'t': 'click', 'p': (616, 395), 'ec': True, 'wait-over': True, "desc": "2 right"}, + {'t': 'exchange_and_click', 'p': (560, 333), "ec": True, "desc": "2 upper right"}, + {'t': 'click', 'p': (668, 410), 'wait-over': True, "desc": "1 left"}, + {'t': 'click_and_teleport', 'p': (692, 553), 'ec': True, "desc": "1 lower left and tp"}, + {'t': 'end-turn'}, + {'t': 'click', 'p': (641, 459), "desc": "1 left"}, + ] + }, + '8-3-present': { + 'start': { + 'pierce1': (793, 471), + 'pierce2': (325, 359), + }, + 'action': [ + {'t': ['exchange_and_click', 'teleport'], 'p': (557, 449),'ec':True, "desc": "2 lower right and tp"}, + {'t': 'choose_and_change', 'p': (713, 336), "desc": "swap 1 2"}, + {'t': 'click', 'p': (779, 258), 'wait-over': True, "desc": "1 upper right"}, + {'t': 'click', 'p': (722, 446), "desc": "1 lower left"}, + {'t': 'end-turn'}, + {'t': 'click', 'p': (560, 398), 'ec': True, "desc": "1 left"}, + {'t': 'click', 'p': (754, 422), 'ec': True, 'wait-over': True, "desc": "2 right"}, + {'t': 'click', 'p': (445, 275), 'ec': True, "desc": "1 upper left"}, + {'t': 'click', 'p': (889, 435), 'wait-over': True, "desc": "2 right"}, + {'t': 'click', 'p': (460, 249), 'ec': True, "desc": "1 upper left"}, + {'t': 'end-turn'}, + {'t': 'click', 'p': (394, 326), 'ec': True, "desc": "1 left"}, + {'t': 'end-turn'}, + ] + }, + '8-3-sss-task': { + 'start': { + 'pierce1': (793, 471), + 'pierce2': (325, 359), + }, + 'action': [ + {'t': ['exchange_and_click', 'teleport'], 'ec': True, 'p': (557, 449), "desc": "2 lower right and tp"}, + {'t': 'choose_and_change', 'p': (713, 336), "desc": "swap 1 2"}, + {'t': 'click', 'p': (604, 341), 'wait-over': True, "desc": "1 left"}, + {'t': 'click', 'p': (466, 249), 'ec': True, "desc": "1 upper left"}, + {'t': 'click', 'p': (823, 377), 'ec': True, 'wait-over': True, "desc": "2 upper right"}, + {'t': 'click', 'p': (727, 318), "ec": True, "desc": "2 upper left"}, + {'t': 'click', 'p': (518, 283), 'wait-over': True, "desc": "1 upper left"}, + {'t': 'click', 'p': (433, 300), 'ec': True, "desc": "1 left"}, + {'t': 'click_and_teleport', 'p': (724, 474), "desc": "2 lower left and tp"}, + ] + }, +} diff --git a/tasks/auto_mission/hard_task/hard_task_9.py b/tasks/auto_mission/hard_task/hard_task_9.py new file mode 100644 index 0000000..234e318 --- /dev/null +++ b/tasks/auto_mission/hard_task/hard_task_9.py @@ -0,0 +1,67 @@ +stage_data = { + '9-1-sss-present-task': { + 'start': { + 'burst1': (493, 301), + 'pierce1': (573, 576), + }, + 'action': [ + {'t': 'click', 'p': (688, 278), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (689, 413), 'ec': True, 'wait-over': True, "desc": "2 upper right"}, + + {'t': 'exchange_and_click', 'p': (743, 352), "ec": True, "desc": "2 upper right"}, + {'t': 'choose_and_change', 'p': (743, 352), "desc": "swap 1 2"}, + {'t': 'click', 'p': (861, 356), 'wait-over': True, "desc": "1 right"}, + + {'t': 'exchange_and_click', 'p': (404, 319), "wait-over": True, "desc": "2 left"}, + {'t': 'click', 'p': (903, 416), "desc": "1 right"}, + + ] + }, + '9-2-sss-present': { + 'start': { + 'burst1': (438, 222), + 'pierce1': (532, 641), + }, + 'action': [ + {'t': 'click', 'p': (674, 350), 'ec': True, "desc": "1 lower right"}, + {'t': 'click', 'p': (688, 420), 'wait-over': True, 'ec': True, "desc": "2 upper right"}, + + {'t': 'exchange_and_click', 'p': (744, 356), 'ec': True, "desc": "2 upper right"}, + {'t': 'click', 'p': (798, 275), 'wait-over': True, "desc": "2 right"}, + + {'t': 'click', 'p': (798, 225), 'ec': True, "desc": "1 upper right"}, + {'t': 'click', 'p': (726, 459), 'wait-over': True, 'ec': True, "desc": "2 right"}, + + {'t': 'exchange_and_click', 'p': (789, 541), "wait-over": True, "desc": "2 lower right"}, + {'t': 'click', 'p': (720, 358), "desc": "1 lower right"}, + ] + }, + '9-2-task': { + 'start': { + 'burst1': (438, 222), + }, + 'action': [ + {'t': 'click', 'p': (584, 381), 'wait-over': True, "desc": "1 lower right"}, + {'t': 'click', 'p': (707, 381), 'wait-over': True, "desc": "1 right"}, + {'t': 'click', 'p': (844, 284), "desc": "1 right"}, + ] + }, + + '9-3-sss-present-task': { + 'start': { + 'burst1': (761, 465), + 'pierce1': (729, 283), + }, + 'action': [ + {'t': 'exchange_and_click', 'p': (579, 422), 'ec': True, "desc": "2 lower left"}, + {'t': 'choose_and_change', 'p': (579, 422), "desc": "swap 1 2"}, + {'t': 'click', 'p': (460, 422), 'wait-over': True, "desc": "1 left"}, + + {'t': 'click', 'p': (440, 502), 'ec': True, "desc": "1 lower left"}, + {'t': 'click', 'p': (873, 467), 'wait-over': True, "desc": "2 right"}, + + {'t': 'exchange_and_click', 'p': (846, 290), 'wait-over': True, "desc": "2 upper right"}, + {'t': 'click', 'p': (378, 392), "desc": "1 left"}, + ] + }, +} diff --git a/tasks/auto_mission/normal_task/__init__.py b/tasks/auto_mission/normal_task/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tasks/auto_mission/normal_task/normal_task_10.py b/tasks/auto_mission/normal_task/normal_task_10.py new file mode 100644 index 0000000..d0bf5c6 --- /dev/null +++ b/tasks/auto_mission/normal_task/normal_task_10.py @@ -0,0 +1,93 @@ +stage_data = { + '10': { + 'SUB': "burst1" + }, + '10-1': { + 'start': { + 'burst1': (640, 261), + 'mystic1': (403, 560), + }, + 'action': [ + {'t': 'click', 'p': (811, 398), 'ec': True, "desc": "1 lower right"}, + {'t': 'click', 'p': (586, 546), "wait-over": True, 'ec': True, "desc": "2 lower right"}, + + {'t': 'click', 'p': (779, 386), 'ec': True, "desc": "1 lower right"}, + {'t': 'click', 'p': (575, 363), 'ec': True, "wait-over": True, "desc": "2 upper left"}, + + {'t': 'exchange_and_click', 'p': (487, 284), 'ec': True, "desc": "change to 2 and upper left"}, + {'t': 'click', 'p': (904, 392), "desc": "1 right"}, + ] + }, + '10-2': { + 'start': { + 'burst1': (704, 558), + 'mystic1': (554, 480), + }, + 'action': [ + {'t': 'click', 'p': (620, 381), 'ec': True, "desc": "1 upper left"}, + {'t': 'choose_and_change', 'p': (620, 381), "desc": "swap 1 2"}, + {'t': 'click', 'p': (688, 303), "wait-over": True, 'ec': True, "desc": "2 upper right"}, + + {'t': 'exchange_and_click', 'p': (880, 338), 'ec': True, "desc": "change to 2 and right"}, + {'t': 'click', 'p': (527, 414), "wait-over": True, "desc": "1 upper left"}, + + {'t': 'click', 'p': (455, 497), "desc": "1 left"}, + ] + }, + '10-3': { + 'start': { + 'burst1': (821, 344), + 'mystic1': (656, 351), + }, + 'action': [ + {'t': 'click', 'p': (701, 477), 'ec': True, "desc": "1 lower left"}, + {'t': 'choose_and_change', 'p': (701, 477), "desc": "swap 1 2"}, + {'t': 'click', 'p': (764, 556), "wait-over": True, 'ec': True, "desc": "2 lower right"}, + + {'t': 'exchange_and_click', 'p': (713, 522), 'ec': True, "desc": "change to 2 and lower left"}, + {'t': 'click', 'p': (536, 273), "wait-over": True, "desc": "1 left"}, + + {'t': 'click', 'p': (535, 272), "desc": "1 left"}, + ] + }, + '10-4': { + 'start': { + 'burst1': (374, 263), + 'mystic1': (560, 582), + }, + 'action': [ + + {'t': 'exchange_and_click', 'p': (688, 418), 'ec': True, "desc": "change to 2 and upper left"}, + {'t': 'click', 'p': (701, 278), "wait-over": True, "desc": "1 right"}, + + {'t': 'click', 'p': (680, 291), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (616, 543), "ec": True, "wait-over": True, "desc": "2 lower right"}, + + {'t': 'exchange_and_click', 'p': (535, 590), 'ec': True, "desc": "change to 2 and lower left"}, + {'t': 'click', 'p': (736, 270), "wait-over": True, "desc": "1 right"}, + + {'t': 'exchange_and_click', 'p': (694, 495), 'ec': True, "desc": "change to 2 and right"}, + {'t': 'click', 'p': (739, 359), "desc": "1 lower left"}, + ] + }, + '10-5': { + 'start': { + 'burst1': (374, 387), + 'mystic1': (562, 473), + }, + 'action': [ + {'t': 'click', 'p': (617, 381), "ec": True, "desc": "1 right"}, + {'t': 'choose_and_change', 'p': (617, 381), "desc": "swap 1 2"}, + {'t': 'click', 'p': (680, 300), "wait-over": True, "ec": True, "desc": "2 upper right"}, + + {'t': 'click', 'p': (743, 498), "ec": True, "desc": "1 right"}, + {'t': 'click', 'p': (844, 308), 'ec': True, "wait-over": True, "desc": "2 right"}, + + {'t': 'click', 'p': (506, 570), 'ec': True, "desc": "1 lower left"}, + {'t': 'click', 'p': (827, 290), "wait-over": True, 'ec': True, "desc": "2 right"}, + + {'t': 'exchange_and_click', 'p': (794, 387), 'ec': True, "desc": "change to 2 and lower right"}, + {'t': 'click', 'p': (626, 439), "desc": "1 right"}, + ] + }, +} diff --git a/tasks/auto_mission/normal_task/normal_task_11.py b/tasks/auto_mission/normal_task/normal_task_11.py new file mode 100644 index 0000000..ea3fde6 --- /dev/null +++ b/tasks/auto_mission/normal_task/normal_task_11.py @@ -0,0 +1,101 @@ +stage_data = { + '11': { + 'SUB': "pierce1" + }, + '11-1': { + 'start': { + 'pierce1': (496, 525), + 'mystic1': (794, 130), + }, + 'action': [ + {'t': 'click', 'p': (499, 412), 'ec': True, "desc": "1 upper left"}, + {'t': 'click_and_teleport', 'p': (775, 368), "wait-over": True, 'ec': True, "desc": "2 lower right"}, + + {'t': 'click', 'p': (556, 317), 'ec': True, "desc": "1 upper right"}, + {'t': 'click', 'p': (684, 388), "wait-over": True, "desc": "2 upper left"}, + + {'t': 'click', 'p': (469, 245), "desc": "1 upper left"}, + ] + }, + '11-2': { + 'start': { + 'pierce1': (281, 347), + 'mystic1': (791, 287), + }, + 'action': [ + {'t': 'click', 'p': (553, 478), 'ec': True, "desc": "1 lower right"}, + {'t': 'click_and_teleport', "wait-over": True, 'ec': True, 'p': (823, 406), "desc": "2 lower right"}, + + {'t': 'click', 'p': (616, 371), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (904, 412), "wait-over": True, 'ec': True, "desc": "2 right"}, + + {'t': 'click', 'p': (553, 469), 'ec': True, "desc": "1 lower right"}, + {'t': 'click_and_teleport', "wait-over": True, 'ec': True, 'p': (662, 419), "desc": "2 left"}, + + {'t': 'exchange_and_click', 'p': (715, 270), 'ec': True, "desc": "2 right"}, + {'t': 'click', 'p': (624, 451), "desc": "1 right"}, + ] + }, + '11-3': { + 'start': { + 'pierce1': (315, 466), + 'mystic1': (919, 178), + }, + 'action': [ + {'t': 'click', 'p': (635, 461), 'ec': True, "desc": "1 right"}, + {'t': 'click_and_teleport', 'ec': True, "wait-over": True, 'p': (693, 397), "desc": "2 lower left"}, + + {'t': 'click', 'p': (613, 422), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (672, 365), "ec": True, "wait-over": True, "desc": "2 left"}, + + {'t': 'exchange_and_click', 'p': (716, 427), 'ec': True, "desc": "2 lower left"}, + {'t': 'click', 'p': (555, 511), "desc": "1 lower right"}, + ] + }, + '11-4': { + 'start': { + 'pierce1': (940, 350), + 'mystic1': (841, 285), + }, + 'action': [ + + {'t': 'click', 'p': (647, 323), 'ec': True, "desc": "1 upper left"}, + {'t': 'choose_and_change', 'p': (648, 318), "desc": "swap 1 2"}, + {'t': 'click_and_teleport', 'ec': True, "wait-over": True, 'p': (530, 321), "desc": "2 left"}, + + {'t': 'click', 'p': (642, 330), 'ec': True, "desc": "1 left"}, + {'t': 'click', 'p': (558, 446), "ec": True, "wait-over": True, "desc": "2 lower right"}, + + {'t': 'click_and_teleport', 'p': (634, 318), 'ec': True, "desc": "1 left"}, + {'t': 'click', 'p': (434, 422), 'ec': True, "wait-over": True, "desc": "2 left"}, + + {'t': 'choose_and_change', 'p': (494, 404), "desc": "swap 1 2"}, + {'t': 'click', 'p': (433, 489), 'ec': True, "desc": "1 lower left"}, + {'t': 'click', 'p': (525, 249), "desc": "2 left"}, + + ] + }, + '11-5': { + 'start': { + 'pierce1': (374, 429), + 'mystic1': (1114, 591), + }, + 'action': [ + {'t': 'click_and_teleport', 'ec': True, 'p': (719, 351), "desc": "2 upper left"}, + {'t': 'click', 'p': (613, 371), "desc": "1 right", "wait-over": True}, + + {'t': 'click', 'p': (729, 377), "ec": True, "desc": "1 right"}, + {'t': 'click', 'p': (616, 216), 'ec': True, "wait-over": True, "desc": "2 upper right"}, + + {'t': 'click', 'p': (868, 437), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (683, 290), "wait-over": True, 'ec': True, "desc": "2 right"}, + + {'t': 'click_and_teleport', 'ec': True, 'p': (715, 523), "desc": "1 lower left"}, + {'t': 'click', 'p': (835, 288), 'ec': True, "wait-over": True, "desc": "2 right"}, + + {'t': 'click', 'p': (586, 549), 'ec': True, "desc": "2 lower right"}, + {'t': 'click', 'p': (662, 306), "desc": "1 right"}, + + ] + }, +} diff --git a/tasks/auto_mission/normal_task/normal_task_12.py b/tasks/auto_mission/normal_task/normal_task_12.py new file mode 100644 index 0000000..50347ce --- /dev/null +++ b/tasks/auto_mission/normal_task/normal_task_12.py @@ -0,0 +1,104 @@ +stage_data = { + '12': { + 'SUB': "burst1" + }, + '12-1': { + 'start': { + 'mystic1': (370, 428), + 'burst1': (566, 328), + }, + 'action': [ + {'t': 'click_and_teleport', 'ec': True, 'p': (640, 560), "desc": "1 lower right"}, + {'t': 'click', 'p': (704, 320), "wait-over": True, 'ec': True, "desc": "2 right"}, + + {'t': 'exchange_and_click', 'p': (778, 373), 'ec': True, "desc": "2 right"}, + {'t': 'choose_and_change', 'p': (778, 373), "desc": "swap 1 2"}, + {'t': 'click', 'p': (901, 374), "wait-over": True, "desc": "1 right"}, + + {'t': 'exchange_and_click', 'p': (547, 556), 'ec': True, "desc": "2 lower left"}, + {'t': 'click', 'p': (772, 384), "desc": "1 lower right"}, + ] + }, + '12-2': { + 'start': { + 'mystic1': (733, 387), + 'burst1': (574, 474), + }, + 'action': [ + {'t': 'click', 'p': (581, 309), 'ec': True, "desc": "1 left"}, + {'t': 'choose_and_change', 'p': (581, 309), "desc": "swap 1 2"}, + {'t': 'click', 'p': (464, 306), 'ec': True, "wait-over": True, "desc": "2 left"}, + + {'t': 'exchange_and_click', 'p': (526, 453), 'ec': True, "desc": "2 lower left"}, + {'t': 'click', 'p': (767, 401), "wait-over": True, "desc": "1 right"}, + + {'t': 'click', 'p': (845, 490), 'ec': True, "desc": "1 lower right"}, + {'t': 'click', 'p': (617, 383), "desc": "2 right"}, + ] + }, + '12-3': { + 'start': { + 'mystic1': (763, 558), + 'burst1': (586, 147), + }, + 'action': [ + {'t': 'click', 'p': (615, 413), 'ec': True}, + {'t': 'click', 'p': (724, 273), 'wait-over': True}, + + {'t': ['exchange_and_click', 'teleport'],'wait-over':True, 'p': (642, 271)}, + {'t': 'click', 'p': (614, 350), 'ec': True}, + {'t': 'choose_and_change', 'p': (586, 371)}, + {'t': 'click', 'p': (471, 360), "wait-over": True}, + + {'t': 'click', 'p': (440, 286), 'ec': True}, + {'t': 'end-turn'}, + ] + }, + '12-4': { + 'start': { + 'mystic1': (342, 386), + 'burst1': (619, 223), + }, + 'action': [ + {'t': 'click', 'p': (622, 424), 'ec': True, "desc": "1 right"}, + {'t': 'click_and_teleport', 'ec': True, "wait-over": True, 'p': (746, 264), "desc": "2 right"}, + + {'t': 'click', 'p': (657, 523), 'ec': True, "desc": "1 lower right"}, + {'t': 'choose_and_change', 'p': (654, 501), "desc": "swap 1 2"}, + {'t': 'click', 'p': (717, 588), "ec": True, "wait-over": True, "desc": "2 lower right"}, + + {'t': 'exchange_and_click', 'p': (808, 496), 'ec': True, "desc": "2 right"}, + {'t': 'click_and_teleport', 'p': (579, 397), "desc": "1 teleport"}, + {'t': 'click', 'p': (700, 240), "desc": "1 right", "wait-over": True}, + + {'t': 'click_and_teleport', 'p': (824, 291),'ec':True ,"desc": "1 right"}, + {'t': 'click', 'p': (740, 513), "desc": "2 right"}, + + ] + }, + '12-5': { + 'start': { + 'mystic1': (549, 556), + 'burst1': (835, 478), + }, + 'action': [ + {'t': 'click_and_teleport', 'ec': True, 'p': (582, 359), "desc": "1 upper right"}, + {'t': 'choose_and_change', 'p': (781, 353), "desc": "swap 1 2"}, + {'t': 'click', 'p': (842, 272), "wait-over": True ,"desc": "2 upper right"}, + + {'t': 'click_and_teleport', 'p': (665, 397),'ec':True ,"desc": "1 upper right"}, + {'t': 'click_and_teleport', 'p': (756, 317), "desc": "2 teleport"}, + {'t': 'click', 'p': (637, 327), 'ec': True, "wait-over": True, "desc": "2 lower right"}, + + {'t': 'click', 'p': (631, 386), 'ec': True, "desc": "1 upper left"}, + {'t': 'click_and_teleport', 'ec': True, 'p': (701, 248), "desc": "2 upper left"}, + + {'t': 'click', 'p': (377, 392), 'ec': True, "desc": "1 left left"}, + {'t': 'click', 'p': (845, 309), 'ec': True, "desc": "2 upper right", "wait-over": True}, + + {'t': 'exchange_and_click', 'p': (731, 299), 'ec': True, "desc": "2 upper left"}, + {'t': 'click', 'p': (385, 422), "desc": "1 left"}, + + ] + }, +} diff --git a/tasks/auto_mission/normal_task/normal_task_13.py b/tasks/auto_mission/normal_task/normal_task_13.py new file mode 100644 index 0000000..379b55f --- /dev/null +++ b/tasks/auto_mission/normal_task/normal_task_13.py @@ -0,0 +1,109 @@ +stage_data = { + '13': { + 'SUB': "pierce1" + }, + '13-1': { + 'start': { + 'pierce1': (493, 305), + 'pierce2': (701, 570), + }, + 'action': [ + # 第一回合 + {'t': 'click', 'p': (606, 374), 'ec': True, "desc": "1 lower right"}, + {'t': 'click', 'p': (574, 495), "wait-over": True, 'ec': True, "desc": "2 left"}, + # 第二回合 + {'t': 'click', 'p': (699, 344), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (461, 495), "wait-over": True, "desc": "2 left"}, + + # 第三回合 + {'t': 'click', 'p': (851, 300), 'ec': True, "desc": "1 right"}, + {'t': 'end-turn'}, + ] + }, + '13-2': { + 'start': { + 'pierce1': (728, 394), + 'pierce2': (409, 226), + }, + 'action': [ + # 第一回合 + {'t': 'click', 'p': (630, 463), 'ec': True, "desc": "1 left"}, + {'t': 'click', 'p': (591, 400), 'ec': True, "wait-over": True, "desc": "2 lower right"}, + + # 第二回合 + {'t': 'click', 'p': (585, 565), 'ec': True, "desc": "lower left"}, + {'t': 'click', 'p': (666, 418), 'ec': True, "wait-over": True, "desc": "2 lower right"}, + + # 第三回合 + {'t': 'exchange_and_click', 'p': (823, 327), 'ec': True, "desc": "2 upper right"}, + {'t': 'click', 'p': (610, 570), "desc": "1 lower right"}, + ] + }, + '13-3': { + 'start': { + 'pierce1': (427, 513), + 'pierce2': (779, 451), + }, + 'action': [ + # 第一回合 + {'t': 'click', 'p': (579, 361), 'ec': True, "desc": "1 upper right"}, + {'t': 'click', 'p': (702, 354), "wait-over": True, 'ec': True, "desc": "2 upper left"}, + + # 第二回合 + {'t': 'choose_and_change', 'p': (782, 458), "desc": "swap 1 2"}, + {'t': 'click', 'p': (823, 357), 'ec': True, "desc": "1 upper right"}, + {'t': 'click', 'p': (722, 445), "wait-over": True, 'ec': True, "desc": "2 right"}, + + # 第三回合 + {'t': 'click', 'p': (826, 282), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (762, 498), 'ec': True, "wait-over": True, "desc": "2 right"}, + + # 第四回合 + {'t': 'click', 'p': (890, 365), "desc": "1 right"}, + ] + }, + '13-4': { + 'start': { + 'pierce1': (580, 263), + 'pierce2': (875, 389), + }, + 'action': [ + # 第一回合 + {'t': 'click', 'p': (604, 473), 'ec': True, "desc": "1 lower right"}, + {'t': 'click', 'p': (731, 473), 'ec': True, "wait-over": True, "desc": "2 lower left"}, + + # 第二回合 + {'t': 'exchange_and_click', 'p': (728, 473), 'ec': True, "desc": "2 lower left"}, + {'t': 'choose_and_change', 'p': (728, 473), "desc": "swap 1 2"}, + {'t': 'click', 'p': (672, 567), "wait-over": True, "desc": "1 lower left"}, + + # 第三回合 + {'t': 'click', 'p': (628, 475), 'ec': True, "desc": "1 left"}, + {'t': 'click', 'p': (738, 198), "desc": "2 upper right"}, + + ] + }, + '13-5': { + 'start': { + 'pierce1': (669, 223), + 'pierce2': (904, 419), + }, + 'action': [ + # 第一回合 + {'t': 'click', 'p': (625, 355), 'ec': True, "desc": "1 lower right"}, + {'t': 'click', 'p': (651, 440), 'ec': True, "wait-over": True, "desc": "2 left"}, + + # 第二回合 + {'t': 'exchange_and_click', 'p': (503, 371), 'ec': True, "desc": "2 left"}, + {'t': 'choose_and_change', 'p': (503, 371), "desc": "swap 1 2"}, + {'t': 'click', 'p': (443, 454), "wait-over": True, "desc": "1 lower left"}, + + # 第三回合 + {'t': 'click', 'p': (454, 473), 'ec': True, "desc": "1 left"}, + {'t': 'click', 'p': (550, 275), 'ec': True, "wait-over": True, "desc": "2 left"}, + + # 第四回合 + {'t': 'click', 'p': (476, 498), "desc": "1 lower left"}, + ] + }, +} diff --git a/tasks/auto_mission/normal_task/normal_task_14.py b/tasks/auto_mission/normal_task/normal_task_14.py new file mode 100644 index 0000000..f2e8290 --- /dev/null +++ b/tasks/auto_mission/normal_task/normal_task_14.py @@ -0,0 +1,118 @@ +stage_data = { + '14': { + 'SUB': "burst1" # 支线用爆发1 + }, + '14-1': { + 'start': { + 'burst1': (460, 383), + 'mystic1': (572, 303), + }, + 'action': [ + # 第一回合 + {'t': 'exchange_and_click', 'p': (756, 388), 'ec': True, "desc": "2 right"}, + {'t': 'click', 'p': (636, 555), 'wait-over': True, "desc": "1 lower right"}, + # 第二回合 + {'t': 'exchange_and_click', 'p': (867, 316), 'ec': True, "desc": "2 right"}, + {'t': 'click', 'p': (619, 461), 'wait-over': True, "desc": "1 lower right"}, + # 第三回合 + {'t': 'exchange_and_click', 'p': (839, 298), 'ec': True, "desc": "2 right"}, + {'t': 'click', 'p': (669, 491), "desc": "1 right"}, + ] + }, + '14-2': { + 'start': { + 'burst1': (611, 299), + 'mystic1': (880, 559), + }, + 'action': [ + # 第一回合 + {'t': 'click', 'p': (590, 396), 'ec': True, "desc": "1 lower right"}, + {'t': 'click', 'p': (685, 390), 'ec': True, "wait-over": True, "desc": "2 upper left"}, + + # 第二回合 + {'t': 'click', 'p': (514, 466), 'ec': True, "desc": "1 lower left"}, + {'t': 'click', 'p': (580, 380), 'ec': True, "wait-over": True, "desc": "2 left"}, + + # 第三回合 + {'t': 'exchange_and_click', 'p': (600, 228), 'ec': True, "desc": "2 upper right"}, + {'t': 'click', 'p': (545, 443), "wait-over": True, "desc": "1 left"}, + + # 第四回合 + {'t': 'exchange_and_click', 'p': (802, 280), 'ec': True, "desc": "2 right"}, + {'t': 'click', 'p': (493, 402), "desc": "1 upper left"}, + ] + }, + '14-3': { + 'start': { + 'burst1': (583, 306), + 'mystic1': (520, 560), + }, + 'action': [ + # 第一回合 + {'t': 'click', 'p': (745, 410), 'ec': True, "desc": "1 lower right"}, + {'t': 'click', 'p': (686, 491), "wait-over": True, 'ec': True, "desc": "2 right"}, + + # 第二回合 + {'t': 'click', 'p': (866, 408), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (677, 396), "wait-over": True, "desc": "2 upper right"}, + + # 第三回合 + {'t': 'click', 'p': (842, 317), 'ec': True, "desc": "1 upper right"}, + {'t': 'click', 'p': (412, 339), 'ec': True, "wait-over": True, "desc": "2 left"}, + + # 第四回合 + {'t': 'exchange_and_click', 'p': (439, 303), 'ec': True, "desc": "2 upper left"}, + {'t': 'click', 'p': (767, 399), "desc": "1 lower right"}, + + ] + }, + '14-4': { + 'start': { + 'burst1': (818, 302), + 'mystic1': (535, 498), + }, + 'action': [ + # 第一回合 + {'t': 'click', 'p': (647, 317), 'ec': True, "desc": "1 left"}, + {'t': 'click', 'p': (610, 381), 'ec': True, "wait-over": True, "desc": "2 upper right"}, + + # 第二回合 + {'t': 'exchange_and_click', 'p': (547, 302), 'ec': True, "desc": "2 upper left"}, + {'t': 'choose_and_change', 'p': (547, 302), "desc": "swap 1 2"}, + {'t': 'click', 'p': (493, 219), "wait-over": True, "desc": "1 upper left"}, + + # 第三回合 + {'t': 'click', 'p': (412, 315), 'ec': True, "desc": "1 left"}, + {'t': 'click', 'p': (763, 408), "wait-over": True, 'ec': True, "desc": "2 lower right"}, + + # 第四回合 + {'t': 'click', 'p': (454, 420), 'ec': True, "desc": "1 lower left"}, + {'t': 'click', 'p': (724, 512), "desc": "2 lower left"}, + + ] + }, + '14-5': { + 'start': { + 'burst1': (880, 388), + 'mystic1': (246, 302), + }, + 'action': [ + # 第一回合 + {'t': 'click', 'p': (724, 330), 'ec': True, "desc": "1 upper left"}, + {'t': 'click', 'p': (559, 283), 'ec': True, "wait-over": True, "desc": "2 upper right"}, + + # 第二回合 + {'t': 'click', 'p': (540, 267), 'ec': True, "desc": "1 left"}, + {'t': 'click', 'p': (630, 336), 'ec': True, "wait-over": True, "desc": "2 right"}, + + # 第三回合 + {'t': 'exchange_and_click', 'p': (581, 407), 'ec': True, "desc": "2 lower right"}, + {'t': 'choose_and_change', 'p': (581, 407), "desc": "swap 1 2"}, + {'t': 'click', 'p': (517, 494), "wait-over": True, "desc": "1 lower left"}, + + # 第四回合 + {'t': 'exchange_and_click', 'p': (727, 483), 'ec': True, "desc": "2 lower left"}, + {'t': 'click', 'p': (519, 409), "desc": "1 lower left"}, + ] + }, +} diff --git a/tasks/auto_mission/normal_task/normal_task_15.py b/tasks/auto_mission/normal_task/normal_task_15.py new file mode 100644 index 0000000..c225ca4 --- /dev/null +++ b/tasks/auto_mission/normal_task/normal_task_15.py @@ -0,0 +1,105 @@ +stage_data = { + '15': { + 'SUB': "mystic1" + }, + '15-1': { + 'start': { + 'mystic1': (376, 344), + 'mystic2': (1044, 609), + }, + 'action': [ + + {'t': 'click', 'p': (629, 329), 'ec': True}, + {'t': 'click_and_teleport', 'ec': True, "wait-over": True, 'p': (824, 365)}, + + {'t': 'exchange_and_click', 'p': (678, 357), 'ec': True}, + {'t': 'choose_and_change', 'p': (679, 347)}, + {'t': 'click', 'p': (794, 352), 'wait-over': True}, + + {'t': 'click', 'p': (823, 413), 'ec': True}, + {'t': 'click', 'p': (444, 446)}, + ] + }, + '15-2': { + 'start': { + 'mystic1': (407, 259), + 'mystic2': (751, 487), + }, + 'action': [ + + {'t': 'click', 'p': (636, 317), 'ec': True}, + {'t': 'click', 'p': (673, 385), 'ec': True}, + + {'t': 'exchange_and_click', 'p': (727, 349), 'ec': True}, + {'t': 'choose_and_change', 'p': (727, 342)}, + {'t': 'click', 'p': (838, 344), 'wait-over': True}, + + {'t': ['exchange_and_click','teleport'], 'ec': True, 'p': (432, 451)}, + {'t': 'click', 'p': (814, 245)}, + ] + }, + '15-3': { + 'start': { + 'mystic1': (757, 144), + 'mystic2': (407, 188), + }, + 'action': [ + + {'t': 'click', 'p': (728, 461), 'ec': True}, + {'t': 'click_and_teleport', 'ec': True, 'p': (576, 399)}, + + {'t': 'choose_and_change', 'p': (680, 452)}, + {'t': 'click', 'p': (623, 541), 'ec': True}, + {'t': 'click', 'p': (797, 421), 'ec': True, 'wait-over': True}, + + {'t': 'exchange_and_click', 'ec': True, 'p': (835, 425)}, + {'t': 'choose_and_change', 'p': (610, 459)}, + {'t': 'click', 'p': (512, 452)}, + {'t': 'click', 'p': (674, 537)} + ] + }, + '15-4': { + 'start': { + 'mystic1': (824, 554), + 'mystic2': (665, 66), + }, + 'action': [ + + {'t': 'click', 'p': (546, 498), 'ec': True}, + {'t': 'click', 'p': (687, 343), 'ec': True, 'wait-over': True}, + + {'t': 'click', 'p': (547, 419), 'ec': True}, + {'t': 'click_and_teleport', 'ec': True, 'wait-over': True, 'p': (801, 275)}, + + {'t': 'exchange_and_click', 'p': (460, 498), 'ec': True}, + {'t': 'choose_and_change', 'p': (528, 457)}, + {'t': 'click', 'p': (408, 468), 'wait-over': True}, + + {'t': 'exchange_and_click', 'p': (897, 416), 'wait-over': True}, + {'t': 'click', 'p': (435, 446)}, + ] + }, + '15-5': { + 'start': { + 'mystic1': (314, 300), + 'mystic2': (490, 526), + }, + 'action': [ + + {'t': 'exchange_and_click', 'p': (608, 384), 'ec': True}, + + {'t': 'choose_and_change', 'p': (610, 388)}, + {'t': 'click', 'p': (730, 388), 'wait-over': True}, + + {'t': 'click', 'p': (784, 218), 'ec': True}, + {'t': 'click_and_teleport', 'ec': True, 'wait-over': True, 'p': (579, 234)}, + + {'t': 'click_and_teleport', 'ec': True, 'wait-over': True, 'p': (788, 216)}, + {'t': 'click', 'p': (651, 373), 'wait-over': True}, + + {'t': 'click', 'p': (803, 491), 'ec': True}, + {'t': 'click', 'p': (734, 354), 'wait-over': True}, + {'t': 'click', 'p': (779, 511)}, + ] + }, +} diff --git a/tasks/auto_mission/normal_task/normal_task_16.py b/tasks/auto_mission/normal_task/normal_task_16.py new file mode 100644 index 0000000..7e36613 --- /dev/null +++ b/tasks/auto_mission/normal_task/normal_task_16.py @@ -0,0 +1,127 @@ +stage_data = { + '16': { + 'SUB': "pierce1" + }, + '16-1': { + 'start': { + 'pierce1': (728, 303), + 'mystic1': (882, 562), + }, + 'action': [ + # 第一回合 + {'t': 'click', 'p': (468, 397), 'ec': True, "desc": "1 lower left"}, + {'t': 'click', 'p': (637, 461), "wait-over": True, 'ec': True, "desc": "2 left"}, + # 第二回合 + {'t': 'click', 'p': (433, 463), 'ec': True, "desc": "1 lower left"}, + {'t': 'click', 'p': (630, 443), "wait-over": True,'ec': True, "desc": "2 left"}, + + # 第三回合 + {'t': 'click', 'p': (453, 525), 'ec': True, "desc": "1 lower left"}, + {'t': 'click', 'p': (596, 390), "wait-over": True, 'ec': True,"desc": "2 left"}, + + # 第四回合 + {'t': 'click', 'p': (421, 480), 'ec': True, "desc": "1 left"}, + {'t': 'click', 'p': (776, 214), "desc": "2 upper right"}, + ] + }, + '16-2': { + 'start': { + 'pierce1': (428, 472), + 'mystic1': (409, 269), + }, + 'action': [ + # 第一回合 + {'t': 'click', 'p': (752, 492), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (637, 318), 'ec': True, "wait-over": True, "desc": "2 right"}, + + # 第二回合 + {'t': 'click', 'p': (560, 338), 'ec': True, "desc": "1 upper right"}, + {'t': 'click', 'p': (637, 330), 'ec': True, "wait-over": True, "desc": "2 right"}, + + # 第三回合 + {'t': 'click', 'p': (775, 361), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (657, 357), 'ec': True, "wait-over": True, "desc": "2 lower right"}, + + # 第四回合 + {'t': 'exchange_and_click', 'p': (439, 505), 'ec': True, "desc": "2 lower left"}, + {'t': 'click', 'p': (890, 348), "desc": "1 right"}, + ] + }, + '16-3': { + 'start': { + 'pierce1': (370, 388), + 'mystic1': (1102, 562), + }, + 'action': [ + # 第一回合 + {'t': 'click', 'p': (619, 357), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (660, 432), "wait-over": True, 'ec': True, "desc": "2 left"}, + + # 第二回合 + {'t': 'click', 'p': (624, 336), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (702, 373), "wait-over": True, 'ec': True, "desc": "2 upper left"}, + + # 第三回合 + {'t': 'exchange_and_click', 'p': (653, 304), 'ec': True, "desc": "2 lower left"}, + {'t': 'choose_and_change', 'p': (653, 304), "desc": "swap 1 2"}, + {'t': 'click', 'p': (718, 223),"wait-over": True, "desc": "1 upper right"}, + + # 第四回合 + {'t': 'exchange_and_click', 'p': (433, 487), 'ec': True, "desc": "2 lower left"}, + {'t': 'click', 'p': (893, 357), "wait-over": True,"desc": "1 right"}, + + # 第五回合 + {'t': 'exchange_and_click', 'p': (439, 321), 'ec': True, "desc": "2 upper left"}, + {'t': 'click', 'p': (839, 303), "desc": "1 upper right"}, + ] + }, + '16-4': { + 'start': { + 'pierce1': (343, 473), + 'mystic1': (812, 510), + }, + 'action': [ + # 第一回合 + {'t': 'click', 'p': (553, 300), 'ec': True, "desc": "1 upper right"}, + {'t': 'click', 'p': (697, 365), 'ec': True, "wait-over": True, "desc": "2 upper left"}, + + # 第二回合 + {'t': 'exchange_and_click', 'p': (660, 292), 'ec': True, "desc": "2 upper left"}, + {'t': 'choose_and_change', 'p': (660, 292), "desc": "swap 1 2"}, + {'t': 'click', 'p': (715, 223), "wait-over": True, "desc": "1 upper right"}, + + # 第三回合 + {'t': 'click', 'p': (831, 293), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (450, 534), "desc": "2 lower right"}, + + ] + }, + '16-5': { + 'start': { + 'pierce1': (307, 403), + 'mystic1': (854, 238), + }, + 'action': [ + # 第一回合 + {'t': 'click', 'p': (566, 530), 'ec': True, "desc": "1 lower right"}, + {'t': 'click', 'p': (640, 320), "wait-over": True, 'ec': True, "desc": "2 left"}, + + # 第二回合 + {'t': 'click', 'p': (662, 481), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (634, 367), "wait-over": True, 'ec': True, "desc": "2 lower left"}, + + # 第三回合 + {'t': 'exchange_and_click', 'p': (694, 425), 'ec': True, "desc": "2 lower right"}, + {'t': 'choose_and_change', 'p': (694, 425), "desc": "swap 1 2"}, + {'t': 'click', 'p': (813, 425), "wait-over": True,"desc": "1 right"}, + + # 第四回合 + {'t': 'click', 'p': (897, 373), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (378, 385), "wait-over": True, 'ec': True,"desc": "2 left"}, + + # 第五回合 + {'t': 'click', 'p': (847, 472), 'ec': True, "desc": "1 lower right"}, + {'t': 'click', 'p': (560, 301), "desc": "2 upper left"}, + ] + }, +} diff --git a/tasks/auto_mission/normal_task/normal_task_4.py b/tasks/auto_mission/normal_task/normal_task_4.py new file mode 100644 index 0000000..fa5cc89 --- /dev/null +++ b/tasks/auto_mission/normal_task/normal_task_4.py @@ -0,0 +1,60 @@ +stage_data = { + '4': { + 'SUB': 'pierce1' + }, + '4-1': { + 'start': { + 'pierce1': (370, 470), + }, + 'action': [ + {'t': 'click_and_teleport', "wait-over": True, 'p': (632, 432), "desc": "right and tp"}, + {'t': 'click', 'p': (831, 414), "wait-over": True, "desc": "right"}, + {'t': 'click', 'p': (842, 329), "desc": "upper right"}, + + ] + }, + '4-2': { + 'start': { + 'pierce1': (434, 387), + }, + 'action': [ + {'t': 'click_and_teleport', "wait-over": True, 'p': (565, 305), "desc": "upper right and tp"}, + {'t': 'click', 'p': (794, 330), "wait-over": True, "desc": "upper right"}, + {'t': 'click', 'p': (838, 432), "desc": "lower right"}, + + ] + }, + '4-3': { + 'start': { + 'pierce1': (400, 468), + }, + 'action': [ + {'t': 'click_and_teleport', "wait-over": True, 'p': (581, 345), "desc": "upper right and tp"}, + {'t': 'click_and_teleport', 'p': (656, 338), 'wait-over':True,"desc": "tp"}, + {'t': 'click', 'p': (626, 380), "desc": "lower right"}, + ] + }, + '4-4': { + 'start': { + 'pierce1': (460, 470), + }, + 'action': [ + {'t': 'click', 'p': (652, 440), "wait-over": True, "desc": "right"}, + {'t': 'click', 'p': (773, 441), "desc": "right"}, + {'t': 'nothing'}, + + ] + }, + '4-5': { + 'start': { + 'pierce1': (580, 511), + }, + 'action': [ + {'t': 'click', 'p': (719, 474), "wait-over": True, 'desc': "right"}, + {'t': 'click_and_teleport', 'p': (634, 452),'wait-over':True, "desc": "tp"}, + {'t': 'click', 'p': (524, 293), "wait-over": True, "desc": 'left'}, + {'t': 'click', 'p': (419, 305), "desc": "left"} + + ] + } +} diff --git a/tasks/auto_mission/normal_task/normal_task_5.py b/tasks/auto_mission/normal_task/normal_task_5.py new file mode 100644 index 0000000..92e6f4b --- /dev/null +++ b/tasks/auto_mission/normal_task/normal_task_5.py @@ -0,0 +1,57 @@ +stage_data = { + '5': { + 'SUB': 'burst1' + }, + '5-1': { + 'start': { + 'burst1': (523, 305), + }, + 'action': [ + {'t': 'click', 'p': (703, 474), "wait-over": True ,"desc": "lower right"}, + {'t': 'click', 'p': (763, 464), "desc": "lower right"}, + + ] + }, + '5-2': { + 'start': { + 'burst1': (460, 474), + }, + 'action': [ + {'t': 'click', 'p': (652, 439), "wait-over": True, "desc": "right"}, + {'t': 'click', 'p': (772, 439), "desc": "right"}, + + ] + }, + '5-3': { + 'start': { + 'burst1': (524, 348), + }, + 'action': [ + {'t': 'click', 'p': (700, 474), "wait-over": True ,"desc": "lower right"}, + {'t': 'click', 'p': (775, 411), "wait-over": True ,"desc": "right"}, + {'t': 'click', 'p': (742, 258), "desc": "upper right"}, + ] + }, + '5-4': { + 'start': { + 'burst1': (460, 470), + }, + 'action': [ + {'t': 'click', 'p': (585, 356), "wait-over": True, 'desc': "upper right"}, + {'t': 'click', 'p': (619, 408), "wait-over": True, "desc": 'right'}, + {'t': 'click', 'p': (676, 492), "desc": "lower right"} + + ] + }, + '5-5': { + 'start': { + 'burst1': (427, 386), + }, + 'action': [ + {'t': 'click', 'p': (625, 390), "wait-over": True, "desc": "right"}, + {'t': 'click', 'p': (568, 511), "wait-over": True, "desc": "lower right"}, + {'t': 'click', 'p': (700, 490), "wait-over": True, "desc": "right"}, + {'t': 'click', 'p': (695, 536), "desc": "lower right"}, + ] + }, +} diff --git a/tasks/auto_mission/normal_task/normal_task_6.py b/tasks/auto_mission/normal_task/normal_task_6.py new file mode 100644 index 0000000..c4c2afa --- /dev/null +++ b/tasks/auto_mission/normal_task/normal_task_6.py @@ -0,0 +1,94 @@ +stage_data = { + '6': { + 'SUB': 'pierce1', + }, + '6-1': { + 'start': { + 'pierce1': (494, 269), + 'pierce2': (467, 548), + }, + 'action': [ + {'t': 'click', 'p': (682, 348), 'ec': True, "desc": "1 lower right"}, + {'t': 'click', 'p': (697, 490), "wait-over": True, 'ec': True, "desc": "2 right"}, + + {'t': 'click', 'p': (781, 326), 'ec': True, "desc": "1 right"}, + {'t': 'end-turn'}, + + {'t': 'click', 'p': (844, 328),'ec': True, "desc": "1 right"}, + {'t': 'end-turn'}, + + ] + }, + '6-2': { + 'start': { + 'pierce1': (460, 556), + 'pierce2': (499, 216), + }, + 'action': [ + {'t': 'click', 'p': (680, 418), 'ec': True, "desc": "1 upper left"}, + {'t': 'click', 'p': (695, 280), "wait-over": True, 'ec': True, "desc": "2 right"}, + + {'t': 'click', 'p': (815, 447), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (775, 267), "wait-over": True, 'ec': True, "desc": "2 right"}, + + {'t': 'click', 'p': (754, 413), 'ec': True, "desc": "1 right"}, + {'t': 'end-turn'}, + + ] + }, + '6-3': { + 'start': { + 'pierce1': (520, 560), + 'pierce2': (466, 146), + }, + 'attr': { + '1': 'pierce1', + '2': 'pierce2', + }, + 'action': [ + {'t': 'click', 'p': (721, 420), 'ec': True, "desc": "1 upper right"}, + {'t': 'click', 'p': (647, 362), "wait-over": True, 'ec': True, "desc": "2 lower right"}, + + {'t': 'click', 'p': (761, 408), 'ec': True, "desc": "1 upper right"}, + {'t': 'click', 'p': (700, 328), "wait-over": True, 'ec': True, "desc": "2 right"}, + + {'t': 'click', 'p': (661, 386), "desc": "1 right"}, + ] + }, + '6-4': { + 'start': { + 'pierce1': (403, 347), + 'pierce2': (679, 285), + }, + 'action': [ + + {'t': 'exchange_and_click', 'p': (629, 447), 'ec': True, "desc": "2 lower left"}, + {'t': 'choose_and_change', 'p': (629, 447), "desc": "swap 1 2"}, + {'t': 'click', 'p': (692, 535), "wait-over": True, "desc": "1 lower right"}, + + {'t': 'click', 'p': (625, 432), 'ec': True, "desc": "1 lower right"}, + {'t': 'end-turn'}, + + {'t': 'click', 'p': (851, 484),'ec': True, "desc": "1 right"}, + {'t': ''}, + ] + }, + '6-5': { + 'start': { + 'pierce1': (818, 261), + 'pierce2': (583, 225), + }, + 'action': [ + {'t': 'click', 'p': (715, 429), "ec": True, "desc": "1 lower left"}, + {'t': 'click', 'p': (535, 348), "wait-over": True, "ec": True, "desc": "2 lower left"}, + + {'t': 'exchange_and_click', 'p': (653, 352), "ec": True, "desc": "2 lower right"}, + {'t': 'click', 'p': (713, 446), "wait-over": True, "desc": "1 lower left"}, + + {'t': 'click', 'p': (845, 461), 'ec': True, "desc": "1 lower right"}, + {'t': 'click', 'p': (530, 280), "wait-over": True, 'ec': True, "desc": "2 left"}, + + {'t': 'click', 'p': (877, 410), "desc": "1 right"}, + ] + }, +} diff --git a/tasks/auto_mission/normal_task/normal_task_7.py b/tasks/auto_mission/normal_task/normal_task_7.py new file mode 100644 index 0000000..9209d0e --- /dev/null +++ b/tasks/auto_mission/normal_task/normal_task_7.py @@ -0,0 +1,86 @@ +stage_data = { + '7': { + 'SUB': 'burst1', + }, + '7-1': { + 'start': { + 'burst1': (306, 470), + 'burst2': (511, 258), + }, + 'action': [ + {'t': 'click_and_teleport', 'ec': True, 'p': (663, 461), "desc": "1 right and tp"}, + {'t': 'click_and_teleport', "wait-over": True, 'ec': True, 'p': (622, 342), "desc": "2 right and tp"}, + + {'t': 'click', 'p': (657, 309), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (596, 560), "wait-over": True, 'ec': True, "desc": "2 lower right"}, + + {'t': 'click', 'p': (789, 278), 'ec': True, "desc": "1 right"}, + {'t': 'end-turn'}, + ] + }, + '7-2': { + 'start': { + 'burst1': (373, 386), + 'burst2': (563, 306), + }, + 'action': [ + {'t': 'exchange_and_click', 'p': (700, 475), 'ec': True, "desc": "2 lower left"}, + {'t': 'choose_and_change', 'p': (700, 475), "desc": "swap 1 2"}, + {'t': 'click_and_teleport', 'p': (819, 476), 'wait-over': True, "desc": "1 right and tp"}, + + {'t': 'click', 'p': (607, 490), 'ec': True, "desc": "1 lower left"}, + {'t': 'end-turn'}, + + ] + }, + '7-3': { + 'start': { + 'burst1': (579, 385), + 'burst2': (938, 476), + }, + 'action': [ + {'t': 'click_and_teleport', 'p': (718, 345), 'ec': True, "desc": "2 upper left and tp"}, + {'t': 'choose_and_change', 'p': (564, 438), "desc": "swap 1 2"}, + {'t': 'click', 'p': (503, 522), 'wait-over': True, "desc": "1 lower left"}, + + {'t': 'click', 'p': (425, 481), 'ec': True, "desc": "1 left"}, + {'t': 'click_and_teleport', 'p': (682, 354), "desc": "2 lower right"}, + ] + }, + '7-4': { + 'start': { + 'burst1': (395, 559), + 'burst2': (486, 370), + }, + 'action': [ + {'t': 'click', 'p': (679, 463), 'ec': True, "desc": "1 right"}, + {'t': 'click_and_teleport', 'p': (619, 379), "wait-over": True, 'ec': True, "desc": "2 right and tp"}, + + {'t': 'click', 'p': (715, 403), 'ec': True, "desc": "1 upper right"}, + {'t': 'click', 'p': (815, 275), "wait-over": True, 'ec': True, "desc": "2 right"}, + + {'t': ['exchange_and_click', 'teleport'], 'p': (770, 417), 'ec': True, "desc": "2 lower right and tp"}, + {'t': 'choose_and_change', 'p': (644, 455), "desc": "swap 1 2"}, + {'t': 'click_and_teleport', 'p': (641, 458), "wait-over": True, "desc": "1 teleport and tp"}, + {'t': 'click', 'p': (880, 300), "desc": "1 right"}, + + ] + }, + '7-5': { + 'start': { + 'burst1': (523, 385), + 'burst2': (813, 309), + }, + 'action': [ + {'t': 'exchange_and_click', 'p': (706, 418), "ec": True, "desc": "2 lower left"}, + {'t': 'choose_and_change', 'p': (706, 418), "desc": "swap 1 2"}, + {'t': 'click', 'p': (767, 500), 'wait-over': True, "desc": "1 lower right"}, + + {'t': 'click_and_teleport', 'ec': True, 'p': (685, 565), "desc": "1 lower left and tp"}, + {'t': 'click_and_teleport', "wait-over": True, 'ec': True, 'p': (555, 472), "desc": "2 lower right and tp"}, + + {'t': 'exchange_and_click', 'p': (378, 423), 'ec': True, "desc": "2 left"}, + {'t': 'click', 'p': (889, 351), "desc": "1 right"}, + ] + }, +} diff --git a/tasks/auto_mission/normal_task/normal_task_8.py b/tasks/auto_mission/normal_task/normal_task_8.py new file mode 100644 index 0000000..862743e --- /dev/null +++ b/tasks/auto_mission/normal_task/normal_task_8.py @@ -0,0 +1,104 @@ +stage_data = { + '8': { + 'SUB': 'pierce1', + }, + '8-1': { + 'start': { + 'pierce1': (640, 303), + 'pierce2': (518, 390), + }, + 'action': [ + {'t': 'click', 'p': (877, 392), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (431, 390), "wait-over": True, "desc": "2 left"}, + + {'t': 'exchange_and_click', 'p': (436, 474), "ec": True, "desc": "2 lower left"}, + {'t': 'click', 'p': (784, 354), "wait-over": True, "desc": "1 right"}, + + {'t': 'click', 'p': (841, 443), 'ec': True, "desc": "1 lower right"}, + {'t': 'click_and_teleport', 'wait-over': True, 'ec': True, 'p': (556, 320), "desc": "2 upper right and tp"}, + + {'t': 'exchange_and_click', 'p': (564, 515), "ec": True, "desc": "2 lower right"}, + {'t': 'click', 'p': (723, 451), "desc": "1 lower left"}, + + ] + }, + '8-2': { + 'start': { + 'pierce1': (730, 558), + 'pierce2': (567, 482), + }, + 'action': [ + {'t': 'click', 'p': (634, 390), 'ec': True, "desc": "1 upper left"}, + {'t': 'click_and_teleport', 'wait-over': True, 'ec': True, 'p': (513, 390), "desc": "2 upper left and tp"}, + + {'t': 'click', 'p': (838, 326), 'ec': True, "desc": "1 upper right"}, + {'t': 'click', 'p': (561, 281), "wait-over": True, 'ec': True, "desc": "2 upper right"}, + + {'t': 'exchange_and_click', 'p': (640, 319), "ec": True, "desc": "2 right"}, + {'t': 'click', 'p': (784, 372), "wait-over": True, "desc": "1 right"}, + + {'t': 'exchange_and_click', 'p': (466, 240), "ec": True, "desc": "2 upper left"}, + {'t': 'click', 'p': (840, 520), "desc": "1 lower right"}, + ] + }, + '8-3': { + 'start': { + 'pierce1': (404, 343), + 'pierce2': (618, 364), + }, + 'action': [ + {'t': 'click', 'p': (582, 474), 'ec': True, "desc": "1 lower right"}, + {'t': 'choose_and_change', 'p': (582, 474), "desc": "swap 1 2"}, + {'t': 'click_and_teleport', 'wait-over': True, 'ec': True, 'p': (640, 559), "desc": "2 lower right and tp"}, + + {'t': 'click', 'p': (707, 364), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (798, 229), "wait-over": True, 'ec': True, "desc": "2 upper right"}, + + {'t': 'click', 'p': (647, 337), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (757, 282), "desc": "2 right"}, + ] + }, + '8-4': { + 'start': { + 'pierce1': (335, 561), + 'pierce2': (650, 451), + }, + 'action': [ + {'t': 'click_and_teleport', 'ec': True, 'p': (580, 308), "desc": "1 upper right and tp"}, + {'t': 'click_and_teleport', "wait-over": True, 'ec': True, 'p': (670, 395), "desc": "2 upper right and tp"}, + + {'t': 'choose_and_change', 'p': (780, 357), "desc": "swap 1 2"}, + {'t': 'click', 'p': (899, 360), 'ec': True, "desc": "1 right"}, + {'t': 'click_and_teleport', "wait-over": True, 'ec': True, 'p': (644, 314), "desc": "2 right and tp"}, + + {'t': 'click', 'p': (727, 428), 'ec': True, "desc": "1 lower right"}, + {'t': 'click', 'p': (653, 469), "wait-over": True, 'ec': True, "desc": "2 right"}, + + {'t': 'click', 'p': (900, 395), 'ec': True, "desc": "1 right"}, + + ] + }, + '8-5': { + 'start': { + 'pierce1': (396, 469), + 'pierce2': (577, 351), + }, + 'action': [ + {'t': 'exchange_and_click', 'p': (698, 482), "ec": True, "desc": "2 lower right"}, + {'t': 'choose_and_change', 'p': (698, 482), "desc": "swap 1 2"}, + {'t': 'click', 'p': (816, 472), 'wait-over': True, "desc": "1 right"}, + + {'t': 'click', 'p': (889, 448), 'ec': True, "desc": "1 right"}, + {'t': 'click_and_teleport', "wait-over": True, 'ec': True, 'p': (439, 495), "desc": "2 lower left and tp"}, + + {'t': 'exchange_and_click', 'p': (731, 276), 'ec': True, "desc": "2 left"}, + {'t': 'click', 'p': (743, 428), 'wait-over': True, "desc": "1 right"}, + + {'t': 'click', 'p': (810, 515), 'ec': True, "desc": "1 lower right"}, + {'t': 'click_and_teleport', "wait-over": True, 'ec': True,'p': (710, 281), "desc": "2 right and tp"}, + + {'t': 'exchange_and_click', 'p': (556, 305), 'ec': True, "desc": "2 upper right"}, + {'t': 'click', 'p': (711, 542), "desc": "1 lower left"}, + ] + }, +} diff --git a/tasks/auto_mission/normal_task/normal_task_9.py b/tasks/auto_mission/normal_task/normal_task_9.py new file mode 100644 index 0000000..474f0ca --- /dev/null +++ b/tasks/auto_mission/normal_task/normal_task_9.py @@ -0,0 +1,90 @@ +stage_data = { + '9': { + 'SUB': 'burst1', + }, + '9-1': { + 'start': { + 'burst1': (492, 302), + 'pierce1': (812, 398), + }, + 'action': [ + {'t': 'click', 'p': (441, 415), 'ec': True, "desc": "1 lower left"}, + {'t': 'click', 'p': (664, 407), "wait-over": True, "desc": "2 left"}, + + {'t': 'exchange_and_click', 'p': (675, 491), "ec": True, "desc": "2 lower left"}, + {'t': 'click', 'p': (556, 482), "wait-over": True, "desc": "1 lower right"}, + + {'t': 'exchange_and_click', 'p': (838, 279), "ec": True, "desc": "2 upper right"}, + {'t': 'click', 'p': (570, 532), "desc": "1 lower right"}, + + ] + }, + '9-2': { + 'start': { + 'burst1': (430, 345), + 'pierce1': (923, 443), + }, + 'action': [ + {'t': 'click', 'p': (618, 366), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (725, 500), 'wait-over': True, 'ec': True, "desc": "2 lower left"}, + + {'t': 'exchange_and_click', 'p': (608, 485), "ec": True, "desc": "2 left"}, + {'t': 'click', 'p': (634, 328), "wait-over": True, "desc": "1 right"}, + + {'t': 'click', 'p': (657, 204), "desc": "1 upper right"}, + ] + }, + '9-3': { + 'start': { + 'burst1': (430, 386), + 'pierce1': (623, 556), + }, + 'action': [ + {'t': 'click', 'p': (631, 326), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (688, 407), 'wait-over': True, 'ec': True, "desc": "2 upper right"}, + + {'t': 'exchange_and_click', 'p': (682, 421), "ec": True, "desc": "2 upper right"}, + {'t': 'choose_and_change', 'p': (682, 421), "desc": "swap 1 2"}, + {'t': 'click', 'p': (807, 422), "wait-over": True, "desc": "1 right"}, + + {'t': 'click', 'p': (840, 506), "desc": "1 lower right"}, + ] + }, + '9-4': { + 'start': { + 'burst1': (337, 555), + 'pierce1': (1116, 288), + }, + 'action': [ + {'t': 'click', 'p': (565, 352), 'ec': True, "desc": "1 upper right"}, + {'t': 'click', 'p': (713, 275), "wait-over": True, 'ec': True, "desc": "2 upper left"}, + + {'t': 'click', 'p': (555, 331), 'ec': True, "desc": "1 upper right"}, + {'t': 'click', 'p': (653, 341), "wait-over": True, 'ec': True, "desc": "2 left"}, + + {'t': 'exchange_and_click', 'p': (707, 418), "ec": True, "desc": "2 lower left"}, + {'t': 'click', 'p': (591, 396), "wait-over": True, "desc": "1 lower right"}, + + {'t': 'click', 'p': (638, 440), 'ec': True, "desc": "1 right"}, + + ] + }, + '9-5': { + 'start': { + 'burst1': (433, 383), + 'pierce1': (626, 225), + }, + 'action': [ + + {'t': 'click', 'p': (628, 425), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (695, 335), "wait-over": True, 'ec': True, "desc": "2 lower right"}, + + {'t': 'exchange_and_click', 'p': (672, 354), "ec": True, "desc": "2 lower right"}, + {'t': 'choose_and_change', 'p': (672,354), "desc": "swap 1 2"}, + {'t': 'click', 'p': (795, 355), 'wait-over': True, "desc": "1 right"}, + + {'t': 'click', 'p': (902, 378), 'ec': True, "desc": "1 right"}, + {'t': 'click', 'p': (440, 303), "desc": "2 upper left"}, + ] + }, +} diff --git a/tasks/auto_mission/stage.py b/tasks/auto_mission/stage.py new file mode 100644 index 0000000..2c667a2 --- /dev/null +++ b/tasks/auto_mission/stage.py @@ -0,0 +1,38 @@ +from enum import Enum + +class StageState(Enum): + SUB = 0 + UNCLEARED = 1 + CLEARED = 2 + SSS = 3 + CHEST = 4 + +class Stage: + def __init__(self, name: str, state: str, data: dict): + self.name = name + self.state = state + self.data = data + + @property + def formation_start_info(self): + if self.state == StageState.SUB: + return None + return self.data["start"].items() + + @property + def start_info(self): + if self.state == StageState.SUB: + return None + return self.data["start"].values() + + @property + def formation_info(self): + if self.state == StageState.SUB: + return self.data["SUB"] + return self.data["start"].keys() + + @property + def action_info(self): + if self.state == StageState.SUB: + return None + return self.data["action"] \ No newline at end of file diff --git a/tasks/auto_mission/ui.py b/tasks/auto_mission/ui.py new file mode 100644 index 0000000..c59ecc9 --- /dev/null +++ b/tasks/auto_mission/ui.py @@ -0,0 +1,152 @@ +from module.logger import logger +from module.ocr.ocr import Digit +from tasks.auto_mission.stage import StageState, Stage +from tasks.auto_mission.copilot import Copilot +from tasks.stage.assets.assets_stage_sweep import ENTER #SWEEP +from tasks.auto_mission.assets.assets_auto_mission import * +import importlib + +class AutoMissionUI(Copilot): + """ + Class dedicated to navigate the mission page and check stages + """ + def get_stages_data(self, mode: str, area: int): + # Dynamically generate the complete module path + if mode == "N": + module_path = f'tasks.auto_mission.normal_task.normal_task_' + str(area) + else: + module_path = f'tasks.auto_mission.hard_task.hard_task_' + str(area) + # Import the specified module + try: + stage_module = importlib.import_module(module_path) + stage_data = getattr(stage_module, 'stage_data', None) + # Get stage_data data from the module + return stage_data + except ModuleNotFoundError: + mode_name = "Normal" if mode == "N" else "Hard" + logger.error(f"Exploration not supported for Mission {mode_name} area {area}, under development...") + return None + + def wait_mission_info(self, mode: str, open_task=False, max_retry=99999) -> str: + """ + Wait for the mission information popup to load in the mission page + """ + while max_retry > 0: + self.device.screenshot() + # Main task + if self.appear(ENTER): + return 'main' + # Side quest + if mode == "N" and self.appear(ENTER_SUB): + return 'side' + # Open the task if needed + if open_task: + if mode == "N": + self.device.swipe((917, 220), (917, 552)) + self.sleep(1) + #click enter + self.click(1118, 239) + #self.sleep(1) + max_retry -= 1 + logger.error("max_retry {0}".format(max_retry)) + return None + + def check_stage_state(self, mode: str, completion_level: str) -> StageState: + """ + Check the current stage type + """ + # Wait for the task information popup to load + self.wait_mission_info(mode) + self.sleep(1) + self.device.screenshot() + # Side quest + if mode == "N" and self.appear(ENTER_SUB): + return StageState.SUB + # Hard main task - Can collect gifts + if completion_level == 'three_stars_chest' and self.appear(CHEST): + return StageState.CHEST + # Main task - Three stars + if self.match_color(THREE_STARS): + return StageState.SSS + # Not cleared + if self.match_color(ONE_STAR): + return StageState.CLEARED + # Main task - Cleared + return StageState.UNCLEARED + + def get_stage_info(self, stage_name: str, stage_state: StageState, stages_data: dict, completion_level: str) -> dict: + """ + Retrieves the stage info from stages_data trying + to find the most suited based on completion_level + """ + possible_stages = [] + for stage in stages_data: + if stage_name in stage: + possible_stages.append(stage) + if possible_stages: + if stage_state == StageState.CHEST: + for stage in possible_stages: + if "present" in stage: + return stages_data[stage] + elif completion_level in ["three_stars", "three_stars_chest"]: + for stage in possible_stages: + if "sss" in stage: + return stages_data[stage] + elif completion_level in ["clear"]: + for stage in possible_stages: + if not "sss" in stage and "present" not in stage: + return stages_data[stage] + return stages_data[possible_stages[0]] + return None + + def check_stages(self, mode: str, area: int, stages_data: dict, completion_level: str) -> Stage: + """ + Find the stage that needs to be battled + """ + stage_index = 1 + max_index = 4 if mode == "H" else 6 + while 1: + # Wait for the task information to load + stage_state = self.check_stage_state(mode, completion_level) + logger.info("Current stage status: {0}".format(stage_state)) + # Not cleared side quest + if stage_state == StageState.SUB: + logger.warning("Uncleared SUB stage, starting battle...") + #return stage_state + return Stage("SUB", stage_state, stages_data[str(area)]) + # Get the current stage + stage_name = f"{area}-{stage_index}" + stage_info = self.get_stage_info(stage_name, stage_state, stages_data, completion_level) + if not stage_info: + logger.error(f"Exploration not supported for the stage {stage_name}, under development...") + return None + # Not cleared main task + if stage_state == StageState.UNCLEARED: + logger.warning(f"{stage_name} Not cleared main stage, starting battle...") + return Stage(stage_name, stage_state, stage_info) + # Mode 2 ⭐️⭐️⭐️ or ⭐️⭐️⭐️ + box gift + if completion_level in ["three_stars", "three_stars_chest"]: + if stage_state == StageState.CHEST: + logger.warning(f"{stage_name} Found chest, starting battle...") + return Stage(stage_name, stage_state, stage_info) + if stage_state != StageState.SSS: + logger.warning(f"{stage_name} Not three-star cleared, starting battle...") + return Stage(stage_name, stage_state, stage_info) + # Click on the next stage + logger.info(f"{stage_name} already meets specified completion level, searching for the next stage") + self.click(1172, 358, interval=0) + # Check if still in the same region + stage_index += 1 + if stage_index >= max_index: + self.sleep(1) + self.device.screenshot() + if area != Digit(OCR_AREA).ocr_single_line(self.device.image): + return None + + def start_stage(self, stage: Stage): + # Click to start the task + if stage.state == StageState.SUB: + self.select_then_check(ENTER_SUB, MOBILIZE) + else: + self.select_then_check(ENTER, MISSION_INFO) + # Wait for the map to load \ No newline at end of file diff --git a/tasks/schedule/ui.py b/tasks/schedule/ui.py index 354235d..29be0e5 100644 --- a/tasks/schedule/ui.py +++ b/tasks/schedule/ui.py @@ -4,10 +4,10 @@ from module.base.decorator import Config from module.base.timer import Timer from module.logger import logger from module.ocr.ocr import DigitCounter +from module.ui.scroll_select import ScrollSelect from tasks.base.assets.assets_base_page import SCHEDULE_CHECK from tasks.base.ui import UI from tasks.schedule.assets.assets_schedule import * -from tasks.schedule.scroll_select import ScrollSelect SCROLL_SELECT = ScrollSelect(window_button=SCROLL, first_item_button=FIRST_ITEM, expected_button=LOCATIONS, clickx=1116) xs = np.linspace(299, 995, 3, dtype=int) @@ -51,7 +51,7 @@ class ScheduleUI(UI): return False def enter_location(self, location): - SCROLL_SELECT.select_location(self, location) + SCROLL_SELECT.select_index(main=self, target_index=location) if not self.appear(LOCATIONS): logger.error("Unable to navigate to page for location {}".format(location + 1)) return False