Skip to content

Commit

Permalink
702 防止重复截图
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawnsdaddy committed Oct 17, 2024
1 parent 8c401f3 commit 3c970a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 6 additions & 3 deletions arknights_mower/solvers/base_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ def plan_run_order(self, room):
in_out_plan[room][idx] = x.replacement[0]
self.tasks.append(
SchedulerTask(
time=self.get_run_roder_time(room),
time=self.get_run_order_time(room),
task_plan=in_out_plan,
task_type=TaskTypes.RUN_ORDER,
meta_data=room,
Expand Down Expand Up @@ -1711,7 +1711,7 @@ def check_fia(self):
].replacement, self.op_data.operators["菲亚梅塔"].room
return None, None

def get_run_roder_time(self, room):
def get_run_order_time(self, room):
logger.info("基建:读取插拔时间")
# 点击进入该房间
self.enter_room(room)
Expand Down Expand Up @@ -3112,10 +3112,13 @@ def agent_arrange(self, plan: tp.BasePlan, get_time=False):
self.sleep(0.5)
wait += 1
# 接受当前订单
not_take = True
while (
self.find("order_ready", scope=((450, 675), (600, 750))) is not None
):
self.recog.save_screencap("run_order")
if not_take:
self.recog.save_screencap("run_order")
not_take = False
self.tap((self.recog.w * 0.25, self.recog.h * 0.25), interval=0.5)
if self.drone_room is None or (
self.drone_room == room and room in self.op_data.run_order_rooms
Expand Down
2 changes: 0 additions & 2 deletions arknights_mower/utils/recognize.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from arknights_mower.utils import config
from arknights_mower.utils import typealias as tp
from arknights_mower.utils.csleep import MowerExit
from arknights_mower.utils.deprecated import deprecated
from arknights_mower.utils.device.device import Device
from arknights_mower.utils.image import bytes2img, cmatch, cropimg, loadres, thres2
from arknights_mower.utils.log import logger, save_screenshot
Expand Down Expand Up @@ -95,7 +94,6 @@ def color(self, x: int, y: int) -> tp.Pixel:
"""get the color of the pixel"""
return self.img[y][x]

@deprecated
def save_screencap(self, folder):
# del folder # 兼容2024.05旧版接口
save_screenshot(self.screencap, folder)
Expand Down

0 comments on commit 3c970a8

Please sign in to comment.