From 3770f3924602e0ff90e8db9591ced143659d5136 Mon Sep 17 00:00:00 2001 From: this-Fish Date: Mon, 11 Aug 2025 12:55:32 +0800 Subject: [PATCH] =?UTF-8?q?JS=20:=20Auto=20Theft=20NPC=20&=20=E5=8E=9F?= =?UTF-8?q?=E9=A3=9F=202.0.1=20(#1546)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增纳塔杂货店NPC --- .../assets/path/布纳马.json | 57 +++++++++++++++++++ .../assets/path/恩忒卡.json | 2 +- repo/js/Auto Theft NPC & 原食/main.js | 41 +++++++++++-- repo/js/Auto Theft NPC & 原食/manifest.json | 4 +- 4 files changed, 95 insertions(+), 9 deletions(-) create mode 100644 repo/js/Auto Theft NPC & 原食/assets/path/布纳马.json diff --git a/repo/js/Auto Theft NPC & 原食/assets/path/布纳马.json b/repo/js/Auto Theft NPC & 原食/assets/path/布纳马.json new file mode 100644 index 00000000..820debcf --- /dev/null +++ b/repo/js/Auto Theft NPC & 原食/assets/path/布纳马.json @@ -0,0 +1,57 @@ +{ + "info": { + "name": "布纳马", + "type": "collect", + "authors": [ + { + "name": "芝士贝果" + } + ], + "version": "1.0", + "description": "", + "map_name": "Teyvat", + "bgi_version": "0.47.3", + "tags": [], + "last_modified_time": 1754489424074, + "enable_monster_loot_split": false, + "map_match_method": "" + }, + "positions": [ + { + "id": 1, + "action": "", + "move_mode": "walk", + "type": "teleport", + "x": 9060.5419921875, + "y": -1847.5107421875, + "action_params": "" + }, + { + "id": 2, + "x": 9089.0361328125, + "y": -1852.42919921875, + "type": "path", + "move_mode": "walk", + "action": "", + "action_params": "" + }, + { + "id": 3, + "x": 9088.6552734375, + "y": -1856.89306640625, + "type": "target", + "move_mode": "walk", + "action": "", + "action_params": "" + }, + { + "id": 4, + "x": 9089.8935546875, + "y": -1857.2724609375, + "type": "target", + "move_mode": "walk", + "action": "", + "action_params": "" + } + ] +} \ No newline at end of file diff --git a/repo/js/Auto Theft NPC & 原食/assets/path/恩忒卡.json b/repo/js/Auto Theft NPC & 原食/assets/path/恩忒卡.json index 7f1c4145..a7e2a0a2 100644 --- a/repo/js/Auto Theft NPC & 原食/assets/path/恩忒卡.json +++ b/repo/js/Auto Theft NPC & 原食/assets/path/恩忒卡.json @@ -63,7 +63,7 @@ "y": -470.27734375, "action": "combat_script", "move_mode": "walk", - "action_params": "wait(0.5),keypress(F),wait(6),keydown(W),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),keyup(W)", + "action_params": "wait(0.5),keypress(F),wait(7.5),keydown(W),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),wait(0.5),keypress(SPACE),keyup(W)", "type": "path" } ] diff --git a/repo/js/Auto Theft NPC & 原食/main.js b/repo/js/Auto Theft NPC & 原食/main.js index 8a9e043a..8398a11b 100644 --- a/repo/js/Auto Theft NPC & 原食/main.js +++ b/repo/js/Auto Theft NPC & 原食/main.js @@ -111,6 +111,14 @@ const npcData = { "time": "any", "path": "assets/path/阿鲁埃.json", "goods": ["咖啡豆", "枫达"] + }, + "Bunama": { + "name": "布纳马", + "enable": true, + "page": 2, + "time": "any", + "path": "assets/path/布纳马.json", + "goods": ["盐", "小麦", "胡椒", "洋葱", "牛奶", "番茄", "卷心菜", "土豆", "秃秃豆"] } } @@ -400,11 +408,31 @@ async function qucikBuy() { } // 跳过对话 -async function spikChat(count = 5) { - await sleep(100); - for (let i = 0; i < count; i++) { - keyPress("VK_F"); - await sleep(1300); +async function spikChat(npcName) { + count = 5 + await sleep(1000); + if(npcName== "布纳马"){ + // 對話 + await sleep(500); + keyDown("VK_MENU");// Alt + await sleep(1000); + await click(1255, 530); + await sleep(1000); + keyUp("VK_MENU");// Alt + // 跳過交互&進入買食畫面 + await click(1345, 580); + await sleep(1000); + await click(1345, 580); + await sleep(1000); + await click(1345, 580); + await sleep(1000); + await click(1345, 580); + await sleep(1000); + }else { + for (let i = 0; i < count; i++) { + keyPress("VK_F"); + await sleep(1300); + } } await sleep(1000); } @@ -525,6 +553,7 @@ async function initRo() { // ==================== 自动购买 ==================== for (let [key, npc] of Object.entries(npcData)) { if (npc.enable) { + await genshin.returnMainUi(); log.info("开始购买NPC: {npcName}", npc.name); // 设置游戏时间 if (npc.time === "night") { @@ -534,7 +563,7 @@ async function initRo() { await setTime(8, 0); // 设置为早上8点 } await autoPath(npc.path); - await spikChat(); + await spikChat(npc.name); await buyGoods(key); // 返回主界面 await genshin.returnMainUi(); diff --git a/repo/js/Auto Theft NPC & 原食/manifest.json b/repo/js/Auto Theft NPC & 原食/manifest.json index bb93d8f2..a088bf88 100644 --- a/repo/js/Auto Theft NPC & 原食/manifest.json +++ b/repo/js/Auto Theft NPC & 原食/manifest.json @@ -1,8 +1,8 @@ { "manifest_version": 1, "name": "购买NPC食材-图像识别", - "version": "2.0.0", - "description": "原食脚本: 基于图像识别的抢劫NPC商品, 可选择性购买商品, 节省大量摩拉与时间.", + "version": "2.0.1", + "description": "原食脚本: 基于图像识别的购买NPC商品, 可选择性购买商品, 按地区顺序购买, 节省大量时间.", "authors": [ { "name": "听雨♪",