js:狗粮批发1.5.0,狗粮团购1.8.0,锄地一条龙1.12.0,采集cd管理2.2.0 (#2448)

* js:狗粮批发1.5.0,狗粮团购1.8.0,锄地一条龙1.12.0,采集cd管理2.2.0

增加配置项,允许自定义f识别间隔

* 增加上下界,限制滚轮频率

* Update main.js

* Update main.js
This commit is contained in:
mno
2025-12-07 16:10:24 +08:00
committed by GitHub
parent 5c3b97f1d1
commit 3964d91f62
11 changed files with 101 additions and 22 deletions

View File

@@ -47,6 +47,15 @@ let furinaState = "unknown";
let targetItems;
let pickupDelay = 100;
let timeMove = 1000;
let findFInterval = (+settings.findFInterval || 100);
if (findFInterval < 16) {
findFInterval = 16;
}
if (findFInterval > 200) {
findFInterval = 200;
}
let lastRoll = new Date();
let checkDelay = Math.round(findFInterval / 2);
let timeMoveUp = Math.round(timeMove * 0.45);
let timeMoveDown = Math.round(timeMove * 0.55);
let rollingDelay = 25;
@@ -1288,7 +1297,12 @@ async function recognizeAndInteract() {
gameRegion = captureGameRegion();
let centerYF = await findFIcon();
if (!centerYF) {
if (await isMainUI()) await keyMouseScript.runFile(`assets/滚轮下翻.json`);
if (await isMainUI()) {
if (new Date() - lastRoll >= 200) {
await keyMouseScript.runFile(`assets/滚轮下翻.json`);
lastRoll = new Date();
}
}
continue;
}
//log.info(`调试-成功找到f图标,centerYF为${centerYF}`);
@@ -1377,7 +1391,7 @@ async function recognizeAndInteract() {
if (!state.running)
return null;
}
await sleep(100);
await sleep(checkDelay);
return null;
}
@@ -1396,7 +1410,7 @@ async function recognizeAndInteract() {
return false;
}
attempts++;
await sleep(50);
await sleep(checkDelay);
}
return false;
}

View File

@@ -1,7 +1,7 @@
{
"manifest_version": 1,
"name": "AAA狗粮批发",
"version": "1.4.10",
"version": "1.5.0",
"tags": [
"狗粮"
],

View File

@@ -74,5 +74,11 @@
"type": "input-text",
"label": "拾取使用的匹配阈值\n观察到误捡可适当调高\n观察到漏捡可适当调低",
"default": "0.9"
},
{
"name": "findFInterval",
"type": "input-text",
"label": "识别间隔(毫秒)\n两次检测f图标之间等待时间",
"default": "100"
}
]

View File

@@ -3,6 +3,15 @@ const leaveTeamRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("asset
let targetItems;
let pickupDelay = 100;
let timeMove = 1000;
let findFInterval = (+settings.findFInterval || 100);
if (findFInterval < 16) {
findFInterval = 16;
}
if (findFInterval > 200) {
findFInterval = 200;
}
let lastRoll = new Date();
let checkDelay = Math.round(findFInterval / 2);
let timeMoveUp = Math.round(timeMove * 0.45);
let timeMoveDown = Math.round(timeMove * 0.55);
let rollingDelay = 50;
@@ -1218,7 +1227,12 @@ async function recognizeAndInteract() {
gameRegion = captureGameRegion();
let centerYF = await findFIcon();
if (!centerYF) {
if (await isMainUI()) await keyMouseScript.runFile(`assets/滚轮下翻.json`);
if (await isMainUI()) {
if (new Date() - lastRoll >= 200) {
await keyMouseScript.runFile(`assets/滚轮下翻.json`);
lastRoll = new Date();
}
}
continue;
}
//log.info(`调试-成功找到f图标,centerYF为${centerYF}`);
@@ -1307,7 +1321,7 @@ async function recognizeAndInteract() {
if (!state.running)
return null;
}
await sleep(100);
await sleep(checkDelay);
return null;
}
@@ -1326,7 +1340,7 @@ async function recognizeAndInteract() {
return false;
}
attempts++;
await sleep(50);
await sleep(checkDelay);
}
return false;
}

View File

@@ -1,7 +1,7 @@
{
"manifest_version": 1,
"name": "AAA狗粮联机团购",
"version": "1.7.3",
"version": "1.8.0",
"tags": [
"狗粮"
],

View File

@@ -102,6 +102,12 @@
"label": "拾取使用的匹配阈值\n观察到误捡可适当调高\n观察到漏捡可适当调低",
"default": "0.9"
},
{
"name": "findFInterval",
"type": "input-text",
"label": "识别间隔(毫秒)\n两次检测f图标之间等待时间",
"default": "100"
},
{
"name": "p1EndingRoute",
"type": "select",

View File

@@ -1,4 +1,4 @@
//当前js版本1.11.0
//当前js版本1.12.0
let timeMoveUp;
let timeMoveDown;
@@ -27,7 +27,16 @@ whiteFurinaRo.InitTemplate();
let targetItems;
let doFurinaSwitch = false;
let rollingDelay = (+settings.rollingDelay || 25);
let findFInterval = (+settings.findFInterval || 100);
if (findFInterval < 16) {
findFInterval = 16;
}
if (findFInterval > 200) {
findFInterval = 200;
}
let lastRoll = new Date();
let checkDelay = Math.round(findFInterval / 2);
let rollingDelay = (+settings.rollingDelay || 32);
const pickupDelay = (+settings.pickupDelay || 100);
const timeMove = (+settings.timeMove || 1000);
@@ -426,7 +435,7 @@ async function findBestRouteGroups(pathings, k1, k2, targetEliteNum, targetMonst
maxE1 = Math.max(maxE1, p.E1);
maxE2 = Math.max(maxE2, p.E2);
});
pathings.forEach(p => {
if (p.prioritized) { p.E1 += maxE1; p.E2 += maxE2; }
});
@@ -802,7 +811,12 @@ async function recognizeAndInteract() {
let centerYF = await findFIcon();
if (!centerYF) {
if (await isMainUI()) await keyMouseScript.runFile(`assets/滚轮下翻.json`);
if (await isMainUI()) {
if (new Date() - lastRoll >= 200) {
await keyMouseScript.runFile(`assets/滚轮下翻.json`);
lastRoll = new Date();
}
}
continue;
}
/*
@@ -908,7 +922,7 @@ async function recognizeAndInteract() {
if (!state.running)
return null;
}
await sleep(50);
await sleep(checkDelay);
return null;
}
@@ -954,9 +968,9 @@ async function isMainUI() {
return false;
}
attempts++;
await sleep(50);
await sleep(checkDelay);
if (dodispose) {
gameRegion.dispose;
gameRegion.dispose();
}
}
return false;
@@ -1206,7 +1220,7 @@ async function dumper(pathFilePath, map_name) {
attempts++; // 增加尝试次数
await sleep(200); // 每次检测间隔 200 毫秒
if (dodispose) {
gameRegion.dispose;
gameRegion.dispose();
}
}
return false; // 如果尝试次数达到上限或取消,返回 false

View File

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

View File

@@ -50,6 +50,12 @@
"type": "checkbox",
"label": "勾选后禁用根据运行记录优化路线选择的功能\n完全使用路线原有信息"
},
{
"name": "findFInterval",
"type": "input-text",
"label": "识别间隔(毫秒)\n两次检测f图标之间等待时间",
"default": "100"
},
{
"name": "pickupDelay",
"type": "input-text",

View File

@@ -5,7 +5,7 @@ let blacklist = [];
let blacklistSet = new Set();
let gameRegion;
let state = { running: true, currentPathing: null };
const rollingDelay = 25;
const rollingDelay = 32;
const pickupDelay = 100;
const timeMoveUp = Math.round((settings.timeMove || 1000) * 0.45);
const timeMoveDown = Math.round((settings.timeMove || 1000) * 0.55);
@@ -67,6 +67,16 @@ if (!userSettings.infoFileName) {
].join(".");
}
let findFInterval = (+settings.findFInterval || 100);
if (findFInterval < 16) {
findFInterval = 16;
}
if (findFInterval > 200) {
findFInterval = 200;
}
let lastRoll = new Date();
let checkDelay = Math.round(findFInterval / 2);
(async function () {
/* ===== 零基构建 settings.jsonBEGIN ===== */
const SETTINGS_FILE = `settings.json`;
@@ -140,6 +150,12 @@ if (!userSettings.infoFileName) {
"name": "disableJsons",
"type": "input-text",
"label": "填写需要禁用的路线的关键词,使用中文分号分隔\n文件路径含有相关关键词的路线会被禁用"
},
{
"name": "findFInterval",
"type": "input-text",
"label": "识别间隔(毫秒)\n两次检测f图标之间等待时间",
"default": "100"
}
);
@@ -512,7 +528,10 @@ async function recognizeAndInteract() {
const centerYF = await findFIcon();
if (!centerYF) {
if (await isMainUI()) {
await keyMouseScript.runFile(`assets/滚轮下翻.json`);
if (new Date() - lastRoll >= 200) {
await keyMouseScript.runFile(`assets/滚轮下翻.json`);
lastRoll = new Date();
}
}
continue;
}
@@ -565,7 +584,7 @@ async function findFIcon() {
} catch (e) {
log.error(`findFIcon:${e.message}`);
}
await sleep(50);
await sleep(checkDelay);
return null;
}
@@ -597,7 +616,7 @@ async function isMainUI() {
} catch (e) {
log.error(`isMainUI:${e.message}`);
}
await sleep(50);
await sleep(checkDelay);
}
return false;
}

View File

@@ -1,7 +1,7 @@
{
"manifest_version": 1,
"name": "采集cd管理",
"version": "2.1.1",
"version": "2.2.0",
"bgi_version": "0.44.8",
"description": "仅面对会操作文件和读readme的用户基于文件夹操作自动管理采集路线的cd会按照路径组的顺序依次运行直到指定的时间并会按照给定的cd类型自动跳过未刷新的路线",
"saved_files": [