瀏覽代碼

feat(task): add WantedQuests

runhey 3 年之前
父節點
當前提交
0e10ea99de

+ 2 - 2
module/config/config_manual.py

@@ -11,9 +11,9 @@ class ConfigManual:
         Restart
         >KekkaiUtilize > KekkaiActivation > DemonEncounter
         > AreaBoss > GoldYoukai > ExperienceYoukai > Nian > RealmRaid > RyouToppa > DailyTrifles > Exploration
-        > Hunt
+        > Hunt 
         > Orochi > OrochiMoans > OrochiJudgement > Sougenbi > FallenSun > EternitySea
-        > ActivityShikigami
+        > ActivityShikigami > WantedQuests
         > BondlingFairyland > EvoZone > GoryouRealm
         > TrueOrochi > RichMan
         > CollectiveMissions

+ 1 - 1
module/config/config_menu.py

@@ -21,7 +21,7 @@ class ConfigMenu:
         self.menu["Soul Zones"] = ['Orochi', 'Sougenbi', 'FallenSun', 'EternitySea']
         # 日常的任务
         self.menu["Daily Task"] = ['DailyTrifles', 'AreaBoss', 'GoldYoukai', 'ExperienceYoukai', 'Nian',
-                                   'TalismanPass', 'DemonEncounter', 'Pets', 'SoulsTidy', 'Delegation']
+                                   'TalismanPass', 'DemonEncounter', 'Pets', 'SoulsTidy', 'Delegation', 'WantedQuests']
         # 很肝的任务
         self.menu["Liver Emperor Exclusive"] = ['BondlingFairyland', 'EvoZone', 'GoryouRealm', 'Exploration']
         # 阴阳寮

+ 2 - 0
module/config/config_model.py

@@ -29,6 +29,7 @@ from tasks.TalismanPass.config import TalismanPass
 from tasks.Pets.config import Pets
 from tasks.SoulsTidy.config import SoulsTidy
 from tasks.Delegation.config import Delegation
+from tasks.WantedQuests.config import WantedQuests
 # ----------------------------------------------------------------------------------------------------------------------
 from tasks.Orochi.config import Orochi
 from tasks.OrochiMoans.config import OrochiMoans
@@ -80,6 +81,7 @@ class ConfigModel(ConfigBase):
     souls_tidy: SoulsTidy = Field(default_factory=SoulsTidy)
     delegation: Delegation = Field(default_factory=Delegation)
     exploration: Exploration = Field(default_factory=Exploration)
+    wanted_quests: WantedQuests = Field(default_factory=WantedQuests)
 
     # 这些是刷御魂的
     orochi: Orochi = Field(default_factory=Orochi)

+ 1 - 1
tasks/Secret/assets.py

@@ -19,7 +19,7 @@ class SecretAssets:
 	# 进入 
 	I_SE_ENTER = RuleImage(roi_front=(1145,593,100,100), roi_back=(1145,593,100,100), threshold=0.8, method="Template matching", file="./tasks/Secret/se/se_se_enter.png")
 	# 秘闻挑战 
-	I_SE_FIRE = RuleImage(roi_front=(1108,551,100,100), roi_back=(1108,551,100,100), threshold=0.8, method="Template matching", file="./tasks/Secret/se/se_se_fire.png")
+	I_SE_FIRE = RuleImage(roi_front=(1108,551,100,100), roi_back=(1100,541,120,120), threshold=0.7, method="Template matching", file="./tasks/Secret/se/se_se_fire.png")
 	# 排行 
 	I_SE_PLACEMENT = RuleImage(roi_front=(1013,570,50,48), roi_back=(996,555,79,81), threshold=0.8, method="Template matching", file="./tasks/Secret/se/se_se_placement.png")
 	# 勾玉 

+ 2 - 2
tasks/Secret/se/image.json

@@ -12,9 +12,9 @@
     "itemName": "se_fire",
     "imageName": "se_se_fire.png",
     "roiFront": "1108,551,100,100",
-    "roiBack": "1108,551,100,100",
+    "roiBack": "1100,541,120,120",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.7,
     "description": "秘闻挑战"
   },
   {

+ 84 - 0
tasks/WantedQuests/assets.py

@@ -0,0 +1,84 @@
+from module.atom.image import RuleImage
+from module.atom.click import RuleClick
+from module.atom.long_click import RuleLongClick
+from module.atom.swipe import RuleSwipe
+from module.atom.ocr import RuleOcr
+from module.atom.list import RuleList
+
+# This file was automatically generated by ./dev_tools/assets_extract.py.
+# Don't modify it manually.
+class WantedQuestsAssets: 
+
+
+	# Ocr Rule Assets
+	# 挑战券的数量 
+	O_WQ_NUMBER = RuleOcr(roi=(569,13,50,32), area=(569,13,50,32), mode="Digit", method="Default", keyword="", name="wq_number")
+	# 悬赏封印 
+	O_WQ_WANTED = RuleOcr(roi=(9,145,123,381), area=(9,145,123,381), mode="Full", method="Default", keyword="", name="wq_wanted")
+	# Ocr-description 
+	O_WQ_TEXT_1 = RuleOcr(roi=(19,233,100,32), area=(19,233,100,32), mode="Single", method="Default", keyword="悬赏封印", name="wq_text_1")
+	# Ocr-description 
+	O_WQ_TEXT_2 = RuleOcr(roi=(20,377,98,32), area=(20,377,98,32), mode="Single", method="Default", keyword="悬赏封印", name="wq_text_2")
+	# Ocr-description 
+	O_WQ_NUM_1 = RuleOcr(roi=(32,260,72,27), area=(32,260,72,27), mode="DigitCounter", method="Default", keyword="", name="wq_num_1")
+	# Ocr-description 
+	O_WQ_NUM_2 = RuleOcr(roi=(34,406,65,24), area=(34,406,65,24), mode="DigitCounter", method="Default", keyword="", name="wq_num_2")
+	# Ocr-description 
+	O_WQ_TYPE_1 = RuleOcr(roi=(544,238,55,36), area=(544,238,55,36), mode="Single", method="Default", keyword="", name="wq_type_1")
+	# Ocr-description 
+	O_WQ_TYPE_2 = RuleOcr(roi=(544,311,55,30), area=(544,311,55,30), mode="Single", method="Default", keyword="", name="wq_type_2")
+	# Ocr-description 
+	O_WQ_TYPE_3 = RuleOcr(roi=(544,382,54,30), area=(544,382,54,30), mode="Single", method="Default", keyword="", name="wq_type_3")
+	# Ocr-description 
+	O_WQ_TYPE_4 = RuleOcr(roi=(545,452,52,32), area=(545,452,52,32), mode="Single", method="Default", keyword="", name="wq_type_4")
+	# Ocr-description 
+	O_WQ_INFO_1 = RuleOcr(roi=(609,236,309,45), area=(609,236,309,45), mode="Single", method="Default", keyword="", name="wq_info_1")
+	# Ocr-description 
+	O_WQ_INFO_2 = RuleOcr(roi=(612,308,298,41), area=(612,308,298,41), mode="Single", method="Default", keyword="", name="wq_info_2")
+	# Ocr-description 
+	O_WQ_INFO_3 = RuleOcr(roi=(612,376,305,44), area=(612,376,305,44), mode="Single", method="Default", keyword="", name="wq_info_3")
+	# Ocr-description 
+	O_WQ_INFO_4 = RuleOcr(roi=(613,446,315,44), area=(613,446,315,44), mode="Single", method="Default", keyword="", name="wq_info_4")
+
+
+	# Image Rule Assets
+	# description 
+	I_WQC_LOCK = RuleImage(roi_front=(620,528,27,31), roi_back=(620,528,27,31), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/chanllenge/chanllenge_wqc_lock.png")
+	# description 
+	I_WQC_UNLOCK = RuleImage(roi_front=(621,527,26,28), roi_back=(621,527,26,28), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/chanllenge/chanllenge_wqc_unlock.png")
+	# 挑战 
+	I_WQC_FIRE = RuleImage(roi_front=(893,503,123,64), roi_back=(871,485,164,91), threshold=0.7, method="Template matching", file="./tasks/WantedQuests/chanllenge/chanllenge_wqc_fire.png")
+
+
+	# Image Rule Assets
+	# 封印 
+	I_WQ_SEAL = RuleImage(roi_front=(244,181,40,40), roi_back=(56,152,664,396), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_wq_seal.png")
+	# 勾号 
+	I_WQ_DONE = RuleImage(roi_front=(248,183,37,39), roi_back=(107,147,570,389), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_wq_done.png")
+	# 一键追踪 
+	I_TRACE_ENABLE = RuleImage(roi_front=(1097,588,101,70), roi_back=(1097,588,101,70), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_trace_enable.png")
+	# 取消追踪 
+	I_TARCE_DISENABLE = RuleImage(roi_front=(1091,586,108,70), roi_back=(1091,586,108,70), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_tarce_disenable.png")
+	# 奖励宝箱 
+	I_WQ_BOX = RuleImage(roi_front=(48,187,43,38), roi_back=(20,137,100,397), threshold=0.7, method="Template matching", file="./tasks/WantedQuests/wq/wq_wq_box.png")
+	# 小号追踪 
+	I_TRACE_TRUE = RuleImage(roi_front=(173,187,28,29), roi_back=(173,187,28,29), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_trace_true.png")
+	# 小号不追踪 
+	I_TRACE_FALSE = RuleImage(roi_front=(170,186,31,32), roi_back=(170,186,31,32), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_trace_false.png")
+	# description 
+	I_GOTO_1 = RuleImage(roi_front=(978,234,87,45), roi_back=(978,234,87,45), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_goto_1.png")
+	# description 
+	I_GOTO_2 = RuleImage(roi_front=(979,305,88,43), roi_back=(979,305,88,43), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_goto_2.png")
+	# description 
+	I_GOTO_3 = RuleImage(roi_front=(979,373,88,47), roi_back=(979,373,88,47), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_goto_3.png")
+	# description 
+	I_GOTO_4 = RuleImage(roi_front=(979,447,87,42), roi_back=(979,447,87,42), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_goto_4.png")
+	# 判断是否还有任务 
+	I_WQ_CHECK_TASK = RuleImage(roi_front=(106,296,24,113), roi_back=(73,122,69,427), threshold=0.85, method="Template matching", file="./tasks/WantedQuests/wq/wq_wq_check_task.png")
+
+
+	# Image Rule Assets
+	# 奇怪了之前的不能用 
+	I_WQSE_FIRE = RuleImage(roi_front=(1041,556,100,100), roi_back=(1016,534,147,138), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_wqse_fire.png")
+
+

二進制
tasks/WantedQuests/chanllenge/chanllenge_wqc_fire.png


二進制
tasks/WantedQuests/chanllenge/chanllenge_wqc_lock.png


二進制
tasks/WantedQuests/chanllenge/chanllenge_wqc_unlock.png


+ 29 - 0
tasks/WantedQuests/chanllenge/image.json

@@ -0,0 +1,29 @@
+[
+  {
+    "itemName": "wqc_lock",
+    "imageName": "chanllenge_wqc_lock.png",
+    "roiFront": "620,528,27,31",
+    "roiBack": "620,528,27,31",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "wqc_unlock",
+    "imageName": "chanllenge_wqc_unlock.png",
+    "roiFront": "621,527,26,28",
+    "roiBack": "621,527,26,28",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "wqc_fire",
+    "imageName": "chanllenge_wqc_fire.png",
+    "roiFront": "893,503,123,64",
+    "roiBack": "871,485,164,91",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": "挑战"
+  }
+]

+ 24 - 0
tasks/WantedQuests/config.py

@@ -0,0 +1,24 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+from datetime import timedelta, time
+from pydantic import BaseModel, Field
+
+from tasks.Component.config_scheduler import Scheduler
+from tasks.Component.config_base import ConfigBase, TimeDelta
+from tasks.Component.GeneralBattle.config_general_battle import GeneralBattleConfig
+from tasks.Component.SwitchSoul.switch_soul_config import SwitchSoulConfig
+
+
+class WantedQuestsConfig(BaseModel):
+    before_end: time = Field(default=time(0, 0, 0), description='before_end_help')
+
+
+class WantedQuests(ConfigBase):
+    scheduler: Scheduler = Field(default_factory=Scheduler)
+    wanted_quests_config: WantedQuestsConfig = Field(default_factory=WantedQuestsConfig)
+
+
+
+
+

+ 128 - 0
tasks/WantedQuests/ocr.json

@@ -0,0 +1,128 @@
+[
+  {
+    "itemName": "wq_number",
+    "roiFront": "569,13,50,32",
+    "roiBack": "569,13,50,32",
+    "mode": "Digit",
+    "method": "Default",
+    "keyword": "",
+    "description": "挑战券的数量"
+  },
+  {
+    "itemName": "wq_wanted",
+    "roiFront": "9,145,123,381",
+    "roiBack": "9,145,123,381",
+    "mode": "Full",
+    "method": "Default",
+    "keyword": "",
+    "description": "悬赏封印"
+  },
+  {
+    "itemName": "wq_text_1",
+    "roiFront": "19,233,100,32",
+    "roiBack": "19,233,100,32",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "悬赏封印",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "wq_text_2",
+    "roiFront": "20,377,98,32",
+    "roiBack": "20,377,98,32",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "悬赏封印",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "wq_num_1",
+    "roiFront": "32,260,72,27",
+    "roiBack": "32,260,72,27",
+    "mode": "DigitCounter",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "wq_num_2",
+    "roiFront": "34,406,65,24",
+    "roiBack": "34,406,65,24",
+    "mode": "DigitCounter",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "wq_type_1",
+    "roiFront": "544,238,55,36",
+    "roiBack": "544,238,55,36",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "wq_type_2",
+    "roiFront": "544,311,55,30",
+    "roiBack": "544,311,55,30",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "wq_type_3",
+    "roiFront": "544,382,54,30",
+    "roiBack": "544,382,54,30",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "wq_type_4",
+    "roiFront": "545,452,52,32",
+    "roiBack": "545,452,52,32",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "wq_info_1",
+    "roiFront": "609,236,309,45",
+    "roiBack": "609,236,309,45",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "wq_info_2",
+    "roiFront": "612,308,298,41",
+    "roiBack": "612,308,298,41",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "wq_info_3",
+    "roiFront": "612,376,305,44",
+    "roiBack": "612,376,305,44",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "wq_info_4",
+    "roiFront": "613,446,315,44",
+    "roiBack": "613,446,315,44",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  }
+]

+ 208 - 0
tasks/WantedQuests/script_task.py

@@ -0,0 +1,208 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+import re
+from time import sleep
+from datetime import timedelta, time, datetime
+from cached_property import cached_property
+
+from module.exception import TaskEnd
+from module.logger import logger
+from module.base.timer import Timer
+
+from tasks.GameUi.game_ui import GameUi
+from tasks.GameUi.page import page_main, page_exploration
+from tasks.Component.GeneralBattle.general_battle import GeneralBattle
+from tasks.Component.GeneralBattle.config_general_battle import GeneralBattleConfig
+from tasks.Secret.script_task import ScriptTask as SecretScriptTask
+from tasks.WantedQuests.config import WantedQuestsConfig
+from tasks.WantedQuests.assets import WantedQuestsAssets
+
+class ScriptTask(SecretScriptTask, WantedQuestsAssets):
+
+    def run(self):
+        con = self.config
+        self.pre_work()
+        self.screenshot()
+        number_challenge = self.O_WQ_NUMBER.ocr(self.device.image)
+        while 1:
+            self.screenshot()
+            if self.appear_then_click(self.I_WQ_BOX, interval=0.6):
+                continue
+            if self.ui_reward_appear_click(False):
+                continue
+            if self.ocr_appear(self.O_WQ_TEXT_1, interval=0.7):
+                cu, re, total = self.O_WQ_NUM_1.ocr(self.device.image)
+                if cu > total:
+                    logger.warning('Current number of wanted quests is greater than total number')
+                    cu = cu % 10
+                if cu < total and re != 0:
+                    self.execute_mission(self.O_WQ_TEXT_1, total, number_challenge)
+                continue
+            if self.ocr_appear(self.O_WQ_TEXT_2, interval=0.7):
+                cu, re, total = self.O_WQ_NUM_2.ocr(self.device.image)
+                if cu > total:
+                    logger.warning('Current number of wanted quests is greater than total number')
+                    cu = cu % 10
+                if cu < total and re != 0:
+                    self.execute_mission(self.O_WQ_TEXT_2, total, number_challenge)
+                continue
+            if not self.appear(self.I_WQ_CHECK_TASK, interval=2.5):
+                logger.info('No wanted quests')
+                break
+
+
+        self.next_run()
+        raise TaskEnd('WantedQuests')
+
+    def next_run(self):
+        before_end: time = self.config.wanted_quests.wanted_quests_config.before_end
+        if before_end == time(hour=0, minute=0, second=0):
+            self.set_next_run(task='WantedQuests', success=True, finish=True)
+            return
+        time_delta = timedelta(hours=-before_end.hour, minutes=-before_end.minute, seconds=-before_end.second)
+        now_datetime = datetime.now()
+        now_time = now_datetime.time()
+        if time(hour=6) <= now_time < time(hour=18):
+            # 如果是在6点到18点之间,那就设定下一次运行的时间为第二天的6点 + before_end
+            next_run_datetime = datetime.combine(now_datetime.date() +
+                                                 timedelta(days=1), time(hour=6) +
+                                                 time_delta)
+        elif time(hour=18) <= now_time < time(hour=23, minute=59, second=59):
+            # 如果是在18点到23点59分59秒之间,那就设定下一次运行的时间为第二天的18点 + before_end
+            next_run_datetime = datetime.combine(now_datetime.date() +
+                                                    timedelta(days=1), time(hour=18) +
+                                                    time_delta)
+        else:
+            # 如果是在0点到6点之间,那就设定下一次运行的时间为今天的18点 + before_end
+            next_run_datetime = datetime.combine(now_datetime.date(), time(hour=18) + time_delta)
+        self.set_next_run(task='WantedQuests', target=next_run_datetime)
+
+    def pre_work(self):
+        """
+        前置工作,
+        :return:
+        """
+        self.ui_get_current_page()
+        self.ui_goto(page_main)
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_TARCE_DISENABLE):
+                break
+            if self.appear_then_click(self.I_WQ_SEAL, interval=1):
+                continue
+            if self.appear_then_click(self.I_WQ_DONE, interval=1):
+                continue
+            if self.appear_then_click(self.I_TRACE_ENABLE, interval=1):
+                continue
+        # 已追踪所有任务
+        logger.info('All wanted quests are traced')
+        self.ui_click_until_disappear(self.I_UI_BACK_RED)
+        self.ui_goto(page_exploration)
+
+    def execute_mission(self, ocr, num_want: int, num_challenge: int):
+        """
+
+        :param ocr: 要点击的 文字
+        :param num_want: 一共要打败的怪物数量
+        :param num_challenge: 现在有的挑战卷数量
+        :return:
+        """
+        logger.hr('Start wanted quests')
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_TRACE_TRUE):
+                break
+            if self.ocr_appear_click(ocr, interval=1):
+                continue
+        if not self.appear(self.I_GOTO_1):
+            # 如果没有出现 '前往'按钮, 那就是这个可能是神秘任务但是没有解锁
+            logger.warning('This is a secret mission but not unlock')
+            self.ui_click(self.I_TRACE_TRUE, self.I_TRACE_FALSE)
+            return
+        # 找到一个最优的关卡来挑战
+        challenge = True if num_challenge >= 10 else False
+        def check_battle(cha: bool, wq_type, wq_info) -> tuple:
+            battle = False
+            self.screenshot()
+            type_wq = wq_type.ocr(self.device.image)
+            if cha and type_wq == '挑战':
+                battle = 'CHALLENGE'
+            if type_wq == '秘闻':
+                battle = 'SECRET'
+            if not battle:
+                return None, None
+            info = wq_info.ocr(self.device.image)
+            try:
+                # 匹配: 第九章(数量:5)
+                one_number = int(re.findall(r'(\d+)', info)[-1])
+                # one_number = int(re.findall(r'\*\(\数量:\s*(\d+)\)', info)[0])
+            except IndexError:
+                # 匹配: 第九章
+                one_number = 3
+            # num_want / one_number = 一共要打几次
+            if one_number > num_want:
+                return battle, 1
+            else:
+                return battle, num_want // one_number + 1
+
+        battle, num, goto = None, None, None
+        if not battle:
+            battle, num = check_battle(challenge, self.O_WQ_TYPE_1, self.O_WQ_INFO_1)
+            goto = self.I_GOTO_1
+        if not battle:
+            battle, num = check_battle(challenge, self.O_WQ_TYPE_2, self.O_WQ_INFO_2)
+            goto = self.I_GOTO_2
+        if not battle:
+            battle, num = check_battle(challenge, self.O_WQ_TYPE_3, self.O_WQ_INFO_3)
+            goto = self.I_GOTO_3
+        if not battle:
+            battle, num = check_battle(challenge, self.O_WQ_TYPE_4, self.O_WQ_INFO_4)
+            goto = self.I_GOTO_4
+        if battle == 'CHALLENGE':
+            self.challenge(goto, num)
+        elif battle == 'SECRET':
+            self.secret(goto, num)
+        else:
+            # 没有找到可以挑战的关卡 那就关闭
+            logger.warning('No wanted quests can be challenged')
+            return False
+
+
+    def challenge(self, goto, num):
+        self.ui_click(goto, self.I_WQC_FIRE)
+        self.ui_click(self.I_WQC_LOCK, self.I_WQC_UNLOCK)
+        self.ui_click_until_disappear(self.I_WQC_FIRE)
+        self.run_general_battle()
+        self.wait_until_appear(self.I_WQC_FIRE)
+        self.ui_click_until_disappear(self.I_UI_BACK_RED)
+        # 我忘记了打完后是否需要关闭 挑战界面
+
+    def secret(self, goto, num=1):
+        self.ui_click(goto, self.I_WQSE_FIRE)
+        for i in range(num):
+            self.wait_until_appear(self.I_WQSE_FIRE)
+            self.ui_click_until_disappear(self.I_WQSE_FIRE)
+            success = self.run_general_battle(self.battle_config)
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_CHECK_EXPLORATION):
+                break
+            if self.appear_then_click(self.I_UI_BACK_RED, interval=1):
+                continue
+            if self.appear_then_click(self.I_UI_BACK_BLUE, interval=1.5):
+                continue
+        logger.info('Secret mission finished')
+
+
+if __name__ == '__main__':
+    from module.config.config import Config
+    from module.device.device import Device
+    c = Config('oas1')
+    d = Device(c)
+    t = ScriptTask(c, d)
+    t.screenshot()
+
+    t.run()
+
+

+ 110 - 0
tasks/WantedQuests/wq/image.json

@@ -0,0 +1,110 @@
+[
+  {
+    "itemName": "wq_seal",
+    "imageName": "wq_wq_seal.png",
+    "roiFront": "244,181,40,40",
+    "roiBack": "56,152,664,396",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "封印"
+  },
+  {
+    "itemName": "wq_done",
+    "imageName": "wq_wq_done.png",
+    "roiFront": "248,183,37,39",
+    "roiBack": "107,147,570,389",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "勾号"
+  },
+  {
+    "itemName": "trace_enable",
+    "imageName": "wq_trace_enable.png",
+    "roiFront": "1097,588,101,70",
+    "roiBack": "1097,588,101,70",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "一键追踪"
+  },
+  {
+    "itemName": "tarce_disenable",
+    "imageName": "wq_tarce_disenable.png",
+    "roiFront": "1091,586,108,70",
+    "roiBack": "1091,586,108,70",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "取消追踪"
+  },
+  {
+    "itemName": "wq_box",
+    "imageName": "wq_wq_box.png",
+    "roiFront": "48,187,43,38",
+    "roiBack": "20,137,100,397",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": "奖励宝箱"
+  },
+  {
+    "itemName": "trace_true",
+    "imageName": "wq_trace_true.png",
+    "roiFront": "173,187,28,29",
+    "roiBack": "173,187,28,29",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "小号追踪"
+  },
+  {
+    "itemName": "trace_false",
+    "imageName": "wq_trace_false.png",
+    "roiFront": "170,186,31,32",
+    "roiBack": "170,186,31,32",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "小号不追踪"
+  },
+  {
+    "itemName": "goto_1",
+    "imageName": "wq_goto_1.png",
+    "roiFront": "978,234,87,45",
+    "roiBack": "978,234,87,45",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "goto_2",
+    "imageName": "wq_goto_2.png",
+    "roiFront": "979,305,88,43",
+    "roiBack": "979,305,88,43",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "goto_3",
+    "imageName": "wq_goto_3.png",
+    "roiFront": "979,373,88,47",
+    "roiBack": "979,373,88,47",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "goto_4",
+    "imageName": "wq_goto_4.png",
+    "roiFront": "979,447,87,42",
+    "roiBack": "979,447,87,42",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "wq_check_task",
+    "imageName": "wq_wq_check_task.png",
+    "roiFront": "106,296,24,113",
+    "roiBack": "73,122,69,427",
+    "method": "Template matching",
+    "threshold": 0.85,
+    "description": "判断是否还有任务"
+  }
+]

+ 11 - 0
tasks/WantedQuests/wq/se_image.json

@@ -0,0 +1,11 @@
+[
+  {
+    "itemName": "wqse_fire",
+    "imageName": "wq_wqse_fire.png",
+    "roiFront": "1041,556,100,100",
+    "roiBack": "1016,534,147,138",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "奇怪了之前的不能用"
+  }
+]

二進制
tasks/WantedQuests/wq/wq_goto_1.png


二進制
tasks/WantedQuests/wq/wq_goto_2.png


二進制
tasks/WantedQuests/wq/wq_goto_3.png


二進制
tasks/WantedQuests/wq/wq_goto_4.png


二進制
tasks/WantedQuests/wq/wq_tarce_disenable.png


二進制
tasks/WantedQuests/wq/wq_trace_enable.png


二進制
tasks/WantedQuests/wq/wq_trace_false.png


二進制
tasks/WantedQuests/wq/wq_trace_true.png


二進制
tasks/WantedQuests/wq/wq_wq_box.png


二進制
tasks/WantedQuests/wq/wq_wq_check_task.png


二進制
tasks/WantedQuests/wq/wq_wq_done.png


二進制
tasks/WantedQuests/wq/wq_wq_seal.png


二進制
tasks/WantedQuests/wq/wq_wqse_fire.png