Compare commits
4 Commits
5b240ba7c5
...
8820ec19ab
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8820ec19ab | ||
|
|
6ae02e50ff | ||
|
|
6e406649f3 | ||
|
|
809039b2af |
25
repo.json
25
repo.json
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"time": "20250807110204",
|
"time": "20250807151045",
|
||||||
"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": [
|
||||||
@@ -74118,8 +74118,8 @@
|
|||||||
{
|
{
|
||||||
"name": "AutoHoeingOneDragon",
|
"name": "AutoHoeingOneDragon",
|
||||||
"type": "directory",
|
"type": "directory",
|
||||||
"hash": "6c8ae3788c2bbd13f6d74d8eba51bb1f6c42a8ab",
|
"hash": "f38cc8f917009bccd2e022d95de021b74affc556",
|
||||||
"version": "1.3.4",
|
"version": "1.3.5",
|
||||||
"author": "mno",
|
"author": "mno",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
@@ -74129,7 +74129,7 @@
|
|||||||
],
|
],
|
||||||
"description": "锄地一条龙~|~一站式解决自动化锄地,支持只拾取狗粮,请仔细阅读README.md后使用",
|
"description": "锄地一条龙~|~一站式解决自动化锄地,支持只拾取狗粮,请仔细阅读README.md后使用",
|
||||||
"tags": [],
|
"tags": [],
|
||||||
"lastUpdated": "2025-08-07 09:41:32"
|
"lastUpdated": "2025-08-07 15:10:28"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "AutoLeyLineOutcrop",
|
"name": "AutoLeyLineOutcrop",
|
||||||
@@ -74415,6 +74415,23 @@
|
|||||||
],
|
],
|
||||||
"lastUpdated": "2025-07-12 11:31:10"
|
"lastUpdated": "2025-07-12 11:31:10"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "ComputerBlower",
|
||||||
|
"type": "directory",
|
||||||
|
"hash": "d242defaff3aa614b36769dc436a4cfa493cb899",
|
||||||
|
"version": "0.1",
|
||||||
|
"author": "mno",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "mno"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "截图性能测试~|~测测你的",
|
||||||
|
"tags": [
|
||||||
|
"bgi≥0.46.0"
|
||||||
|
],
|
||||||
|
"lastUpdated": "2025-08-07 13:21:18"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "CrystalflyTrap",
|
"name": "CrystalflyTrap",
|
||||||
"type": "directory",
|
"type": "directory",
|
||||||
|
|||||||
@@ -74,6 +74,8 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
### 更新日志
|
### 更新日志
|
||||||
|
### 1.3.5(2025.08.07)
|
||||||
|
1.使用dispose极大优化内存占用
|
||||||
### 1.3.4(2025.08.07)
|
### 1.3.4(2025.08.07)
|
||||||
1.修复拾取失效
|
1.修复拾取失效
|
||||||
2.修复泥头车模式卡复活界面
|
2.修复泥头车模式卡复活界面
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//当前js版本 1.3.4
|
//当前js版本 1.3.5
|
||||||
|
|
||||||
//拾取时上下滑动的时间
|
//拾取时上下滑动的时间
|
||||||
const timeMoveUp = 500;
|
const timeMoveUp = 500;
|
||||||
@@ -501,7 +501,9 @@ async function runPath(pathFilePath, map_name, whitelistKeywords, blacklistKeywo
|
|||||||
try {
|
try {
|
||||||
let template = file.ReadImageMatSync(imagePath);
|
let template = file.ReadImageMatSync(imagePath);
|
||||||
let recognitionObject = RecognitionObject.TemplateMatch(template, xMin, yMin, width, height);
|
let recognitionObject = RecognitionObject.TemplateMatch(template, xMin, yMin, width, height);
|
||||||
let result = captureGameRegion().find(recognitionObject);
|
const gameRegion = captureGameRegion();
|
||||||
|
let result = gameRegion.find(recognitionObject);
|
||||||
|
gameRegion.dispose();
|
||||||
if (result.isExist()) {
|
if (result.isExist()) {
|
||||||
return true; // 如果找到图标,返回 true
|
return true; // 如果找到图标,返回 true
|
||||||
}
|
}
|
||||||
@@ -540,7 +542,9 @@ async function runPath(pathFilePath, map_name, whitelistKeywords, blacklistKeywo
|
|||||||
try {
|
try {
|
||||||
let template = file.ReadImageMatSync(imagePath);
|
let template = file.ReadImageMatSync(imagePath);
|
||||||
let recognitionObject = RecognitionObject.TemplateMatch(template, xMin, yMin, width, height);
|
let recognitionObject = RecognitionObject.TemplateMatch(template, xMin, yMin, width, height);
|
||||||
let result = captureGameRegion().find(recognitionObject);
|
const gameRegion = captureGameRegion();
|
||||||
|
let result = gameRegion.find(recognitionObject);
|
||||||
|
gameRegion.dispose();
|
||||||
if (result.isExist()) {
|
if (result.isExist()) {
|
||||||
return true; // 如果找到图标,返回 true
|
return true; // 如果找到图标,返回 true
|
||||||
}
|
}
|
||||||
@@ -584,7 +588,7 @@ async function runPath(pathFilePath, map_name, whitelistKeywords, blacklistKeywo
|
|||||||
xRange.min, yRange.min,
|
xRange.min, yRange.min,
|
||||||
xRange.max - xRange.min, yRange.max - yRange.min
|
xRange.max - xRange.min, yRange.max - yRange.min
|
||||||
));
|
));
|
||||||
|
ra.dispose();
|
||||||
// 遍历识别结果,检查是否找到目标文本
|
// 遍历识别结果,检查是否找到目标文本
|
||||||
let results = [];
|
let results = [];
|
||||||
for (let i = 0; i < resList.count; i++) {
|
for (let i = 0; i < resList.count; i++) {
|
||||||
@@ -622,9 +626,13 @@ async function runPath(pathFilePath, map_name, whitelistKeywords, blacklistKeywo
|
|||||||
try {
|
try {
|
||||||
let template = file.ReadImageMatSync(imagePath);
|
let template = file.ReadImageMatSync(imagePath);
|
||||||
let recognitionObject = RecognitionObject.TemplateMatch(template, xMin, yMin, width, height);
|
let recognitionObject = RecognitionObject.TemplateMatch(template, xMin, yMin, width, height);
|
||||||
let result = captureGameRegion().find(recognitionObject);
|
const gameRegion = captureGameRegion();
|
||||||
|
let result = gameRegion.find(recognitionObject);
|
||||||
|
gameRegion.dispose();
|
||||||
if (result.isExist()) {
|
if (result.isExist()) {
|
||||||
return { success: true, x: result.x, y: result.y, width: result.width, height: result.height };
|
return { success: true, x: result.x, y: result.y, width: result.width, height: result.height };
|
||||||
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error(`识别图像时发生异常: ${error.message}`);
|
log.error(`识别图像时发生异常: ${error.message}`);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 1,
|
"manifest_version": 1,
|
||||||
"name": "锄地一条龙",
|
"name": "锄地一条龙",
|
||||||
"version": "1.3.4",
|
"version": "1.3.5",
|
||||||
"description": "一站式解决自动化锄地,支持只拾取狗粮,请仔细阅读README.md后使用",
|
"description": "一站式解决自动化锄地,支持只拾取狗粮,请仔细阅读README.md后使用",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
"settings_ui": "settings.json",
|
"settings_ui": "settings.json",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"saved_files": [
|
"saved_files": [
|
||||||
"records/"
|
"records/",
|
||||||
|
"assets/拾取名单.json"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
29
repo/js/ComputerBlower/main.js
Normal file
29
repo/js/ComputerBlower/main.js
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
// 主函数
|
||||||
|
(async function () {
|
||||||
|
let startTime = Date.now();
|
||||||
|
const interval = +settings.interval || 1000;
|
||||||
|
const timeout = +settings.timeout || 60;
|
||||||
|
let lastCheck = startTime;
|
||||||
|
let ocrcount = 0;
|
||||||
|
let loopCount = 0;
|
||||||
|
let logCount = 0;
|
||||||
|
//let store = [];
|
||||||
|
while (Date.now() - startTime < timeout * 1000) {
|
||||||
|
loopCount++;
|
||||||
|
try {
|
||||||
|
let GameRegion = captureGameRegion();
|
||||||
|
// store[loopCount] = GameRegion;
|
||||||
|
if (settings.dispose) GameRegion.dispose();
|
||||||
|
ocrcount++;
|
||||||
|
} catch (error) {
|
||||||
|
log.error(`运行时发生异常: ${error.message}`);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (Date.now() - lastCheck >= interval) {
|
||||||
|
logCount++;
|
||||||
|
lastCheck = Date.now();
|
||||||
|
log.info(`在第${logCount}个${interval}毫秒内执行了${ocrcount}次截图`);
|
||||||
|
ocrcount = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
||||||
16
repo/js/ComputerBlower/manifest.json
Normal file
16
repo/js/ComputerBlower/manifest.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"manifest_version": 1,
|
||||||
|
"name": "截图性能测试",
|
||||||
|
"version": "0.1",
|
||||||
|
"tags": [],
|
||||||
|
"bgi_version": "0.46.0",
|
||||||
|
"description": "测测你的",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "mno",
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"settings_ui": "settings.json",
|
||||||
|
"main": "main.js"
|
||||||
|
}
|
||||||
|
|
||||||
2
repo/js/ComputerBlower/readme.md
Normal file
2
repo/js/ComputerBlower/readme.md
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
运行后将会尝试满负荷循环截图,并在日志输出截图次数,可在自定义配置选择是否dispose
|
||||||
|
|
||||||
19
repo/js/ComputerBlower/settings.json
Normal file
19
repo/js/ComputerBlower/settings.json
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "dispose",
|
||||||
|
"type": "checkbox",
|
||||||
|
"label": "是否dispose"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "timeout",
|
||||||
|
"type": "input-text",
|
||||||
|
"label": "运行时间(秒)",
|
||||||
|
"default": "60"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "interval",
|
||||||
|
"type": "input-text",
|
||||||
|
"label": "间隔多久输出一次(毫秒)",
|
||||||
|
"default": "1000"
|
||||||
|
}
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user