Feature: New OpsiShop. (#3086)

* feat: New OpsiShop

* fix: use AdaptiveScroll

* feat: scan counter

* perf: calculate y value
This commit is contained in:
霞飛 2024-06-17 11:24:40 +08:00 committed by GitHub
parent a70d4c4675
commit 0b97b40c46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
116 changed files with 1178 additions and 342 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
assets/shop/os/EmptyT1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
assets/shop/os/EmptyT2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
assets/shop/os/EmptyT3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -1635,7 +1635,9 @@
"ServerUpdate": "00:00"
},
"OpsiShop": {
"BuySupply": true
"ScanFrequencyLimit": "weekly",
"PresetFilter": "max_benefit_meta",
"CustomFilter": "Logger"
},
"Storage": {
"Storage": {}

View File

@ -1,3 +1,4 @@
from functools import reduce
import re
from module.logger import logger
@ -45,7 +46,7 @@ class Filter:
"""
Args:
objs (list): List of objects and strings
func (callable): A function to filter object.
func (callable): A function that to filter object.
Function should receive an object as arguments, and return a bool.
True means add it to output.
@ -76,6 +77,19 @@ class Filter:
return out
def applys(self, objs, funcs):
"""
Args:
objs (list): List of objects and strings
List[func(callable)] : A list of funciton that to filter object.
Function should receive an object as arguments, and return a bool.
True means add it to output.
Returns:
list: A list of objects and preset strings, such as [object, object, object, 'reset']
"""
return self.apply(objs, func=lambda x: all(func(x)for func in funcs))
def apply_filter_to_obj(self, obj, filter):
"""
Args:

View File

@ -29,11 +29,6 @@ class OSCampaignRun(OSMapOperation):
self.config.opsi_task_delay(ap_limit=True)
def opsi_shop(self):
if self.config.SERVER in ['cn', 'en', 'jp', 'tw']:
logger.info('Task OpsiShop is disabled before assets update')
self.config.task_delay(server_update=True)
self.config.task_stop()
try:
self.load_campaign()
self.campaign.os_shop()

View File

@ -8420,9 +8420,29 @@
}
},
"OpsiShop": {
"BuySupply": {
"type": "checkbox",
"value": true
"ScanFrequencyLimit": {
"type": "select",
"value": "weekly",
"option": [
"everyday",
"weekly",
"everyday_of_week_before_reset"
]
},
"PresetFilter": {
"type": "select",
"value": "max_benefit_meta",
"option": [
"max_benefit",
"max_benefit_meta",
"no_meta",
"all",
"custom"
]
},
"CustomFilter": {
"type": "textarea",
"value": "Logger"
}
},
"Storage": {

View File

@ -666,7 +666,22 @@ OpsiExplore:
ForceRun: false
LastZone: 0
OpsiShop:
BuySupply: true
ScanFrequencyLimit:
value: weekly
option:
- everyday
- weekly
- everyday_of_week_before_reset
PresetFilter:
value: max_benefit_meta
option:
- max_benefit
- max_benefit_meta
- no_meta
- all
- custom
CustomFilter: |-
Logger
OpsiVoucher:
Filter: |-
LoggerAbyssal > LoggerObscure > Book > Coin > Fragment

View File

@ -308,7 +308,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", "OpsiVoucher", "OpsiMonthBoss"],
limit_next_run(["OpsiExplore", "OpsiCrossMonth", "OpsiVoucher", "OpsiMonthBoss", "OpsiShop"],
limit=now + timedelta(days=31, seconds=-1))
limit_next_run(["OpsiArchive"], limit=now + timedelta(days=7, seconds=-1))
limit_next_run(self.args.keys(), limit=now + timedelta(hours=24, seconds=-1))

View File

@ -388,7 +388,9 @@ class GeneratedConfig:
OpsiExplore_LastZone = 0
# Group `OpsiShop`
OpsiShop_BuySupply = True
OpsiShop_ScanFrequencyLimit = 'weekly' # everyday, weekly, everyday_of_week_before_reset
OpsiShop_PresetFilter = 'max_benefit_meta' # max_benefit, max_benefit_meta, no_meta, all, custom
OpsiShop_CustomFilter = 'Logger'
# Group `OpsiVoucher`
OpsiVoucher_Filter = 'LoggerAbyssal > LoggerObscure > Book > Coin > Fragment'

View File

@ -321,6 +321,8 @@ class ManualConfig:
OS_ACTION_POINT_BOX_USE = True
OS_ACTION_POINT_PRESERVE = 0
OS_CL1_YELLOW_COINS_PRESERVE = 100000
OS_NORMAL_YELLOW_COINS_PRESERVE = 35000
OS_NORMAL_PURPLE_COINS_PRESERVE = 100
"""
module.os.globe_detection

View File

@ -2287,9 +2287,25 @@
"name": "OpSi Shop Settings",
"help": "Completes OpSi daily activities\nThe following must be satisfied:\n- OpSi story and practice battles 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"
"ScanFrequencyLimit": {
"name": "Scan Frequency Limit",
"help": "The frequency of scanning the OS shop when all items in the filter have been purchased.",
"everyday": "everyday",
"weekly": "weekly",
"everyday_of_week_before_reset": "everyday of week before reset"
},
"PresetFilter": {
"name": "OpSi Shop Filter",
"help": "Generally does not need to be modified. Use \"High value items and META material\"` if Voucher Coins spilled or \"Without META materials\" if you are newcomer.\nHigh value items include ActionPoint, Logger and T4 or higher items; META materials include METABook and META enhance materials.",
"max_benefit": "High value items",
"max_benefit_meta": "High value items and META materials",
"no_meta": "Not to buy META materials",
"all": "All",
"custom": "custom"
},
"CustomFilter": {
"name": "Custom Research Priority",
"help": "To use your own filter, set \"OpSi Shop Filter Select\" to \"custom\". All options have been defined at <https://github.com/LmeSzinc/AzurLaneAutoScript/wiki/filter_string_en>"
}
},
"OpsiVoucher": {

View File

@ -2287,9 +2287,25 @@
"name": "OpsiShop._info.name",
"help": "OpsiShop._info.help"
},
"BuySupply": {
"name": "OpsiShop.BuySupply.name",
"help": "OpsiShop.BuySupply.help"
"ScanFrequencyLimit": {
"name": "OpsiShop.ScanFrequencyLimit.name",
"help": "OpsiShop.ScanFrequencyLimit.help",
"everyday": "everyday",
"weekly": "weekly",
"everyday_of_week_before_reset": "everyday of week before reset"
},
"PresetFilter": {
"name": "OpsiShop.PresetFilter.name",
"help": "OpsiShop.PresetFilter.help",
"max_benefit": "max_benefit",
"max_benefit_meta": "max_benefit_meta",
"no_meta": "no_meta",
"all": "all",
"custom": "custom"
},
"CustomFilter": {
"name": "OpsiShop.CustomFilter.name",
"help": "OpsiShop.CustomFilter.help"
}
},
"OpsiVoucher": {

View File

@ -2287,9 +2287,25 @@
"name": "大世界商店",
"help": "使用此功能前必须满足以下条件:\n- 通关大世界主线并完成模拟战+塞壬试验场\n- 启用大世界开荒任务或使用战役信息记录仪5000油道具"
},
"BuySupply": {
"name": "购买港口商店",
"help": "每月港口商店可购买商品是固定的,未购买的物品下次仍会出现,并阻塞高价值物品,因此需要购买全部"
"ScanFrequencyLimit": {
"name": "扫描商店频率",
"help": "当认为港口商店已经购买完所有过滤器中的物品后,扫描港口商店的频率。",
"everyday": "每天",
"weekly": "每周",
"everyday_of_week_before_reset": "大世界重置前的一周的每天"
},
"PresetFilter": {
"name": "港口商店过滤器",
"help": "一般默认即可,白票溢出建议选 \"高价值物品与META材料\",萌新建议选 \"不购买META材料\"这会买除了META材料以外的所有东西。\n高价值物品为行动力、坐标和金或者更高级別的商品META材料为META通用战术教材和4种强化材料。",
"max_benefit": "高价值物品",
"max_benefit_meta": "高价值物品与META材料",
"no_meta": "不购买META材料",
"all": "全部",
"custom": "自定义"
},
"CustomFilter": {
"name": "自定义过滤器",
"help": "使用自定义过滤器需将 \"港口商店过滤器\" 设置为 \"自定义\",并阅读 https://github.com/LmeSzinc/AzurLaneAutoScript/wiki/filter_string_cn"
}
},
"OpsiVoucher": {

View File

@ -2287,9 +2287,25 @@
"name": "大世界商店",
"help": "使用此功能前必須滿足以下條件:\n- 通關大世界主線任務+模擬戰\n- 開啟大世界開荒任務或使用戰役信息記錄儀5000油道具"
},
"BuySupply": {
"name": "購買港口商店",
"help": "每月港口商店可購買商品是固定的,未購買的物品下次仍會出現,並阻擋高價值物品,因此需要購買全部"
"ScanFrequencyLimit": {
"name": "掃描頻率約束",
"help": "當過濾器中的所有物品都已購買時,掃描港口商店的頻率。",
"everyday": "每天",
"weekly": "每週",
"everyday_of_week_before_reset": "大世界重置前的一周的每天"
},
"PresetFilter": {
"name": "港口商店過濾器",
"help": "一般用預設即可,白票溢出建議選 \"高價值物品與META材料\",新手建議選 \"不購買META材料\"這會買除了META材料以外的所有東西。\n高價值物品為行動點、坐標和金或者更高級別的物品META材料為META通用戰術教材和4種強化材料。",
"max_benefit": "高價值物品",
"max_benefit_meta": "高價值物品與META材料",
"no_meta": "不購買META材料",
"all": "全部",
"custom": "自定義過濾器"
},
"CustomFilter": {
"name": "自定義過濾器",
"help": "使用自定義過濾器需將 \"港口商店過濾器\" 設定為 \"自定義\",並閱讀 https://github.com/LmeSzinc/AzurLaneAutoScript/wiki/filter_string_cn"
}
},
"OpsiVoucher": {

Some files were not shown because too many files have changed in this diff Show More