1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 12:08:21 +08:00

Refactor: module/device, separate all screenshot method and control methods

- Better screenshot and control retries, handle common exceptions
This commit is contained in:
LmeSzinc
2022-01-21 22:50:02 +08:00
parent f4d798e3d7
commit 8374174d55
22 changed files with 1056 additions and 493 deletions

View File

@@ -46,7 +46,7 @@ class GlobeCamera(GlobeOperation, ZoneManager):
vector = np.array(distance) * vector
vector = -vector
self.device.swipe(vector, name=name, box=box)
self.device.swipe_vector(vector, name=name, box=box)
self.device.sleep(0.3)
self.globe_update()

View File

@@ -67,8 +67,8 @@ class GlobeOperation(ActionPointHandler, MapEventHandler):
"""
if self.is_zone_pinned():
# A click does not disable pinned zone, a swipe does.
self.device.swipe((50, -50), box=area_pad(ZONE_PINNED.area, pad=-80), random_range=(-10, -10, 10, 10),
padding=0, name='PINNED_DISABLE')
self.device.swipe_vector((50, -50), box=area_pad(ZONE_PINNED.area, pad=-80), random_range=(-10, -10, 10, 10),
padding=0, name='PINNED_DISABLE')
return True
return False