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

+ 1 - 0
module/config/config_manual.py

@@ -14,6 +14,7 @@ class ConfigManual:
         > Orochi > OrochiMoans > OrochiJudgement > Sougenbi > FallenSun > EternitySea
         > ActivityShikigami
         > BondlingFairyland
+        > TrueOrochi
         """
 
     DEVICE_OVER_HTTP = False

+ 2 - 1
module/config/config_menu.py

@@ -25,7 +25,8 @@ class ConfigMenu:
         self.menu["Activity Task"] = ['ActivityShikigami']
         # 很肝的任务
         self.menu["Liver Emperor Exclusive"] = ['BondlingFairyland']
-
+        # 每周任务
+        self.menu["Weekly Task"] = ['TrueOrochi']
         # 开发工具
         self.menu["Tools"] = ['Image Rule', 'Ocr Rule', 'Click Rule', 'Long Click Rule', 'Swipe Rule', 'List Rule']
 

+ 6 - 0
module/config/config_model.py

@@ -38,6 +38,10 @@ from tasks.ActivityShikigami.config import ActivityShikigami
 from tasks.BondlingFairyland.config import BondlingFairyland
 # ----------------------------------------------------------------------------------------------------------------------
 
+# 每周任务---------------------------------------------------------------------------------------------------------------
+from tasks.TrueOrochi.config import TrueOrochi
+# ----------------------------------------------------------------------------------------------------------------------
+
 class ConfigModel(ConfigBase):
     config_name: str = "oas"
     script: Script = Field(default_factory=Script)
@@ -67,6 +71,8 @@ class ConfigModel(ConfigBase):
     # 这些是肝帝专属
     bondling_fairyland: BondlingFairyland = Field(default_factory=BondlingFairyland)
 
+    # 这些是每周任务
+    true_orochi: TrueOrochi = Field(default_factory=TrueOrochi)
 
     # @validator('script')
     # def script_validator(cls, v):

BIN
module/config/i18n/zh_CN.qm


+ 12 - 0
module/config/i18n/zh_CN.ts

@@ -485,5 +485,17 @@ mode_3策略是刷到五个契灵后开始结契,选择高级、中级盘来
 	<message><source>card_rule_help</source><translation>规则还没想好</translation></message>
 	<message><source>exchange_before_help</source><translation>必选项</translation></message>
 	<message><source>exchange_max_help</source><translation>必选项</translation></message>
+</context>	
+<context>
+    <name>Args</name>
+	<message><source>TrueOrochiScheduler</source><translation>任务调度</translation></message>
+	<message><source>TrueOrochiConfig</source><translation>任务</translation></message>
+	<message><source>Find True Orochi</source><translation>挑战御魂十层触发真蛇</translation></message>
+	<message><source>Green Mark Type</source><translation>绿标哪一个</translation></message>
+	<message><source>find_true_orochi_help</source><translation>启用这一项,没有出现八岐大蛇时会单独挑战十层十次,如果还不出现判断失败,将会设置失败时的间隔到下一次来进行开启任务
+如果不启用这一项,没有发现真蛇时直接判定运行失败</translation></message>
+	<message><source>green_mark_type_help</source><translation> </translation></message>
+	<message><source>Current Success</source><translation>本周已经挑战成功的次数</translation></message>
+	<message><source>current_success_help</source><translation>请不要手动修改这一项,是为了给机器计数的,机器会自动修改</translation></message>
 </context>		
 </TS>

+ 1 - 1
module/device/handle.py

@@ -292,7 +292,7 @@ class Handle:
             for node in PreOrderIter(self.root_node):
                 if node.name == Handle.emulator_handle['bluestacks_family']:
                     return node.num
-        return None
+        return self.root_node.num
 
     @cached_property
     def screenshot_size(self) -> tuple or None:

+ 1 - 1
tasks/Component/GeneralRoom/assets.py

@@ -26,7 +26,7 @@ class GeneralRoomAssets:
 	# description 
 	I_CREATE_ENSURE_2 = RuleImage(roi_front=(552,489,42,55), roi_back=(552,489,42,55), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralRoom/gr/gr_create_ensure_2.png")
 	# description 
-	I_GR_MATCHING_NEW = RuleImage(roi_front=(1204,102,42,121), roi_back=(1204,102,42,121), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralRoom/gr/gr_gr_matching_new.png")
+	I_GR_MATCHING_NEW = RuleImage(roi_front=(62,571,42,121), roi_back=(62,571,42,121), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralRoom/gr/gr_gr_matching_new.png")
 	# description 
 	I_GR_BACK_YELLOW = RuleImage(roi_front=(19,13,53,53), roi_back=(19,13,53,53), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralRoom/gr/gr_gr_back_yellow.png")
 

+ 2 - 2
tasks/Orochi/assets.py

@@ -18,13 +18,13 @@ class OrochiAssets:
 	# description 
 	I_OROCHI_LOCK = RuleImage(roi_front=(558,562,31,33), roi_back=(558,562,31,33), threshold=0.8, method="Template matching", file="./tasks/Orochi/o/o_lock.png")
 	# description 
-	I_OROCHI_UNLOCK = RuleImage(roi_front=(560,564,26,29), roi_back=(560,564,26,29), threshold=0.8, method="Template matching", file="./tasks/Orochi/o/o_unlock.png")
+	I_OROCHI_UNLOCK = RuleImage(roi_front=(560,564,26,29), roi_back=(560,564,26,29), threshold=0.8, method="Template matching", file="./tasks/Orochi/o/o_orochi_unlock.png")
 	# 点击挑战 
 	I_OROCHI_FIRE = RuleImage(roi_front=(1095,577,131,124), roi_back=(1095,577,131,124), threshold=0.6, method="Template matching", file="./tasks/Orochi/o/o_fire.png")
 	# 式神录 
 	I_SHI_RECORDS = RuleImage(roi_front=(821,638,48,45), roi_back=(821,638,48,45), threshold=0.8, method="Template matching", file="./tasks/Orochi/o/o_shi_records.png")
 	# description 
-	I_OROCHI_MATCHING = RuleImage(roi_front=(1205,106,44,114), roi_back=(1205,106,44,114), threshold=0.8, method="Template matching", file="./tasks/Orochi/o/o_matching.png")
+	I_OROCHI_MATCHING = RuleImage(roi_front=(62,568,44,114), roi_back=(62,568,44,114), threshold=0.8, method="Template matching", file="./tasks/Orochi/o/o_orochi_matching.png")
 
 
 	# List Rule Assets

+ 58 - 0
tasks/TrueOrochi/assets.py

@@ -0,0 +1,58 @@
+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 module/dev_tools/assets_extract.py.
+# Don't modify it manually.
+class TrueOrochiAssets: 
+
+
+	# Click Rule Assets
+	# description 
+	C_ST_GREEN_1 = RuleClick(roi_front=(210,395,46,66), roi_back=(210,395,46,66), name="st_green_1")
+	# description 
+	C_ST_GREEN_2 = RuleClick(roi_front=(291,481,46,63), roi_back=(291,481,46,63), name="st_green_2")
+	# description 
+	C_ST_GREEN_3 = RuleClick(roi_front=(459,426,53,59), roi_back=(459,426,53,59), name="st_green_3")
+	# description 
+	C_ST_GREEN_4 = RuleClick(roi_front=(687,391,43,57), roi_back=(687,391,43,57), name="st_green_4")
+	# description 
+	C_ST_GREEN_5 = RuleClick(roi_front=(814,490,41,60), roi_back=(814,490,41,60), name="st_green_5")
+	# description 
+	C_ST_GREEN_6 = RuleClick(roi_front=(921,386,48,59), roi_back=(921,386,48,59), name="st_green_6")
+	# description 
+	C_ST_GREEN_7 = RuleClick(roi_front=(0,0,100,100), roi_back=(0,0,100,100), name="st_green_7")
+	# description 
+	C_ST_GREEN_MAIN = RuleClick(roi_front=(611,541,40,66), roi_back=(611,541,40,66), name="st_green_main")
+
+
+	# Image Rule Assets
+	# 出现真蛇 
+	I_FIND_TS = RuleImage(roi_front=(1,613,100,93), roi_back=(1,613,100,93), threshold=0.8, method="Template matching", file="./tasks/TrueOrochi/st/st_find_ts.png")
+	# 点击挑战60体力 
+	I_ST_FIRE = RuleImage(roi_front=(960,485,100,100), roi_back=(960,485,100,100), threshold=0.8, method="Template matching", file="./tasks/TrueOrochi/st/st_st_fire.png")
+	# 确认挑战 
+	I_ST_FIRE_CONFIRM = RuleImage(roi_front=(671,406,176,53), roi_back=(671,406,176,53), threshold=0.8, method="Template matching", file="./tasks/TrueOrochi/st/st_st_fire_confirm.png")
+	# 十个式神的准备 
+	I_ST_FIRE_PREPARE = RuleImage(roi_front=(1118,548,100,100), roi_back=(1118,548,100,100), threshold=0.8, method="Template matching", file="./tasks/TrueOrochi/st/st_st_fire_prepare.png")
+	# description 
+	I_ST_AUTO_FALSE = RuleImage(roi_front=(1112,463,33,34), roi_back=(1112,463,33,34), threshold=0.8, method="Template matching", file="./tasks/TrueOrochi/st/st_st_auto_false.png")
+	# description 
+	I_ST_AUTO_TRUE = RuleImage(roi_front=(1112,461,34,37), roi_back=(1112,461,34,37), threshold=0.8, method="Template matching", file="./tasks/TrueOrochi/st/st_st_auto_true.png")
+	# description 
+	I_ST_GREEN_1 = RuleImage(roi_front=(209,216,22,48), roi_back=(188,192,69,87), threshold=0.8, method="Template matching", file="./tasks/TrueOrochi/st/st_st_green_1.png")
+	# description 
+	I_ST_GREEN_2 = RuleImage(roi_front=(294,311,21,46), roi_back=(273,282,70,91), threshold=0.8, method="Template matching", file="./tasks/TrueOrochi/st/st_st_green_2.png")
+	# description 
+	I_ST_GREEN_3 = RuleImage(roi_front=(473,269,21,49), roi_back=(457,245,56,89), threshold=0.8, method="Template matching", file="./tasks/TrueOrochi/st/st_st_green_3.png")
+	# description 
+	I_ST_GREEN_4 = RuleImage(roi_front=(690,258,27,49), roi_back=(662,235,83,83), threshold=0.8, method="Template matching", file="./tasks/TrueOrochi/st/st_st_green_4.png")
+	# description 
+	I_ST_GREEN_5 = RuleImage(roi_front=(841,335,26,44), roi_back=(814,302,100,100), threshold=0.8, method="Template matching", file="./tasks/TrueOrochi/st/st_st_green_5.png")
+	# description 
+	I_ST_GREEN_6 = RuleImage(roi_front=(930,247,24,47), roi_back=(894,224,100,100), threshold=0.8, method="Template matching", file="./tasks/TrueOrochi/st/st_st_green_6.png")
+
+

+ 37 - 0
tasks/TrueOrochi/config.py

@@ -0,0 +1,37 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+from pydantic import BaseModel, Field
+from enum import Enum
+from datetime import datetime, time
+
+from tasks.Component.config_scheduler import Scheduler
+from tasks.Component.config_base import ConfigBase, TimeDelta
+from tasks.Utils.config_enum import ShikigamiClass
+
+class GreenMarkType(str, Enum):
+    LEFT_1 = 'left_1'
+    LEFT_2 = 'left_2'
+    LEFT_3 = 'left_3'
+    LEFT_4 = 'left_4'
+    LEFT_5 = 'left_5'
+    LEFT_6 = 'left_6'
+    MAIN = 'main'
+
+
+
+class TrueOrochiScheduler(Scheduler):
+    priority = Field(default=10, description='priority_help')
+    success_interval: TimeDelta = Field(default=TimeDelta(days=7), description='success_interval_help')
+    failure_interval: TimeDelta = Field(default=TimeDelta(days=1), description='failure_interval_help')
+
+class TrueOrochiConfig(BaseModel):
+    find_true_orochi: bool = Field(default=True, description='find_true_orochi_help')
+    green_enable: bool = Field(default=False, description='green_enable_help')
+    green_mark_type: GreenMarkType = Field(default=GreenMarkType.LEFT_1, description='green_mark_type_help')
+    current_success: int = Field(default=0, description='current_success_help')
+
+class TrueOrochi(ConfigBase):
+    scheduler: TrueOrochiScheduler = Field(default_factory=TrueOrochiScheduler)
+    true_orochi_config: TrueOrochiConfig = Field(default_factory=TrueOrochiConfig)
+

+ 35 - 0
tasks/TrueOrochi/script_task.py

@@ -0,0 +1,35 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+from module.logger import logger
+from module.exception import TaskEnd
+
+from tasks.GameUi.game_ui import GameUi
+from tasks.Component.GeneralBattle.general_battle import GeneralBattle
+from tasks.Component.GeneralInvite.general_invite import GeneralInvite
+from tasks.Component.GeneralRoom.general_room import GeneralRoom
+from tasks.Orochi.script_task import ScriptTask as OrochiScriptTask
+from tasks.GameUi.page import page_main, page_soul_zones
+
+
+class ScriptTask(GameUi, OrochiScriptTask, GeneralBattle, GeneralInvite, GeneralRoom):
+
+    def run(self):
+        config = self.config.ture_orochi
+        self.ui_get_current_page()
+        self.ui_goto(page_soul_zones)
+        self.orochi_enter()
+
+
+    def check_true_orochi(self, screenshot=False) -> bool:
+        """
+        检查是否出现真蛇(要求当前的界面必须是在御魂挑战的界面)
+        :return:
+        """
+        if screenshot:
+            self.screenshot()
+        return self.appear(self.I_FIND_TS)
+
+    def run_true_orochi(self) -> bool:
+        pass
+

+ 50 - 0
tasks/TrueOrochi/st/click.json

@@ -0,0 +1,50 @@
+[
+  {
+    "itemName": "st_green_1",
+    "roiFront": "210,395,46,66",
+    "roiBack": "210,395,46,66",
+    "description": "description"
+  },
+  {
+    "itemName": "st_green_2",
+    "roiFront": "291,481,46,63",
+    "roiBack": "291,481,46,63",
+    "description": "description"
+  },
+  {
+    "itemName": "st_green_3",
+    "roiFront": "459,426,53,59",
+    "roiBack": "459,426,53,59",
+    "description": "description"
+  },
+  {
+    "itemName": "st_green_4",
+    "roiFront": "687,391,43,57",
+    "roiBack": "687,391,43,57",
+    "description": "description"
+  },
+  {
+    "itemName": "st_green_5",
+    "roiFront": "814,490,41,60",
+    "roiBack": "814,490,41,60",
+    "description": "description"
+  },
+  {
+    "itemName": "st_green_6",
+    "roiFront": "921,386,48,59",
+    "roiBack": "921,386,48,59",
+    "description": "description"
+  },
+  {
+    "itemName": "st_green_7",
+    "roiFront": "0,0,100,100",
+    "roiBack": "0,0,100,100",
+    "description": "description"
+  },
+  {
+    "itemName": "st_green_main",
+    "roiFront": "611,541,40,66",
+    "roiBack": "611,541,40,66",
+    "description": "description"
+  }
+]

+ 110 - 0
tasks/TrueOrochi/st/image.json

@@ -0,0 +1,110 @@
+[
+  {
+    "itemName": "find_ts",
+    "imageName": "st_find_ts.png",
+    "roiFront": "1,613,100,93",
+    "roiBack": "1,613,100,93",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "出现真蛇"
+  },
+  {
+    "itemName": "st_fire",
+    "imageName": "st_st_fire.png",
+    "roiFront": "960,485,100,100",
+    "roiBack": "960,485,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "点击挑战60体力"
+  },
+  {
+    "itemName": "st_fire_confirm",
+    "imageName": "st_st_fire_confirm.png",
+    "roiFront": "671,406,176,53",
+    "roiBack": "671,406,176,53",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "确认挑战"
+  },
+  {
+    "itemName": "st_fire_prepare",
+    "imageName": "st_st_fire_prepare.png",
+    "roiFront": "1118,548,100,100",
+    "roiBack": "1118,548,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "十个式神的准备"
+  },
+  {
+    "itemName": "st_auto_false",
+    "imageName": "st_st_auto_false.png",
+    "roiFront": "1112,463,33,34",
+    "roiBack": "1112,463,33,34",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "st_auto_true",
+    "imageName": "st_st_auto_true.png",
+    "roiFront": "1112,461,34,37",
+    "roiBack": "1112,461,34,37",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "st_green_1",
+    "imageName": "st_st_green_1.png",
+    "roiFront": "209,216,22,48",
+    "roiBack": "188,192,69,87",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "st_green_2",
+    "imageName": "st_st_green_2.png",
+    "roiFront": "294,311,21,46",
+    "roiBack": "273,282,70,91",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "st_green_3",
+    "imageName": "st_st_green_3.png",
+    "roiFront": "473,269,21,49",
+    "roiBack": "457,245,56,89",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "st_green_4",
+    "imageName": "st_st_green_4.png",
+    "roiFront": "690,258,27,49",
+    "roiBack": "662,235,83,83",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "st_green_5",
+    "imageName": "st_st_green_5.png",
+    "roiFront": "841,335,26,44",
+    "roiBack": "814,302,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "st_green_6",
+    "imageName": "st_st_green_6.png",
+    "roiFront": "930,247,24,47",
+    "roiBack": "894,224,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

BIN
tasks/TrueOrochi/st/st_find_ts.png


BIN
tasks/TrueOrochi/st/st_st_auto_false.png


BIN
tasks/TrueOrochi/st/st_st_auto_true.png


BIN
tasks/TrueOrochi/st/st_st_fire.png


BIN
tasks/TrueOrochi/st/st_st_fire_confirm.png


BIN
tasks/TrueOrochi/st/st_st_fire_prepare.png


BIN
tasks/TrueOrochi/st/st_st_green_1.png


BIN
tasks/TrueOrochi/st/st_st_green_2.png


BIN
tasks/TrueOrochi/st/st_st_green_3.png


BIN
tasks/TrueOrochi/st/st_st_green_4.png


BIN
tasks/TrueOrochi/st/st_st_green_5.png


BIN
tasks/TrueOrochi/st/st_st_green_6.png