mirror of
https://github.com/babalae/bettergi-scripts-list.git
synced 2026-03-16 03:33:25 +08:00
Merge branch 'main' of https://github.com/babalae/bettergi-scripts-list
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"time": "20250905011038",
|
||||
"time": "20250905012916",
|
||||
"url": "https://github.com/babalae/bettergi-scripts-list/archive/refs/heads/main.zip",
|
||||
"file": "repo.json",
|
||||
"indexes": [
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
@@ -1,3 +1,5 @@
|
||||
const outDatedRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/RecognitionObject/ConfirmButton.png"), 760, 700, 100, 100);
|
||||
|
||||
(async function () {
|
||||
// 读取用户设置
|
||||
let operationType = settings.operationType || "分解"; // 默认为分解
|
||||
@@ -11,10 +13,36 @@
|
||||
log.debug(`操作次数: ${times}`);
|
||||
log.debug(`包含一星: ${includeOneStar}, 包含二星: ${includeTwoStar}, 包含三星: ${includeThreeStar}, 包含四星: ${includeFourStar}`);
|
||||
|
||||
// 点击过期按钮
|
||||
async function findAndClick(target, maxAttempts = 20) {
|
||||
for (let attempts = 0; attempts < maxAttempts; attempts++) {
|
||||
const gameRegion = captureGameRegion();
|
||||
try {
|
||||
const result = gameRegion.find(target);
|
||||
if (result.isExist) {
|
||||
result.click();
|
||||
return true; // 成功立刻返回
|
||||
}
|
||||
log.warn(`识别失败,第 ${attempts + 1} 次重试`);
|
||||
} catch (err) {
|
||||
} finally {
|
||||
gameRegion.dispose();
|
||||
}
|
||||
if (attempts < maxAttempts - 1) { // 最后一次不再 sleep
|
||||
await sleep(250);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 分解圣遗物
|
||||
async function salvage() {
|
||||
await genshin.returnMainUi();
|
||||
keyPress("B"); await sleep(2000); // 打开背包
|
||||
if (await findAndClick(outDatedRo)) {
|
||||
log.info("检测到过期物品弹窗,处理");
|
||||
await sleep(1000);
|
||||
}
|
||||
click(670, 40); await sleep(1000); // 点击圣遗物
|
||||
click(660, 1010); await sleep(1000); // 点击分解
|
||||
click(300, 1020); await sleep(1000); // 点击快速选择
|
||||
@@ -38,6 +66,10 @@
|
||||
async function destroy() {
|
||||
await genshin.returnMainUi();
|
||||
keyPress("B"); await sleep(2000); // 打开背包
|
||||
if (await findAndClick(outDatedRo)) {
|
||||
log.info("检测到过期物品弹窗,处理");
|
||||
await sleep(1000);
|
||||
}
|
||||
click(670, 40); await sleep(1000); // 点击圣遗物
|
||||
|
||||
for (let i = 0; i < times; i++) {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
"type": "select",
|
||||
"label": "操作类型(默认:分解)",
|
||||
"options": [
|
||||
"分解",
|
||||
"摧毁"
|
||||
"分解(经验瓶)",
|
||||
"摧毁(摩拉)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -8,18 +8,22 @@
|
||||
{
|
||||
"links": "",
|
||||
"name": "呱呱z"
|
||||
},
|
||||
{
|
||||
"links": "",
|
||||
"name": "蜜柑魚"
|
||||
}
|
||||
],
|
||||
"bgi_version": "0.45.0",
|
||||
"description": "",
|
||||
"enable_monster_loot_split": false,
|
||||
"last_modified_time": 1756367313887,
|
||||
"last_modified_time": 1756913879379,
|
||||
"map_match_method": "",
|
||||
"map_name": "Teyvat",
|
||||
"name": "枫丹铁匠铺",
|
||||
"tags": [],
|
||||
"type": "collect",
|
||||
"version": "1.1"
|
||||
"version": "1.2"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
@@ -54,6 +58,15 @@
|
||||
"action_params": "",
|
||||
"id": 4,
|
||||
"move_mode": "dash",
|
||||
"type": "path",
|
||||
"x": 4579.9658203125,
|
||||
"y": 3599.89013671875
|
||||
},
|
||||
{
|
||||
"action": "",
|
||||
"action_params": "",
|
||||
"id": 5,
|
||||
"move_mode": "dash",
|
||||
"type": "target",
|
||||
"x": 4580.56640625,
|
||||
"y": 3603.6337890625
|
||||
|
||||
Reference in New Issue
Block a user