JS脚本:自动周本全部升级至2.0,以及打牌流程优化 (#674)
* 测试 * 你的提交信息 * 周本全2.0更新以及打牌更新 * Update manifest.json * Update manifest.json * Update manifest.json * Update manifest.json * Update manifest.json * Update manifest.json * Update manifest.json * Update manifest.json * Update manifest.json
This commit is contained in:
1
repo/js/周本2-风魔龙/assets/recover.json
Normal file
1
repo/js/周本2-风魔龙/assets/recover.json
Normal file
@@ -0,0 +1 @@
|
||||
{"info":{"name":"","type":""},"positions":[{"x":2297.6201171875,"y":-824.5869140625,"type":"teleport","move_mode":"walk"},{"x":2292.62109375,"y":-826.0419921875,"type":"path","move_mode":"walk"}]}
|
||||
22
repo/js/周本2-风魔龙/assets/tp.json
Normal file
22
repo/js/周本2-风魔龙/assets/tp.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "未命名路径",
|
||||
"type": "collect",
|
||||
"author": "柒叶子",
|
||||
"version": "1.0",
|
||||
"description": "前往周本",
|
||||
"bgiVersion": "0.35.1"
|
||||
},
|
||||
"positions": [
|
||||
|
||||
{
|
||||
"id": 1,
|
||||
"x": 122.6259765625,
|
||||
"y": 2657.634521484375,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
]
|
||||
}
|
||||
43
repo/js/周本2-风魔龙/assets/老版本.js
Normal file
43
repo/js/周本2-风魔龙/assets/老版本.js
Normal file
@@ -0,0 +1,43 @@
|
||||
|
||||
(async function () {
|
||||
|
||||
|
||||
await sleep(1000);
|
||||
await pathingScript.runFile("assets/recover.json");
|
||||
await sleep(5000);
|
||||
await pathingScript.runFile("assets/tp.json");
|
||||
await sleep(1000);
|
||||
keyDown("w");
|
||||
await sleep(2000);
|
||||
keyUp("w");
|
||||
keyPress("F");
|
||||
await sleep(9000);
|
||||
click(1725, 1020);//单人挑战
|
||||
await sleep(2000);
|
||||
click(1725, 1020);//开始挑战
|
||||
await sleep(15000);
|
||||
keyPress("1");
|
||||
await sleep(1000);//切回钟离
|
||||
keyDown("w");
|
||||
await sleep(4000);
|
||||
keyUp("w");
|
||||
await dispatcher.runTask(new SoloTask("AutoFight"));
|
||||
|
||||
await sleep(30000);//等待柱子碎裂
|
||||
keyPress("1");
|
||||
await sleep(1000);//切回钟离
|
||||
|
||||
keyDown("w");
|
||||
await sleep(5000);
|
||||
keyUp("w");
|
||||
keyDown("s");
|
||||
await sleep(1400);
|
||||
keyUp("s");
|
||||
await sleep(1000);
|
||||
keyPress("F");//领奖
|
||||
await sleep(1000);
|
||||
click(950, 750);//使用树脂
|
||||
await sleep(6000);
|
||||
click(975, 1000);//退出秘境
|
||||
await sleep(10000);
|
||||
})();
|
||||
83
repo/js/周本2-风魔龙/main.js
Normal file
83
repo/js/周本2-风魔龙/main.js
Normal file
@@ -0,0 +1,83 @@
|
||||
|
||||
(async function () {
|
||||
|
||||
await sleep(1000);
|
||||
await pathingScript.runFile("assets/recover.json");
|
||||
await sleep(5000);
|
||||
await pathingScript.runFile("assets/tp.json");
|
||||
await sleep(1000);
|
||||
keyDown("w");
|
||||
await sleep(2000);
|
||||
keyUp("w");
|
||||
keyPress("F");
|
||||
await sleep(9000);
|
||||
click(1725, 1020);//单人挑战
|
||||
await sleep(2000);
|
||||
click(1725, 1020);//开始挑战
|
||||
await sleep(15000);
|
||||
keyPress("1");
|
||||
await sleep(1000);//切回钟离
|
||||
keyDown("w");
|
||||
await sleep(4000);
|
||||
keyUp("w");
|
||||
|
||||
/**
|
||||
* 根据两个区域的OCR检测结果执行不同操作的循环函数
|
||||
*/
|
||||
async function autoFightAndEndDetection() {
|
||||
// 定义两个检测区域
|
||||
const region1 = RecognitionObject.ocr(750, 0, 420, 110);//区域一 BOSS名称
|
||||
const region2 = RecognitionObject.ocr(840, 935, 230, 40);//区域二 成功倒计时
|
||||
const region3 = RecognitionObject.ocr(1690, 230, 75, 350);//区域三 队伍名称
|
||||
let challengeTime = 0;
|
||||
let challengeNum = 0;
|
||||
//12分钟兜底
|
||||
while (challengeTime < 1200) {
|
||||
// 捕获游戏区域
|
||||
let capture = captureGameRegion();
|
||||
// 检测两个区域的OCR结果
|
||||
let res1 = capture.find(region1);
|
||||
let res2 = capture.find(region2);
|
||||
let res3 = capture.find(region3);
|
||||
let hasText1 = !res1.isEmpty() && res1.text.trim().length > 0;
|
||||
let hasText2 = !res2.isEmpty() && res2.text.trim().length > 0;
|
||||
let hasText3 = !res3.isEmpty() && res3.text.trim().length > 0;
|
||||
// 情况1: 区域1有文字 且 区域2无文字 且 区域3有文字 → 执行AutoFight
|
||||
if (hasText1 && !hasText2 && hasText3) {
|
||||
challengeNum++;
|
||||
log.info(`执行第${challengeNum}次战斗`);
|
||||
challengeTime = challengeTime + 40;
|
||||
await dispatcher.runTask(new SoloTask("AutoFight"));
|
||||
}
|
||||
// 情况2: 区域2有文字 且 区域1无文字 且 区域3有文字 → 结束循环
|
||||
else if (hasText2 && !hasText1 && hasText3) {
|
||||
log.info("检测到挑战成功");
|
||||
break;
|
||||
}
|
||||
// 其他情况: 什么都不做
|
||||
challengeTime = challengeTime + 1;
|
||||
// 每次检测间隔500毫秒,避免CPU占用过高
|
||||
await sleep(500);
|
||||
}
|
||||
}
|
||||
await autoFightAndEndDetection();//一直战斗直到检测到结束
|
||||
|
||||
log.info(`等待柱子碎裂`);
|
||||
await sleep(30000);//等待柱子碎裂
|
||||
keyPress("1");
|
||||
await sleep(1000);//切回钟离
|
||||
log.info(`开始领奖`);
|
||||
keyDown("w");
|
||||
await sleep(5000);
|
||||
keyUp("w");
|
||||
keyDown("s");
|
||||
await sleep(1400);
|
||||
keyUp("s");
|
||||
await sleep(1000);
|
||||
keyPress("F");//领奖
|
||||
await sleep(1000);
|
||||
click(950, 750);//使用树脂
|
||||
await sleep(6000);
|
||||
click(975, 1000);//退出秘境
|
||||
await sleep(10000);
|
||||
})();
|
||||
15
repo/js/周本2-风魔龙/manifest.json
Normal file
15
repo/js/周本2-风魔龙/manifest.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "风魔龙自动刷取",
|
||||
"version": "2.0",
|
||||
"bgi_version": "0.42.0",
|
||||
"description": "需0.44.6及以上版本,配队刚需芙芙等大范围索敌角色,保证战斗脚本没有任何的转向和移动应该可以正常领取。脚本需要在调度器设置里开启路径追踪行走配置,选择切换的队伍,打开允许在JsScript中使用,打开战斗配置,选择战斗策略,关闭战斗结束拾取物品和万叶拾取,最后根据战斗脚本一次循环的时间,在战斗超时中填入,比如周本原地版q是14s,建议可以比正常单轮时间多个1s,另外搭配一条龙领奖无树脂脚本使用体验更佳哟。演示视频https://www.bilibili.com/video/BV1cpGCz6EWN/?vd_source=9dfaf88af48ecc0ff95a41f1145af7a2。",
|
||||
"authors": [
|
||||
{
|
||||
"name": "柒叶子",
|
||||
"link": "https://github.com/511760049"
|
||||
}
|
||||
],
|
||||
"settings_ui": "settings.json",
|
||||
"main": "main.js"
|
||||
}
|
||||
9
repo/js/周本2-风魔龙/周本队原地版q.txt
Normal file
9
repo/js/周本2-风魔龙/周本队原地版q.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
钟离 wait(0.2),e(hold)
|
||||
芙宁娜 e,q
|
||||
雷神 e
|
||||
芭芭拉 e,q,attack(4)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
9
repo/js/周本2-风魔龙/周本队火神原地版.txt
Normal file
9
repo/js/周本2-风魔龙/周本队火神原地版.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
钟离 e(hold)
|
||||
芙宁娜 q,e
|
||||
玛薇卡 e
|
||||
芭芭拉 e,attack(5.5)
|
||||
钟离 e(hold)
|
||||
芭芭拉 e,attack(10)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user