Merge branch 'main' into pr/401
# Conflicts: # repo.json
This commit is contained in:
6
repo/combat/妮草芙白.txt
Normal file
6
repo/combat/妮草芙白.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
// 作者:PineappleBear
|
||||
// 描述:
|
||||
纳西妲 e(hold),wait(0.3),q
|
||||
妮露 e,e,e,e,e,e,e,e
|
||||
芙宁娜 e,q
|
||||
白术 e,q,attack(6),e
|
||||
30
repo/js/AutoProcess/assets/AutoPath/找厨房.json
Normal file
30
repo/js/AutoProcess/assets/AutoPath/找厨房.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "找厨房",
|
||||
"type": "collect",
|
||||
"author": "听雨♪",
|
||||
"version": "1.1",
|
||||
"description": "",
|
||||
"bgiVersion": "0.35.1"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 267.939453125,
|
||||
"y": -665.13134765625,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "teleport"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 254.6251423712256,
|
||||
"y": -680.625,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "target"
|
||||
}
|
||||
]
|
||||
}
|
||||
178
repo/js/AutoProcess/main.js
Normal file
178
repo/js/AutoProcess/main.js
Normal file
@@ -0,0 +1,178 @@
|
||||
// main.js
|
||||
|
||||
const settingsInput = settings.process
|
||||
|
||||
const FoodItems = {
|
||||
1: { name: '面粉', coordinate: [240, 260] },
|
||||
2: { name: '兽肉', coordinate: [435, 260] },
|
||||
3: { name: '鱼肉', coordinate: [630, 260] },
|
||||
4: { name: '神秘肉加工产物', coordinate: [825, 260] },
|
||||
5: { name: '奶油', coordinate: [1020, 260] },
|
||||
6: { name: '熏禽肉', coordinate: [1215, 260] },
|
||||
7: { name: '黄油', coordinate: [1410, 260] },
|
||||
8: { name: '火腿', coordinate: [1605, 260] },
|
||||
9: { name: '糖', coordinate: [240, 500] },
|
||||
10: { name: '香辛料', coordinate: [435, 500] },
|
||||
11: { name: '蟹黄', coordinate: [630, 500] },
|
||||
12: { name: '果酱', coordinate: [825, 500] },
|
||||
13: { name: '奶酪', coordinate: [1020, 500] },
|
||||
14: { name: '培根', coordinate: [1215, 500] },
|
||||
15: { name: '香肠', coordinate: [1410, 500] }
|
||||
};
|
||||
|
||||
const coordinates = {
|
||||
process: [1350, 64],
|
||||
claimAll: [327, 1367],
|
||||
cook: [2250, 1368],
|
||||
amountStart: [990, 790],
|
||||
confirm: [1577, 1011]
|
||||
}
|
||||
|
||||
|
||||
function validateAndStoreNumbers(input) {
|
||||
// 定义存储结果的数组
|
||||
let storedNumbers = [];
|
||||
|
||||
// 使用正则表达式检测是否符合期望格式
|
||||
const regex = /^(\b([1-9]|1[0-5])\b)(, (\b([1-9]|1[0-5])\b))*$/;
|
||||
|
||||
// 检测输入字符串是否符合正则表达式
|
||||
if (regex.test(input)) {
|
||||
// 将输入字符串按逗号和空格分割成数组
|
||||
const numbers = input.split(', ');
|
||||
|
||||
// 将分割后的数字字符串转换为整数并存储到数组中
|
||||
storedNumbers = numbers.map(Number);
|
||||
|
||||
return storedNumbers;
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
async function QucikCook() {
|
||||
// 点击Cook
|
||||
click(...coordinates.cook);
|
||||
await sleep(100); // 等待窗口弹出
|
||||
|
||||
// 选中左边点
|
||||
moveMouseTo(...coordinates.amountStart);
|
||||
await sleep(100);
|
||||
leftButtonDown();
|
||||
await sleep(50);
|
||||
|
||||
// 向右滑动
|
||||
moveMouseBy(1200, 0);
|
||||
await sleep(200);
|
||||
leftButtonUp();
|
||||
await sleep(100);
|
||||
|
||||
// 点击弹出页的确认
|
||||
click(...coordinates.confirm);
|
||||
await sleep(500);
|
||||
|
||||
// 点击空白处关闭
|
||||
click(...coordinates.confirm);
|
||||
await sleep(200);
|
||||
}
|
||||
|
||||
async function AutoPath(locationName) {
|
||||
try {
|
||||
let filePath = `assets/AutoPath/${locationName}.json`;
|
||||
await pathingScript.runFile(filePath);
|
||||
|
||||
return true;
|
||||
} catch (error) {
|
||||
log.error(`执行 ${locationName} 路径时发生错误`);
|
||||
log.error(error.message);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
(async function () {
|
||||
|
||||
// 提醒别带内鬼
|
||||
log.warn("建议不要带某些靠近能灭火的\"内鬼\"角色.")
|
||||
|
||||
|
||||
// 判断设置合法性
|
||||
var items = [];
|
||||
|
||||
if (settingsInput) {
|
||||
items = validateAndStoreNumbers(settingsInput);
|
||||
if (items) {
|
||||
const names = items
|
||||
.map(id => FoodItems[id] ? FoodItems[id].name : null) // 检查是否存在
|
||||
.filter(name => name !== null) // 过滤掉不存在的项
|
||||
.join(', ');
|
||||
log.info("已从设置中读取内容: ")|
|
||||
await sleep(100)
|
||||
log.info(names)
|
||||
|
||||
} else {
|
||||
log.info("设置所填内容不合法, 请仔细阅读设置要求, 或者在群里问其他玩家")
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
} else {
|
||||
log.info("还没有设置需要制作食材呢")
|
||||
log.info("请在调试器里添加本脚本->右键JS脚本->修改JS脚本自定义配置.")
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// 前往灶台
|
||||
if (!await AutoPath("找厨房")) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
//设置脚本环境的游戏分辨率和DPI缩放
|
||||
setGameMetrics(2560, 1440, 1.5);
|
||||
|
||||
// 交互, 进入烹饪界面
|
||||
await sleep(500)
|
||||
keyPress("F")
|
||||
await sleep(1000)
|
||||
click(...coordinates.process)
|
||||
await sleep(1000)
|
||||
|
||||
// 收菜
|
||||
click(...coordinates.claimAll)
|
||||
await sleep(500)
|
||||
click(...coordinates.claimAll)
|
||||
await sleep(500)
|
||||
|
||||
// 批量Cook
|
||||
for (let item of items) {
|
||||
// 选择目标
|
||||
click(...FoodItems[item].coordinate)
|
||||
await sleep(300)
|
||||
|
||||
await QucikCook()
|
||||
|
||||
log.info(`${FoodItems[item].name} = 制作完成 :)`);
|
||||
await sleep(200)
|
||||
}
|
||||
|
||||
// 返回主菜单
|
||||
await genshin.returnMainUi()
|
||||
|
||||
// 后退一下, 防止某些内鬼灭火
|
||||
keyDown("S")
|
||||
await sleep(2000)
|
||||
keyUp("S")
|
||||
|
||||
log.info("┌────────────────────────────┐")
|
||||
log.info(" 感谢您的使用, 任务已全部完成")
|
||||
log.info(" 拜拜")
|
||||
log.info(" Done.")
|
||||
log.info("└────────────────────────────┘")
|
||||
|
||||
|
||||
|
||||
})();
|
||||
14
repo/js/AutoProcess/manifest.json
Normal file
14
repo/js/AutoProcess/manifest.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "自动食材加工",
|
||||
"version": "1.0",
|
||||
"description": "自动食材加工, 可自动获取加工完成食材,可指定制作食材.",
|
||||
"authors": [
|
||||
{
|
||||
"name": "听雨♪",
|
||||
"link": "https://github.com/TingYu-lulumi"
|
||||
}
|
||||
],
|
||||
"settings_ui": "settings.json",
|
||||
"main": "main.js"
|
||||
}
|
||||
7
repo/js/AutoProcess/settings.json
Normal file
7
repo/js/AutoProcess/settings.json
Normal file
@@ -0,0 +1,7 @@
|
||||
[
|
||||
{
|
||||
"name": "process",
|
||||
"type": "input-text",
|
||||
"label": "下面输入框填: 需要加工的食材, 序号为加工界面依次排序,\n英文逗号空格[, ]隔开, 不要输入括号, 只填数字逗号和空格\n如:\n[1, 5, 8, 9, 13](别填括号) 代表加工: 面粉, 奶油, 火腿, 糖, 奶酪"
|
||||
}
|
||||
]
|
||||
100
repo/js/买菜/NPC_list.json
Normal file
100
repo/js/买菜/NPC_list.json
Normal file
@@ -0,0 +1,100 @@
|
||||
{
|
||||
"dongsheng": {
|
||||
"npc_name": "东升",
|
||||
"location_name": "东升",
|
||||
"item_count": 12,
|
||||
"spik_count": 4,
|
||||
"daytimeOnly": 0
|
||||
},
|
||||
"laosun": {
|
||||
"npc_name": "老孙",
|
||||
"location_name": "老孙",
|
||||
"item_count": 3,
|
||||
"spik_count": 5,
|
||||
"daytimeOnly": 1
|
||||
},
|
||||
"laogao": {
|
||||
"npc_name": "老高",
|
||||
"location_name": "老高",
|
||||
"item_count": 3,
|
||||
"spik_count": 5,
|
||||
"daytimeOnly": 1
|
||||
},
|
||||
"maoshifu": {
|
||||
"npc_name": "香菱她爹",
|
||||
"location_name": "卯师父",
|
||||
"item_count": 16,
|
||||
"spik_count": 5,
|
||||
"daytimeOnly": 0
|
||||
},
|
||||
"shala": {
|
||||
"npc_name": "莎拉",
|
||||
"location_name": "莎拉",
|
||||
"item_count": 14,
|
||||
"spik_count": 5,
|
||||
"daytimeOnly": 0
|
||||
},
|
||||
"buluqi": {
|
||||
"npc_name": "布兰琪",
|
||||
"location_name": "布兰琪",
|
||||
"item_count": 8,
|
||||
"spik_count": 5,
|
||||
"daytimeOnly": 0
|
||||
},
|
||||
"kui": {
|
||||
"npc_name": "葵",
|
||||
"location_name": "葵",
|
||||
"item_count": 12,
|
||||
"spik_count": 4,
|
||||
"daytimeOnly": 0
|
||||
},
|
||||
"zckbw": {
|
||||
"npc_name": "志村勘兵卫",
|
||||
"location_name": "志村勘兵卫",
|
||||
"item_count": 12,
|
||||
"spik_count": 4,
|
||||
"daytimeOnly": 0
|
||||
},
|
||||
"pomu": {
|
||||
"npc_name": "珀姆",
|
||||
"location_name": "珀姆",
|
||||
"item_count": 4,
|
||||
"spik_count": 4,
|
||||
"daytimeOnly": 0
|
||||
},
|
||||
"hamawei": {
|
||||
"npc_name": "哈马维",
|
||||
"location_name": "哈马维",
|
||||
"item_count": 13,
|
||||
"spik_count": 5,
|
||||
"daytimeOnly": 0
|
||||
},
|
||||
"buteluosi": {
|
||||
"npc_name": "布特罗斯",
|
||||
"location_name": "布特罗斯",
|
||||
"item_count": 3,
|
||||
"spik_count": 4,
|
||||
"daytimeOnly": 0
|
||||
},
|
||||
"azhalai": {
|
||||
"npc_name": "阿扎莱",
|
||||
"location_name": "阿扎莱",
|
||||
"item_count": 10,
|
||||
"spik_count": 4,
|
||||
"daytimeOnly": 2
|
||||
},
|
||||
"alue": {
|
||||
"npc_name": "阿鲁埃",
|
||||
"location_name": "阿鲁埃",
|
||||
"item_count": 4,
|
||||
"spik_count": 4,
|
||||
"daytimeOnly": 0
|
||||
},
|
||||
"buxike": {
|
||||
"npc_name": "布希柯",
|
||||
"location_name": "布希柯",
|
||||
"item_count": 14,
|
||||
"spik_count": 4,
|
||||
"daytimeOnly": 0
|
||||
}
|
||||
}
|
||||
30
repo/js/买菜/assets/AutoPath/东升.json
Normal file
30
repo/js/买菜/assets/AutoPath/东升.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "ds",
|
||||
"type": "collect",
|
||||
"author": "听雨♪",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.35.1"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": 267.9560546875,
|
||||
"y": -665.14794921875,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 257.146484375,
|
||||
"y": -682.4951171875,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
39
repo/js/买菜/assets/AutoPath/卯师父.json
Normal file
39
repo/js/买菜/assets/AutoPath/卯师父.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "卯师父",
|
||||
"type": "collect",
|
||||
"author": "听雨♪",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.35.1"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": 267.9580078125,
|
||||
"y": -665.1201171875,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 226.04296875,
|
||||
"y": -660.0048828125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 227.4072265625,
|
||||
"y": -668.20751953125,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
75
repo/js/买菜/assets/AutoPath/哈马维.json
Normal file
75
repo/js/买菜/assets/AutoPath/哈马维.json
Normal file
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "哈马维",
|
||||
"type": "collect",
|
||||
"author": "听雨♪",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.35.1"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": 2786.9755859375,
|
||||
"y": -503.09130859375,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 2788.0830078125,
|
||||
"y": -488.28173828125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 2771.4755859375,
|
||||
"y": -476.07421875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 2763.0478515625,
|
||||
"y": -453.83349609375,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 2760.521484375,
|
||||
"y": -439.513671875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": 2778.63671875,
|
||||
"y": -435.7626953125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"x": 2778.24609375,
|
||||
"y": -430.80810546875,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
121
repo/js/买菜/assets/AutoPath/小畑.json
Normal file
121
repo/js/买菜/assets/AutoPath/小畑.json
Normal file
@@ -0,0 +1,121 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "小畑",
|
||||
"type": "collect",
|
||||
"author": "听雨♪",
|
||||
"version": "",
|
||||
"description": "",
|
||||
"bgiVersion": "0.35.1"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": -3812.7041015625,
|
||||
"y": -2546.6064453125,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "teleport"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -3811.9248046875,
|
||||
"y": -2567.5771484375,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": -3727.125996598583,
|
||||
"y": -2570.25,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": -3720.250047457075,
|
||||
"y": -2569.625
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": -3713.6250949141504,
|
||||
"y": -2568.5
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": -3706.7501423712256,
|
||||
"y": -2567.875
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"x": -3700.625284742451,
|
||||
"y": -2566.875
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"x": -3693.2480542599114,
|
||||
"y": -2564.875
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"x": -3684.874810171699,
|
||||
"y": -2562.375
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"x": -3680.4998576287744,
|
||||
"y": -2561.25
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"x": -3677.6251423712256,
|
||||
"y": -2558.125
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
"x": -3675.5,
|
||||
"y": -2558.25,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
"x": -3674.124952542925,
|
||||
"y": -2560.125
|
||||
},
|
||||
{
|
||||
"id": 14,
|
||||
"x": -3672.624952542925,
|
||||
"y": -2564,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 15,
|
||||
"x": -3670.2495728863214,
|
||||
"y": -2567.75
|
||||
},
|
||||
{
|
||||
"id": 16,
|
||||
"x": -3666.0014237122596,
|
||||
"y": -2566
|
||||
},
|
||||
{
|
||||
"id": 17,
|
||||
"x": -3667.37571185613,
|
||||
"y": -2561.125,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "target"
|
||||
}
|
||||
]
|
||||
}
|
||||
39
repo/js/买菜/assets/AutoPath/布兰琪.json
Normal file
39
repo/js/买菜/assets/AutoPath/布兰琪.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "布兰琪",
|
||||
"type": "collect",
|
||||
"author": "听雨♪",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.35.1"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": -867.720703125,
|
||||
"y": 2281.377685546875,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -893.705078125,
|
||||
"y": 2258.10791015625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": -895.7216796875,
|
||||
"y": 2264.712890625,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
57
repo/js/买菜/assets/AutoPath/布希柯.json
Normal file
57
repo/js/买菜/assets/AutoPath/布希柯.json
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "布希柯",
|
||||
"type": "collect",
|
||||
"author": "听雨♪",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.35.1"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": 4508.96875,
|
||||
"y": 3630.584228515625,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 4514.79296875,
|
||||
"y": 3605.441650390625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 4497.20556640625,
|
||||
"y": 3586.030029296875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 4475.7421875,
|
||||
"y": 3559.308837890625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 4470.52685546875,
|
||||
"y": 3560.251708984375,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
30
repo/js/买菜/assets/AutoPath/布特罗斯.json
Normal file
30
repo/js/买菜/assets/AutoPath/布特罗斯.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "布特罗斯",
|
||||
"type": "collect",
|
||||
"author": "听雨♪",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.35.1"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": 2679.8427734375,
|
||||
"y": -1935.005859375,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 2659.951171875,
|
||||
"y": -1928.943359375,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
39
repo/js/买菜/assets/AutoPath/志村勘兵卫.json
Normal file
39
repo/js/买菜/assets/AutoPath/志村勘兵卫.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "志村勘兵卫",
|
||||
"type": "collect",
|
||||
"author": "听雨♪",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.35.1"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": -4402.5703125,
|
||||
"y": -3053.0234375,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "teleport"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -4418.000213556839,
|
||||
"y": -3083.5625,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": -4424.500332199528,
|
||||
"y": -3080.375,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "target"
|
||||
}
|
||||
]
|
||||
}
|
||||
39
repo/js/买菜/assets/AutoPath/珀姆.json
Normal file
39
repo/js/买菜/assets/AutoPath/珀姆.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "珀姆",
|
||||
"type": "collect",
|
||||
"author": "听雨♪",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.35.1"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": 2786.958984375,
|
||||
"y": -503.0859375,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 2809.5712890625,
|
||||
"y": -514.7138671875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 2811.244140625,
|
||||
"y": -509.603515625,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
102
repo/js/买菜/assets/AutoPath/老孙.json
Normal file
102
repo/js/买菜/assets/AutoPath/老孙.json
Normal file
@@ -0,0 +1,102 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "买鱼-1",
|
||||
"type": "buy",
|
||||
"author": "听雨♪",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.35.1"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 263.5,
|
||||
"y": -672.5,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "teleport"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 247.5,
|
||||
"y": -664.5,
|
||||
"action": "",
|
||||
"move_mode": "run",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 214.5,
|
||||
"y": -661.5,
|
||||
"action": "",
|
||||
"move_mode": "run",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 192.5,
|
||||
"y": -682,
|
||||
"action": "",
|
||||
"move_mode": "run",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 162.5,
|
||||
"y": -681,
|
||||
"action": "",
|
||||
"move_mode": "run",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": 157.5000949141504,
|
||||
"y": -630.375,
|
||||
"action": "",
|
||||
"move_mode": "run",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"x": 139.99022999999943,
|
||||
"y": -608.2969000000003,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"x": 162.32030999999915,
|
||||
"y": -592.3183600000002,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"x": 167.29102000000057,
|
||||
"y": -599.75684,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"x": 163.2538999999997,
|
||||
"y": -603.9433600000002,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
93
repo/js/买菜/assets/AutoPath/老高.json
Normal file
93
repo/js/买菜/assets/AutoPath/老高.json
Normal file
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "牢高",
|
||||
"type": "collect",
|
||||
"author": "听雨♪",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.35.1"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 263.5,
|
||||
"y": -672.5,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "teleport"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 247.5,
|
||||
"y": -664.5,
|
||||
"action": "",
|
||||
"move_mode": "run",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 214.5,
|
||||
"y": -661.5,
|
||||
"action": "",
|
||||
"move_mode": "run",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 192.5,
|
||||
"y": -682,
|
||||
"action": "",
|
||||
"move_mode": "run",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 162.5,
|
||||
"y": -681,
|
||||
"action": "",
|
||||
"move_mode": "run",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": 157.5000949141504,
|
||||
"y": -630.375,
|
||||
"action": "",
|
||||
"move_mode": "run",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"x": 139.99022999999943,
|
||||
"y": -608.2969000000003,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"x": 162.32030999999915,
|
||||
"y": -592.3183600000002,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"x": 158.751953125,
|
||||
"y": -586.27294921875,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
39
repo/js/买菜/assets/AutoPath/莎拉.json
Normal file
39
repo/js/买菜/assets/AutoPath/莎拉.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "莎拉",
|
||||
"type": "collect",
|
||||
"author": "听雨♪",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.35.1"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": -867.7138671875,
|
||||
"y": 2281.37646484375,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -891.755859375,
|
||||
"y": 2255.769775390625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": -888.6591796875,
|
||||
"y": 2240.89892578125,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
30
repo/js/买菜/assets/AutoPath/葵.json
Normal file
30
repo/js/买菜/assets/AutoPath/葵.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "葵",
|
||||
"type": "collect",
|
||||
"author": "听雨♪",
|
||||
"version": "1.1",
|
||||
"description": "",
|
||||
"bgiVersion": "0.35.1"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": -4402.5390625,
|
||||
"y": -3053.0341796875,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "teleport"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -4402.687357628773,
|
||||
"y": -3072.3125,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "target"
|
||||
}
|
||||
]
|
||||
}
|
||||
66
repo/js/买菜/assets/AutoPath/阿扎莱.json
Normal file
66
repo/js/买菜/assets/AutoPath/阿扎莱.json
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "阿扎莱",
|
||||
"type": "collect",
|
||||
"author": "听雨♪",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.35.1"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": 4096.03125,
|
||||
"y": -2025.9755859375,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 4085.078125,
|
||||
"y": -2018.173828125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 4076.845703125,
|
||||
"y": -1995.6533203125,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 4100.158203125,
|
||||
"y": -1986.6904296875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 4100.736328125,
|
||||
"y": -1979.58837890625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": 4091.5751953125,
|
||||
"y": -1980.16015625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
57
repo/js/买菜/assets/AutoPath/阿鲁埃.json
Normal file
57
repo/js/买菜/assets/AutoPath/阿鲁埃.json
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "ale",
|
||||
"type": "collect",
|
||||
"author": "听雨♪",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.35.1"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": 4645.490234375,
|
||||
"y": 3467.8603515625,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 4635.865234375,
|
||||
"y": 3475.1591796875,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 4639.42724609375,
|
||||
"y": 3505.39697265625,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 4622.95654296875,
|
||||
"y": 3509.7421875,
|
||||
"type": "path",
|
||||
"move_mode": "fly",
|
||||
"action": "stop_flying",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 4602.0556640625,
|
||||
"y": 3515.504150390625,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
229
repo/js/买菜/main.js
Normal file
229
repo/js/买菜/main.js
Normal file
@@ -0,0 +1,229 @@
|
||||
// main.js
|
||||
|
||||
|
||||
let NPC_list = {};
|
||||
|
||||
async function setTime(hour, minute) {
|
||||
// 关于setTime
|
||||
// 原作者: Tim
|
||||
// 脚本名称: SetTimeMinute - 精确调整游戏时间到分钟
|
||||
// 脚本版本: 1.0
|
||||
// Hash: f5c2547dfc286fc643c733d630f775e8fbf12971
|
||||
|
||||
// 设置游戏分辨率和DPI缩放
|
||||
setGameMetrics(1920, 1080, 1);
|
||||
// 圆心坐标
|
||||
const centerX = 1441;
|
||||
const centerY = 501.6;
|
||||
// 半径
|
||||
const r1 = 30;
|
||||
const r2 = 150;
|
||||
const r3 = 300;
|
||||
const stepDuration = 50;
|
||||
|
||||
function getPosition(r, index) {
|
||||
let angle = index * Math.PI / 720;
|
||||
return [Math.round(centerX + r * Math.cos(angle)), Math.round(centerY + r * Math.sin(angle))];
|
||||
}
|
||||
async function mouseClick(x, y) {
|
||||
moveMouseTo(x, y);
|
||||
await sleep(50);
|
||||
leftButtonDown();
|
||||
await sleep(50);
|
||||
leftButtonUp();
|
||||
await sleep(stepDuration);
|
||||
}
|
||||
async function mouseClickAndMove(x1, y1, x2, y2) {
|
||||
moveMouseTo(x1, y1);
|
||||
await sleep(50);
|
||||
leftButtonDown();
|
||||
await sleep(50);
|
||||
moveMouseTo(x2, y2);
|
||||
await sleep(50);
|
||||
leftButtonUp();
|
||||
await sleep(stepDuration);
|
||||
}
|
||||
async function setTime(hour, minute) {
|
||||
const end = (hour + 6) * 60 + minute-20;
|
||||
const n = 3;
|
||||
for (let i = - n + 1; i < 1; i++) {
|
||||
let [x,y] = getPosition(r1, end + i * 1440 / n);
|
||||
await mouseClick(x, y);
|
||||
}
|
||||
let [x1,y1] = getPosition(r2, end + 5);
|
||||
let [x2, y2] = getPosition(r3, end + 20 + 0.5);
|
||||
await mouseClickAndMove(x1, y1, x2, y2);
|
||||
}
|
||||
|
||||
let h = Math.floor(hour+minute/60);
|
||||
const m = Math.floor(hour*60+minute)-h*60;
|
||||
h = ((h % 24) + 24) % 24;
|
||||
log.info(`设置时间到 ${h} 点 ${m} 分`);
|
||||
await keyPress("Escape");
|
||||
await sleep(1000);
|
||||
await click(50,700);
|
||||
await sleep(2000);
|
||||
await setTime(h, m);
|
||||
await sleep(1000);
|
||||
await click(1500,1000);//确认
|
||||
await sleep(18000);
|
||||
await keyPress("Escape");
|
||||
await sleep(2000);
|
||||
await keyPress("Escape");
|
||||
await sleep(2000);
|
||||
|
||||
// 最后恢复到听雨的分辨率
|
||||
setGameMetrics(2560, 1440, 1.5);
|
||||
}
|
||||
|
||||
|
||||
// 快速购买
|
||||
async function QucikBuy(count = 1) {
|
||||
|
||||
for (let i = 0; i < count; i++) {
|
||||
// 点击购买/兑换
|
||||
click(2230, 1370);
|
||||
await sleep(100); // 等待窗口弹出
|
||||
|
||||
// 选中左边点
|
||||
moveMouseTo(1000, 806);
|
||||
await sleep(100);
|
||||
leftButtonDown();
|
||||
await sleep(50);
|
||||
|
||||
// 向右滑动
|
||||
moveMouseBy(1200, 0);
|
||||
await sleep(200);
|
||||
leftButtonUp();
|
||||
await sleep(100);
|
||||
|
||||
// 点击弹出页的购买/兑换 1560, 1040
|
||||
click(1560, 1040);
|
||||
await sleep(500);
|
||||
|
||||
// 点击空白处关闭
|
||||
click(936, 230);
|
||||
await sleep(2000);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 跳过对话
|
||||
async function Spik(count) {
|
||||
await sleep(100);
|
||||
for (let i = 0; i < count; i++) {
|
||||
keyPress("VK_F");
|
||||
await sleep(2000);
|
||||
}
|
||||
}
|
||||
|
||||
async function AutoPath(locationName) {
|
||||
try {
|
||||
let filePath = `assets/AutoPath/${locationName}.json`;
|
||||
await pathingScript.runFile(filePath);
|
||||
sleep(2000);
|
||||
|
||||
return true;
|
||||
} catch (error) {
|
||||
log.error(`执行 ${locationName} 路径时发生错误`);
|
||||
log.error(error.message);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
async function AutoBuy(npc) {
|
||||
let npc_name = NPC_list[npc].npc_name;
|
||||
|
||||
log.info(`自动寻路, 前往 ${npc_name} 所在`)
|
||||
|
||||
if (await AutoPath(NPC_list[npc].location_name)) {
|
||||
|
||||
await Spik(NPC_list[npc].spik_count);
|
||||
|
||||
log.info("已打开商店界面")
|
||||
|
||||
await QucikBuy(NPC_list[npc].item_count);
|
||||
|
||||
await sleep(1000);
|
||||
await genshin.returnMainUi();
|
||||
log.info(`${npc_name} 的商品购买完毕`)
|
||||
|
||||
|
||||
} else {
|
||||
log.error("寻路错误, 跳过购买任务")
|
||||
};
|
||||
}
|
||||
|
||||
(async function () {
|
||||
|
||||
// ==================== 加载NPC列表 ===================
|
||||
|
||||
try {
|
||||
const NPCText = file.readTextSync("NPC_list.json");
|
||||
NPC_list = JSON.parse(NPCText);
|
||||
log.info("NPC信息加载完成");
|
||||
} catch (e) {
|
||||
log.error("NPC信息文件损坏,脚本终止");
|
||||
return;
|
||||
}
|
||||
|
||||
//设置脚本环境的游戏分辨率和DPI缩放
|
||||
setGameMetrics(2560, 1440, 1.5);
|
||||
|
||||
log.info("┌───────────────────────────────────────────────────┐");
|
||||
log.info(" 在设置中勾选禁用的NPC.")
|
||||
await sleep(400);
|
||||
log.info(" 调试器添加脚本后, 右键脚本->修改JS脚本自定义配置.")
|
||||
await sleep(400);
|
||||
log.info(" 但是, BetterGI有Bug, 只能现实9个设置...")
|
||||
await sleep(400);
|
||||
log.info(" 要不, 你直接删掉不想要的NPC文件吧, 删除方法: ")
|
||||
await sleep(400);
|
||||
log.info(" JS脚本->打开目录->进入当前项目/assets/AutoPath文件夹")
|
||||
await sleep(400);
|
||||
log.info("└───────────────────────────────────────────────────┘")
|
||||
await sleep(400);
|
||||
|
||||
|
||||
try {
|
||||
for (let key in NPC_list) {
|
||||
|
||||
let name = NPC_list[key].npc_name;
|
||||
|
||||
log.info(`======== 当前目标NPC: ${name} ========`);
|
||||
await sleep(400);
|
||||
|
||||
if (settings[key]) {
|
||||
log.info(` 玩家已标记, 跳过`);
|
||||
continue;
|
||||
};
|
||||
|
||||
if (NPC_list[key].daytimeOnly == 1) {
|
||||
log.info("当前NPC只有白天才刷新, 调整时间");
|
||||
await sleep(3000);
|
||||
await setTime(9, 0);
|
||||
} else if (NPC_list[key].daytimeOnly == 2) {
|
||||
log.info("当前NPC只有晚上更合适, 调整时间");
|
||||
await sleep(3000);
|
||||
await setTime(20, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
await AutoBuy(key);
|
||||
await sleep(2000);
|
||||
};
|
||||
|
||||
} catch (e) {
|
||||
log.error(`发生异常: ${e.message}`);
|
||||
await sleep(3000);
|
||||
} finally {
|
||||
|
||||
log.info("┌────────────────────────────┐")
|
||||
log.info(" 感谢您的使用, 任务已全部完成")
|
||||
log.info(" 拜拜")
|
||||
log.info(" Done.")
|
||||
log.info("└────────────────────────────┘")
|
||||
}
|
||||
})();
|
||||
14
repo/js/买菜/manifest.json
Normal file
14
repo/js/买菜/manifest.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "购买食材-自动购物",
|
||||
"version": "1.0.3",
|
||||
"description": "一个自动买菜脚本, 目前只添加了15个NPC. 一些NPC商人的信息作者可能不知道, 白淞镇、离岛、竞技场NPC无法识别坐标信息.",
|
||||
"authors": [
|
||||
{
|
||||
"name": "听雨♪",
|
||||
"link": "https://github.com/TingYu-lulumi"
|
||||
}
|
||||
],
|
||||
"settings_ui": "settings.json",
|
||||
"main": "main.js"
|
||||
}
|
||||
67
repo/js/买菜/settings.json
Normal file
67
repo/js/买菜/settings.json
Normal file
@@ -0,0 +1,67 @@
|
||||
[
|
||||
{
|
||||
"name": "dongsheng",
|
||||
"type": "checkbox",
|
||||
"label": "东升"
|
||||
},
|
||||
{
|
||||
"name": "laosun",
|
||||
"type": "checkbox",
|
||||
"label": "老孙"
|
||||
},
|
||||
{
|
||||
"name": "laogao",
|
||||
"type": "checkbox",
|
||||
"label": "老高"
|
||||
},
|
||||
{
|
||||
"name": "maoshifu",
|
||||
"type": "checkbox",
|
||||
"label": "卯师父"
|
||||
},
|
||||
{
|
||||
"name": "shala",
|
||||
"type": "checkbox",
|
||||
"label": "莎拉"
|
||||
},
|
||||
{
|
||||
"name": "buluqi",
|
||||
"type": "checkbox",
|
||||
"label": "布兰琪"
|
||||
},
|
||||
{
|
||||
"name": "kui",
|
||||
"type": "checkbox",
|
||||
"label": "葵"
|
||||
},
|
||||
{
|
||||
"name": "zckbw",
|
||||
"type": "checkbox",
|
||||
"label": "志村勘兵卫"
|
||||
},
|
||||
{
|
||||
"name": "pomu",
|
||||
"type": "checkbox",
|
||||
"label": "珀姆"
|
||||
},
|
||||
{
|
||||
"name": "buteluosi",
|
||||
"type": "checkbox",
|
||||
"label": "布特罗斯"
|
||||
},
|
||||
{
|
||||
"name": "ahalai",
|
||||
"type": "checkbox",
|
||||
"label": "阿扎莱"
|
||||
},
|
||||
{
|
||||
"name": "alue",
|
||||
"type": "checkbox",
|
||||
"label": "阿鲁埃"
|
||||
},
|
||||
{
|
||||
"name": "buxike",
|
||||
"type": "checkbox",
|
||||
"label": "布希柯"
|
||||
}
|
||||
]
|
||||
1
repo/js/全自动晶蝶诱捕装置/README.md
Normal file
1
repo/js/全自动晶蝶诱捕装置/README.md
Normal file
@@ -0,0 +1 @@
|
||||
暂时不支持自定义安装位置,之后可能会更新自定义设置
|
||||
58
repo/js/全自动晶蝶诱捕装置/main.js
Normal file
58
repo/js/全自动晶蝶诱捕装置/main.js
Normal file
@@ -0,0 +1,58 @@
|
||||
(async function () {
|
||||
|
||||
//设置脚本环境的游戏分辨率和DPI缩放
|
||||
setGameMetrics(1920, 1080, 1.5);
|
||||
|
||||
await genshin.tp(8973.50,-1878.81);
|
||||
await sleep(6000);
|
||||
// 执行主操作
|
||||
keyPress("F");
|
||||
await sleep(500);
|
||||
click(1500, 400);
|
||||
await sleep(3000);
|
||||
keyPress("B");
|
||||
await sleep(1000);
|
||||
click(1054, 46);
|
||||
await sleep(500);
|
||||
click(1200, 200);
|
||||
await sleep(500);
|
||||
click(1684, 1012);
|
||||
await sleep(500);
|
||||
keyPress("F");
|
||||
await sleep(1000);
|
||||
|
||||
let maTerial = settings.material || '';
|
||||
if (maTerial === '铁块') {
|
||||
log.info('开始加入铁块');
|
||||
click(180, 190);//铁块
|
||||
} else if (maTerial === '白铁块') {
|
||||
log.info('开始加入白铁块');
|
||||
click(330, 190);//白铁块
|
||||
} else if (maTerial === '水晶块') {
|
||||
log.info('开始加入水晶块');
|
||||
click(470, 190);//水晶块
|
||||
} else if (maTerial === '魔晶块') {
|
||||
log.info('开始加入魔晶块');
|
||||
click(610, 190);//魔晶块
|
||||
} else if (maTerial === '星银矿石') {
|
||||
log.info('开始加入星银矿石');
|
||||
click(770, 190);//星银矿石
|
||||
} else if (maTerial === '紫晶块') {
|
||||
log.info('开始加入紫晶块');
|
||||
click(910, 190);//紫晶块
|
||||
} else if (maTerial === '萃凝晶') {
|
||||
log.info('开始加入萃凝晶');
|
||||
click(1050, 190);//萃凝晶
|
||||
} else {
|
||||
log.info('未选择材料,执行默认材料(铁块)');
|
||||
click(180, 190);//铁块
|
||||
}
|
||||
|
||||
await sleep(500);
|
||||
click(447, 1018);
|
||||
await sleep(500);
|
||||
click(1725, 1021);
|
||||
await sleep(500);
|
||||
click(1178, 752);
|
||||
await sleep(500);
|
||||
})();
|
||||
13
repo/js/全自动晶蝶诱捕装置/manifest.json
Normal file
13
repo/js/全自动晶蝶诱捕装置/manifest.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "自动晶蝶诱捕装置",
|
||||
"version": "1.0",
|
||||
"description": "自动晶蝶诱捕装置,安装位置纳塔圣火竞技场传送点",
|
||||
"authors": [
|
||||
{
|
||||
"name": "miludelongwang",
|
||||
}
|
||||
],
|
||||
"settings_ui": "settings.json",
|
||||
"main": "main.js"
|
||||
}
|
||||
16
repo/js/全自动晶蝶诱捕装置/settings.json
Normal file
16
repo/js/全自动晶蝶诱捕装置/settings.json
Normal file
@@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"name": "material",
|
||||
"type": "select",
|
||||
"label": "材料(默认 铁块)",
|
||||
"options": [
|
||||
"铁块",
|
||||
"白铁块",
|
||||
"水晶块",
|
||||
"魔晶块",
|
||||
"星银矿石",
|
||||
"紫晶块",
|
||||
"萃凝晶"
|
||||
]
|
||||
}
|
||||
]
|
||||
14
repo/js/尘歌壶洞天百宝购买/README.md
Normal file
14
repo/js/尘歌壶洞天百宝购买/README.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# README
|
||||
1. 用于每周一尘歌壶洞天百宝购买,可自定义配置购买须臾树脂,大英雄的经验,流浪者的经验,精锻用魔矿,摩拉,祝圣精华,祝圣油膏
|
||||
2. 请于阿园附近(显示有对话交互)开始脚本
|
||||
3. 由于自定义配置表单7个之后不显示,所以布匹的配置为空,无法购买
|
||||
4. 后面可能会添加摆设,摆设图纸,洞天珍物,洞天种物,木材的购买
|
||||
5. 默认购买最大数量,暂时不支持自定义数量购买
|
||||
|
||||
# 更新日志
|
||||
## 1.1
|
||||
### 新增了脚本执行星期控制
|
||||
- 该脚本只在星期一运行,也支持自定义,例如你希望脚本在周二,周五,周日运行,那么:
|
||||
1.打开脚本文件夹,用记事本打开main.js文件
|
||||
2.将代码里的` ALLOWED_DAYS = [1]; `替换为`ALLOWED_DAYS = [2,5,7];`
|
||||
3.保存退出即可
|
||||
@@ -1,8 +1,32 @@
|
||||
// main.js
|
||||
(async function () {
|
||||
// ==================== 时间检查 ====================
|
||||
function checkBeijingDay(allowedDays) {
|
||||
// 创建北京时间对象
|
||||
const now = new Date();
|
||||
const beijingTime = new Date(now.getTime() + (8 * 3600 * 1000)); // UTC+8
|
||||
|
||||
// 获取ISO星期(1=周一 到7=周日)
|
||||
const beijingDay = beijingTime.getUTCDay() || 7; // 转换周日0为7
|
||||
|
||||
// 检查允许日期
|
||||
if (!allowedDays.includes(beijingDay)) {
|
||||
log.info(`当前北京时间:${beijingTime.toISOString()}`);
|
||||
log.error(`今日星期${beijingDay}不在允许运行列表,脚本终止`);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// ==================== 初始化日志 ====================
|
||||
log.info("======== 脚本启动 ========");
|
||||
|
||||
// ==================== 日期检查配置 ====================
|
||||
const ALLOWED_DAYS = [1]; // 设置允许运行的星期(1-7)
|
||||
if (!checkBeijingDay(ALLOWED_DAYS)) {
|
||||
return; // 直接终止脚本
|
||||
}
|
||||
|
||||
//设置脚本环境的游戏分辨率和DPI缩放
|
||||
setGameMetrics(1920, 1080, 1.5);
|
||||
|
||||
@@ -114,4 +138,4 @@
|
||||
await sleep(1000);
|
||||
log.info("======== 脚本执行结束 ========");
|
||||
}
|
||||
})();
|
||||
})();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "尘歌壶洞天百宝购买",
|
||||
"version": "1.0",
|
||||
"version": "1.1",
|
||||
"bgi_version": "0.36.0",
|
||||
"description": "用于每周一尘歌壶洞天百宝购买,可自定义配置购买须臾树脂,大英雄的经验,流浪者的经验,精锻用魔矿,摩拉,祝圣精华,祝圣油膏",
|
||||
"authors": [
|
||||
@@ -11,4 +11,4 @@
|
||||
],
|
||||
"settings_ui": "settings.json",
|
||||
"main": "main.js"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
用于每周一尘歌壶洞天百宝购买,可自定义配置购买须臾树脂,大英雄的经验,流浪者的经验,精锻用魔矿,摩拉,祝圣精华,祝圣油膏
|
||||
|
||||
请于阿园附近(显示有对话交互)开始脚本
|
||||
|
||||
由于自定义配置表单7个之后不显示,所以布匹的配置为空,无法购买
|
||||
|
||||
后面可能会添加摆设,摆设图纸,洞天珍物,洞天种物,木材的购买
|
||||
|
||||
默认购买最大数量,暂时不支持自定义数量购买
|
||||
Reference in New Issue
Block a user