1
0
mirror of https://github.com/TheFunny/ArisuAutoSweeper synced 2026-06-29 15:04:56 +00:00

3 Commits

6 changed files with 32 additions and 3 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

+1 -1
View File
@@ -172,7 +172,7 @@ class Control(Hermit, Minitouch, Scrcpy, MaaTouch):
self.click(ClickButton(button=area_offset(point_random, p2), name=name))
# just used in cafe
def pinch(self, box=(33, 130, 1247, 569), name='PINCH'):
def pinch(self, box=(35, 130, 1250, 560), name='PINCH'):
self.handle_control_check(name)
middle_point = (box[0] + box[2]) // 2, (box[1] + box[3]) // 2
width = box[2] - middle_point[0]
+20
View File
@@ -103,6 +103,26 @@ GOT_REWARD = ButtonWrapper(
button=(561, 501, 718, 556),
),
)
INVENTORY = ButtonWrapper(
name='INVENTORY',
jp=Button(
file='./assets/jp/cafe/INVENTORY.png',
area=(553, 94, 725, 122),
search=(533, 74, 745, 142),
color=(198, 205, 213),
button=(1130, 94, 1156, 120),
),
)
MOMOTALK_CLOSE = ButtonWrapper(
name='MOMOTALK_CLOSE',
jp=Button(
file='./assets/jp/cafe/MOMOTALK_CLOSE.png',
area=(824, 82, 850, 108),
search=(804, 62, 870, 128),
color=(252, 182, 194),
button=(824, 82, 850, 108),
),
)
OCR_CAFE = ButtonWrapper(
name='OCR_CAFE',
jp=Button(
+11 -2
View File
@@ -71,7 +71,9 @@ class Cafe(UI):
return [point for point in zip(*loc[::-1])]
def _get_clickable_buttons(self, threshold=0.8, offset=(0, 0)):
image = cv2.copyMakeBorder(self.device.image, 20, 20, 10, 80, cv2.BORDER_CONSTANT, value=(0, 0, 0))
image = self.device.image
h, w = image.shape[:2]
cv2.rectangle(image, (0, 10), (w - 25, h - 10), (0, 0, 0), 50)
image = self._extract_clickable_from_image(image)
points = self._match_clickable_points(image, threshold)
points = self.merge_points(points)
@@ -120,6 +122,13 @@ class Cafe(UI):
logger.attr('Reward', num)
return num
def _cafe_additional(self) -> bool:
if self.appear_then_click(INVENTORY):
return True
if self.appear_then_click(MOMOTALK_CLOSE):
return True
return False
def _handle_cafe(self, status):
match status:
case CafeStatus.STUDENT_LIST:
@@ -206,7 +215,7 @@ class Cafe(UI):
self.device.screenshot()
if self.ui_additional():
if self.ui_additional() or self._cafe_additional():
continue
if not loading_timer.reached():