mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-21 00:55:34 +08:00
@@ -8,7 +8,8 @@ from module.logger import logger
|
|||||||
from module.map.assets import FLEET_PREPARATION, MAP_PREPARATION
|
from module.map.assets import FLEET_PREPARATION, MAP_PREPARATION
|
||||||
from module.ocr.ocr import Digit
|
from module.ocr.ocr import Digit
|
||||||
from module.retire.dock import *
|
from module.retire.dock import *
|
||||||
from module.ui.page import page_fleet
|
from module.ui.page import page_fleet, page_main
|
||||||
|
from module.exception import CampaignEnd
|
||||||
|
|
||||||
SIM_VALUE = 0.95
|
SIM_VALUE = 0.95
|
||||||
|
|
||||||
@@ -40,7 +41,7 @@ class GemsCampaignOverride(CampaignBase):
|
|||||||
if self.appear(FLEET_PREPARATION, offset=(20, 20), interval=2) or self.appear(MAP_PREPARATION, offset=(20, 20), interval=2):
|
if self.appear(FLEET_PREPARATION, offset=(20, 20), interval=2) or self.appear(MAP_PREPARATION, offset=(20, 20), interval=2):
|
||||||
self.enter_map_cancel()
|
self.enter_map_cancel()
|
||||||
break
|
break
|
||||||
return False
|
raise CampaignEnd('Emotion withdraw')
|
||||||
else:
|
else:
|
||||||
return super().handle_combat_low_emotion()
|
return super().handle_combat_low_emotion()
|
||||||
|
|
||||||
@@ -95,6 +96,8 @@ class GemsFarming(CampaignRun, EquipmentChange):
|
|||||||
|
|
||||||
self.equipment_take_on(index_list=index_list)
|
self.equipment_take_on(index_list=index_list)
|
||||||
|
|
||||||
|
self.ui_ensure(page_main)
|
||||||
|
|
||||||
def vanguard_change(self):
|
def vanguard_change(self):
|
||||||
'''
|
'''
|
||||||
Change vanguard and vanguard's equipment
|
Change vanguard and vanguard's equipment
|
||||||
@@ -116,6 +119,7 @@ class GemsFarming(CampaignRun, EquipmentChange):
|
|||||||
self._equip_take_off_one()
|
self._equip_take_off_one()
|
||||||
|
|
||||||
self.equipment_take_on()
|
self.equipment_take_on()
|
||||||
|
self.ui_ensure(page_main)
|
||||||
|
|
||||||
def _ship_change_confirm(self, button):
|
def _ship_change_confirm(self, button):
|
||||||
|
|
||||||
@@ -160,7 +164,7 @@ class GemsFarming(CampaignRun, EquipmentChange):
|
|||||||
for button, level in zip(card_grids.buttons, list_level):
|
for button, level in zip(card_grids.buttons, list_level):
|
||||||
if level == 1 and template.match(self.device.image.crop(button.area), similarity=SIM_VALUE):
|
if level == 1 and template.match(self.device.image.crop(button.area), similarity=SIM_VALUE):
|
||||||
return button
|
return button
|
||||||
|
|
||||||
logger.info('No specific CV was found, try reversed order.')
|
logger.info('No specific CV was found, try reversed order.')
|
||||||
self.dock_sort_method_dsc_set(False)
|
self.dock_sort_method_dsc_set(False)
|
||||||
|
|
||||||
@@ -279,7 +283,7 @@ class GemsFarming(CampaignRun, EquipmentChange):
|
|||||||
|
|
||||||
while 1:
|
while 1:
|
||||||
# Backup config file
|
# Backup config file
|
||||||
# while cover ENABLE_AUTO_SEARCH
|
# will cover ENABLE_AUTO_SEARCH
|
||||||
backup = self.config.cover(
|
backup = self.config.cover(
|
||||||
STOP_IF_REACH_LV32=True,
|
STOP_IF_REACH_LV32=True,
|
||||||
FLEET_1=self.config.GEMS_FLEET_1,
|
FLEET_1=self.config.GEMS_FLEET_1,
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ EQUIP_INFO_BAR = ButtonGrid(
|
|||||||
origin=(723, 111), delta=(94, 0), button_shape=(76, 76), grid_shape=(5, 1), name="EQUIP_INFO_BAR"
|
origin=(723, 111), delta=(94, 0), button_shape=(76, 76), grid_shape=(5, 1), name="EQUIP_INFO_BAR"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
EQUIPMENT_GRID = ButtonGrid(
|
||||||
|
origin=(725, 155), delta=(95, 0), button_shape=(31, 31), grid_shape=(5, 1),
|
||||||
|
name='EQUIPMENT_GRID')
|
||||||
|
|
||||||
EQUIPMENT_SCROLL = Scroll(EQUIP_SCROLL, color=(
|
EQUIPMENT_SCROLL = Scroll(EQUIP_SCROLL, color=(
|
||||||
247, 211, 66), name='EQUIP_SCROLL')
|
247, 211, 66), name='EQUIP_SCROLL')
|
||||||
|
|
||||||
@@ -24,18 +28,20 @@ class EquipmentChange(Equipment):
|
|||||||
def get_equiping_list(self, skip_first_screenshot=True):
|
def get_equiping_list(self, skip_first_screenshot=True):
|
||||||
'''
|
'''
|
||||||
Pages:
|
Pages:
|
||||||
in: ship's equipments details
|
in: ship's details
|
||||||
'''
|
'''
|
||||||
logger.info("Get equipping list")
|
logger.info("Get equipping list")
|
||||||
if skip_first_screenshot:
|
if skip_first_screenshot:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
self.device.screenshot()
|
self.device.screenshot()
|
||||||
for index in range(0, 5):
|
index = 0
|
||||||
enter_button = globals()[
|
for button in EQUIPMENT_GRID.buttons:
|
||||||
'EQUIP_TAKE_ON_{index}'.format(index=index)]
|
crop_image = np.array(self.device.image.crop(button.area))
|
||||||
if self.appear(enter_button, offset=(5, 5)):
|
edge_value = abs(np.mean(cv2.Sobel(crop_image,3, 1, 1)))
|
||||||
|
if edge_value < 0.1:
|
||||||
self.equipping_list.remove(index)
|
self.equipping_list.remove(index)
|
||||||
|
index += 1
|
||||||
logger.info(f"Equipping list: {self.equipping_list}")
|
logger.info(f"Equipping list: {self.equipping_list}")
|
||||||
|
|
||||||
def record_equipment(self, index_list=range(0, 5)):
|
def record_equipment(self, index_list=range(0, 5)):
|
||||||
@@ -44,9 +50,8 @@ class EquipmentChange(Equipment):
|
|||||||
Notice: The equipment icons in the upgrade page are the same size as the icons in the equipment status
|
Notice: The equipment icons in the upgrade page are the same size as the icons in the equipment status
|
||||||
'''
|
'''
|
||||||
logger.info('RECORD EQUIPMENT')
|
logger.info('RECORD EQUIPMENT')
|
||||||
self.equip_side_navbar_ensure(bottom=2)
|
|
||||||
self.get_equiping_list()
|
|
||||||
self.equip_side_navbar_ensure(bottom=1)
|
self.equip_side_navbar_ensure(bottom=1)
|
||||||
|
self.get_equiping_list()
|
||||||
|
|
||||||
for index in index_list:
|
for index in index_list:
|
||||||
if index in self.equipping_list:
|
if index in self.equipping_list:
|
||||||
|
|||||||
Reference in New Issue
Block a user