From b8453d770e1a46227339009e858d5e34f61a14d4 Mon Sep 17 00:00:00 2001 From: DoctorReid Date: Sat, 21 Sep 2024 11:09:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E6=8B=9F=E5=AE=87=E5=AE=99=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=9B=E5=85=A5=E9=A6=96=E9=A2=86=E5=89=8D?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E4=BA=A4=E4=BA=92=E9=BB=91=E5=A1=94=E5=8D=A1?= =?UTF-8?q?=E6=AD=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../op/sim_uni_move/sim_uni_move_to_next_level_v2.py | 12 ++---------- .../op/sim_uni_move/sim_uni_move_to_next_level_v3.py | 12 ++---------- version.yml | 2 +- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/src/sr/sim_uni/op/sim_uni_move/sim_uni_move_to_next_level_v2.py b/src/sr/sim_uni/op/sim_uni_move/sim_uni_move_to_next_level_v2.py index 8dd1f494..56f71a95 100644 --- a/src/sr/sim_uni/op/sim_uni_move/sim_uni_move_to_next_level_v2.py +++ b/src/sr/sim_uni/op/sim_uni_move/sim_uni_move_to_next_level_v2.py @@ -1,19 +1,17 @@ import time -from typing import Optional, List import numpy as np from cv2.typing import MatLike +from typing import Optional, List from basic import str_utils from basic.i18_utils import gt from basic.log_utils import log from sr.const import OPPOSITE_DIRECTION from sr.context.context import Context -from sr.control import GameController from sr.image.sceenshot import screen_state from sr.operation import OperationOneRoundResult, OperationResult from sr.operation.unit.interact import get_move_interact_words -from sr.screen_area.screen_normal_world import ScreenNormalWorld from sr.sim_uni.op.move_in_sim_uni import MoveToNextLevel from sr.sim_uni.op.sim_uni_move.sim_uni_move_by_detect import delta_angle_to_detected_object, turn_by_angle_slowly from sr.sim_uni.sim_uni_const import SimUniLevelType @@ -93,13 +91,7 @@ def _move_and_interact(self) -> OperationOneRoundResult: now = time.time() # 等待最开始的交互词消失了 就可以无脑交互了 - need_ocr: bool = len(self.existed_interact_word) > 0 - log.debug('是否需要OCR %s', need_ocr) - if not need_ocr: - self.ctx.controller.interact( - pos=ScreenNormalWorld.MOVE_INTERACT_SINGLE_LINE.value.center, - interact_type=GameController.MOVE_INTERACT_TYPE - ) + need_ocr: bool = True # 现在OCR速度快 可以保持使用 screen = self.screenshot() diff --git a/src/sr/sim_uni/op/sim_uni_move/sim_uni_move_to_next_level_v3.py b/src/sr/sim_uni/op/sim_uni_move/sim_uni_move_to_next_level_v3.py index 6a155740..7d2a0e5e 100644 --- a/src/sr/sim_uni/op/sim_uni_move/sim_uni_move_to_next_level_v3.py +++ b/src/sr/sim_uni/op/sim_uni_move/sim_uni_move_to_next_level_v3.py @@ -1,8 +1,8 @@ import time -from typing import Optional, List import numpy as np from cv2.typing import MatLike +from typing import Optional, List from basic import str_utils, cal_utils from basic.i18_utils import gt @@ -14,7 +14,6 @@ from sr.image.sceenshot import screen_state, mini_map from sr.operation import OperationOneRoundResult, StateOperation, StateOperationNode, Operation from sr.operation.unit.interact import get_move_interact_words -from sr.screen_area.screen_normal_world import ScreenNormalWorld from sr.sim_uni.op.move_in_sim_uni import MoveToNextLevel from sr.sim_uni.op.sim_uni_move.sim_uni_move_by_detect import delta_angle_to_detected_object, turn_by_angle_slowly from sr.sim_uni.sim_uni_const import SimUniLevelType, SimUniLevelTypeEnum @@ -223,14 +222,7 @@ def move_and_interact(self) -> OperationOneRoundResult: now = time.time() # 出现过交互词 且消失了 就可以无脑交互了 - need_ocr: bool = not self.existed_interact_word or len(self.current_interact_word) > 0 - log.debug('是否需要OCR %s', need_ocr) - if not need_ocr: - self.ctx.controller.interact( - pos=ScreenNormalWorld.MOVE_INTERACT_SINGLE_LINE.value.center, - interact_type=GameController.MOVE_INTERACT_TYPE - ) - time.sleep(0.2) + need_ocr: bool = True # 现在OCR速度快 可以保持使用 screen = self.screenshot() diff --git a/version.yml b/version.yml index 97271973..61815057 100644 --- a/version.yml +++ b/version.yml @@ -1 +1 @@ -version: "2.5.0" \ No newline at end of file +version: "2.5.1" \ No newline at end of file