mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-31 17:00:34 +08:00
add logger
This commit is contained in:
@@ -3,6 +3,7 @@ from module.base.decorator import Config
|
|||||||
from module.base.utils import *
|
from module.base.utils import *
|
||||||
from module.equipment.assets import *
|
from module.equipment.assets import *
|
||||||
from module.equipment.equipment import Equipment
|
from module.equipment.equipment import Equipment
|
||||||
|
from module.logger import logger
|
||||||
from module.ui.scroll import Scroll
|
from module.ui.scroll import Scroll
|
||||||
|
|
||||||
EQUIP_INFO_BAR = ButtonGrid(
|
EQUIP_INFO_BAR = ButtonGrid(
|
||||||
@@ -25,6 +26,7 @@ class EquipmentChange(Equipment):
|
|||||||
Pages:
|
Pages:
|
||||||
in: ship's equipments details
|
in: ship's equipments details
|
||||||
'''
|
'''
|
||||||
|
logger.info("Get equipping list")
|
||||||
if skip_first_screenshot:
|
if skip_first_screenshot:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
@@ -34,19 +36,21 @@ class EquipmentChange(Equipment):
|
|||||||
'EQUIP_TAKE_ON_{index}'.format(index=index)]
|
'EQUIP_TAKE_ON_{index}'.format(index=index)]
|
||||||
if self.appear(enter_button, offset=(5, 5)):
|
if self.appear(enter_button, offset=(5, 5)):
|
||||||
self.equipping_list.remove(index)
|
self.equipping_list.remove(index)
|
||||||
|
logger.info(f"Equipping list: {self.equipping_list}")
|
||||||
|
|
||||||
def record_equipment(self, index_list=range(0, 5), skip_first_screenshot=True):
|
def record_equipment(self, index_list=range(0, 5), skip_first_screenshot=True):
|
||||||
'''
|
'''
|
||||||
Record equipment through upgrade page
|
Record equipment through upgrade page
|
||||||
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')
|
||||||
self.equip_side_navbar_ensure(bottom=2)
|
self.equip_side_navbar_ensure(bottom=2)
|
||||||
self.get_equiping_list()
|
self.get_equiping_list()
|
||||||
self.equip_side_navbar_ensure(bottom=1)
|
self.equip_side_navbar_ensure(bottom=1)
|
||||||
|
|
||||||
for index in index_list:
|
for index in index_list:
|
||||||
if index in self.equipping_list:
|
if index in self.equipping_list:
|
||||||
|
logger.info(f'Record {index}')
|
||||||
while 1:
|
while 1:
|
||||||
if skip_first_screenshot:
|
if skip_first_screenshot:
|
||||||
skip_first_screenshot = False
|
skip_first_screenshot = False
|
||||||
@@ -55,7 +59,6 @@ class EquipmentChange(Equipment):
|
|||||||
|
|
||||||
if self.appear(EQUIPMENT_OPEN, interval=3):
|
if self.appear(EQUIPMENT_OPEN, interval=3):
|
||||||
self.device.click(EQUIP_INFO_BAR[(index, 0)])
|
self.device.click(EQUIP_INFO_BAR[(index, 0)])
|
||||||
# time.sleep(1)
|
|
||||||
continue
|
continue
|
||||||
if self.appear_then_click(UPGRADE_ENTER, interval=3):
|
if self.appear_then_click(UPGRADE_ENTER, interval=3):
|
||||||
continue
|
continue
|
||||||
@@ -69,13 +72,14 @@ class EquipmentChange(Equipment):
|
|||||||
'''
|
'''
|
||||||
Equip the equipment previously recorded
|
Equip the equipment previously recorded
|
||||||
'''
|
'''
|
||||||
|
logger.info('Take on equipment')
|
||||||
self.equip_side_navbar_ensure(bottom=2)
|
self.equip_side_navbar_ensure(bottom=2)
|
||||||
|
|
||||||
self.ensure_no_info_bar(1)
|
self.ensure_no_info_bar(1)
|
||||||
|
|
||||||
for index in index_list:
|
for index in index_list:
|
||||||
if index in self.equipping_list:
|
if index in self.equipping_list:
|
||||||
|
logger.info(f'Take on {index}')
|
||||||
enter_button = globals()[
|
enter_button = globals()[
|
||||||
'EQUIP_TAKE_ON_{index}'.format(index=index)]
|
'EQUIP_TAKE_ON_{index}'.format(index=index)]
|
||||||
|
|
||||||
@@ -108,6 +112,7 @@ class EquipmentChange(Equipment):
|
|||||||
def _equip_equipment(self, point, offset=(100, 100), skip_first_screenshot=True):
|
def _equip_equipment(self, point, offset=(100, 100), skip_first_screenshot=True):
|
||||||
'''
|
'''
|
||||||
Equip Equipment then back to ship details
|
Equip Equipment then back to ship details
|
||||||
|
Confirm the popup
|
||||||
Pages:
|
Pages:
|
||||||
in: EQUIPMENT STATUS
|
in: EQUIPMENT STATUS
|
||||||
out: SHIP_SIDEBAR_EQUIPMENT
|
out: SHIP_SIDEBAR_EQUIPMENT
|
||||||
@@ -159,7 +164,7 @@ class EquipmentChange(Equipment):
|
|||||||
self._equip_equipment(point)
|
self._equip_equipment(point)
|
||||||
break
|
break
|
||||||
if self.appear(EQUIPMENT_SCROLL_BOTTOM):
|
if self.appear(EQUIPMENT_SCROLL_BOTTOM):
|
||||||
print(23333)
|
logger.warning('No recorded equipment was found.')
|
||||||
break
|
break
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user