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

+ 3 - 3
README.md

@@ -57,11 +57,11 @@ This project is licensed under the GNU General Public License v3.0.
 
 #### QQ交流群: 465946275
 
-相对于其他的游戏,阴阳师玩家总体而言对脚本这类工具具有极高的排斥性。无论你是否喜欢 OAS ,我们都希望你不在互联网上进行宣传,这保护 OAS , 也保护开发者们。
+相对于其他的游戏,阴阳师玩家总体而言对脚本这类工具具有极高的排斥性。树大招风,无论你是否喜欢 OAS ,我们都希望你不在互联网上进行宣传,这保护 OAS , 也保护开发者们。
 
-同样保持较高的入群门槛:  
+这保持较高的入群门槛:  
 - 你的QQ等级必须大于32级(🌞🌞),注册时间超过一年;
-- 你必须拥有一个 Github 账户来点一个 **Star**(这并不影响你取消Star),同样的要求注册时间过半年。
+- 你必须拥有一个 Github 账户来点一个 **Star**(这并不影响你入群后取消Star),同样的要求注册时间过半年。
 
 #### 技术/开发群: 207613181
 

+ 1 - 1
tasks/CollectiveMissions/config.py

@@ -14,7 +14,7 @@ from tasks.Component.SwitchSoul.switch_soul_config import SwitchSoulConfig
 
 class MissionsConfig(BaseModel):
     # 契灵 > 觉醒二 > 觉醒一 > 御灵二 > 御灵一 > 御魂五 > 御魂四
-    missions_rule: MultiLine = Field(default='契灵 > 觉醒二 > 觉醒一 > 御灵二 > 御灵一 > 御魂五 > 御魂四',
+    missions_rule: MultiLine = Field(default='契灵 > 觉醒三 > 觉醒二 > 觉醒一 > 御灵二 > 御灵一 > 御魂五 > 御魂四',
                                      description='missions_rule_help')
 
 

+ 6 - 1
tasks/CollectiveMissions/script_task.py

@@ -21,6 +21,7 @@ class MC(str, Enum):
     BL = '契灵'
     AW1 = '觉醒一'
     AW2 = '觉醒二'
+    AW3 = '觉醒三'
     GR1 = '御灵一'
     GR2 = '御灵二'
     SO4 = '御魂四'
@@ -57,10 +58,12 @@ class ScriptTask(GameUi, CollectiveMissionsAssets):
             raise TaskEnd('CollectiveMissions')
         # 判断最优的任务是哪一个
         mission, index = self.detect_best()
+        logger.info(f'Best mission is {mission}')
+        logger.info(f'Best mission index is {index}')
         if mission == MC.BL:
             # 契灵单独处理
             self._bondling_fairyland()
-        elif mission == MC.AW1 or mission == MC.AW2 or mission == MC.GR1 or mission == MC.GR2:
+        elif mission == MC.AW1 or mission == MC.AW2 or mission == MC.AW3 or mission == MC.GR1 or mission == MC.GR2:
             # 其他就捐材料
             self._donate(index)
         elif mission == MC.SO4 or mission == MC.SO5:
@@ -105,6 +108,8 @@ class ScriptTask(GameUi, CollectiveMissionsAssets):
             return MC.AW1
         elif result_2 == '觉醒二':
             return MC.AW2
+        elif result_2 == '觉醒三':
+            return MC.AW3
         elif result_2 == '御灵一':
             return MC.GR1
         elif result_2 == '御灵二':

+ 5 - 0
tasks/Component/Summon/summon.py

@@ -43,6 +43,11 @@ class Summon(BaseTask, SummonAssets):
         if '1' not in ticket_info:
             logger.warning('There is no any one blue ticket')
             return
+        # 某些情况下滑动异常
+        self.S_RANDOM_SWIPE_1.name = 'S_RANDOM_SWIPE'
+        self.S_RANDOM_SWIPE_2.name = 'S_RANDOM_SWIPE'
+        self.S_RANDOM_SWIPE_3.name = 'S_RANDOM_SWIPE'
+        self.S_RANDOM_SWIPE_4.name = 'S_RANDOM_SWIPE'
         while 1:
             self.screenshot()
             if self.appear(self.I_ONE_TICKET):

+ 1 - 1
tasks/GameUi/assets.py

@@ -47,7 +47,7 @@ class GameUiAssets:
 	# 式神委派 
 	I_EXPLORATION_GOTO_DELEGATION = RuleImage(roi_front=(445,638,60,50), roi_back=(445,638,60,50), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_delegation.png")
 	# 秘闻 
-	I_EXPLORATION_GOTO_SECRET_ZONES = RuleImage(roi_front=(542,645,61,55), roi_back=(542,645,61,55), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_secret_zones.png")
+	I_EXPLORATION_GOTO_SECRET_ZONES = RuleImage(roi_front=(546,628,61,55), roi_back=(524,614,100,87), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_secret_zones.png")
 	# 地狱鬼王 
 	I_EXPLORATION_GOTO_AREA_BOSS = RuleImage(roi_front=(640,638,51,45), roi_back=(640,638,51,45), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_area_boss.png")
 	# 平安奇谭 

+ 2 - 2
tasks/GameUi/page/page_img.json

@@ -74,8 +74,8 @@
   {
     "itemName": "exploration_goto_secret_zones",
     "imageName": "page_exploration_goto_secret_zones.png",
-    "roiFront": "542,645,61,55",
-    "roiBack": "542,645,61,55",
+    "roiFront": "546,628,61,55",
+    "roiBack": "524,614,100,87",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "秘闻"

+ 5 - 5
tasks/RichMan/assets.py

@@ -269,9 +269,9 @@ class RichManAssets:
 	# 朴素的御魂 
 	O_SCA_RES_OROCHI = RuleOcr(roi=(531,9,127,37), area=(531,9,127,37), mode="DigitCounter", method="Default", keyword="", name="sca_res_orochi")
 	# 首领御魂数量 
-	O_SCA_RES_DEMON = RuleOcr(roi=(943,10,100,35), area=(943,10,100,35), mode="Digit", method="Default", keyword="", name="sca_res_demon")
+	O_SCA_RES_DEMON = RuleOcr(roi=(949,10,86,35), area=(949,10,86,35), mode="Digit", method="Default", keyword="", name="sca_res_demon")
 	# 永生之海 
-	O_SCA_RES_SEA = RuleOcr(roi=(1142,11,100,38), area=(1142,11,100,38), mode="Digit", method="Default", keyword="", name="sca_res_sea")
+	O_SCA_RES_SEA = RuleOcr(roi=(1152,11,80,38), area=(1152,11,80,38), mode="Digit", method="Default", keyword="", name="sca_res_sea")
 
 
 	# Image Rule Assets
@@ -304,11 +304,11 @@ class RichManAssets:
 	# 下期预览 
 	I_S_NEXT_PERIOD = RuleImage(roi_front=(1083,574,90,86), roi_back=(1083,574,90,86), threshold=0.8, method="Template matching", file="./tasks/RichMan/shrine/shrine_s_next_period.png")
 	# description 
-	I_S_WHITE_FIVE = RuleImage(roi_front=(769,143,77,85), roi_back=(769,143,77,85), threshold=0.8, method="Template matching", file="./tasks/RichMan/shrine/shrine_s_white_five.png")
+	I_S_WHITE_FIVE = RuleImage(roi_front=(769,143,77,85), roi_back=(769,143,77,85), threshold=0.85, method="Template matching", file="./tasks/RichMan/shrine/shrine_s_white_five.png")
 	# description 
-	I_S_WHITE_FOUR = RuleImage(roi_front=(951,144,73,82), roi_back=(951,144,73,82), threshold=0.8, method="Template matching", file="./tasks/RichMan/shrine/shrine_s_white_four.png")
+	I_S_WHITE_FOUR = RuleImage(roi_front=(951,144,73,82), roi_back=(951,144,73,82), threshold=0.85, method="Template matching", file="./tasks/RichMan/shrine/shrine_s_white_four.png")
 	# 黑蛋 
-	I_S_BLACK = RuleImage(roi_front=(588,143,78,83), roi_back=(588,143,78,83), threshold=0.8, method="Template matching", file="./tasks/RichMan/shrine/shrine_s_black.png")
+	I_S_BLACK = RuleImage(roi_front=(588,143,78,83), roi_back=(588,143,78,83), threshold=0.9, method="Template matching", file="./tasks/RichMan/shrine/shrine_s_black.png")
 	# description 
 	I_S_BUY_BLACK = RuleImage(roi_front=(777,508,173,60), roi_back=(777,508,173,60), threshold=0.8, method="Template matching", file="./tasks/RichMan/shrine/shrine_s_buy_black.png")
 	# description 

+ 1 - 1
tasks/RichMan/mall/scales.py

@@ -307,7 +307,7 @@ class Scales(Buy, MallNavbar):
             for i in range(buy_cycles_number):
                 self._scales_buy_sea_more(self.I_SCA_PICTURE_BOOK)
                 time.sleep(0.5)
-        if buy_res_number and buy_rule >= 2:
+        if buy_res_number and buy_res_number >= 2:
             self._scales_buy_sea_more(self.I_SCA_PICTURE_BOOK, buy_res_number)
             time.sleep(0.5)
 

+ 4 - 4
tasks/RichMan/mall/scales/ocr.json

@@ -46,8 +46,8 @@
   },
   {
     "itemName": "sca_res_demon",
-    "roiFront": "943,10,100,35",
-    "roiBack": "943,10,100,35",
+    "roiFront": "949,10,86,35",
+    "roiBack": "949,10,86,35",
     "mode": "Digit",
     "method": "Default",
     "keyword": "",
@@ -55,8 +55,8 @@
   },
   {
     "itemName": "sca_res_sea",
-    "roiFront": "1142,11,100,38",
-    "roiBack": "1142,11,100,38",
+    "roiFront": "1152,11,80,38",
+    "roiBack": "1152,11,80,38",
     "mode": "Digit",
     "method": "Default",
     "keyword": "",

+ 1 - 1
tasks/RichMan/script_task.py

@@ -45,7 +45,7 @@ if __name__ == '__main__':
     from module.config.config import Config
     from module.device.device import Device
     from memory_profiler import profile
-    c = Config('oas1')
+    c = Config('test')
     d = Device(c)
     t = ScriptTask(c, d)
 

+ 3 - 3
tasks/RichMan/shrine/image.json

@@ -14,7 +14,7 @@
     "roiFront": "769,143,77,85",
     "roiBack": "769,143,77,85",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.85,
     "description": "description"
   },
   {
@@ -23,7 +23,7 @@
     "roiFront": "951,144,73,82",
     "roiBack": "951,144,73,82",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.85,
     "description": "description"
   },
   {
@@ -32,7 +32,7 @@
     "roiFront": "588,143,78,83",
     "roiBack": "588,143,78,83",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.9,
     "description": "黑蛋"
   },
   {

+ 1 - 1
tasks/Secret/assets.py

@@ -36,7 +36,7 @@ class SecretAssets:
 	# 未通关 
 	O_SE_NO_PASS = RuleOcr(roi=(428,151,262,248), area=(428,151,262,248), mode="Full", method="Default", keyword="未通关", name="se_no_pass")
 	# 第一个位置的层数 
-	O_SE_LAYER_1 = RuleOcr(roi=(208,146,47,46), area=(208,146,47,46), mode="Single", method="Default", keyword="", name="se_layer_1")
+	O_SE_LAYER_1 = RuleOcr(roi=(210,150,44,39), area=(210,150,44,39), mode="Single", method="Default", keyword="", name="se_layer_1")
 	# Ocr-description 
 	O_SE_LAYER_10 = RuleOcr(roi=(210,507,34,34), area=(210,507,34,34), mode="Single", method="Default", keyword="拾", name="se_layer_10")
 	# Ocr-description 

+ 1 - 1
tasks/Secret/script_task.py

@@ -134,7 +134,7 @@ class ScriptTask(GameUi, GeneralBattle, SwitchSoul, SecretAssets):
             level = ocr_target.ocr(self.device.image)
             if not isinstance(level, str):
                 logger.warning(f'OCR failed, try again {level}')
-            level = level.replace('·', '').replace(' ', '').replace('。', '')
+            level = level.replace('·', '').replace(' ', '').replace('。', '').replace('武', '贰')
             if level not in self.lay_list and roi:
                 print(roi)
                 print(ocr_target.roi)

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

@@ -10,8 +10,8 @@
   },
   {
     "itemName": "se_layer_1",
-    "roiFront": "208,146,47,46",
-    "roiBack": "208,146,47,46",
+    "roiFront": "210,150,44,39",
+    "roiBack": "210,150,44,39",
     "mode": "Single",
     "method": "Default",
     "keyword": "",