feat: add update_settings.py for automated purchasing configuration

- Introduced a new script to manage NPC settings and food items for automated purchasing.
- Parsed NPC data from a JSON string and extracted unique food items and tags.
- Created a settings structure for user configuration, including options for account name, food selection, purchase schedule, and debug mode.
- Saved the settings to a JSON file for easy access and modification.
This commit is contained in:
秋云
2026-04-16 03:57:11 +08:00
parent f22957a88c
commit f35fa212f9
4 changed files with 1475 additions and 17 deletions

View File

@@ -132,9 +132,18 @@ async function loadExternalData() {
logConditional(`共收集到 ${allTags.size} 个标签`);
// ========== 解析用户输入 ==========
const foodsInput = (settings.foodsToBuy || "").trim();
if (foodsInput) {
const items = foodsInput.split(/[,\s、]+/).filter(item => item.trim() !== "");
let items = [];
// 优先尝试读取新的列表配置
if (settings.foodsToBuyList) {
items = Array.from(settings.foodsToBuyList);
} else if (typeof settings.foodsToBuy === 'string') {
// 兼容旧配置
items = (settings.foodsToBuy || "").trim().split(/[,\s、]+/).filter(item => item.trim() !== "");
} else if (settings.foodsToBuy) {
items = Array.from(settings.foodsToBuy);
}
if (items.length > 0) {
const enabledFoodsList = [];
const enabledTagsList = [];
@@ -350,7 +359,15 @@ const ignoreRecords = settings.ignoreRecords || false;
const recordDebug = settings.recordDebug || false;
// 解析禁用的标签列表
const disabledTags = (settings.disabledTags || "").split(/[,\s、]+/).filter(tag => tag.trim() !== "");
let disabledTags = [];
if (settings.disabledTagsList) {
disabledTags = Array.from(settings.disabledTagsList);
} else if (typeof settings.disabledTags === 'string') {
disabledTags = (settings.disabledTags || "").split(/[,\s、]+/).filter(tag => tag.trim() !== "");
} else if (settings.disabledTags) {
disabledTags = Array.from(settings.disabledTags);
}
if (disabledTags.length > 0) {
log.info(`已禁用标签: ${disabledTags.join(", ")}`);
}

View File

@@ -0,0 +1,437 @@
[
{
"npcname": "神奇的霍普金斯",
"1d": [
"圣水"
],
"1d_time": "2026-04-09T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "布兰琪",
"1d": [
"盐",
"胡椒",
"洋葱",
"牛奶",
"卷心菜",
"土豆",
"小麦"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "莎拉",
"1d": [],
"1d_time": null,
"3d": [],
"3d_time": null,
"7d": [
"培根"
],
"7d_time": "2026-03-30T04:00:00+08:00",
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "东升",
"1d": [
"盐",
"胡椒",
"洋葱",
"牛奶",
"卷心菜",
"土豆",
"小麦",
"稻米",
"虾仁",
"豆腐",
"杏仁"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "葵",
"1d": [
"盐",
"胡椒",
"洋葱",
"牛奶",
"卷心菜",
"土豆"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "清子",
"1d": [],
"1d_time": null,
"3d": [],
"3d_time": null,
"7d": [
"牛奶",
"土豆",
"小麦",
"豆腐"
],
"7d_time": "2026-04-13T04:00:00+08:00",
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "哈马维",
"1d": [
"盐",
"胡椒",
"洋葱",
"牛奶"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "拉玛",
"1d": [
"盐",
"胡椒"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "布希柯",
"1d": [
"枫达",
"盐",
"胡椒",
"洋葱",
"牛奶"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "阿鲁埃",
"1d": [
"枫达"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "老孙",
"1d": [
"虾仁"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "长顺",
"1d": [
"土豆"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "小畑",
"1d": [
"虾仁"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "珀姆",
"1d": [
"虾仁"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "布特罗斯",
"1d": [
"虾仁"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "欧仁妮",
"1d": [
"卷心菜"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "桑格内蒂",
"1d": [
"枫达"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "安特曼",
"1d": [
"虾仁"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "皮托",
"1d": [
"牛奶"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "钦特利",
"1d": [
"土豆"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "布纳马",
"1d": [
"盐",
"胡椒",
"洋葱",
"牛奶",
"卷心菜"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "采若",
"1d": [
"盐",
"胡椒",
"洋葱",
"牛奶",
"卷心菜",
"土豆",
"小麦",
"黑麦"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "科菲策",
"1d": [
"牛奶"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "丰泰",
"1d": [
"稻米",
"豆腐"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "路易",
"1d": [
"枫达"
],
"1d_time": "2026-04-13T04:00:00+08:00",
"3d": [],
"3d_time": null,
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
},
{
"npcname": "小白",
"1d": [],
"1d_time": null,
"3d": [
"豆腐",
"杏仁"
],
"3d_time": "2026-04-15T04:00:00+08:00",
"7d": [],
"7d_time": null,
"thu": [],
"thu_time": null,
"month": [],
"month_time": null
}
]

View File

@@ -2,19 +2,157 @@
{
"name": "userName",
"type": "input-text",
"label": "账号名(用于区分不同账户的记录)\n为空则读取uid作为自定义CD记录标识",
"label": "账号名(用于区分不同账户的记录)\\n为空则读取uid作为自定义CD记录标识",
"default": "默认账户"
},
{
"name": "foodsToBuy",
"type": "input-text",
"label": "要购买的商品(多个商品用空格分隔)\n示例\"小麦 黑麦\"\n\n支援的 商人与商品详细 请前往 README.md 查看\n建议直接复制商品名称贴上输入栏",
"default": "小麦 黑麦"
"name": "foodsToBuyList",
"type": "multi-checkbox",
"label": "要购买的商品",
"options": [
"「四方八方之网」",
"「皮拉米达的夜莺」",
"云岩裂叶",
"兽肉",
"冒险家之花",
"冒险家头带",
"冒险家尾羽",
"冒险家怀表",
"冒险家金杯",
"冰钩钩果汁",
"冰雾花花朵",
"劫波莲",
"卷心菜",
"发酵果实汁",
"咖啡豆",
"嘟嘟莲",
"团子牛奶",
"土豆",
"圣水",
"培根",
"堇瓜",
"塞西莉亚花",
"墩墩桃",
"夜泊石",
"大碗茶",
"奶油",
"奶酪",
"宿影花",
"小灯草",
"小麦",
"帕蒂沙兰",
"幸运儿之杯",
"幸运儿沙漏",
"幸运儿绿花",
"幸运儿银冠",
"幸运儿鹰羽",
"微光角菌",
"慕风蘑菇",
"日落果",
"星蕈",
"星螺",
"杏仁",
"松茸",
"果酱",
"枣椰",
"枫达",
"树王圣体菇",
"树莓薄荷饮",
"气泡酸莓汁",
"水晶块",
"汐藻",
"沉玉仙茗",
"泡泡桔",
"洋葱",
"浪沫羽鳃",
"海灵芝",
"海草",
"海露花",
"清心",
"清水玉",
"游医的怀钟",
"游医的方巾",
"游医的枭羽",
"游医的药壶",
"游医的银莲",
"澄晶实",
"火腿",
"灼灼彩菊",
"烈焰花花蕊",
"烛伞蘑菇",
"烬芯花",
"熏禽肉",
"牛奶",
"特制风味烤蘑菇披萨",
"珊瑚真珠",
"琉璃百合",
"琉璃袋",
"琉鳞石",
"甜甜花",
"电气水晶",
"番茄",
"白萝卜",
"白铁块",
"盐",
"石珀",
"禽肉",
"秃秃豆",
"稻米",
"竹笋",
"糖",
"绝云椒椒",
"肉龙掌",
"胡椒",
"胡萝卜",
"苍晶螺",
"苦种",
"苹果",
"苹果酿",
"茉洁草",
"莲蓬",
"萃凝晶",
"落落莓",
"蒲公英籽",
"薄荷",
"蘑菇",
"虹彩蔷薇",
"虾仁",
"螃蟹",
"蟹黄",
"豆腐",
"边陲之地",
"野浆果之路",
"金鱼草",
"钩钩果",
"铁块",
"霄灯",
"霓裳花",
"霜盏花",
"青蜜莓",
"面粉",
"颗粒果",
"风车菊",
"香肠",
"香辛料",
"香辛果",
"马尾",
"鱼肉",
"鱼肉2",
"鳗肉",
"鸟蛋",
"鸣草",
"黄油",
"黑麦"
],
"default": [
"小麦",
"黑麦"
]
},
{
"name": "AKF",
"type": "select",
"label": "每周商品购买方式\n0=跟随系统周期自动判定\n1-7=指定星期几购买(1=周一,7=周日)",
"label": "每周商品购买方式\\n0=跟随系统周期自动判定\\n1-7=指定星期几购买(1=周一,7=周日)",
"options": [
"0",
"1",
@@ -28,10 +166,127 @@
"default": "0"
},
{
"name": "disabledTags",
"type": "input-text",
"label": "禁用标签\n多个标签以空格分隔 挪德卡莱 黑心商人 卡琵莉亚)",
"default": "卡琵莉亚"
"name": "disabledTagsList",
"type": "multi-checkbox",
"label": "禁用标签",
"options": [
"东升",
"丰泰",
"丽切娅",
"伊蜜",
"克洛莎",
"克罗丽丝",
"兰巴德",
"兰巴德酒馆",
"兰玛尼",
"凯叔",
"化城郭",
"博来",
"卡嘉",
"卡琵莉亚",
"卯师父",
"哈马维",
"圣火竞技场",
"坚岩隘谷",
"夏安卡",
"天使的馈赠",
"奥摩斯港",
"安特曼",
"小畑",
"小白",
"山城健太",
"巴巴克",
"布兰琪",
"布希柯",
"布特罗斯",
"布纳马",
"张顺",
"德波大饭店",
"德米安",
"志村勘兵卫",
"恩忒卡",
"悠悠度假村",
"拉玛",
"挪德卡莱",
"旗舰",
"普斯帕咖啡馆",
"智树",
"望舒客栈",
"木南杏奈",
"朱特",
"朱老板",
"杜拉夫",
"枫丹",
"枫丹廷",
"查尔斯",
"桑格内蒂",
"桓那兰那(梦境)",
"欧仁妮",
"海祇岛",
"清子",
"清泉镇",
"灰河",
"狗粮商人",
"独立地图",
"珀姆",
"琳琅",
"琼玑野",
"璃月",
"璃月港",
"白淞镇",
"白狐之野",
"皮托",
"皮拉米达城",
"石头",
"石榴",
"石门",
"神奇的霍普金斯",
"离岛",
"秋月",
"秋蔚",
"科菲策",
"移动",
"稀少商品",
"稻妻",
"稻妻城",
"穆托莉娜",
"纳塔",
"老周叔",
"老孙",
"老高",
"艾库瓦",
"芙萝拉",
"若紫",
"莎拉",
"菲尔戈黛特",
"葵",
"蒙德",
"蒙德城",
"路易",
"轻策庄",
"连芳",
"遗珑埠",
"那夏镇",
"采若",
"钦特利",
"锈舵酒馆",
"长顺",
"阿什帕齐",
"阿夫辛",
"阿如村",
"阿山婆",
"阿扎莱",
"阿桂",
"阿鲁埃",
"雷科",
"须弥",
"须弥城",
"风起地",
"黑心商人"
],
"default": [
"卡琵莉亚"
]
},
{
"name": "skip",
@@ -42,7 +297,7 @@
{
"name": "ignoreRecords",
"type": "checkbox",
"label": "-----------------\n无视记录强制购买不推荐",
"label": "-----------------\\n无视记录强制购买不推荐",
"default": false
},
{
@@ -51,5 +306,4 @@
"label": "调试模式(显示详细日志)",
"default": false
}
]
]

View File

@@ -0,0 +1,750 @@
import json
import os
# Content of npcs.json
npcs_content = """
{
"克罗丽丝": {
"name": "克罗丽丝",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/蒙德-风起地-克罗丽丝.json",
"_3d_foods": ["金鱼草", "薄荷", "钩钩果","落落莓","慕风蘑菇"],
"tags": ["蒙德", "风起地", "克罗丽丝", "移动"]
},
"神奇的霍普金斯": {
"name": "神奇的霍普金斯",
"enable": true,
"page": 2,
"time": "day",
"path": "assets/path/蒙德-清泉镇-神奇的霍普金斯.json",
"_1d_foods": ["圣水"],
"tags": ["蒙德", "清泉镇", "神奇的霍普金斯", "稀少商品"]
},
"杜拉夫": {
"name": "杜拉夫",
"enable": true,
"page": 1,
"time": "day",
"path": "assets/path/蒙德-清泉镇-杜拉夫.json",
"_1d_foods": ["兽肉", "禽肉", "鸟蛋"],
"tags": ["蒙德", "清泉镇", "杜拉夫"]
},
"Blanche": {
"name": "布兰琪",
"enable": true,
"page": 2,
"time": "night",
"path": "assets/path/蒙德-蒙德城-布兰琪.json",
"_1d_foods": ["", "胡椒", "洋葱", "牛奶", "番茄", "卷心菜", "土豆", "小麦"],
"tags": ["蒙德", "蒙德城", "布兰琪"]
},
"莎拉": {
"name": "莎拉",
"enable": true,
"page": 4,
"time": "night",
"path": "assets/path/蒙德-蒙德城-莎拉.json",
"_7d_foods": ["面粉","奶油","熏禽肉","黄油","火腿","","蟹黄","果酱","奶酪","培根","香肠"],
"tags": ["蒙德", "蒙德城", "莎拉"]
},
"芙萝拉": {
"name": "芙萝拉",
"enable": true,
"page": 1,
"time": "day",
"path": "assets/path/蒙德-蒙德城-芙萝拉.json",
"_3d_foods": ["甜甜花", "风车菊", "塞西莉亚花", "小灯草", "嘟嘟莲"],
"tags": ["蒙德", "蒙德城", "芙萝拉"]
},
"石榴": {
"name": "石榴",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/蒙德-蒙德城-石榴.json",
"_thu_foods": ["冒险家金杯", "冒险家尾羽", "冒险家头带", "冒险家之花", "冒险家怀表"],
"tags": ["蒙德", "蒙德城", "石榴", "狗粮商人"]
},
"查尔斯": {
"name": "查尔斯",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/蒙德-蒙德城-天使的馈赠-查尔斯.json",
"_1d_foods": ["冰钩钩果汁", "树莓薄荷饮", "苹果酿", "气泡酸莓汁"],
"tags": ["蒙德", "蒙德城", "天使的馈赠", "查尔斯", "独立地图", "稀少商品"]
},
"阿山婆": {
"name": "阿山婆",
"enable": true,
"page": 2,
"time": "any",
"path": "assets/path/璃月-璃月港-阿山婆.json",
"_1d_foods": ["霄灯"],
"tags": ["璃月", "璃月港", "阿山婆"]
},
"石头": {
"name": "石头",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/璃月-璃月港-石头.json",
"_1d_foods": ["铁块", "白铁块", "夜泊石"],
"tags": ["璃月", "璃月港", "石头"]
},
"DongSheng": {
"name": "东升",
"enable": true,
"page": 2,
"time": "any",
"path": "assets/path/璃月-璃月港-东升.json",
"_1d_foods": ["", "胡椒", "洋葱", "牛奶", "番茄", "卷心菜", "土豆", "小麦", "稻米", "虾仁", "豆腐", "杏仁" ],
"tags": ["璃月", "璃月港", "东升"]
},
"ChefMao": {
"name": "卯师父",
"enable": true,
"page": 5,
"time": "any",
"path": "assets/path/璃月-璃月港-卯师父.json",
"_1d_foods": ["鱼肉", "螃蟹"],
"_3d_foods": ["竹笋", "莲蓬", "松茸", "蘑菇", "胡萝卜", "白萝卜", "绝云椒椒"],
"_7d_foods": ["面粉","","香肠","火腿"],
"tags": ["璃月", "璃月港", "卯师父"]
},
"UncleSun": {
"name": "老孙",
"enable": true,
"page": 1,
"time": "day",
"path": "assets/path/璃月-璃月港-老孙.json",
"_1d_foods": ["鱼肉", "螃蟹", "虾仁"],
"tags": ["璃月", "璃月港", "老孙"]
},
"UncleGao": {
"name": "老高",
"enable": true,
"page": 1,
"time": "day",
"path": "assets/path/璃月-璃月港-老高.json",
"_1d_foods": ["鱼肉","鱼肉2"],
"tags": ["璃月", "璃月港", "老高"]
},
"长顺": {
"name": "长顺",
"enable": true,
"page": 1,
"time": "day",
"path": "assets/path/璃月-璃月港-长顺.json",
"_1d_foods": ["土豆"],
"_3d_foods": ["石珀", "电气水晶"],
"_7d_foods": ["", "奶酪"],
"tags": ["璃月", "璃月港", "长顺"]
},
"琳琅": {
"name": "琳琅",
"enable": true,
"page": 1,
"time": "night",
"path": "assets/path/璃月-璃月港-琳琅.json",
"_thu_foods": ["游医的药壶" ,"游医的枭羽" ,"游医的方巾" ,"游医的银莲" ,"游医的怀钟"],
"tags": ["璃月", "璃月港", "琳琅", "狗粮商人"]
},
"张顺": {
"name": "张顺",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/璃月-璃月港-张顺.json",
"_thu_foods": ["幸运儿之杯", "幸运儿鹰羽", "幸运儿银冠", "幸运儿绿花", "幸运儿沙漏"],
"tags": ["璃月", "璃月港", "张顺", "狗粮商人"]
},
"博来": {
"name": "博来",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/璃月-璃月港-博来.json",
"_3d_foods": ["苹果", "日落果", "鱼肉", "星螺"],
"tags": ["璃月", "璃月港", "博来"]
},
"阿桂": {
"name": "阿桂",
"enable": true,
"page": 2,
"time": "night",
"path": "assets/path/璃月-璃月港-阿桂.json",
"_3d_foods": ["清心", "琉璃袋", "马尾", "莲蓬", "冰雾花花朵", "烈焰花花蕊"],
"tags": ["璃月", "璃月港", "阿桂"]
},
"朱老板": {
"name": "朱老板",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/璃月-琼玑野-朱老板.json",
"_1d_foods": ["大碗茶"],
"tags": ["璃月", "琼玑野", "朱老板", "稀少商品"]
},
"菲尔戈黛特": {
"name": "菲尔戈黛特",
"enable": true,
"page": 2,
"time": "any",
"path": "assets/path/璃月-望舒客栈-菲尔戈黛特.json",
"_3d_foods": ["松茸","霓裳花", "琉璃袋"],
"_7d_foods": ["黄油", "香肠"],
"tags": ["璃月", "望舒客栈", "菲尔戈黛特"]
},
"老周叔": {
"name": "老周叔",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/璃月-石门-老周叔.json",
"_1d_foods": ["大碗茶"],
"tags": ["璃月", "石门", "老周叔", "稀少商品"]
},
"小白": {
"name": "小白",
"enable": true,
"page": 2,
"time": "any",
"path": "assets/path/璃月-轻策庄-小白.json",
"_3d_foods": ["豆腐", "杏仁", "霓裳花"],
"_month_foods": ["琉璃百合"],
"tags": ["璃月", "轻策庄", "小白"]
},
"凯叔": {
"name": "凯叔",
"enable": true,
"page": 1,
"time": "day",
"path": "assets/path/璃月-轻策庄-凯叔.json",
"_1d_foods": ["大碗茶"],
"tags": ["璃月", "轻策庄", "凯叔", "稀少商品"]
},
"丰泰": {
"name": "丰泰",
"enable": true,
"page": 2,
"time": "any",
"path": "assets/path/璃月-遗珑埠-丰泰.json",
"_1d_foods": ["稻米","豆腐"],
"_3d_foods": [ "清水玉","石珀","夜泊石","琉璃袋", "霓裳花", "绝云椒椒","沉玉仙茗"],
"_7d_foods": ["蟹黄"],
"tags": ["璃月", "遗珑埠", "丰泰"]
},
"连芳": {
"name": "连芳",
"enable": true,
"page": 2,
"time": "any",
"path": "assets/path/璃月-遗珑埠-连芳.json",
"_3d_foods": ["沉玉仙茗"],
"tags": ["璃月", "遗珑埠", "连芳"]
},
"Obata": {
"name": "小畑",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/稻妻-离岛-小畑.json",
"_1d_foods": ["螃蟹","鱼肉", "虾仁"],
"_3d_foods": ["海灵芝"],
"tags": ["稻妻", "离岛", "小畑"]
},
"秋月": {
"name": "秋月",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/稻妻-离岛-秋月.json",
"_1d_foods": ["铁块", "白铁块", "电气水晶"],
"tags": ["稻妻", "离岛", "秋月"]
},
"山城健太": {
"name": "山城健太",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/稻妻-离岛-山城健太.json",
"_1d_foods": ["鳗肉"],
"_3d_foods": ["珊瑚真珠"],
"_thu_foods": ["幸运儿之杯", "幸运儿鹰羽", "幸运儿银冠", "幸运儿绿花", "幸运儿沙漏"],
"tags": ["稻妻", "离岛", "山城健太", "狗粮商人"]
},
"卡琵莉亚": {
"name": "卡琵莉亚",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/稻妻-离岛-卡琵莉亚.json",
"_3d_foods": ["蒲公英籽"],
"tags": ["稻妻", "离岛", "卡琵莉亚"]
},
"若紫": {
"name": "若紫",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/稻妻-白狐之野-若紫.json",
"_7d_foods": ["「四方八方之网」"],
"tags": ["稻妻", "白狐之野", "若紫"]
},
"Aoi": {
"name": "",
"enable": true,
"page": 2,
"time": "any",
"path": "assets/path/稻妻-稻妻城-葵.json",
"_1d_foods": ["", "胡椒", "洋葱", "牛奶", "番茄", "卷心菜", "土豆", "小麦", "稻米", "虾仁", "豆腐"],
"_3d_foods": ["鸣草"],
"tags": ["稻妻", "稻妻城", ""]
},
"ShimuraKanbei": {
"name": "志村勘兵卫",
"enable": true,
"page": 4,
"time": "any",
"path": "assets/path/稻妻-稻妻城-志村勘兵卫.json",
"_1d_foods": ["鱼肉", "螃蟹"],
"_3d_foods": ["海草", "堇瓜", "白萝卜"],
"_7d_foods": ["香肠", "培根", "面粉", ""],
"tags": ["稻妻", "稻妻城", "志村勘兵卫"]
},
"智树": {
"name": "智树",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/稻妻-稻妻城-智树.json",
"_1d_foods": ["团子牛奶"],
"tags": ["稻妻", "稻妻城", "智树", "稀少商品"]
},
"木南杏奈": {
"name": "木南杏奈",
"enable": true,
"page": 2,
"time": "any",
"path": "assets/path/稻妻-稻妻城-木南杏奈.json",
"_1d_foods": ["特制风味烤蘑菇披萨"],
"tags": ["稻妻", "稻妻城", "木南杏奈", "稀少商品"]
},
"清子": {
"name": "清子",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/稻妻-海祇岛-清子.json",
"_7d_foods": ["牛奶", "番茄", "土豆", "小麦", "豆腐"],
"tags": ["稻妻", "海祇岛", "清子"]
},
"阿什帕齐": {
"name": "阿什帕齐",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/须弥-化城郭-阿什帕齐.json",
"_1d_foods": ["兽肉", "禽肉"],
"_3d_foods": ["鸟蛋", "树王圣体菇"],
"_7d_foods": ["香辛料"],
"tags": ["须弥", "化城郭", "阿什帕齐"]
},
"Zhute": {
"name": "朱特",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/须弥-须弥城-朱特.json",
"_3d_foods": ["香辛果", "帕蒂沙兰"],
"_7d_foods": ["香辛料"],
"tags": ["须弥", "须弥城", "朱特"]
},
"阿夫辛": {
"name": "阿夫辛",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/须弥-须弥城-阿夫辛.json",
"_thu_foods": ["冒险家金杯", "冒险家尾羽", "冒险家头带", "冒险家之花", "冒险家怀表"],
"tags": ["须弥", "须弥城", "阿夫辛", "狗粮商人"]
},
"Pam": {
"name": "珀姆",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/须弥-须弥城-珀姆.json",
"_1d_foods": ["鱼肉", "螃蟹", "虾仁"],
"_3d_foods": ["海草"],
"tags": ["须弥", "须弥城", "珀姆"]
},
"Hamawi": {
"name": "哈马维",
"enable": true,
"page": 2,
"time": "any",
"path": "assets/path/须弥-须弥城-哈马维.json",
"_1d_foods": ["", "胡椒", "洋葱", "牛奶", "番茄", "卷心菜", "土豆", "小麦", "稻米", "豆腐", "虾仁"],
"_3d_foods": ["香辛果", "墩墩桃"],
"tags": ["须弥", "须弥城", "哈马维"]
},
"Lambad": {
"name": "兰巴德",
"enable": true,
"page": 3,
"time": "any",
"path": "assets/path/须弥-须弥城-兰巴德酒馆-兰巴德.json",
"_1d_foods": ["鱼肉", "螃蟹", "秃秃豆"],
"_3d_foods": ["星蕈"],
"_7d_foods": ["面粉", "香肠", "培根", "香辛料", ""],
"tags": ["须弥", "须弥城", "兰巴德酒馆", "兰巴德", "独立地图"]
},
"Enteka": {
"name": "恩忒卡",
"enable": true,
"page": 2,
"time": "any",
"path": "assets/path/须弥-须弥城-普斯帕咖啡馆-恩忒卡.json",
"_1d_foods": ["咖啡豆"],
"tags": ["须弥", "须弥城", "普斯帕咖啡馆", "恩忒卡", "独立地图"]
},
"拉玛": {
"name": "拉玛",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/须弥-奥摩斯港-拉玛.json",
"_1d_foods": ["", "胡椒"],
"_7d_foods": ["香辛料", "", "黄油", "奶酪"],
"tags": ["须弥", "奥摩斯港", "拉玛"]
},
"Butrus": {
"name": "布特罗斯",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/须弥-奥摩斯港-布特罗斯.json",
"_1d_foods": ["鱼肉", "螃蟹", "虾仁"],
"tags": ["须弥", "奥摩斯港", "布特罗斯"]
},
"秋蔚": {
"name": "秋蔚",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/须弥-奥摩斯港-秋蔚.json",
"_3d_foods": ["水晶块", "石珀", "夜泊石", "霓裳花"],
"tags": ["须弥", "奥摩斯港", "秋蔚"]
},
"巴巴克": {
"name": "巴巴克",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/须弥-奥摩斯港-巴巴克.json",
"_3d_foods": ["慕风蘑菇" ,"蒲公英籽" ,"琉璃袋", "清心", "鸣草", "珊瑚真珠"],
"tags": ["须弥", "奥摩斯港", "巴巴克"]
},
"兰玛尼": {
"name": "兰玛尼",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/须弥-桓那兰那(梦境)-兰玛尼.json",
"_3d_foods": ["日落果", "香辛果", "墩墩桃", "树王圣体菇", "劫波莲"],
"tags": ["须弥", "桓那兰那(梦境)", "兰玛尼", "桓那兰那(梦境)"]
},
"Azalai": {
"name": "阿扎莱",
"enable": true,
"page": 2,
"time": "night",
"path": "assets/path/须弥-阿如村-阿扎莱.json",
"_1d_foods": ["鱼肉", "兽肉", "秃秃豆"],
"_3d_foods": ["星蕈", "枣椰", "墩墩桃"],
"_7d_foods": ["面粉", "香辛料", ""],
"tags": ["须弥", "阿如村", "阿扎莱", "黑心商人"]
},
"Boucicaut": {
"name": "布希柯",
"enable": true,
"page": 2,
"time": "any",
"path": "assets/path/枫丹-枫丹廷-布希柯.json",
"_1d_foods": ["枫达", "", "胡椒", "洋葱", "牛奶", "番茄", "卷心菜", "土豆", "小麦", "秃秃豆", "杏仁", "发酵果实汁"],
"_3d_foods": ["蘑菇", "茉洁草"],
"tags": ["枫丹", "枫丹廷", "布希柯"]
},
"Arouet": {
"name": "阿鲁埃",
"enable": true,
"page": 2,
"time": "any",
"path": "assets/path/枫丹-枫丹廷-阿鲁埃.json",
"_1d_foods": ["枫达", "咖啡豆"],
"tags": ["枫丹", "枫丹廷", "阿鲁埃"]
},
"路易": {
"name": "路易",
"enable": true,
"page": 2,
"time": "any",
"path": "assets/path/枫丹-枫丹廷-路易.json",
"_1d_foods": ["枫达"],
"tags": ["枫丹", "枫丹廷", "路易"]
},
"欧仁妮": {
"name": "欧仁妮",
"enable": true,
"page": 2,
"time": "any",
"path": "assets/path/枫丹-枫丹廷-欧仁妮.json",
"_1d_foods": ["番茄", "卷心菜"],
"_3d_foods": ["泡泡桔", "茉洁草", "日落果", "墩墩桃", "枣椰", "落落莓", "虹彩蔷薇"],
"tags": ["枫丹", "枫丹廷", "欧仁妮"]
},
"桑格内蒂": {
"name": "桑格内蒂",
"enable": true,
"page": 5,
"time": "any",
"path": "assets/path/枫丹-枫丹廷-德波大饭店-桑格内蒂.json",
"_1d_foods": ["枫达"],
"_7d_foods": ["面粉","奶油","黄油","火腿","","蟹黄","果酱","奶酪","培根","香肠"],
"tags": ["枫丹", "枫丹廷", "德波大饭店", "桑格内蒂", "独立地图"]
},
"克洛莎": {
"name": "克洛莎",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/枫丹-枫丹廷-灰河-克洛莎.json",
"_thu_foods": ["幸运儿之杯", "幸运儿鹰羽", "幸运儿银冠", "幸运儿绿花", "幸运儿沙漏"],
"tags": ["枫丹", "枫丹廷", "灰河", "克洛莎", "狗粮商人"]
},
"Antman": {
"name": "安特曼",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/枫丹-白淞镇-安特曼.json",
"_1d_foods": ["鱼肉", "螃蟹", "虾仁"],
"_3d_foods": ["海露花", "汐藻", "苍晶螺"],
"tags": ["枫丹", "白淞镇", "安特曼"]
},
"皮托": {
"name": "皮托",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/枫丹-锈舵酒馆-皮托.json",
"_1d_foods": ["牛奶"],
"_7d_foods": ["培根", "火腿", "香肠", "奶酪"],
"tags": ["枫丹", "锈舵酒馆", "皮托", "黑心商人"]
},
"艾库瓦": {
"name": "艾库瓦",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/纳塔-圣火竞技场-艾库瓦.json",
"_thu_foods": ["幸运儿之杯", "幸运儿鹰羽", "幸运儿银冠", "幸运儿绿花", "幸运儿沙漏"],
"tags": ["纳塔", "圣火竞技场", "艾库瓦", "狗粮商人"]
},
"钦特利": {
"name": "钦特利",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/纳塔-圣火竞技场-钦特利.json",
"_1d_foods": ["土豆"],
"_3d_foods": ["烛伞蘑菇", "颗粒果", "苦种", "烬芯花", "青蜜莓", "肉龙掌"],
"tags": ["纳塔", "圣火竞技场", "钦特利"]
},
"Bunama": {
"name": "布纳马",
"enable": true,
"page": 2,
"time": "any",
"path": "assets/path/纳塔-圣火竞技场-布纳马.json",
"_1d_foods": ["", "胡椒", "小麦", "洋葱", "牛奶", "番茄", "卷心菜", "土豆", "秃秃豆"],
"tags": ["纳塔", "圣火竞技场", "布纳马"]
},
"夏安卡": {
"name": "夏安卡",
"enable": true,
"page": 3,
"time": "any",
"path": "assets/path/纳塔-圣火竞技场-夏安卡.json",
"_7d_foods": ["面粉", "奶油", "黄油", "火腿", "", "蟹黄", "果酱", "奶酪", "培根", "香肠"],
"tags": ["纳塔", "圣火竞技场", "夏安卡"]
},
"伊蜜": {
"name": "伊蜜",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/纳塔-坚岩隘谷-伊蜜.json",
"_3d_foods": ["铁块", "白铁块", "水晶块", "萃凝晶", "澄晶实"],
"tags": ["纳塔", "坚岩隘谷", "伊蜜"]
},
"穆托莉娜": {
"name": "穆托莉娜",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/纳塔-悠悠度假村-穆托莉娜.json",
"_3d_foods": ["灼灼彩菊", "肉龙掌", "云岩裂叶", "浪沫羽鳃"],
"tags": ["纳塔", "悠悠度假村", "穆托莉娜"]
},
"采若": {
"name": "采若",
"enable": true,
"page": 3,
"time": "any",
"path": "assets/path/挪德卡莱-那夏镇-采若.json",
"_1d_foods": ["", "胡椒", "洋葱", "牛奶", "番茄", "卷心菜", "土豆", "小麦", "黑麦"],
"tags": ["挪德卡莱", "那夏镇", "采若"]
},
"丽切娅": {
"name": "丽切娅",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/挪德卡莱-那夏镇-丽切娅.json",
"_3d_foods": ["甜甜花", "宿影花", "霜盏花"],
"tags": ["挪德卡莱", "那夏镇", "丽切娅"]
},
"卡嘉": {
"name": "卡嘉",
"enable": true,
"page": 4,
"time": "any",
"path": "assets/path/挪德卡莱-那夏镇-卡嘉.json",
"_7d_foods": ["面粉", "奶油", "熏禽肉", "黄油", "火腿", "", "蟹黄", "果酱", "奶酪", "培根", "香肠"],
"tags": ["挪德卡莱", "那夏镇", "卡嘉"]
},
"雷科": {
"name": "雷科",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/挪德卡莱-那夏镇-雷科.json",
"_thu_foods": ["幸运儿之杯", "幸运儿鹰羽", "幸运儿银冠", "幸运儿绿花", "幸运儿沙漏"],
"tags": ["挪德卡莱", "那夏镇", "雷科", "狗粮商人"]
},
"德米安": {
"name": "德米安",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/挪德卡莱-那夏镇-旗舰-德米安.json",
"_1d_foods": ["「皮拉米达的夜莺」", "边陲之地", "野浆果之路"],
"tags": ["挪德卡莱", "那夏镇", "旗舰", "德米安", "稀少商品", "独立地图"]
},
"科菲策": {
"name": "科菲策",
"enable": true,
"page": 1,
"time": "any",
"path": "assets/path/挪德卡莱-皮拉米达城-科菲策.json",
"_1d_foods": ["牛奶", "咖啡豆"],
"_3d_foods": ["微光角菌", "琉鳞石"],
"tags": ["挪德卡莱", "皮拉米达城", "科菲策", "黑心商人"]
}
}
"""
data = json.loads(npcs_content)
all_foods = set()
all_tags = set()
for npc in data.values():
if "_1d_foods" in npc:
for food in npc["_1d_foods"]:
all_foods.add(food)
if "_3d_foods" in npc:
for food in npc["_3d_foods"]:
all_foods.add(food)
if "_7d_foods" in npc:
for food in npc["_7d_foods"]:
all_foods.add(food)
if "_thu_foods" in npc:
for food in npc["_thu_foods"]:
all_foods.add(food)
if "_month_foods" in npc:
for food in npc["_month_foods"]:
all_foods.add(food)
if "tags" in npc:
for tag in npc["tags"]:
all_tags.add(tag)
# Sort lists
sorted_foods = sorted(list(all_foods))
sorted_tags = sorted(list(all_tags))
settings = [
{
"name": "userName",
"type": "input-text",
"label": "账号名(用于区分不同账户的记录)\\n为空则读取uid作为自定义CD记录标识",
"default": "默认账户"
},
{
"name": "foodsToBuyList",
"type": "multi-checkbox",
"label": "要购买的商品",
"options": sorted_foods,
"default": ["小麦", "黑麦"]
},
{
"name": "AKF",
"type": "select",
"label": "每周商品购买方式\\n0=跟随系统周期自动判定\\n1-7=指定星期几购买(1=周一,7=周日)",
"options": [
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7"
],
"default": "0"
},
{
"name": "disabledTagsList",
"type": "multi-checkbox",
"label": "禁用标签",
"options": sorted_tags,
"default": ["卡琵莉亚"]
},
{
"name": "skip",
"type": "checkbox",
"label": "跳过调整时间动画",
"default": False
},
{
"name": "ignoreRecords",
"type": "checkbox",
"label": "-----------------\\n无视记录强制购买不推荐",
"default": False
},
{
"name": "recordDebug",
"type": "checkbox",
"label": "调试模式(显示详细日志)",
"default": False
}
]
with open('repo/js/自动购买商品/settings.json', 'w', encoding='utf-8') as f:
json.dump(settings, f, indent=4, ensure_ascii=False)