mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-17 13:25:26 +08:00
Fix: Add minimal delay to ADB click
This commit is contained in:
@@ -3,6 +3,7 @@ from functools import wraps
|
|||||||
|
|
||||||
import cv2
|
import cv2
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import time
|
||||||
from adbutils.errors import AdbError
|
from adbutils.errors import AdbError
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
|
||||||
@@ -175,7 +176,10 @@ class Adb(Connection):
|
|||||||
|
|
||||||
@retry
|
@retry
|
||||||
def click_adb(self, x, y):
|
def click_adb(self, x, y):
|
||||||
|
start = time.time()
|
||||||
self.adb_shell(['input', 'tap', x, y])
|
self.adb_shell(['input', 'tap', x, y])
|
||||||
|
if time.time() - start <= 0.05:
|
||||||
|
self.sleep(0.05)
|
||||||
|
|
||||||
@retry
|
@retry
|
||||||
def swipe_adb(self, p1, p2, duration=0.1):
|
def swipe_adb(self, p1, p2, duration=0.1):
|
||||||
|
|||||||
Reference in New Issue
Block a user