Ver código fonte

Merge: 庭院检测逻辑重构完成

lhye 4 meses atrás
pai
commit
6d7a9dd927

+ 1 - 1
module/config/config_manual.py

@@ -15,7 +15,7 @@ class ConfigManual:
         > Orochi > OrochiMoans > OrochiJudgement > Sougenbi > FallenSun > EternitySea > SixRealms
         > ActivityShikigami > WantedQuests
         > BondlingFairyland > EvoZone > GoryouRealm > HeroTest
-        > CollectiveMissionsr
+        > CollectiveMissions
         > Pets > TalismanPass > Delegation > Hyakkiyakou
         > Secret > WeeklyTrifles > MysteryShop > Duel 
         > TrueOrochi > RichMan

+ 1 - 2
tasks/AbyssShadows/assets.py

@@ -61,7 +61,7 @@ class AbyssShadowsAssets:
 	# 式神录 
 	I_ABYSS_SHIKI = RuleImage(roi_front=(1199,462,47,53), roi_back=(1199,462,47,53), threshold=0.8, method="Template matching", file="./tasks/AbyssShadows/res/res_abyss_shiki.png")
 	# 狭间暗域 
-	I_ABYSS_SHADOWS = RuleImage(roi_front=(711,489,107,38), roi_back=(711,479,107,48), threshold=0.8, method="Template matching", file="./tasks/AbyssShadows/res/res_abyss_shadows.png")
+	I_ABYSS_SHADOWS = RuleImage(roi_front=(711,489,107,38), roi_back=(700,470,140,70), threshold=0.8, method="Template matching", file="./tasks/AbyssShadows/res/res_abyss_shadows.png")
 	# 开启狭间暗域 
 	I_OPEN_ABYSS_SHADOWS = RuleImage(roi_front=(1133,602,74,58), roi_back=(1133,602,74,58), threshold=0.8, method="Template matching", file="./tasks/AbyssShadows/res/res_open_abyss_shadows.png")
 	# 战报页面 
@@ -102,4 +102,3 @@ class AbyssShadowsAssets:
 	# 滑到狭间 
 	S_TO_ABBSY_SHADOWS = RuleSwipe(roi_front=(752,395,62,66), roi_back=(758,193,62,48), mode="default", name="to_abbsy_shadows")
 
-

+ 2 - 2
tasks/AbyssShadows/res/image.json

@@ -75,7 +75,7 @@
     "itemName": "abyss_shadows",
     "imageName": "res_abyss_shadows.png",
     "roiFront": "711,489,107,38",
-    "roiBack": "711,479,107,48",
+    "roiBack": "700,470,140,70",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "狭间暗域"
@@ -206,4 +206,4 @@
     "threshold": 0.8,
     "description": "description"
   }
-]
+]

+ 5 - 1
tasks/AbyssShadows/script_task.py

@@ -317,6 +317,10 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, AbyssShadowsAssets):
         
         while 1:
             self.screenshot()
+            # Entering Shenshe can resume an active Abyss Shadows map directly.
+            if self.appear(self.I_ABYSS_NAVIGATION):
+                logger.info("Already in abyss_shadows")
+                break
             # 进入神社
             if self.appear_then_click(self.I_RYOU_SHENSHE,interval=1):
                 logger.info("Enter Shenshe")
@@ -566,4 +570,4 @@ if __name__ == "__main__":
     config = Config('zhu')
     device = Device(config)
     t = ScriptTask(config, device)
-    t.run()
+    t.run()

BIN
tasks/ActivityShikigami/as/as_battle_main_to_records.png


BIN
tasks/ActivityShikigami/as/as_climb_mode_pass.png


BIN
tasks/ActivityShikigami/as/as_climb_mode_switch.png


BIN
tasks/ActivityShikigami/as/as_shi.png


BIN
tasks/ActivityShikigami/as/as_to_battle_main.png


+ 2 - 2
tasks/ActivityShikigami/as/image.json

@@ -20,8 +20,8 @@
   {
     "itemName": "climb_mode_pass",
     "imageName": "as_climb_mode_pass.png",
-    "roiFront": "1142,546,21,21",
-    "roiBack": "1129,510,48,69",
+    "roiFront": "1142,547,21,21",
+    "roiBack": "1129,511,111,68",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "活动爬塔标志"

+ 3 - 3
tasks/ActivityShikigami/as/pages.json

@@ -2,7 +2,7 @@
   {
     "itemName": "shi",
     "imageName": "as_shi.png",
-    "roiFront": "1187,304,43,29",
+    "roiFront": "1187,383,43,29",
     "roiBack": "1164,134,83,393",
     "method": "Template matching",
     "threshold": 0.7,
@@ -38,8 +38,8 @@
   {
     "itemName": "to_battle_main",
     "imageName": "as_to_battle_main.png",
-    "roiFront": "403,300,39,176",
-    "roiBack": "313,246,238,269",
+    "roiFront": "245,284,39,176",
+    "roiBack": "177,240,238,269",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "进入主要的战斗界面"

+ 5 - 5
tasks/ActivityShikigami/assets.py

@@ -29,7 +29,7 @@ class ActivityShikigamiAssets:
 	# 还未上锁图片 
 	I_UNLOCK = RuleImage(roi_front=(884,648,28,25), roi_back=(733,607,266,95), threshold=0.5, method="Template matching", file="./tasks/ActivityShikigami/as/as_unlock.png")
 	# 活动爬塔标志 
-	I_CLIMB_MODE_PASS = RuleImage(roi_front=(1142,546,21,21), roi_back=(1129,510,48,69), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_climb_mode_pass.png")
+	I_CLIMB_MODE_PASS = RuleImage(roi_front=(1142,547,21,21), roi_back=(1129,511,111,68), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_climb_mode_pass.png")
 	# 体力爬塔标志 
 	I_CLIMB_MODE_AP = RuleImage(roi_front=(1093,544,20,20), roi_back=(1055,495,100,100), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_climb_mode_ap.png")
 	# 切换按键 
@@ -38,7 +38,7 @@ class ActivityShikigamiAssets:
 
 	# Image Rule Assets
 	# 进入活动 
-	I_SHI = RuleImage(roi_front=(1187,304,43,29), roi_back=(1164,134,83,393), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_shi.png")
+	I_SHI = RuleImage(roi_front=(1187,383,43,29), roi_back=(1164,134,83,393), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_shi.png")
 	# 左上角返回 
 	I_BACK_GREEN = RuleImage(roi_front=(27,19,34,38), roi_back=(2,1,170,75), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_back_green.png")
 	# 右上跳过按钮 
@@ -46,7 +46,7 @@ class ActivityShikigamiAssets:
 	# 红色退出 
 	I_RED_EXIT = RuleImage(roi_front=(1162,96,39,38), roi_back=(1120,49,110,135), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_red_exit.png")
 	# 进入主要的战斗界面 
-	I_TO_BATTLE_MAIN = RuleImage(roi_front=(403,300,39,176), roi_back=(313,246,238,269), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_to_battle_main.png")
+	I_TO_BATTLE_MAIN = RuleImage(roi_front=(245,284,39,176), roi_back=(177,240,238,269), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_to_battle_main.png")
 	# 点击进入boss战斗页面 
 	I_TO_BATTLE_BOSS = RuleImage(roi_front=(1076,241,37,136), roi_back=(934,209,234,327), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_to_battle_boss.png")
 	# description 
@@ -94,9 +94,9 @@ class ActivityShikigamiAssets:
 	# 挑战 
 	O_FIRE = RuleOcr(roi=(1124,599,96,50), area=(1123,570,106,100), mode="Single", method="Default", keyword="挑战", name="fire")
 	# 体力的数量检测 
-	O_REMAIN_AP = RuleOcr(roi=(584,15,63,30), area=(584,15,63,30), mode="DigitCounter", method="Default", keyword="", name="remain_ap")
+	O_REMAIN_AP = RuleOcr(roi=(777,17,63,30), area=(776,16,63,30), mode="DigitCounter", method="Default", keyword="", name="remain_ap")
 	# 活动体力的剩余检测 
-	O_REMAIN_PASS = RuleOcr(roi=(803,17,39,28), area=(803,17,39,28), mode="DigitCounter", method="Default", keyword="", name="remain_pass")
+	O_REMAIN_PASS = RuleOcr(roi=(599,15,50,29), area=(600,16,49,28), mode="DigitCounter", method="Default", keyword="", name="remain_pass")
 	# 还有多少次购买体力的机会 
 	O_REMAIN_BUY = RuleOcr(roi=(808,531,39,42), area=(808,531,39,42), mode="DigitCounter", method="Default", keyword="", name="remain_buy")
 	# 活动票数(没有百分比) 

+ 4 - 4
tasks/ActivityShikigami/fire/ocr.json

@@ -10,8 +10,8 @@
   },
   {
     "itemName": "remain_ap",
-    "roiFront": "584,15,63,30",
-    "roiBack": "584,15,63,30",
+    "roiFront": "777,17,63,30",
+    "roiBack": "776,16,63,30",
     "mode": "DigitCounter",
     "method": "Default",
     "keyword": "",
@@ -19,8 +19,8 @@
   },
   {
     "itemName": "remain_pass",
-    "roiFront": "803,17,39,28",
-    "roiBack": "803,17,39,28",
+    "roiFront": "599,15,50,29",
+    "roiBack": "600,16,49,28",
     "mode": "DigitCounter",
     "method": "Default",
     "keyword": "",

+ 28 - 3
tasks/AutoCheckinBigGod/script_task.py

@@ -839,12 +839,19 @@ Java.perform(function() {{
         return None
 
     def _get_device_id(self, pid):
-        """通过 Frida 获取 DeviceId"""
+        """通过 Frida 获取 DeviceId,失败时使用UDID作为备选"""
         script = """
 Java.perform(function() {
     try {
         var YXFDeviceInfo = Java.use('com.netease.gl.glbase.build.YXFDeviceInfo');
-        console.log('GL_DEVICEID:' + YXFDeviceInfo.getDeviceId());
+        var id = YXFDeviceInfo.getDeviceId();
+        if (id && typeof id === 'string' && id != 'unknown') console.log('GL_DEVICEID:' + id);
+    } catch(e) {}
+    try {
+        var ctx = Java.use('android.app.ActivityThread').currentApplication().getApplicationContext();
+        var sp = ctx.getSharedPreferences('gl_user_info', 0);
+        var deviceId = sp.getString('deviceId', '');
+        if (deviceId && deviceId != 'unknown') console.log('GL_DEVICEID:' + deviceId);
     } catch(e) {}
     console.log('__DONE__');
 });
@@ -853,7 +860,18 @@ Java.perform(function() {
         if output:
             for line in output.split('\n'):
                 if 'GL_DEVICEID:' in line:
-                    return line.split('GL_DEVICEID:')[1].strip()
+                    device_id = line.split('GL_DEVICEID:')[1].strip()
+                    if device_id and device_id != 'unknown' and not device_id.startswith('Java.Field'):
+                        return device_id
+        
+        try:
+            udid = self._adb_shell(['settings', 'get', 'secure', 'android_id'])
+            if udid and udid != 'unknown':
+                logger.info(f'使用UDID作为DeviceId')
+                return udid
+        except Exception:
+            pass
+        
         return None
 
     def _login_by_urs_token(self, pid, urs_creds):
@@ -1120,3 +1138,10 @@ Java.perform(function() {
             logger.error(f'  领取异常: {title} - {e}')
 
         return False
+if __name__ == "__main__":
+    from module.config.config import Config
+    from module.device.device import Device
+    config = Config('oas1')
+    device = Device(config)
+    t = ScriptTask(config, device)
+    t.run()

+ 7 - 2
tasks/Component/ReplaceShikigami/replace_shikigami.py

@@ -52,9 +52,14 @@ class ReplaceShikigami(BaseTask, ReplaceShikigamiAssets):
             if self.appear(check_selected):
                 break
             if self.appear(check_click, interval=1):
-                if self.wait_until_pos_stable(check_click, stable_time=1.5, timeout=3.5):
-                    self.click(check_click)
+                if not (self.wait_until_pos_stable(check_click, stable_time=1.5, timeout=3.5)
+                        and self.appear(check_click)):
+                    continue
+                if self.appear(check_selected):
+                    break
+                self.click(check_click, interval=2)
                 continue
+            self.wait_animate_stable(rule=self.C_SHIKIGAMI_SWITCH_1, interval=0.8)
             if self.click(self.C_SHIKIGAMI_SWITCH_1, interval=3.5):
                 continue
         logger.info('Select shikigami class: %s' % shikigami_class)

+ 3 - 1
tasks/DemonRetreat/script_task.py

@@ -123,7 +123,9 @@ class ScriptTask(GameUi, GeneralBattle, SwitchSoul, DemonRetreatAssets, AbyssSha
             # 确保不离开退治
             if self.appear_then_click(self.I_QUIT_BACK, interval=1):
                 pass
-            if self.appear(self.I_HUNT_CHECK):
+            if (self.appear(self.I_HUNT_CHECK)
+                    or self.appear(self.I_DEMON_GATHER)
+                    or self.is_in_prepare(False)):
                 if self.appear_then_click(self.I_QUIT_BACK, interval=1):
                     pass
                 logger.info("Enter demon_retreat success")

+ 1 - 1
tasks/Exploration/base.py

@@ -198,7 +198,7 @@ class BaseExploration(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, Replace
             logger.warning('Opening settings failed due to now in battle')
             return
         cu, res, total = self.O_E_ALTERNATE_NUMBER.ocr(self.device.image)
-        if cu >= 10:
+        if cu >= 40:
             logger.info("Alternate number is enough")
             self.ui_click_until_disappear(self.I_E_SURE_BUTTON)
             return

+ 11 - 16
tasks/Exploration/solo.py

@@ -15,6 +15,7 @@ from tasks.Exploration.config import ChooseRarity, AutoRotate, UserStatus, Explo
 class SoloExploration(BaseExploration):
     INVITE_FLAG_OFF = (157, 109, 83)
     INVITE_FLAG_ON = (227, 193, 153)
+    explore_init = False
 
     @cached_property
     def _invite_config(self) -> InviteConfig:
@@ -29,7 +30,6 @@ class SoloExploration(BaseExploration):
 
     def run_solo(self):
         logger.hr('solo')
-        explore_init = False
         search_fail_cnt = 0
 
         while 1:
@@ -48,22 +48,20 @@ class SoloExploration(BaseExploration):
                 if self.check_exit():
                     break
                 self.open_expect_level()
-                explore_init = False
                 continue
             #
             elif scene == Scene.ENTRANCE:
                 if self.check_exit():
                     break
                 self.ui_click(self.I_E_EXPLORATION_CLICK, stop=self.I_E_SETTINGS_BUTTON)
-                explore_init = False
                 continue
             #
             elif scene == Scene.MAIN:
-                if not explore_init:
-                    self.ui_click(self.I_E_AUTO_ROTATE_OFF, stop=self.I_E_AUTO_ROTATE_ON)
+                if not self.explore_init:
                     if self._config.exploration_config.auto_rotate == AutoRotate.yes:
                         self.enter_settings_and_do_operations()
-                    explore_init = True
+                    self.ui_click(self.I_E_AUTO_ROTATE_OFF, stop=self.I_E_AUTO_ROTATE_ON)
+                    self.explore_init = True
                     continue
                 # 小纸人
                 if self.appear(self.I_BATTLE_REWARD):
@@ -100,7 +98,6 @@ class SoloExploration(BaseExploration):
 
     def run_leader(self):
         logger.hr('leader')
-        explore_init = False
         search_fail_cnt = 0
         friend_leave_timer = Timer(10)
 
@@ -139,7 +136,7 @@ class SoloExploration(BaseExploration):
                     # 可以加一下,清空第一次 explore_init
                     continue
                 self.open_expect_level()
-                explore_init = False
+                # explore_init = False
                 continue
 
             # 邀请好友, 非常有可能是后面邀请好友,然后直接跳到组队了
@@ -179,12 +176,12 @@ class SoloExploration(BaseExploration):
                     break
             ##
             elif scene == Scene.MAIN:
-                if not explore_init:
-                    self.ui_click(self.I_E_AUTO_ROTATE_OFF, stop=self.I_E_AUTO_ROTATE_ON)
+                if not self.explore_init:
                     if self._config.exploration_config.auto_rotate == AutoRotate.yes:
                         self.enter_settings_and_do_operations()
+                    self.ui_click(self.I_E_AUTO_ROTATE_OFF, stop=self.I_E_AUTO_ROTATE_ON)
                     friend_leave_timer = Timer(10)
-                    explore_init = True
+                    self.explore_init = True
                     continue
                 # 小纸人
                 if self.appear(self.I_BATTLE_REWARD):
@@ -235,7 +232,6 @@ class SoloExploration(BaseExploration):
 
     def run_member(self):
         logger.hr('member')
-        explore_init = False
         wait_timer = Timer(50)
         friend_leave_timer = Timer(10)
 
@@ -260,7 +256,6 @@ class SoloExploration(BaseExploration):
                     logger.warning('Wait timer reached')
                     break
 
-                explore_init = False
                 continue
             #
             elif scene == Scene.ENTRANCE:
@@ -270,11 +265,11 @@ class SoloExploration(BaseExploration):
                 continue
             #
             elif scene == Scene.MAIN:
-                if not explore_init:
-                    self.ui_click(self.I_E_AUTO_ROTATE_OFF, stop=self.I_E_AUTO_ROTATE_ON)
+                if not self.explore_init:
                     if self._config.exploration_config.auto_rotate == AutoRotate.yes:
                         self.enter_settings_and_do_operations()
-                    explore_init = True
+                    self.ui_click(self.I_E_AUTO_ROTATE_OFF, stop=self.I_E_AUTO_ROTATE_ON)
+                    self.explore_init = True
                     continue
                 # 小纸人
                 if self.appear(self.I_BATTLE_REWARD):

+ 2 - 2
tasks/GameUi/assets.py

@@ -67,7 +67,7 @@ class GameUiAssets:
 	# 探索前往平安奇谭 
 	I_EXPLORATION_GOTO_HEIAN_KITAN = RuleImage(roi_front=(739,643,52,44), roi_back=(35,615,1097,102), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_heian_kitan.png")
 	# 探索前往六道之门 
-	I_EXPLORATION_GOTO_SIX_GATES = RuleImage(roi_front=(928,638,54,46), roi_back=(46,618,1090,100), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_six_gates.png")
+	I_EXPLORATION_GOTO_SIX_GATES = RuleImage(roi_front=(529,679,93,30), roi_back=(46,618,1090,100), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_six_gates.png")
 	# 探索前往契灵之境 
 	I_EXPLORATION_GOTO_BONDLING_FAIRYLAND = RuleImage(roi_front=(1032,634,46,50), roi_back=(41,619,1104,96), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_bondling_fairyland.png")
 	# description 
@@ -89,7 +89,7 @@ class GameUiAssets:
 	# description 
 	I_CHECK_HEIAN_KITAN = RuleImage(roi_front=(27,48,47,39), roi_back=(27,48,47,39), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_heian_kitan.png")
 	# description 
-	I_CHECK_SIX_GATES = RuleImage(roi_front=(1174,621,55,44), roi_back=(1174,621,55,44), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_six_gates.png")
+	I_CHECK_SIX_GATES = RuleImage(roi_front=(249,33,22,24), roi_back=(227,7,98,85), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_six_gates.png")
 	# description 
 	I_CHECK_BONDLING_FAIRYLAND = RuleImage(roi_front=(614,660,56,49), roi_back=(614,660,56,49), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_bondling_fairyland.png")
 	# description 

BIN
tasks/GameUi/page/page_check_six_gates.png


BIN
tasks/GameUi/page/page_exploration_goto_six_gates.png


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

@@ -110,7 +110,7 @@
   {
     "itemName": "exploration_goto_six_gates",
     "imageName": "page_exploration_goto_six_gates.png",
-    "roiFront": "928,638,54,46",
+    "roiFront": "529,679,93,30",
     "roiBack": "46,618,1090,100",
     "method": "Template matching",
     "threshold": 0.65,
@@ -209,8 +209,8 @@
   {
     "itemName": "check_six_gates",
     "imageName": "page_check_six_gates.png",
-    "roiFront": "1174,621,55,44",
-    "roiBack": "1174,621,55,44",
+    "roiFront": "249,33,22,24",
+    "roiBack": "227,7,98,85",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"

+ 2 - 2
tasks/HeroTest/as/ocr.json

@@ -21,7 +21,7 @@
     "itemName": "art_war_card_plus",
     "roiFront": "916,25,90,29",
     "roiBack": "916,25,90,29",
-    "mode": "SINGLE",
+    "mode": "Digit",
     "method": "Default",
     "keyword": "",
     "description": "兵道帖机密"
@@ -35,4 +35,4 @@
     "keyword": "挑战",
     "description": "挑战按钮"
   }
-]
+]

+ 1 - 2
tasks/HeroTest/assets.py

@@ -107,8 +107,7 @@ class HeroTestAssets:
 	# 兵藏秘境兵道帖 
 	O_ART_WAR_CARD = RuleOcr(roi=(712,21,98,36), area=(712,21,98,36), mode="DigitCounter", method="Default", keyword="", name="art_war_card")
 	# 兵道帖机密 
-	O_ART_WAR_CARD_PLUS = RuleOcr(roi=(916,25,90,29), area=(916,25,90,29), mode="SINGLE", method="Default", keyword="", name="art_war_card_plus")
+	O_ART_WAR_CARD_PLUS = RuleOcr(roi=(916,25,90,29), area=(916,25,90,29), mode="Digit", method="Default", keyword="", name="art_war_card_plus")
 	# 挑战按钮 
 	O_FIRE = RuleOcr(roi=(1130,585,92,55), area=(1126,576,100,99), mode="Single", method="Default", keyword="挑战", name="fire")
 
-

+ 0 - 1
tasks/HeroTest/script_task.py

@@ -209,7 +209,6 @@ class ScriptTask(GameUi, GeneralBattle, HeroTestAssets, SwitchSoul):
             logger.info("Art war card is enough")
             return True
         cu = self.O_ART_WAR_CARD_PLUS.ocr(image=self.device.image)
-        cu = 0 if cu == '' else int(cu)
         if cu >= 1:
             logger.info("Art war card is not enough, but plus card is enough")
             return True

+ 1 - 1
tasks/Hunt/assets.py

@@ -37,7 +37,7 @@ class HuntAssets:
 	# 点击阴界之门 
 	I_NW = RuleImage(roi_front=(1060,602,100,100), roi_back=(1060,602,100,100), threshold=0.8, method="Template matching", file="./tasks/Hunt/netherworld/netherworld_nw.png")
 	# 点击挑战 
-	I_NW_CHALLAGE = RuleImage(roi_front=(306,590,171,63), roi_back=(306,590,171,63), threshold=0.8, method="Template matching", file="./tasks/Hunt/netherworld/netherworld_nw_challage.png")
+	I_NW_CHALLAGE = RuleImage(roi_front=(306,590,171,63), roi_back=(306,590,171,63), threshold=0.7, method="Template matching", file="./tasks/Hunt/netherworld/netherworld_nw_challage.png")
 	# 今日已挑战 
 	I_NW_DONE = RuleImage(roi_front=(308,600,156,41), roi_back=(308,600,156,41), threshold=0.9, method="Template matching", file="./tasks/Hunt/netherworld/netherworld_nw_done.png")
 

+ 1 - 1
tasks/Hunt/netherworld/image.json

@@ -14,7 +14,7 @@
     "roiFront": "306,590,171,63",
     "roiBack": "306,590,171,63",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.7,
     "description": "点击挑战"
   },
   {

+ 1 - 1
tasks/Restart/login.py

@@ -350,4 +350,4 @@ class LoginHandler(BaseTask, RestartAssets, GameUiAssets):
             if self.appear_then_click(self.I_COMPLETE_TASKS, interval=2.3):
                 count_success += 1
                 continue
-        return True
+        return True

+ 7 - 6
tasks/TrueOrochi/script_task.py

@@ -181,26 +181,27 @@ class ScriptTask(OrochiScriptTask, TrueOrochiAssets):
     def check_times(self, battle: bool):
         """
         后续的次数和时间设置
-        :param battle:
+        :param battle: 本次是否挑战了真蛇
         :param current_success: 这周的成功次数
         :return:
         """
         now = datetime.now()
         now_year, now_week_number, now_weekday = now.isocalendar()
         if battle:
+            # 只有真正打过才加一次数
+            logger.info('Add current_success by 1')
+            self.config.true_orochi.true_orochi_config.current_success += 1
+            self.config.true_orochi.true_orochi_config.current_success = min(2, self.config.true_orochi.true_orochi_config.current_success)
             next_run = now + self.config.true_orochi.scheduler.success_interval
         else:
+            logger.info('Battle skipped or not found True Orochi')
             next_run = now + self.config.true_orochi.scheduler.failure_interval
         next_run_year, next_run_week_number, next_run_weekday = next_run.isocalendar()
         # 如果下次运行的时间是下一周,那么就重置成功次数
         if now_week_number != next_run_week_number:
             logger.info('Reset current_success')
             self.config.true_orochi.true_orochi_config.current_success = 0
-        else:
-            # 如果不是下一周,那么就加一
-            logger.info('Add current_success by 1')
-            self.config.true_orochi.true_orochi_config.current_success += 1
-            self.config.true_orochi.true_orochi_config.current_success = min(2, self.config.true_orochi.true_orochi_config.current_success)
+
         self.config.save()
         self.set_next_run(task='TrueOrochi', target=next_run)
         # self.set_next_run('TrueOrochi', finish=True, success=True)