mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-24 10:09:04 +08:00
Refactor: Standardize the use of match_template_color()
This commit is contained in:
@@ -69,8 +69,7 @@ class MeowfficerBase(UI):
|
||||
self.device.screenshot()
|
||||
|
||||
# End
|
||||
if self.appear(MEOWFFICER_CHECK, offset=(20, 20)) \
|
||||
and MEOWFFICER_CHECK.match_appear_on(self.device.image):
|
||||
if self.match_template_color(MEOWFFICER_CHECK, offset=(20, 20)):
|
||||
break
|
||||
else:
|
||||
if click_timer.reached():
|
||||
|
||||
@@ -99,8 +99,7 @@ class MeowfficerBuy(MeowfficerBase):
|
||||
continue
|
||||
|
||||
# End
|
||||
if self.appear(MEOWFFICER_BUY_ENTER, offset=(20, 20)) \
|
||||
and MEOWFFICER_BUY_ENTER.match_appear_on(self.device.image):
|
||||
if self.match_template_color(MEOWFFICER_BUY_ENTER, offset=(20, 20)):
|
||||
break
|
||||
|
||||
def meow_buy(self) -> bool:
|
||||
|
||||
@@ -75,8 +75,7 @@ class MeowfficerCollect(MeowfficerBase):
|
||||
Returns:
|
||||
bool
|
||||
"""
|
||||
if self.appear(MEOWFFICER_GET_CHECK, offset=(40, 40)) and MEOWFFICER_GET_CHECK.match_appear_on(
|
||||
self.device.image):
|
||||
if self.match_template_color(MEOWFFICER_GET_CHECK, offset=(40, 40)):
|
||||
return True
|
||||
|
||||
if self.appear(MEOWFFICER_TRAIN_START, offset=(20, 20)):
|
||||
|
||||
Reference in New Issue
Block a user