mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2026-02-06 08:55:13 +00:00
Compare commits
2 Commits
54aa1bafb5
...
8d83ec1657
| Author | SHA1 | Date | |
|---|---|---|---|
| 8d83ec1657 | |||
| 7fcda15329 |
@ -48,21 +48,22 @@ class CafeUI(UI):
|
|||||||
vector_left = (-width * r, 0)
|
vector_left = (-width * r, 0)
|
||||||
vector_right = (width * r, 0)
|
vector_right = (width * r, 0)
|
||||||
random_r = (-5, -5, 5, 5)
|
random_r = (-5, -5, 5, 5)
|
||||||
|
name = 'CAFE_SWIPE'
|
||||||
match direction:
|
match direction:
|
||||||
case 'init':
|
case 'init':
|
||||||
self.device.pinch()
|
self.device.pinch()
|
||||||
self.device.swipe_vector(vector_down, box=BOX_CAFE.area, random_range=random_r, padding=5)
|
self.device.swipe_vector(vector_down, box=BOX_CAFE.area, random_range=random_r, padding=5, name=name)
|
||||||
self.device.swipe_vector(vector_right, box=BOX_CAFE.area, random_range=random_r, padding=5)
|
self.device.swipe_vector(vector_right, box=BOX_CAFE.area, random_range=random_r, padding=5, name=name)
|
||||||
self.device.swipe_vector(vector_up, box=BOX_CAFE.area, random_range=random_r, padding=5)
|
self.device.swipe_vector(vector_up, box=BOX_CAFE.area, random_range=random_r, padding=5, name=name)
|
||||||
self.device.swipe_vector(vector_up, box=BOX_CAFE.area, random_range=random_r, padding=5)
|
self.device.swipe_vector(vector_up, box=BOX_CAFE.area, random_range=random_r, padding=5, name=name)
|
||||||
case 'left':
|
case 'left':
|
||||||
self.device.swipe_vector(vector_left, box=BOX_CAFE.area, random_range=random_r, padding=5)
|
self.device.swipe_vector(vector_left, box=BOX_CAFE.area, random_range=random_r, padding=5, name=name)
|
||||||
self.device.swipe_vector(vector_left, box=BOX_CAFE.area, random_range=random_r, padding=5)
|
self.device.swipe_vector(vector_left, box=BOX_CAFE.area, random_range=random_r, padding=5, name=name)
|
||||||
case 'right':
|
case 'right':
|
||||||
self.device.swipe_vector(vector_right, box=BOX_CAFE.area, random_range=random_r, padding=5)
|
self.device.swipe_vector(vector_right, box=BOX_CAFE.area, random_range=random_r, padding=5, name=name)
|
||||||
self.device.swipe_vector(vector_right, box=BOX_CAFE.area, random_range=random_r, padding=5)
|
self.device.swipe_vector(vector_right, box=BOX_CAFE.area, random_range=random_r, padding=5, name=name)
|
||||||
# solve too much swipe causing restart
|
# solve too much swipe causing restart
|
||||||
self.device.click_record_clear()
|
self.device.click_record_remove(name)
|
||||||
|
|
||||||
def cafe_additional(self) -> bool:
|
def cafe_additional(self) -> bool:
|
||||||
if self.appear_then_click(INVENTORY):
|
if self.appear_then_click(INVENTORY):
|
||||||
|
|||||||
@ -107,7 +107,13 @@ class StageList:
|
|||||||
self.load_stage_indexes(main=main)
|
self.load_stage_indexes(main=main)
|
||||||
|
|
||||||
if self.current_index_min <= index <= self.current_index_max:
|
if self.current_index_min <= index <= self.current_index_max:
|
||||||
break
|
return True
|
||||||
|
|
||||||
|
indexes = self._indexes
|
||||||
|
if indexes and last_indexes == set(indexes):
|
||||||
|
logger.warning(f'No more index {index}')
|
||||||
|
return False
|
||||||
|
last_indexes = set(indexes)
|
||||||
|
|
||||||
if index < self.current_index_min:
|
if index < self.current_index_min:
|
||||||
self.swipe_page(self.swipe_direction, main, reverse=True)
|
self.swipe_page(self.swipe_direction, main, reverse=True)
|
||||||
@ -120,14 +126,6 @@ class StageList:
|
|||||||
timeout=Timer(1.5, 5)
|
timeout=Timer(1.5, 5)
|
||||||
)
|
)
|
||||||
|
|
||||||
indexes = self._indexes
|
|
||||||
if indexes and last_indexes == set(indexes):
|
|
||||||
logger.warning(f'No more index {index}')
|
|
||||||
return False
|
|
||||||
last_indexes = set(indexes)
|
|
||||||
|
|
||||||
return True
|
|
||||||
|
|
||||||
def select_index_enter(
|
def select_index_enter(
|
||||||
self,
|
self,
|
||||||
main: ModuleBase,
|
main: ModuleBase,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user