Compare commits
3 Commits
2adf3f9efe
...
9a500b9191
| Author | SHA1 | Date | |
|---|---|---|---|
| 9a500b9191 | |||
| 180fa6aa7d | |||
| 4325118562 |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 6.7 KiB |
@ -27,10 +27,10 @@ CAFE_FIRST = ButtonWrapper(
|
|||||||
name='CAFE_FIRST',
|
name='CAFE_FIRST',
|
||||||
jp=Button(
|
jp=Button(
|
||||||
file='./assets/jp/cafe/CAFE_FIRST.png',
|
file='./assets/jp/cafe/CAFE_FIRST.png',
|
||||||
area=(82, 152, 136, 175),
|
area=(96, 92, 111, 110),
|
||||||
search=(62, 132, 156, 195),
|
search=(76, 72, 131, 130),
|
||||||
color=(111, 127, 147),
|
color=(185, 192, 200),
|
||||||
button=(82, 152, 136, 175),
|
button=(96, 92, 111, 110),
|
||||||
),
|
),
|
||||||
en=Button(
|
en=Button(
|
||||||
file='./assets/en/cafe/CAFE_FIRST.png',
|
file='./assets/en/cafe/CAFE_FIRST.png',
|
||||||
@ -51,10 +51,10 @@ CAFE_INVITE = ButtonWrapper(
|
|||||||
name='CAFE_INVITE',
|
name='CAFE_INVITE',
|
||||||
jp=Button(
|
jp=Button(
|
||||||
file='./assets/jp/cafe/CAFE_INVITE.png',
|
file='./assets/jp/cafe/CAFE_INVITE.png',
|
||||||
area=(816, 635, 845, 655),
|
area=(870, 637, 903, 663),
|
||||||
search=(796, 615, 865, 675),
|
search=(850, 617, 923, 683),
|
||||||
color=(173, 182, 192),
|
color=(253, 217, 235),
|
||||||
button=(816, 635, 845, 655),
|
button=(870, 637, 903, 663),
|
||||||
),
|
),
|
||||||
en=Button(
|
en=Button(
|
||||||
file='./assets/en/cafe/CAFE_INVITE.png',
|
file='./assets/en/cafe/CAFE_INVITE.png',
|
||||||
@ -75,10 +75,10 @@ CAFE_INVITED = ButtonWrapper(
|
|||||||
name='CAFE_INVITED',
|
name='CAFE_INVITED',
|
||||||
jp=Button(
|
jp=Button(
|
||||||
file='./assets/jp/cafe/CAFE_INVITED.png',
|
file='./assets/jp/cafe/CAFE_INVITED.png',
|
||||||
area=(815, 633, 847, 657),
|
area=(870, 637, 903, 663),
|
||||||
search=(795, 613, 867, 677),
|
search=(850, 617, 923, 683),
|
||||||
color=(144, 144, 146),
|
color=(111, 109, 109),
|
||||||
button=(815, 633, 847, 657),
|
button=(870, 637, 903, 663),
|
||||||
),
|
),
|
||||||
en=Button(
|
en=Button(
|
||||||
file='./assets/en/cafe/CAFE_INVITED.png',
|
file='./assets/en/cafe/CAFE_INVITED.png',
|
||||||
@ -99,10 +99,10 @@ CAFE_SECOND = ButtonWrapper(
|
|||||||
name='CAFE_SECOND',
|
name='CAFE_SECOND',
|
||||||
jp=Button(
|
jp=Button(
|
||||||
file='./assets/jp/cafe/CAFE_SECOND.png',
|
file='./assets/jp/cafe/CAFE_SECOND.png',
|
||||||
area=(219, 152, 279, 175),
|
area=(99, 92, 108, 110),
|
||||||
search=(199, 132, 299, 195),
|
search=(79, 72, 128, 130),
|
||||||
color=(110, 126, 146),
|
color=(193, 200, 209),
|
||||||
button=(219, 152, 279, 175),
|
button=(99, 92, 108, 110),
|
||||||
),
|
),
|
||||||
en=Button(
|
en=Button(
|
||||||
file='./assets/en/cafe/CAFE_SECOND.png',
|
file='./assets/en/cafe/CAFE_SECOND.png',
|
||||||
@ -195,10 +195,10 @@ CHECK_REWARD = ButtonWrapper(
|
|||||||
name='CHECK_REWARD',
|
name='CHECK_REWARD',
|
||||||
jp=Button(
|
jp=Button(
|
||||||
file='./assets/jp/cafe/CHECK_REWARD.png',
|
file='./assets/jp/cafe/CHECK_REWARD.png',
|
||||||
area=(1095, 621, 1146, 637),
|
area=(1120, 635, 1166, 651),
|
||||||
search=(1075, 601, 1166, 657),
|
search=(1100, 615, 1186, 671),
|
||||||
color=(82, 105, 129),
|
color=(79, 102, 127),
|
||||||
button=(1086, 607, 1225, 685),
|
button=(1109, 627, 1239, 691),
|
||||||
),
|
),
|
||||||
en=Button(
|
en=Button(
|
||||||
file='./assets/en/cafe/CHECK_REWARD.png',
|
file='./assets/en/cafe/CHECK_REWARD.png',
|
||||||
@ -517,10 +517,10 @@ OCR_CAFE = ButtonWrapper(
|
|||||||
name='OCR_CAFE',
|
name='OCR_CAFE',
|
||||||
jp=Button(
|
jp=Button(
|
||||||
file='./assets/jp/cafe/OCR_CAFE.png',
|
file='./assets/jp/cafe/OCR_CAFE.png',
|
||||||
area=(1103, 642, 1202, 672),
|
area=(1127, 657, 1219, 682),
|
||||||
search=(1083, 622, 1222, 692),
|
search=(1107, 637, 1239, 702),
|
||||||
color=(87, 107, 129),
|
color=(93, 112, 134),
|
||||||
button=(1103, 642, 1202, 672),
|
button=(1127, 657, 1219, 682),
|
||||||
),
|
),
|
||||||
en=Button(
|
en=Button(
|
||||||
file='./assets/en/cafe/OCR_CAFE.png',
|
file='./assets/en/cafe/OCR_CAFE.png',
|
||||||
|
|||||||
@ -150,26 +150,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:
|
||||||
|
|||||||