1
0
mirror of https://github.com/TheFunny/ArisuAutoSweeper synced 2025-12-16 22:05:12 +00:00

Compare commits

...

3 Commits

10 changed files with 62 additions and 46 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -27,10 +27,10 @@ CAFE_FIRST = ButtonWrapper(
name='CAFE_FIRST',
jp=Button(
file='./assets/jp/cafe/CAFE_FIRST.png',
area=(82, 152, 136, 175),
search=(62, 132, 156, 195),
color=(111, 127, 147),
button=(82, 152, 136, 175),
area=(96, 92, 111, 110),
search=(76, 72, 131, 130),
color=(185, 192, 200),
button=(96, 92, 111, 110),
),
en=Button(
file='./assets/en/cafe/CAFE_FIRST.png',
@ -44,10 +44,10 @@ CAFE_INVITE = ButtonWrapper(
name='CAFE_INVITE',
jp=Button(
file='./assets/jp/cafe/CAFE_INVITE.png',
area=(816, 635, 845, 655),
search=(796, 615, 865, 675),
color=(173, 182, 192),
button=(816, 635, 845, 655),
area=(870, 637, 903, 663),
search=(850, 617, 923, 683),
color=(253, 217, 235),
button=(870, 637, 903, 663),
),
en=Button(
file='./assets/en/cafe/CAFE_INVITE.png',
@ -61,10 +61,10 @@ CAFE_INVITED = ButtonWrapper(
name='CAFE_INVITED',
jp=Button(
file='./assets/jp/cafe/CAFE_INVITED.png',
area=(815, 633, 847, 657),
search=(795, 613, 867, 677),
color=(144, 144, 146),
button=(815, 633, 847, 657),
area=(870, 637, 903, 663),
search=(850, 617, 923, 683),
color=(111, 109, 109),
button=(870, 637, 903, 663),
),
en=Button(
file='./assets/en/cafe/CAFE_INVITED.png',
@ -78,10 +78,10 @@ CAFE_SECOND = ButtonWrapper(
name='CAFE_SECOND',
jp=Button(
file='./assets/jp/cafe/CAFE_SECOND.png',
area=(219, 152, 279, 175),
search=(199, 132, 299, 195),
color=(110, 126, 146),
button=(219, 152, 279, 175),
area=(99, 92, 108, 110),
search=(79, 72, 128, 130),
color=(193, 200, 209),
button=(99, 92, 108, 110),
),
en=Button(
file='./assets/en/cafe/CAFE_SECOND.png',
@ -146,10 +146,10 @@ CHECK_REWARD = ButtonWrapper(
name='CHECK_REWARD',
jp=Button(
file='./assets/jp/cafe/CHECK_REWARD.png',
area=(1095, 621, 1146, 637),
search=(1075, 601, 1166, 657),
color=(82, 105, 129),
button=(1086, 607, 1225, 685),
area=(1120, 635, 1166, 651),
search=(1100, 615, 1186, 671),
color=(79, 102, 127),
button=(1109, 627, 1239, 691),
),
en=Button(
file='./assets/en/cafe/CHECK_REWARD.png',
@ -377,10 +377,10 @@ OCR_CAFE = ButtonWrapper(
name='OCR_CAFE',
jp=Button(
file='./assets/jp/cafe/OCR_CAFE.png',
area=(1103, 642, 1202, 672),
search=(1083, 622, 1222, 692),
color=(87, 107, 129),
button=(1103, 642, 1202, 672),
area=(1127, 657, 1219, 682),
search=(1107, 637, 1239, 702),
color=(93, 112, 134),
button=(1127, 657, 1219, 682),
),
en=Button(
file='./assets/en/cafe/OCR_CAFE.png',

View File

@ -147,26 +147,42 @@ class Cafe(CafeUI):
continue
if self.is_second_cafe_on and not is_second and status == CafeStatus.FINISHED:
if not SWITCH_CAFE.appear(main=self):
logger.warning('Cafe switch not found')
continue
if SWITCH_CAFE.get(main=self) == 'off':
SWITCH_CAFE.set('on', main=self)
logger.info('Switching to second cafe')
if not SWITCH_CAFE_SELECT.appear(main=self):
logger.info('Cafe switch select not found')
continue
match (SWITCH_CAFE_SELECT.get(main=self)):
case '1':
if self.click_with_interval(CAFE_SECOND):
continue
case '2':
logger.info('Cafe second arrived')
SWITCH_CAFE.set('off', main=self)
status = CafeStatus.STUDENT_LIST
is_list = False
is_second = True
self.check = 0
# handle new jp ui
if self.config.Emulator_GameLanguage == 'jp':
if not SWITCH_CAFE_SELECT.appear(main=self):
logger.info('Cafe switch not found')
continue
match SWITCH_CAFE_SELECT.get(main=self):
case '1':
if self.click_with_interval(CAFE_FIRST):
continue
case '2':
logger.info('Cafe second arrived')
status = CafeStatus.STUDENT_LIST
is_list = False
is_second = True
self.check = 0
else:
if not SWITCH_CAFE.appear(main=self):
logger.warning('Cafe switch not found')
continue
if SWITCH_CAFE.get(main=self) == 'off':
SWITCH_CAFE.set('on', main=self)
logger.info('Switching to second cafe')
if not SWITCH_CAFE_SELECT.appear(main=self):
logger.info('Cafe switch select not found')
continue
match SWITCH_CAFE_SELECT.get(main=self):
case '1':
if self.click_with_interval(CAFE_SECOND):
continue
case '2':
logger.info('Cafe second arrived')
SWITCH_CAFE.set('off', main=self)
status = CafeStatus.STUDENT_LIST
is_list = False
is_second = True
self.check = 0
if action_timer.reached_and_reset():
logger.attr('Status', status)

View File

@ -6,7 +6,7 @@ import numpy as np
from module.base.base import ModuleBase
from module.base.timer import Timer
from module.base.utils import area_size, area_offset
from module.base.utils import area_offset, area_size
from module.config.utils import get_server_next_update
from module.logger import logger
from module.ocr.ocr import Ocr
@ -223,7 +223,7 @@ def handle_invitation_status(status: InvitationStatus, main: ModuleBase) -> Invi
if not invitation.is_invitation:
logger.info('Invitation waiting until next refresh')
return InvitationStatus.FINISHED
if main.appear(CAFE_INVITED):
if main.match_color(CAFE_INVITED):
logger.info('Invitation in cooldown')
return InvitationStatus.FINISHED
if invitation.choice != 'list_top' and invitation.target_name is None: