mirror of
https://github.com/LmeSzinc/AzurLaneAutoScript.git
synced 2025-01-08 12:27:33 +08:00
Add: Accept port missions in overview
- Split OpsiDaily into OpsiDaily and OpsiShop - Add config redirection
This commit is contained in:
parent
61153482b3
commit
4af820841d
4
alas.py
4
alas.py
@ -219,6 +219,10 @@ class AzurLaneAutoScript:
|
||||
from module.campaign.os_run import OSCampaignRun
|
||||
OSCampaignRun(config=self.config, device=self.device).opsi_explore()
|
||||
|
||||
def opsi_shop(self):
|
||||
from module.campaign.os_run import OSCampaignRun
|
||||
OSCampaignRun(config=self.config, device=self.device).opsi_shop()
|
||||
|
||||
def opsi_daily(self):
|
||||
from module.campaign.os_run import OSCampaignRun
|
||||
OSCampaignRun(config=self.config, device=self.device).opsi_daily()
|
||||
|
BIN
assets/cn/os_handler/MISSION_OVERVIEW_ACCEPT.png
Normal file
BIN
assets/cn/os_handler/MISSION_OVERVIEW_ACCEPT.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.5 KiB |
BIN
assets/cn/os_handler/MISSION_OVERVIEW_CHECK.png
Normal file
BIN
assets/cn/os_handler/MISSION_OVERVIEW_CHECK.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.4 KiB |
BIN
assets/cn/os_handler/MISSION_OVERVIEW_ENTER.BUTTON.png
Normal file
BIN
assets/cn/os_handler/MISSION_OVERVIEW_ENTER.BUTTON.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
BIN
assets/cn/os_handler/MISSION_OVERVIEW_ENTER.png
Normal file
BIN
assets/cn/os_handler/MISSION_OVERVIEW_ENTER.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.2 KiB |
@ -1273,6 +1273,19 @@
|
||||
"Submarine": false
|
||||
}
|
||||
},
|
||||
"OpsiShop": {
|
||||
"Scheduler": {
|
||||
"Enable": false,
|
||||
"NextRun": "2020-01-01 00:00:00",
|
||||
"Command": "OpsiShop",
|
||||
"SuccessInterval": 30,
|
||||
"FailureInterval": 30,
|
||||
"ServerUpdate": "00:00"
|
||||
},
|
||||
"OpsiShop": {
|
||||
"BuySupply": true
|
||||
}
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"Scheduler": {
|
||||
"Enable": false,
|
||||
@ -1283,7 +1296,6 @@
|
||||
"ServerUpdate": "00:00"
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"BuySupply": true,
|
||||
"DoMission": true
|
||||
},
|
||||
"OpsiFleet": {
|
||||
|
@ -26,6 +26,13 @@ class OSCampaignRun(OSMapOperation):
|
||||
except ActionPointLimit:
|
||||
self.config.opsi_task_delay(ap_limit=True)
|
||||
|
||||
def opsi_shop(self):
|
||||
self.load_campaign()
|
||||
try:
|
||||
self.campaign.os_shop()
|
||||
except ActionPointLimit:
|
||||
self.config.opsi_task_delay(ap_limit=True)
|
||||
|
||||
def opsi_daily(self):
|
||||
self.load_campaign()
|
||||
try:
|
||||
|
@ -5946,6 +5946,41 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"OpsiShop": {
|
||||
"Scheduler": {
|
||||
"Enable": {
|
||||
"type": "checkbox",
|
||||
"value": false
|
||||
},
|
||||
"NextRun": {
|
||||
"type": "input",
|
||||
"value": "2020-01-01 00:00:00",
|
||||
"validate": "datetime"
|
||||
},
|
||||
"Command": {
|
||||
"type": "disable",
|
||||
"value": "OpsiShop"
|
||||
},
|
||||
"SuccessInterval": {
|
||||
"type": "disable",
|
||||
"value": 30
|
||||
},
|
||||
"FailureInterval": {
|
||||
"type": "disable",
|
||||
"value": 30
|
||||
},
|
||||
"ServerUpdate": {
|
||||
"type": "disable",
|
||||
"value": "00:00"
|
||||
}
|
||||
},
|
||||
"OpsiShop": {
|
||||
"BuySupply": {
|
||||
"type": "checkbox",
|
||||
"value": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"Scheduler": {
|
||||
"Enable": {
|
||||
@ -5975,10 +6010,6 @@
|
||||
}
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"BuySupply": {
|
||||
"type": "checkbox",
|
||||
"value": true
|
||||
},
|
||||
"DoMission": {
|
||||
"type": "checkbox",
|
||||
"value": true
|
||||
|
@ -454,8 +454,9 @@ OpsiExplore:
|
||||
SpecialRadar: false
|
||||
ForceRun: false
|
||||
LastZone: 0
|
||||
OpsiDaily:
|
||||
OpsiShop:
|
||||
BuySupply: true
|
||||
OpsiDaily:
|
||||
DoMission: true
|
||||
OpsiObscure:
|
||||
ForceRun: false
|
||||
|
@ -47,6 +47,7 @@
|
||||
"OpsiGeneral",
|
||||
"OpsiAshAssist",
|
||||
"OpsiExplore",
|
||||
"OpsiShop",
|
||||
"OpsiDaily",
|
||||
"OpsiObscure",
|
||||
"OpsiAbyssal",
|
||||
|
@ -301,6 +301,11 @@ OpsiExplore:
|
||||
SuccessInterval: 0
|
||||
FailureInterval: 0
|
||||
ServerUpdate: 00:00
|
||||
OpsiShop:
|
||||
Scheduler:
|
||||
SuccessInterval: 30
|
||||
FailureInterval: 30
|
||||
ServerUpdate: 00:00
|
||||
OpsiDaily:
|
||||
Scheduler:
|
||||
SuccessInterval: 30
|
||||
|
@ -202,6 +202,9 @@ OpsiExplore:
|
||||
- Scheduler
|
||||
- OpsiExplore
|
||||
- OpsiFleet
|
||||
OpsiShop:
|
||||
- Scheduler
|
||||
- OpsiShop
|
||||
OpsiDaily:
|
||||
- Scheduler
|
||||
- OpsiDaily
|
||||
|
@ -310,8 +310,10 @@ class GeneratedConfig:
|
||||
OpsiExplore_ForceRun = False
|
||||
OpsiExplore_LastZone = 0
|
||||
|
||||
# Group `OpsiShop`
|
||||
OpsiShop_BuySupply = True
|
||||
|
||||
# Group `OpsiDaily`
|
||||
OpsiDaily_BuySupply = True
|
||||
OpsiDaily_DoMission = True
|
||||
|
||||
# Group `OpsiObscure`
|
||||
|
@ -15,7 +15,7 @@ class ManualConfig:
|
||||
> OpsiExplore > OpsiAbyssal > OpsiStronghold > OpsiObscure
|
||||
> Exercise > Daily > Hard > OpsiAshAssist
|
||||
> Sos > EventSp > EventAb > EventCd > RaidDaily > WarArchives
|
||||
> OpsiDaily > OpsiMeowfficerFarming
|
||||
> OpsiDaily > OpsiShop > OpsiMeowfficerFarming
|
||||
> Event > Raid > Main
|
||||
> C124LargeLeveling > C122MediumLeveling > C72MysteryFarming > GemsFarming
|
||||
"""
|
||||
|
@ -341,6 +341,13 @@ class ConfigGenerator:
|
||||
|
||||
|
||||
class ConfigUpdater:
|
||||
# source, target, (optional)convert_func
|
||||
redirection = [
|
||||
('OpsiDaily.OpsiDaily.BuySupply', 'OpsiShop.Scheduler.Enable'),
|
||||
('OpsiDaily.Scheduler.Enable', 'OpsiDaily.OpsiDaily.DoMission'),
|
||||
('OpsiShop.Scheduler.Enable', 'OpsiShop.OpsiShop.BuySupply'),
|
||||
]
|
||||
|
||||
@cached_property
|
||||
def args(self):
|
||||
return read_file(filepath_args())
|
||||
@ -389,6 +396,40 @@ class ConfigUpdater:
|
||||
keys=f'{task}.Campaign.Event',
|
||||
value=deep_get(self.args, f'{task}.Campaign.Event.{server_}'))
|
||||
|
||||
if not is_template:
|
||||
new = self.config_redirect(old, new)
|
||||
|
||||
return new
|
||||
|
||||
def config_redirect(self, old, new):
|
||||
"""
|
||||
Convert old settings to the new.
|
||||
|
||||
Args:
|
||||
old (dict):
|
||||
new (dict):
|
||||
|
||||
Returns:
|
||||
dict:
|
||||
"""
|
||||
for row in self.redirection:
|
||||
if len(row) == 2:
|
||||
source, target = row
|
||||
update_func = None
|
||||
elif len(row) == 3:
|
||||
source, target, update_func = row
|
||||
else:
|
||||
continue
|
||||
|
||||
value = deep_get(old, keys=source, default=None)
|
||||
if value is not None:
|
||||
if update_func is not None:
|
||||
value = update_func(value)
|
||||
deep_set(new, keys=target, value=value)
|
||||
else:
|
||||
# No such setting
|
||||
continue
|
||||
|
||||
return new
|
||||
|
||||
@timer
|
||||
|
@ -178,6 +178,10 @@
|
||||
"name": "OpSi Explore",
|
||||
"help": ""
|
||||
},
|
||||
"OpsiShop": {
|
||||
"name": "Opsi Shop",
|
||||
"help": ""
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"name": "OpSi Daily",
|
||||
"help": ""
|
||||
@ -1640,14 +1644,20 @@
|
||||
"help": "Automatically updated with map ID\nReplace with 0 to reset progress\nAlready completed zones will be skipped"
|
||||
}
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"OpsiShop": {
|
||||
"_info": {
|
||||
"name": "OpSi Daily Settings",
|
||||
"name": "OpSi Shop Settings",
|
||||
"help": "Completes OpSi daily activities\nThe following must be satisfied:\n- OpSi story must be complete\n- Zones must be unlocked either by OpSi explore or consuming 5000 oil for special radar in OpSi shop"
|
||||
},
|
||||
"BuySupply": {
|
||||
"name": "Buy From Port Shops",
|
||||
"help": "Buy all items from port shops\nShop inventory consists of a fixed pool that is reset monthly, items not bought during a cycle has the chance of re-appearing and blocking preferable high value items"
|
||||
}
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"_info": {
|
||||
"name": "OpSi Daily Settings",
|
||||
"help": "Completes OpSi daily activities\nThe following must be satisfied:\n- OpSi story must be complete\n- Zones must be unlocked either by OpSi explore or consuming 5000 oil for special radar in OpSi shop"
|
||||
},
|
||||
"DoMission": {
|
||||
"name": "Do Port Mission(s)",
|
||||
|
@ -178,6 +178,10 @@
|
||||
"name": "Task.OpsiExplore.name",
|
||||
"help": "Task.OpsiExplore.help"
|
||||
},
|
||||
"OpsiShop": {
|
||||
"name": "Task.OpsiShop.name",
|
||||
"help": "Task.OpsiShop.help"
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"name": "Task.OpsiDaily.name",
|
||||
"help": "Task.OpsiDaily.help"
|
||||
@ -1640,15 +1644,21 @@
|
||||
"help": "OpsiExplore.LastZone.help"
|
||||
}
|
||||
},
|
||||
"OpsiShop": {
|
||||
"_info": {
|
||||
"name": "OpsiShop._info.name",
|
||||
"help": "OpsiShop._info.help"
|
||||
},
|
||||
"BuySupply": {
|
||||
"name": "OpsiShop.BuySupply.name",
|
||||
"help": "OpsiShop.BuySupply.help"
|
||||
}
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"_info": {
|
||||
"name": "OpsiDaily._info.name",
|
||||
"help": "OpsiDaily._info.help"
|
||||
},
|
||||
"BuySupply": {
|
||||
"name": "OpsiDaily.BuySupply.name",
|
||||
"help": "OpsiDaily.BuySupply.help"
|
||||
},
|
||||
"DoMission": {
|
||||
"name": "OpsiDaily.DoMission.name",
|
||||
"help": "OpsiDaily.DoMission.help"
|
||||
|
@ -178,6 +178,10 @@
|
||||
"name": "每月开荒",
|
||||
"help": ""
|
||||
},
|
||||
"OpsiShop": {
|
||||
"name": "大世界商店",
|
||||
"help": ""
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"name": "大世界每日",
|
||||
"help": ""
|
||||
@ -1640,14 +1644,20 @@
|
||||
"help": "自动更新的数值,地图ID,填0可重置进度,重置后自动跳过已开荒的海域"
|
||||
}
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"OpsiShop": {
|
||||
"_info": {
|
||||
"name": "大世界每日",
|
||||
"name": "大世界商店",
|
||||
"help": "使用此功能前必须满足以下条件:\n- 通关大世界主线任务\n- 完成大世界开荒或使用战役信息记录仪(5000油道具)"
|
||||
},
|
||||
"BuySupply": {
|
||||
"name": "购买港口商店",
|
||||
"help": "每月港口商店可购买商品是固定的,未购买的物品下次仍会出现,并阻塞高价值物品,因此需要购买全部"
|
||||
}
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"_info": {
|
||||
"name": "大世界每日",
|
||||
"help": "使用此功能前必须满足以下条件:\n- 通关大世界主线任务\n- 完成大世界开荒或使用战役信息记录仪(5000油道具)"
|
||||
},
|
||||
"DoMission": {
|
||||
"name": "做大世界每日",
|
||||
|
@ -178,6 +178,10 @@
|
||||
"name": "每月開荒",
|
||||
"help": ""
|
||||
},
|
||||
"OpsiShop": {
|
||||
"name": "大世界商店",
|
||||
"help": ""
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"name": "大世界每日",
|
||||
"help": ""
|
||||
@ -1640,14 +1644,20 @@
|
||||
"help": "自動更新的數值,地圖ID,填0可重置進度,重置後自動跳過已開荒的海域"
|
||||
}
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"OpsiShop": {
|
||||
"_info": {
|
||||
"name": "大世界每日",
|
||||
"name": "大世界商店",
|
||||
"help": "使用此功能前必須滿足以下條件:\n- 通關大世界主線任務\n- 完成大世界開荒或使用戰役信息記錄儀(5000油道具)"
|
||||
},
|
||||
"BuySupply": {
|
||||
"name": "購買港口商店",
|
||||
"help": "每月港口商店可購買商品是固定的,未購買的物品下次仍會出現,並阻擋高價值物品,因此需要購買全部"
|
||||
}
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"_info": {
|
||||
"name": "大世界每日",
|
||||
"help": "使用此功能前必須滿足以下條件:\n- 通關大世界主線任務\n- 完成大世界開荒或使用戰役信息記錄儀(5000油道具)"
|
||||
},
|
||||
"DoMission": {
|
||||
"name": "做大世界每日",
|
||||
|
@ -224,7 +224,7 @@ class OperationSiren(Reward, OSMap):
|
||||
# Deprecated since 2022.01.13, missions are shown only in overview, no longer to be shown at ports.
|
||||
# if mission and mission_success:
|
||||
# mission_success &= self.port_mission_accept()
|
||||
if supply and supply_success:
|
||||
if supply:
|
||||
supply_success &= self.port_supply_buy()
|
||||
self.port_quit()
|
||||
|
||||
@ -258,23 +258,22 @@ class OperationSiren(Reward, OSMap):
|
||||
return True
|
||||
|
||||
def os_daily(self):
|
||||
# Finish existing missions first
|
||||
self.os_finish_daily_mission()
|
||||
|
||||
while 1:
|
||||
mission_success = True
|
||||
if self.config.OpsiDaily_DoMission or self.config.OpsiDaily_BuySupply:
|
||||
self.os_finish_daily_mission()
|
||||
self.config.check_task_switch()
|
||||
# If unable to receive more dailies, finish them and try again.
|
||||
mission_success, _ = self.os_port_daily(
|
||||
mission=self.config.OpsiDaily_DoMission, supply=self.config.OpsiDaily_BuySupply)
|
||||
|
||||
if self.config.OpsiDaily_DoMission:
|
||||
self.os_finish_daily_mission()
|
||||
|
||||
if mission_success:
|
||||
# If unable to receive more dailies, finish them and try again.
|
||||
success = self.os_mission_overview_accept()
|
||||
self.os_finish_daily_mission()
|
||||
if success:
|
||||
break
|
||||
|
||||
self.config.task_delay(server_update=True)
|
||||
|
||||
def os_shop(self):
|
||||
self.os_port_daily(mission=False, supply=self.config.OpsiShop_BuySupply)
|
||||
self.config.task_delay(server_update=True)
|
||||
|
||||
def os_meowfficer_farming(self):
|
||||
"""
|
||||
Recommend 3 or 5 for higher meowfficer searching point per action points ratio.
|
||||
|
@ -25,6 +25,9 @@ MISSION_ENTER = Button(area={'cn': (767, 639, 853, 695), 'en': (767, 640, 824, 6
|
||||
MISSION_FINISH = Button(area={'cn': (1028, 205, 1112, 232), 'en': (1029, 205, 1112, 232), 'jp': (1026, 204, 1114, 234), 'tw': (1028, 205, 1112, 232)}, color={'cn': (79, 128, 191), 'en': (84, 132, 193), 'jp': (91, 137, 196), 'tw': (79, 128, 191)}, button={'cn': (1028, 205, 1112, 232), 'en': (1029, 205, 1112, 232), 'jp': (1026, 204, 1114, 234), 'tw': (1028, 205, 1112, 232)}, file={'cn': './assets/cn/os_handler/MISSION_FINISH.png', 'en': './assets/en/os_handler/MISSION_FINISH.png', 'jp': './assets/jp/os_handler/MISSION_FINISH.png', 'tw': './assets/tw/os_handler/MISSION_FINISH.png'})
|
||||
MISSION_MAP_CHECK = Button(area={'cn': (943, 499, 1048, 512), 'en': (943, 499, 1048, 512), 'jp': (943, 499, 1048, 512), 'tw': (943, 499, 1048, 512)}, color={'cn': (71, 74, 83), 'en': (71, 74, 83), 'jp': (71, 74, 83), 'tw': (71, 74, 83)}, button={'cn': (943, 499, 1048, 512), 'en': (943, 499, 1048, 512), 'jp': (943, 499, 1048, 512), 'tw': (943, 499, 1048, 512)}, file={'cn': './assets/cn/os_handler/MISSION_MAP_CHECK.png', 'en': './assets/en/os_handler/MISSION_MAP_CHECK.png', 'jp': './assets/jp/os_handler/MISSION_MAP_CHECK.png', 'tw': './assets/tw/os_handler/MISSION_MAP_CHECK.png'})
|
||||
MISSION_MONTHLY_BOSS = Button(area={'cn': (669, 188, 747, 206), 'en': (711, 226, 754, 239), 'jp': (644, 183, 732, 210), 'tw': (669, 188, 747, 206)}, color={'cn': (121, 130, 154), 'en': (93, 116, 157), 'jp': (90, 102, 129), 'tw': (121, 130, 154)}, button={'cn': (669, 188, 747, 206), 'en': (711, 226, 754, 239), 'jp': (644, 183, 732, 210), 'tw': (669, 188, 747, 206)}, file={'cn': './assets/cn/os_handler/MISSION_MONTHLY_BOSS.png', 'en': './assets/en/os_handler/MISSION_MONTHLY_BOSS.png', 'jp': './assets/jp/os_handler/MISSION_MONTHLY_BOSS.png', 'tw': './assets/cn/os_handler/MISSION_MONTHLY_BOSS.png'})
|
||||
MISSION_OVERVIEW_ACCEPT = Button(area={'cn': (1072, 12, 1130, 40), 'en': (1072, 12, 1130, 40), 'jp': (1072, 12, 1130, 40), 'tw': (1072, 12, 1130, 40)}, color={'cn': (230, 193, 168), 'en': (230, 193, 168), 'jp': (230, 193, 168), 'tw': (230, 193, 168)}, button={'cn': (1072, 12, 1130, 40), 'en': (1072, 12, 1130, 40), 'jp': (1072, 12, 1130, 40), 'tw': (1072, 12, 1130, 40)}, file={'cn': './assets/cn/os_handler/MISSION_OVERVIEW_ACCEPT.png', 'en': './assets/cn/os_handler/MISSION_OVERVIEW_ACCEPT.png', 'jp': './assets/cn/os_handler/MISSION_OVERVIEW_ACCEPT.png', 'tw': './assets/cn/os_handler/MISSION_OVERVIEW_ACCEPT.png'})
|
||||
MISSION_OVERVIEW_CHECK = Button(area={'cn': (127, 17, 262, 42), 'en': (127, 17, 262, 42), 'jp': (127, 17, 262, 42), 'tw': (127, 17, 262, 42)}, color={'cn': (148, 165, 209), 'en': (148, 165, 209), 'jp': (148, 165, 209), 'tw': (148, 165, 209)}, button={'cn': (127, 17, 262, 42), 'en': (127, 17, 262, 42), 'jp': (127, 17, 262, 42), 'tw': (127, 17, 262, 42)}, file={'cn': './assets/cn/os_handler/MISSION_OVERVIEW_CHECK.png', 'en': './assets/cn/os_handler/MISSION_OVERVIEW_CHECK.png', 'jp': './assets/cn/os_handler/MISSION_OVERVIEW_CHECK.png', 'tw': './assets/cn/os_handler/MISSION_OVERVIEW_CHECK.png'})
|
||||
MISSION_OVERVIEW_ENTER = Button(area={'cn': (1111, 672, 1207, 690), 'en': (1111, 672, 1207, 690), 'jp': (1111, 672, 1207, 690), 'tw': (1111, 672, 1207, 690)}, color={'cn': (66, 68, 72), 'en': (66, 68, 72), 'jp': (66, 68, 72), 'tw': (66, 68, 72)}, button={'cn': (1105, 629, 1255, 693), 'en': (1105, 629, 1255, 693), 'jp': (1105, 629, 1255, 693), 'tw': (1105, 629, 1255, 693)}, file={'cn': './assets/cn/os_handler/MISSION_OVERVIEW_ENTER.png', 'en': './assets/cn/os_handler/MISSION_OVERVIEW_ENTER.png', 'jp': './assets/cn/os_handler/MISSION_OVERVIEW_ENTER.png', 'tw': './assets/cn/os_handler/MISSION_OVERVIEW_ENTER.png'})
|
||||
MISSION_QUIT = Button(area={'cn': (1086, 111, 1152, 155), 'en': (1086, 111, 1152, 155), 'jp': (1086, 111, 1152, 155), 'tw': (1086, 111, 1152, 155)}, color={'cn': (152, 38, 35), 'en': (152, 38, 35), 'jp': (152, 38, 35), 'tw': (152, 38, 35)}, button={'cn': (1086, 111, 1152, 155), 'en': (1086, 111, 1152, 155), 'jp': (1086, 111, 1152, 155), 'tw': (1086, 111, 1152, 155)}, file={'cn': './assets/cn/os_handler/MISSION_QUIT.png', 'en': './assets/en/os_handler/MISSION_QUIT.png', 'jp': './assets/jp/os_handler/MISSION_QUIT.png', 'tw': './assets/tw/os_handler/MISSION_QUIT.png'})
|
||||
ORDER_CHECK = Button(area={'cn': (106, 77, 224, 94), 'en': (101, 79, 306, 93), 'jp': (65, 64, 147, 95), 'tw': (106, 76, 226, 95)}, color={'cn': (141, 123, 71), 'en': (122, 107, 64), 'jp': (101, 93, 62), 'tw': (139, 127, 88)}, button={'cn': (106, 77, 224, 94), 'en': (101, 79, 306, 93), 'jp': (65, 64, 147, 95), 'tw': (106, 76, 226, 95)}, file={'cn': './assets/cn/os_handler/ORDER_CHECK.png', 'en': './assets/en/os_handler/ORDER_CHECK.png', 'jp': './assets/jp/os_handler/ORDER_CHECK.png', 'tw': './assets/tw/os_handler/ORDER_CHECK.png'})
|
||||
ORDER_ENTER = Button(area={'cn': (1012, 165, 1044, 194), 'en': (1016, 166, 1038, 188), 'jp': (1012, 164, 1043, 195), 'tw': (1012, 165, 1044, 194)}, color={'cn': (95, 114, 137), 'en': (134, 161, 186), 'jp': (96, 116, 140), 'tw': (95, 114, 137)}, button={'cn': (1012, 165, 1044, 194), 'en': (1016, 166, 1038, 188), 'jp': (1012, 164, 1043, 195), 'tw': (1012, 165, 1044, 194)}, file={'cn': './assets/cn/os_handler/ORDER_ENTER.png', 'en': './assets/en/os_handler/ORDER_ENTER.png', 'jp': './assets/jp/os_handler/ORDER_ENTER.png', 'tw': './assets/tw/os_handler/ORDER_ENTER.png'})
|
||||
|
@ -139,3 +139,52 @@ class MissionHandler(GlobeOperation, ZoneManager):
|
||||
if self.is_in_map() and self.info_bar_count():
|
||||
logger.info('Already at mission zone')
|
||||
return 2
|
||||
|
||||
def os_mission_overview_accept(self):
|
||||
"""
|
||||
Accept all missions in mission overview.
|
||||
|
||||
Returns:
|
||||
bool: True if all missions accepted or no mission found.
|
||||
False if unable to accept more missions.
|
||||
|
||||
Pages:
|
||||
in: is_in_map
|
||||
out: is_in_map
|
||||
"""
|
||||
# is_in_map
|
||||
self.os_map_goto_globe(unpin=False)
|
||||
# is_in_globe
|
||||
self.ui_click(MISSION_OVERVIEW_ENTER, check_button=MISSION_OVERVIEW_CHECK,
|
||||
offset=(200, 20), retry_wait=3, skip_first_screenshot=True)
|
||||
|
||||
# MISSION_OVERVIEW_CHECK
|
||||
confirm_timer = Timer(1, count=3).start()
|
||||
skip_first_screenshot = True
|
||||
success = True
|
||||
while 1:
|
||||
if skip_first_screenshot:
|
||||
skip_first_screenshot = False
|
||||
else:
|
||||
self.device.screenshot()
|
||||
|
||||
if self.appear_then_click(PORT_MISSION_ACCEPT, offset=(20, 20), interval=0.2):
|
||||
confirm_timer.reset()
|
||||
continue
|
||||
else:
|
||||
# End
|
||||
if confirm_timer.reached():
|
||||
success = True
|
||||
break
|
||||
|
||||
if self.info_bar_count():
|
||||
logger.info('Unable to accept missions, because reached the maximum number of missions')
|
||||
success = False
|
||||
break
|
||||
|
||||
# is_in_globe
|
||||
self.ui_back(appear_button=MISSION_OVERVIEW_CHECK, check_button=self.is_in_globe,
|
||||
skip_first_screenshot=True)
|
||||
# is_in_map
|
||||
self.os_globe_goto_map()
|
||||
return success
|
||||
|
Loading…
Reference in New Issue
Block a user