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

+ 4 - 1
module/ocr/sub_ocr.py

@@ -133,7 +133,10 @@ class DigitCounter(Single):
         if result:
             result = [int(s) for s in result.groups()]
             current, total = int(result[0]), int(result[1])
-            current = min(current, total)
+            # 不知道为什么加了这一句,妈的
+            # current = min(current, total)
+            if current > total:
+                logger.warning(f'[{cls.name}]: Current {current} is greater than total {total}')
             return current, total - current, total
         else:
             logger.warning(f'Unexpected ocr result: {result}')

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

@@ -1,8 +1,8 @@
 [
   {
     "itemName": "remain_ap",
-    "roiFront": "1113,671,97,30",
-    "roiBack": "1113,671,97,30",
+    "roiFront": "1120,671,90,30",
+    "roiBack": "1120,671,90,30",
     "mode": "DigitCounter",
     "method": "Default",
     "keyword": "",

+ 5 - 1
tasks/ActivityShikigami/script_task.py

@@ -144,8 +144,12 @@ class ScriptTask(BaseActivity, ActivityShikigamiAssets):
         elif current_ap == ApMode.AP_GAME:
             cu, res, total = self.O_REMAIN_AP.ocr(image=self.device.image)
             if cu == total and cu + res == total:
-                logger.warning("Game ap not enough")
+                if cu > total:
+                    logger.warning(f'Game ap {cu} more than total {total}')
+                    return True
+                logger.warning(f'Game ap not enough: {cu}')
                 return False
+
             return True
 
     def switch(self, current_ap: ApMode) -> None:

+ 1 - 1
tasks/GlobalGame/config_emergency.py

@@ -23,7 +23,7 @@ class WhenNetworkError(str, Enum):
 # 也可以是左边的邀请什么的
 class Emergency(BaseModel):
     friend_invitation: FriendInvitation = Field(default=FriendInvitation.ACCEPT,description='friend_invitation_help')
-    invitation_detect_interval: int = Field(default=10, description='invitation_detect_interval_help')
+    invitation_detect_interval: int = Field(default=5, description='invitation_detect_interval_help')
     when_network_abnormal: WhenNetworkAbnormal = Field(default=WhenNetworkAbnormal.WAIT_10S, description='when_network_abnormal_help')
     when_network_error: WhenNetworkError = Field(default=WhenNetworkError.RESTART, description='when_network_error_help')
     home_client_clear: bool = Field(default=True, description='home_client_clear_help')