Compare commits

...

2 Commits

Author SHA1 Message Date
MisakaAldrich
64a23405fb update repo.json
Some checks failed
Build repo.json / build (18.x) (push) Has been cancelled
Build repo.json / upload (push) Has been cancelled
2025-07-09 08:27:17 +00:00
mno
c68787bf23 js:锄地一条龙 (#1312)
优化拾取时滚轮移动和日志输出(不会捡一个输出一串日志了)
2025-07-09 16:26:56 +08:00
3 changed files with 7 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
{ {
"time": "20250709123305", "time": "20250709162716",
"url": "https://github.com/babalae/bettergi-scripts-list/archive/refs/heads/main.zip", "url": "https://github.com/babalae/bettergi-scripts-list/archive/refs/heads/main.zip",
"file": "repo.json", "file": "repo.json",
"indexes": [ "indexes": [

View File

@@ -10,7 +10,7 @@
"type": 6, "type": 6,
"mouseX": 0, "mouseX": 0,
"mouseY": 0, "mouseY": 0,
"time": 100 "time": 50
} }
], ],
"info": { "info": {

View File

@@ -1,6 +1,6 @@
//拾取时上下滑动的时间 //拾取时上下滑动的时间
const timeMoveUp = 600; const timeMoveUp = 500;
const timeMoveDown = 1200; const timeMoveDown = 1000;
(async function () { (async function () {
//自定义配置处理 //自定义配置处理
@@ -380,6 +380,7 @@ async function runPathWithOcr(pathFilePath, targetTexts, blacklistKeywords) {
let lastMoveDown = 0; let lastMoveDown = 0;
let lastPickupTime = new Date(); let lastPickupTime = new Date();
let lastPickupItem = "";
// 定义状态变量 // 定义状态变量
let state = { completed: false, cancelRequested: false }; let state = { completed: false, cancelRequested: false };
// 定义图像路径和目标文本列表 // 定义图像路径和目标文本列表
@@ -533,9 +534,10 @@ async function runPathWithOcr(pathFilePath, targetTexts, blacklistKeywords) {
continue; continue;
} }
if ((new Date() - lastPickupTime) > 200) { if ((new Date() - lastPickupTime) > 1000 || ocrResult.text != lastPickupItem) {
log.info(`交互或拾取:"${ocrResult.text}"`); log.info(`交互或拾取:"${ocrResult.text}"`);
lastPickupTime = new Date(); lastPickupTime = new Date();
lastPickupItem = ocrResult.text;
} }
// 计算目标文本的中心Y坐标 // 计算目标文本的中心Y坐标