JS : Auto Theft NPC & 原食 改用orc方式應對納塔商人交互 (#1580)

修正模擬操作會導致BUG納塔商人交互失敗
改用orc方式應對納塔商人交互
This commit is contained in:
this-Fish
2025-08-13 15:25:33 +08:00
committed by GitHub
parent 6d658e5079
commit 50da8dfd95

View File

@@ -120,7 +120,6 @@ const npcData = {
"path": "assets/path/布纳马.json", "path": "assets/path/布纳马.json",
"goods": ["盐", "小麦", "胡椒", "洋葱", "牛奶", "番茄", "卷心菜", "土豆", "秃秃豆"] "goods": ["盐", "小麦", "胡椒", "洋葱", "牛奶", "番茄", "卷心菜", "土豆", "秃秃豆"]
} }
} }
const goodsData = { const goodsData = {
@@ -411,28 +410,29 @@ async function qucikBuy() {
async function spikChat(npcName) { async function spikChat(npcName) {
count = 5 count = 5
await sleep(1000); await sleep(1000);
if(npcName== "布纳马"){ if (npcName == "布纳马") {
// 對話 // 交互
await sleep(1000); for (let i = 0; i < 3; i++) {
// keyDown("VK_MENU");// Alt keyPress("VK_F");
// await sleep(1500); await sleep(1300);
// await click(1255, 530); }
// await click(1255, 530);
// await click(1255, 530); // 点击有什么卖的
// await sleep(1500); let captureRegion = captureGameRegion()
// keyUp("VK_MENU");// Alt let resList = captureRegion.findMulti(RecognitionObject.ocrThis);
for (let i = 0; i < resList.count; i++) {
if (resList[i].text.includes("有什么卖的")) {
click(resList[i].x + 30, resList[i].y + 30); // 点击有什么卖的
// 使用完后释放资源
captureRegion.dispose();
}
}
await sleep(1300);
keyPress("VK_F"); keyPress("VK_F");
await sleep(1500); await sleep(1300);
// 跳過交互&進入買食畫面 } else {
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++) { for (let i = 0; i < count; i++) {
keyPress("VK_F"); keyPress("VK_F");
await sleep(1300); await sleep(1300);