1
0
mirror of https://github.com/sui-feng-cb/AzurLaneAutoScript1.git synced 2026-08-15 11:43:08 +08:00

Add: hold_duration for drag method

This commit is contained in:
guoh064
2026-06-14 00:20:19 +08:00
parent e4ea103bda
commit 401d3d46e8
6 changed files with 53 additions and 12 deletions

View File

@@ -624,7 +624,7 @@ class NemuIpc(Platform):
self.nemu_ipc.up()
self.sleep(0.050)
def drag_nemu_ipc(self, p1, p2, point_random=(-10, -10, 10, 10)):
def drag_nemu_ipc(self, p1, p2, point_random=(-10, -10, 10, 10), hold_duration=0.0):
p1 = np.array(p1) - random_rectangle_point(point_random)
p2 = np.array(p2) - random_rectangle_point(point_random)
points = insert_swipe(p0=p1, p3=p2, speed=20)
@@ -638,5 +638,10 @@ class NemuIpc(Platform):
self.nemu_ipc.down(*p2)
self.sleep(0.140)
hold_duration = ensure_time(hold_duration) - 0.28
if hold_duration > 0:
self.nemu_ipc.down(*p2)
self.sleep(hold_duration)
self.nemu_ipc.up()
self.sleep(0.050)