mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2025-12-16 19:55:12 +00:00
fix(cafe): update latest Cafe No.2 switch for jp
This commit is contained in:
parent
e7ecf0e94f
commit
51c7a5fed2
@ -147,26 +147,42 @@ class Cafe(CafeUI):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if self.is_second_cafe_on and not is_second and status == CafeStatus.FINISHED:
|
if self.is_second_cafe_on and not is_second and status == CafeStatus.FINISHED:
|
||||||
if not SWITCH_CAFE.appear(main=self):
|
# handle new jp ui
|
||||||
logger.warning('Cafe switch not found')
|
if self.config.Emulator_GameLanguage == 'jp':
|
||||||
continue
|
if not SWITCH_CAFE_SELECT.appear(main=self):
|
||||||
if SWITCH_CAFE.get(main=self) == 'off':
|
logger.info('Cafe switch not found')
|
||||||
SWITCH_CAFE.set('on', main=self)
|
continue
|
||||||
logger.info('Switching to second cafe')
|
match SWITCH_CAFE_SELECT.get(main=self):
|
||||||
if not SWITCH_CAFE_SELECT.appear(main=self):
|
case '1':
|
||||||
logger.info('Cafe switch select not found')
|
if self.click_with_interval(CAFE_FIRST):
|
||||||
continue
|
continue
|
||||||
match (SWITCH_CAFE_SELECT.get(main=self)):
|
case '2':
|
||||||
case '1':
|
logger.info('Cafe second arrived')
|
||||||
if self.click_with_interval(CAFE_SECOND):
|
status = CafeStatus.STUDENT_LIST
|
||||||
continue
|
is_list = False
|
||||||
case '2':
|
is_second = True
|
||||||
logger.info('Cafe second arrived')
|
self.check = 0
|
||||||
SWITCH_CAFE.set('off', main=self)
|
else:
|
||||||
status = CafeStatus.STUDENT_LIST
|
if not SWITCH_CAFE.appear(main=self):
|
||||||
is_list = False
|
logger.warning('Cafe switch not found')
|
||||||
is_second = True
|
continue
|
||||||
self.check = 0
|
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():
|
if action_timer.reached_and_reset():
|
||||||
logger.attr('Status', status)
|
logger.attr('Status', status)
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import numpy as np
|
|||||||
|
|
||||||
from module.base.base import ModuleBase
|
from module.base.base import ModuleBase
|
||||||
from module.base.timer import Timer
|
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.config.utils import get_server_next_update
|
||||||
from module.logger import logger
|
from module.logger import logger
|
||||||
from module.ocr.ocr import Ocr
|
from module.ocr.ocr import Ocr
|
||||||
@ -223,7 +223,7 @@ def handle_invitation_status(status: InvitationStatus, main: ModuleBase) -> Invi
|
|||||||
if not invitation.is_invitation:
|
if not invitation.is_invitation:
|
||||||
logger.info('Invitation waiting until next refresh')
|
logger.info('Invitation waiting until next refresh')
|
||||||
return InvitationStatus.FINISHED
|
return InvitationStatus.FINISHED
|
||||||
if main.appear(CAFE_INVITED):
|
if main.match_color(CAFE_INVITED):
|
||||||
logger.info('Invitation in cooldown')
|
logger.info('Invitation in cooldown')
|
||||||
return InvitationStatus.FINISHED
|
return InvitationStatus.FINISHED
|
||||||
if invitation.choice != 'list_top' and invitation.target_name is None:
|
if invitation.choice != 'list_top' and invitation.target_name is None:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user