mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-22 01:19:18 +08:00
Merge pull request #1923 from nEEtdo0d/voucher_shop
Add: Support OS Voucher Shop
This commit is contained in:
@@ -7984,6 +7984,45 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"OpsiVoucher": {
|
||||
"Scheduler": {
|
||||
"Enable": {
|
||||
"type": "checkbox",
|
||||
"value": false
|
||||
},
|
||||
"NextRun": {
|
||||
"type": "datetime",
|
||||
"value": "2020-01-01 00:00:00",
|
||||
"validate": "datetime"
|
||||
},
|
||||
"Command": {
|
||||
"type": "input",
|
||||
"value": "OpsiVoucher",
|
||||
"display": "hide"
|
||||
},
|
||||
"SuccessInterval": {
|
||||
"type": "input",
|
||||
"value": 30,
|
||||
"display": "hide"
|
||||
},
|
||||
"FailureInterval": {
|
||||
"type": "input",
|
||||
"value": 30,
|
||||
"display": "hide"
|
||||
},
|
||||
"ServerUpdate": {
|
||||
"type": "input",
|
||||
"value": "00:00",
|
||||
"display": "hide"
|
||||
}
|
||||
},
|
||||
"OpsiVoucher": {
|
||||
"Filter": {
|
||||
"type": "textarea",
|
||||
"value": "LoggerAbyssal > LoggerObscure > HECombatPlan > Book > Coin"
|
||||
}
|
||||
}
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"Scheduler": {
|
||||
"Enable": {
|
||||
|
||||
@@ -573,6 +573,9 @@ OpsiExplore:
|
||||
LastZone: 0
|
||||
OpsiShop:
|
||||
BuySupply: true
|
||||
OpsiVoucher:
|
||||
Filter: |-
|
||||
LoggerAbyssal > LoggerObscure > HECombatPlan > Book > Coin
|
||||
OpsiDaily:
|
||||
DoMission: true
|
||||
UseTuningSample: true
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
"OpsiAshAssist",
|
||||
"OpsiExplore",
|
||||
"OpsiShop",
|
||||
"OpsiVoucher",
|
||||
"OpsiDaily",
|
||||
"OpsiObscure",
|
||||
"OpsiAbyssal",
|
||||
|
||||
@@ -336,6 +336,11 @@ OpsiShop:
|
||||
SuccessInterval: 30
|
||||
FailureInterval: 30
|
||||
ServerUpdate: 00:00
|
||||
OpsiVoucher:
|
||||
Scheduler:
|
||||
SuccessInterval: 30
|
||||
FailureInterval: 30
|
||||
ServerUpdate: 00:00
|
||||
OpsiDaily:
|
||||
Scheduler:
|
||||
SuccessInterval: 30
|
||||
|
||||
@@ -243,6 +243,9 @@ OpsiExplore:
|
||||
OpsiShop:
|
||||
- Scheduler
|
||||
- OpsiShop
|
||||
OpsiVoucher:
|
||||
- Scheduler
|
||||
- OpsiVoucher
|
||||
OpsiDaily:
|
||||
- Scheduler
|
||||
- OpsiDaily
|
||||
|
||||
@@ -289,7 +289,7 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig, ConfigWatcher
|
||||
)
|
||||
limit_next_run(["Commission", "Reward"], limit=now + timedelta(hours=12, seconds=-1))
|
||||
limit_next_run(["Research"], limit=now + timedelta(hours=24, seconds=-1))
|
||||
limit_next_run(["OpsiExplore", "OpsiCrossMonth"], limit=now + timedelta(days=31, seconds=-1))
|
||||
limit_next_run(["OpsiExplore", "OpsiCrossMonth", "OpsiVoucher"], limit=now + timedelta(days=31, seconds=-1))
|
||||
limit_next_run(self.args.keys(), limit=now + timedelta(hours=24, seconds=-1))
|
||||
|
||||
def override(self, **kwargs):
|
||||
|
||||
@@ -367,6 +367,9 @@ class GeneratedConfig:
|
||||
# Group `OpsiShop`
|
||||
OpsiShop_BuySupply = True
|
||||
|
||||
# Group `OpsiVoucher`
|
||||
OpsiVoucher_Filter = 'LoggerAbyssal > LoggerObscure > HECombatPlan > Book > Coin'
|
||||
|
||||
# Group `OpsiDaily`
|
||||
OpsiDaily_DoMission = True
|
||||
OpsiDaily_UseTuningSample = True
|
||||
|
||||
@@ -18,7 +18,7 @@ class ManualConfig:
|
||||
> ShopFrequent > ShopOnce > Shipyard > Freebies
|
||||
> OpsiExplore
|
||||
> OpsiAshBeacon
|
||||
> OpsiDaily > OpsiShop
|
||||
> OpsiDaily > OpsiShop > OpsiVoucher
|
||||
> OpsiAbyssal > OpsiStronghold > OpsiObscure
|
||||
> Daily > Hard > OpsiAshBeacon > OpsiAshAssist
|
||||
> Sos > EventSp > EventA > EventB > EventC > EventD > RaidDaily > WarArchives > MaritimeEscort
|
||||
|
||||
@@ -198,6 +198,10 @@
|
||||
"name": "OpSi Shop",
|
||||
"help": ""
|
||||
},
|
||||
"OpsiVoucher": {
|
||||
"name": "OpSi Voucher",
|
||||
"help": ""
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"name": "OpSi Daily",
|
||||
"help": ""
|
||||
@@ -2049,11 +2053,11 @@
|
||||
"OpsiExplore": {
|
||||
"_info": {
|
||||
"name": "OpSi Explore Settings",
|
||||
"help": "At the beginning of each month OpSi is reset\nThe following must be satisfied:\n- OpSi story must be complete\nEach zone will be visited in a clockwise direction every 27 minutes until world has been been completely opened\nNo need to consume 5000 oil for special radar in OpSi shop"
|
||||
"help": "At the beginning of each month OpSi is reset\nThe following must be satisfied:\n- OpSi story must be complete\nEach zone will be visited in a clockwise direction every 27 minutes until world has been been completely opened\nNo need to consume 5000 oil for special radar in OpSi voucher shop"
|
||||
},
|
||||
"SpecialRadar": {
|
||||
"name": "SpecialRadar Bought",
|
||||
"help": "Enable if you have purchased the special radar\nAllows Alas to explore OpSi continously without having to wait 27 minutes between each zone clear\nCannot be selected when not purchased and used"
|
||||
"help": "Enable if you have purchased the special radar\nAllows Alas to explore OpSi continously without having to wait 27 minutes between each zone clear\nCannot be selected when not purchased and used manually"
|
||||
},
|
||||
"ForceRun": {
|
||||
"name": "Force Run",
|
||||
@@ -2067,17 +2071,27 @@
|
||||
"OpsiShop": {
|
||||
"_info": {
|
||||
"name": "OpSi Shop Settings",
|
||||
"help": "Completes OpSi daily activities\nThe following must be satisfied:\n- OpSi story must be complete\n- Task Opsi Explore enabled or consuming 5000 oil for special radar in OpSi shop"
|
||||
"help": "Completes OpSi daily activities\nThe following must be satisfied:\n- OpSi story must be complete\n- Task Opsi Explore enabled or consuming 5000 oil for special radar in OpSi voucher 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"
|
||||
}
|
||||
},
|
||||
"OpsiVoucher": {
|
||||
"_info": {
|
||||
"name": "OpSi Voucher Settings",
|
||||
"help": "Buy monthly items from the OpSi voucher shop\nThe following must be satisfied:\n- OpSi story must be complete"
|
||||
},
|
||||
"Filter": {
|
||||
"name": "Item Filter",
|
||||
"help": "All options have been defined at <https://github.com/LmeSzinc/AzurLaneAutoScript/wiki/reward_shop_filter_string>"
|
||||
}
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"_info": {
|
||||
"name": "OpSi Daily Settings",
|
||||
"help": "Completes OpSi daily activities\nThe following must be satisfied:\n- OpSi story must be complete\n- Task Opsi Explore enabled or consuming 5000 oil for special radar in OpSi shop"
|
||||
"help": "Completes OpSi daily activities\nThe following must be satisfied:\n- OpSi story must be complete\n- Task Opsi Explore enabled or consuming 5000 oil for special radar in OpSi voucher shop"
|
||||
},
|
||||
"DoMission": {
|
||||
"name": "Do Port Mission(s)",
|
||||
@@ -2091,7 +2105,7 @@
|
||||
"OpsiObscure": {
|
||||
"_info": {
|
||||
"name": "OpSi Obscure Settings",
|
||||
"help": "Clear obscure zones every 27 minutes\nThe following must be satisfied:\n- OpSi story must be complete\n- Task Opsi Explore enabled or consuming 5000 oil for special radar in OpSi shop"
|
||||
"help": "Clear obscure zones every 27 minutes\nThe following must be satisfied:\n- OpSi story must be complete\n- Task Opsi Explore enabled or consuming 5000 oil for special radar in OpSi voucher shop"
|
||||
},
|
||||
"ForceRun": {
|
||||
"name": "Force Run",
|
||||
@@ -2100,28 +2114,28 @@
|
||||
},
|
||||
"OpsiAbyssal": {
|
||||
"_info": {
|
||||
"name": "Abyssal Zones",
|
||||
"help": "Clear abyssal zones.\nThe following must be satisfied:\n- OpSi story must be complete\n- Task Opsi Explore enabled or consuming 5000 oil for special radar in OpSi shop"
|
||||
"name": "OpSi Abyssal Settings",
|
||||
"help": "Clear abyssal zones\nThe following must be satisfied:\n- OpSi story must be complete\n- Task Opsi Explore enabled or consuming 5000 oil for special radar in OpSi voucher shop"
|
||||
},
|
||||
"ForceRun": {
|
||||
"name": "Force Run",
|
||||
"help": "Ignore interval, clear all obscure zones, and use AP to submit scan orders (and submarine if enabled)\nGenerally not needed to force run, just run in intervals unless in a rush"
|
||||
"help": "Ignore interval, clear all abyssal zones, and use AP to submit scan orders (and submarine if enabled)\nGenerally not needed to force run, just run in intervals unless in a rush"
|
||||
}
|
||||
},
|
||||
"OpsiStronghold": {
|
||||
"_info": {
|
||||
"name": "Siren Strongholds",
|
||||
"name": "OpSi Siren Stronghold Settings",
|
||||
"help": "Clear the weekly siren strongholds.\nThe following must be satisfied:\n- OpSi story must be complete\n- Task Opsi Explore enabled or consuming 5000 oil for special radar in OpSi shop"
|
||||
},
|
||||
"ForceRun": {
|
||||
"name": "Force Run",
|
||||
"help": "Ignore interval, clear all obscure zones, and use AP to submit scan orders (and submarine if enabled)\nGenerally not needed to force run, just run in intervals unless in a rush"
|
||||
"help": "Ignore interval, clear all siren strongholds, and use AP to submit scan orders (and submarine if enabled)\nGenerally not needed to force run, just run in intervals unless in a rush"
|
||||
}
|
||||
},
|
||||
"OpsiMeowfficerFarming": {
|
||||
"_info": {
|
||||
"name": "OpSi Meowfficer Farm Settings",
|
||||
"help": "Attack target zones of the specified hazard level in a clockwise direction\nThe following must be satisfied:\n- OpSi story must be complete\n- Task Opsi Explore enabled or consuming 5000 oil for special radar in OpSi shop"
|
||||
"help": "Attack target zones of the specified hazard level in a clockwise direction\nThe following must be satisfied:\n- OpSi story must be complete\n- Task Opsi Explore enabled or consuming 5000 oil for special radar in OpSi voucher shop"
|
||||
},
|
||||
"ActionPointPreserve": {
|
||||
"name": "Keep X Amount of AP",
|
||||
|
||||
@@ -198,6 +198,10 @@
|
||||
"name": "Task.OpsiShop.name",
|
||||
"help": "Task.OpsiShop.help"
|
||||
},
|
||||
"OpsiVoucher": {
|
||||
"name": "Task.OpsiVoucher.name",
|
||||
"help": "Task.OpsiVoucher.help"
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"name": "Task.OpsiDaily.name",
|
||||
"help": "Task.OpsiDaily.help"
|
||||
@@ -2074,6 +2078,16 @@
|
||||
"help": "OpsiShop.BuySupply.help"
|
||||
}
|
||||
},
|
||||
"OpsiVoucher": {
|
||||
"_info": {
|
||||
"name": "OpsiVoucher._info.name",
|
||||
"help": "OpsiVoucher._info.help"
|
||||
},
|
||||
"Filter": {
|
||||
"name": "OpsiVoucher.Filter.name",
|
||||
"help": "OpsiVoucher.Filter.help"
|
||||
}
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"_info": {
|
||||
"name": "OpsiDaily._info.name",
|
||||
|
||||
@@ -198,6 +198,10 @@
|
||||
"name": "大世界商店",
|
||||
"help": ""
|
||||
},
|
||||
"OpsiVoucher": {
|
||||
"name": "Task.OpsiVoucher.name",
|
||||
"help": "Task.OpsiVoucher.help"
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"name": "大世界每日",
|
||||
"help": ""
|
||||
@@ -2074,6 +2078,16 @@
|
||||
"help": "每月港口商店可购买商品是固定的,未购买的物品下次仍会出现,并阻塞高价值物品,因此需要购买全部"
|
||||
}
|
||||
},
|
||||
"OpsiVoucher": {
|
||||
"_info": {
|
||||
"name": "OpsiVoucher._info.name",
|
||||
"help": "OpsiVoucher._info.help"
|
||||
},
|
||||
"Filter": {
|
||||
"name": "OpsiVoucher.Filter.name",
|
||||
"help": "OpsiVoucher.Filter.help"
|
||||
}
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"_info": {
|
||||
"name": "大世界每日",
|
||||
|
||||
@@ -198,6 +198,10 @@
|
||||
"name": "大世界商店",
|
||||
"help": ""
|
||||
},
|
||||
"OpsiVoucher": {
|
||||
"name": "Task.OpsiVoucher.name",
|
||||
"help": "Task.OpsiVoucher.help"
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"name": "大世界每日",
|
||||
"help": ""
|
||||
@@ -2074,6 +2078,16 @@
|
||||
"help": "每月港口商店可購買商品是固定的,未購買的物品下次仍會出現,並阻擋高價值物品,因此需要購買全部"
|
||||
}
|
||||
},
|
||||
"OpsiVoucher": {
|
||||
"_info": {
|
||||
"name": "OpsiVoucher._info.name",
|
||||
"help": "OpsiVoucher._info.help"
|
||||
},
|
||||
"Filter": {
|
||||
"name": "OpsiVoucher.Filter.name",
|
||||
"help": "OpsiVoucher.Filter.help"
|
||||
}
|
||||
},
|
||||
"OpsiDaily": {
|
||||
"_info": {
|
||||
"name": "大世界每日",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import re
|
||||
|
||||
FILTER_REGEX = re.compile(
|
||||
FILTER_REGEX_SERIES = re.compile(
|
||||
'(pr|dr)'
|
||||
|
||||
'([1-4]'
|
||||
@@ -28,7 +28,7 @@ def bp_redirect(value):
|
||||
PRBP = PR; PR1BP = PRS1; PROdinBP = PROdin/PROdinS3
|
||||
likewise for DR variants
|
||||
"""
|
||||
matches = re.findall(FILTER_REGEX, value)
|
||||
matches = re.findall(FILTER_REGEX_SERIES, value)
|
||||
if not matches:
|
||||
return value
|
||||
|
||||
@@ -45,5 +45,41 @@ def bp_redirect(value):
|
||||
return value
|
||||
|
||||
|
||||
FILTER_REGEX_VOUCHER = re.compile(
|
||||
'(logger)'
|
||||
|
||||
'(archive)?'
|
||||
|
||||
'(t[1-6])?',
|
||||
flags=re.IGNORECASE)
|
||||
|
||||
|
||||
def voucher_redirect(value):
|
||||
"""
|
||||
Redirects voucher shop filter to prevents users
|
||||
from using banned strings i.e. Logger, LoggerT[1-6],
|
||||
LoggerArchive, or LoggerArchiveT[1-6]
|
||||
Banned strings are used for special circumstances
|
||||
handled by ALAS
|
||||
"""
|
||||
matches = re.findall(FILTER_REGEX_VOUCHER, value)
|
||||
if not matches:
|
||||
return value
|
||||
|
||||
for match in matches:
|
||||
flat = ''.join(match)
|
||||
pattern = rf'\b{flat}\b'
|
||||
if (match[2] and match[1]) or match[1]:
|
||||
value = re.sub(pattern, '', value)
|
||||
value = re.sub('\>\s*\>', '>', value)
|
||||
value = re.sub('\>\s*$', '', value)
|
||||
elif match[2]:
|
||||
value = re.sub(pattern, f'LoggerAbyssal{match[2].upper()} > LoggerObscure{match[2].upper()}', value)
|
||||
else:
|
||||
value = re.sub(pattern, f'LoggerAbyssal > LoggerObscure', value)
|
||||
|
||||
return value
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(bp_redirect('PlateGeneralT1 > DRAgirBP > CatT3 > PROdinBP > Chip > PR1BP > PRBP > DRDrakeBP > DR2BP'))
|
||||
print(voucher_redirect('Coin > HECombatPlan > LoggerArchive > TuningCombatT2 > LoggerArchiveT1 > LoggerT6 > Logger'))
|
||||
|
||||
Reference in New Issue
Block a user