mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2025-12-16 11:15:13 +00:00
fix(cafe): update latest Cafe No.2 switch for jp
This commit is contained in:
parent
2adf3f9efe
commit
4325118562
@ -150,26 +150,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)
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user