From 6d942764fd5161e4ccdc682f7b29df0cd1c4d077 Mon Sep 17 00:00:00 2001 From: LmeSzinc Date: Fri, 8 May 2020 19:07:06 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20=E4=BF=AE=E5=A4=8D=E6=8D=A2=E8=A3=85?= =?UTF-8?q?=E5=A4=87=E6=BB=91=E5=8A=A8=E5=8D=A1=E4=BD=8F=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/equipment/equipment.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/module/equipment/equipment.py b/module/equipment/equipment.py index 21737027b..6e1236081 100644 --- a/module/equipment/equipment.py +++ b/module/equipment/equipment.py @@ -13,12 +13,14 @@ class Equipment(InfoBarHandler, PopupHandler): equipment_has_take_on = False def _view_swipe(self, distance): + swipe_timer = Timer(3, count=3) while 1: SWIPE_CHECK.load_color(self.device.image) - self.device.swipe(vector=(distance, 0), box=SWIPE_AREA.area, random_range=SWIPE_RANDOM_RANGE, - padding=0, duration=(0.1, 0.12)) + if not swipe_timer.started() or swipe_timer.reached(): + swipe_timer.reset() + self.device.swipe(vector=(distance, 0), box=SWIPE_AREA.area, random_range=SWIPE_RANDOM_RANGE, + padding=0, duration=(0.1, 0.12)) - self.device.sleep(0.3) self.device.screenshot() if SWIPE_CHECK.match(self.device.image): continue