js:锄地一条龙1.10.0 (#2278)

* js:锄地一条龙1.10.0

新增烹饪和白芙检测,修改冻结检测逻辑,修改路径文件夹结构,将低效文件夹并入其他文件夹,避免低效排到收尾后面且重复拖地图打乱次序

* Update README.md
This commit is contained in:
mno
2025-10-31 07:58:28 +08:00
committed by GitHub
parent 35a680a867
commit 2313a866cd
286 changed files with 142 additions and 63 deletions

View File

@@ -0,0 +1,40 @@
{
"info": {
"name": "强制黑芙",
"type": "collect",
"authors": [
{
"name": "汐",
"links": ""
}
],
"version": "1.0",
"description": "",
"map_name": "Enkanomiya",
"bgi_version": "0.45.0",
"tags": [],
"last_modified_time": 1755101630357,
"enable_monster_loot_split": false,
"map_match_method": ""
},
"positions": [
{
"id": 1,
"x": 97.65771484375,
"y": 255.2640380859375,
"action": "",
"move_mode": "walk",
"action_params": "",
"type": "teleport"
},
{
"id": 2,
"x": 97.65771484375,
"y": 255.2640380859375,
"action": "log_output",
"move_mode": "walk",
"action_params": "重置[芙宁娜]状态——黑芙",
"type": "orientation"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@@ -1,4 +1,4 @@
//当前js版本1.9.3
//当前js版本1.10.0
let timeMoveUp;
let timeMoveDown;
@@ -14,7 +14,16 @@ let targetItemPath = "assets/targetItems";
let mainUITemplate = file.ReadImageMatSync("assets/MainUI.png");
let itemFullTemplate = file.ReadImageMatSync("assets/itemFull.png");
let frozenTemplate = file.ReadImageMatSync("assets/解除冰冻.png");
const frozenRo = RecognitionObject.TemplateMatch(frozenTemplate, 1379, 574, 1463 - 1379, 613 - 574);
let cookingTemplate = file.ReadImageMatSync("assets/烹饪界面.png");
const cookingRo = RecognitionObject.TemplateMatch(cookingTemplate, 1547, 965, 1815 - 1547, 1059 - 965);
let whiteFurinaTemplate = file.ReadImageMatSync("assets/白芙图标.png");
let whiteFurinaRo = RecognitionObject.TemplateMatch(whiteFurinaTemplate, 1634, 967, 1750 - 1634, 1070 - 967);
whiteFurinaRo.Threshold = 0.99;
whiteFurinaRo.InitTemplate();
let targetItems;
let doFurinaSwitch = false;
let rollingDelay = (+settings.rollingDelay || 25);
const pickupDelay = (+settings.pickupDelay || 100);
@@ -527,6 +536,12 @@ async function assignGroups(pathings, groupTags) {
}
async function runPath(fullPath, map_name) {
//当需要切换芙宁娜形态时,执行一次强制黑芙
if (doFurinaSwitch) {
log.info("上条路线识别到白芙,开始强制切换黑芙")
doFurinaSwitch = false;
await pathingScript.runFile("assets/强制黑芙.json");
}
/* ===== 1. 取得当前路线对象 ===== */
let currentPathing = null;
for (let i = 0; i < pathings.length; i++) {
@@ -571,16 +586,16 @@ async function runPath(fullPath, map_name) {
})();
const errorProcessTask = (async () => {
async function checkFrozen() {
let errorProcessCount = 0;
async function checkRo(recognitionObject) {
const maxAttempts = 1;
let attempts = 0;
let frozenGameRegion;
let errorProcessGameRegion;
while (attempts < maxAttempts && state.running) {
try {
const recognitionObject = RecognitionObject.TemplateMatch(frozenTemplate, 1379, 574, 1463 - 1379, 613 - 574);
frozenGameRegion = captureGameRegion();
const result = frozenGameRegion.find(recognitionObject);
frozenGameRegion.dispose();
errorProcessGameRegion = captureGameRegion();
const result = errorProcessGameRegion.find(recognitionObject);
errorProcessGameRegion.dispose();
if (result.isExist()) {
return true;
}
@@ -594,15 +609,35 @@ async function runPath(fullPath, map_name) {
return false;
}
while (state.running) {
if (await checkFrozen()) {
log.info("检测到冻结,尝试挣脱");
for (let m = 0; m < 3; m++) {
keyPress("VK_SPACE");
await sleep(30);
if (errorProcessCount % 5 === 0) {
//每约250毫秒进行一次冻结检测和白芙检测
if (await checkRo(frozenRo)) {
log.info("检测到冻结,尝试挣脱");
for (let m = 0; m < 3; m++) {
keyPress("VK_SPACE");
await sleep(30);
}
continue;
}
if (!doFurinaSwitch) {
if (await checkRo(whiteFurinaRo)) {
log.info("检测到白芙,本路线运行结束后切换芙宁娜形态");
doFurinaSwitch = true;
continue;
}
}
} else {
await sleep(500);
}
if (errorProcessCount % 100 === 0) {
//每约5000毫秒进行一次烹饪检测
if (await checkRo(cookingRo)) {
log.info("检测到烹饪界面,尝试脱离");
keyPress("VK_ESCAPE");
await sleep(500);
continue;
}
}
errorProcessCount++;
await sleep(45);
}
})();

View File

@@ -1,7 +1,7 @@
{
"manifest_version": 1,
"name": "锄地一条龙",
"version": "1.9.13",
"version": "1.10.0",
"description": "一站式解决自动化锄地支持只拾取狗粮请仔细阅读README.md后使用",
"authors": [
{

View File

@@ -1,83 +1,87 @@
{
"info": {
"name": "238璃月层岩地下巨蛇岩洞200_6",
"type": "collect",
"author": "汐",
"version": "1.0",
"description": " 路线信息该路线预计用时97.12秒包含以下怪物2只遗迹歼击者、2只遗迹防卫者、2只遗迹侦察者。",
"hash_res": "94951186",
"map_name": "TheChasm",
"bgi_version": "0.45.0",
"authors": [
{
"name": "",
"links": "https://github.com/jiegedabaobei"
"links": "https://github.com/jiegedabaobei",
"name": ""
}
]
],
"bgi_version": "0.45.0",
"description": " 路线信息该路线预计用时97.12秒包含以下怪物2只遗迹歼击者、2只遗迹防卫者、2只遗迹侦察者。",
"hash_res": "94951186",
"enable_monster_loot_split": false,
"last_modified_time": 1761833614499,
"map_match_method": "",
"map_name": "TheChasm",
"name": "238璃月层岩地下巨蛇岩洞200_6",
"tags": [],
"type": "collect",
"version": "1.0"
},
"positions": [
{
"action": "",
"action_params": "",
"id": 1,
"x": 891.64,
"y": 764.61,
"action": "",
"move_mode": "walk",
"action_params": "",
"type": "teleport"
"type": "teleport",
"x": 891.64,
"y": 764.61
},
{
"action": "",
"action_params": "",
"id": 2,
"x": 898.52,
"y": 774.56,
"action": "",
"move_mode": "run",
"action_params": "",
"type": "path"
},
{
"id": 3,
"x": 929.18,
"y": 797.96,
"type": "path",
"move_mode": "run",
"action": "",
"action_params": ""
"x": 898.52,
"y": 774.56
},
{
"action": "",
"action_params": "",
"id": 3,
"move_mode": "run",
"type": "path",
"x": 929.18,
"y": 797.96
},
{
"action": "fight",
"action_params": "",
"id": 4,
"x": 939.21,
"y": 832.11,
"action": "fight",
"move_mode": "run",
"action_params": "",
"type": "path"
"type": "path",
"x": 939.21,
"y": 832.11
},
{
"action": "",
"action_params": "",
"id": 5,
"move_mode": "dash",
"type": "path",
"x": 955.3,
"y": 824.19,
"action": "",
"move_mode": "dash",
"action_params": "",
"type": "path"
"y": 824.19
},
{
"action": "",
"action_params": "",
"id": 6,
"x": 970.47,
"y": 813.75,
"action": "",
"move_mode": "fly",
"action_params": "",
"type": "path"
"type": "path",
"x": 970.47,
"y": 813.75
},
{
"id": 7,
"x": 1022.44,
"y": 815.08,
"action": "fight",
"move_mode": "dash",
"action_params": "",
"type": "path"
"id": 7,
"move_mode": "dash",
"type": "path",
"x": 1019.23828125,
"y": 810.3018798828125
}
]
}

Some files were not shown because too many files have changed in this diff Show More