mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-12-12 07:29:03 +00:00
Upd: Support reward assets
This commit is contained in:
parent
5ce334ca8c
commit
a271bf6ba5
Binary file not shown.
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
BIN
assets/share/freebies/support_reward/REWARD_POPUP.png
Normal file
BIN
assets/share/freebies/support_reward/REWARD_POPUP.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.6 KiB |
@ -7,20 +7,20 @@ CAN_GET_REWARD = ButtonWrapper(
|
|||||||
name='CAN_GET_REWARD',
|
name='CAN_GET_REWARD',
|
||||||
share=Button(
|
share=Button(
|
||||||
file='./assets/share/freebies/support_reward/CAN_GET_REWARD.png',
|
file='./assets/share/freebies/support_reward/CAN_GET_REWARD.png',
|
||||||
area=(1066, 121, 1097, 144),
|
area=(1092, 181, 1123, 204),
|
||||||
search=(1046, 101, 1117, 164),
|
search=(1072, 161, 1143, 224),
|
||||||
color=(245, 225, 170),
|
color=(246, 227, 173),
|
||||||
button=(1066, 121, 1097, 144),
|
button=(1092, 181, 1123, 204),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
IN_PROFILE = ButtonWrapper(
|
IN_PROFILE = ButtonWrapper(
|
||||||
name='IN_PROFILE',
|
name='IN_PROFILE',
|
||||||
share=Button(
|
share=Button(
|
||||||
file='./assets/share/freebies/support_reward/IN_PROFILE.png',
|
file='./assets/share/freebies/support_reward/IN_PROFILE.png',
|
||||||
area=(647, 128, 673, 146),
|
area=(640, 155, 666, 173),
|
||||||
search=(627, 108, 693, 166),
|
search=(620, 135, 686, 193),
|
||||||
color=(109, 97, 83),
|
color=(109, 97, 83),
|
||||||
button=(647, 128, 673, 146),
|
button=(640, 155, 666, 173),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
MENU_TO_PROFILE = ButtonWrapper(
|
MENU_TO_PROFILE = ButtonWrapper(
|
||||||
@ -50,3 +50,13 @@ PROFILE = ButtonWrapper(
|
|||||||
button=(907, 102, 1092, 132),
|
button=(907, 102, 1092, 132),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
REWARD_POPUP = ButtonWrapper(
|
||||||
|
name='REWARD_POPUP',
|
||||||
|
share=Button(
|
||||||
|
file='./assets/share/freebies/support_reward/REWARD_POPUP.png',
|
||||||
|
area=(883, 552, 914, 580),
|
||||||
|
search=(863, 532, 934, 600),
|
||||||
|
color=(88, 89, 114),
|
||||||
|
button=(883, 552, 914, 580),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
from module.base.timer import Timer
|
from module.base.timer import Timer
|
||||||
from module.logger import logger
|
from module.logger import logger
|
||||||
from tasks.base.assets.assets_base_page import MENU_CHECK
|
from tasks.base.assets.assets_base_page import CLOSE, MENU_CHECK
|
||||||
from tasks.base.page import page_menu
|
from tasks.base.page import page_menu
|
||||||
from tasks.base.ui import UI
|
from tasks.base.ui import UI
|
||||||
from tasks.freebies.assets.assets_freebies_support_reward import (
|
from tasks.freebies.assets.assets_freebies_support_reward import (
|
||||||
CAN_GET_REWARD,
|
CAN_GET_REWARD,
|
||||||
IN_PROFILE,
|
IN_PROFILE,
|
||||||
MENU_TO_PROFILE,
|
MENU_TO_PROFILE,
|
||||||
PROFILE
|
PROFILE,
|
||||||
|
REWARD_POPUP,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -70,6 +71,9 @@ class SupportReward(UI):
|
|||||||
if self.reward_appear():
|
if self.reward_appear():
|
||||||
logger.info('Got reward')
|
logger.info('Got reward')
|
||||||
break
|
break
|
||||||
|
if self.appear(REWARD_POPUP):
|
||||||
|
logger.info('Got reward popup')
|
||||||
|
break
|
||||||
if timeout.reached():
|
if timeout.reached():
|
||||||
logger.warning('Get support reward timeout')
|
logger.warning('Get support reward timeout')
|
||||||
break
|
break
|
||||||
@ -96,10 +100,14 @@ class SupportReward(UI):
|
|||||||
if self.appear(MENU_CHECK):
|
if self.appear(MENU_CHECK):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
if self.appear_then_click(REWARD_POPUP, interval=2):
|
||||||
|
logger.info(f'{REWARD_POPUP} - {CLOSE}')
|
||||||
|
self.device.click(CLOSE)
|
||||||
|
continue
|
||||||
if self.handle_ui_close(IN_PROFILE, interval=2):
|
if self.handle_ui_close(IN_PROFILE, interval=2):
|
||||||
continue
|
continue
|
||||||
if self.handle_reward(click_button=CAN_GET_REWARD):
|
if self.handle_reward(click_button=CAN_GET_REWARD):
|
||||||
# # Avoid clicking on some other buttons
|
# Avoid clicking on some other buttons
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user