js脚本: 购买5个四方八方之网(v1.0) (#634)

This commit is contained in:
SophieZ22
2025-04-24 15:35:31 +08:00
committed by GitHub
parent e8dc46ce92
commit 96d319a3f8
3 changed files with 84 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
(async function () {
setGameMetrics(1920, 1080, 2);
// 传送到稻妻若紫处
async function AutoPath(locationName) {
log.info(`前往稻妻-白狐之野-若紫处`);
try {
let filePath = `assets/${locationName}.json`;
await pathingScript.runFile(filePath);
} catch (error) {
log.error(`执行 ${locationName} 路径时发生错误`);
}
await sleep(500);
}
async function Shopping() {
await sleep(500);
for (let j = 0; j < 4; j++) {
keyPress("F"); await sleep(1000);//对话
}
await sleep(1000);
for (let i = 0; i < 5; i++) {
click(1690, 1020); await sleep(500); // 购买
click(1170, 780); await sleep(400); // 确定
click(1690, 1020); await sleep(200); // 点击空白处
}
keyPress("ESCAPE"); await sleep(2000);
}
log.info("开始执行脚本");
await AutoPath("四方八方之网");
log.info("到达若紫处");
await Shopping();
log.info("已购买5个四方八方之网");
})();