mirror of
https://github.com/babalae/bettergi-scripts-list.git
synced 2026-03-15 03:23:22 +08:00
博士周本充能1.2 (#2812)
This commit is contained in:
BIN
repo/js/博士周本充能/Assets/RecognitionObject/panduan.png
Normal file
BIN
repo/js/博士周本充能/Assets/RecognitionObject/panduan.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@@ -8,5 +8,11 @@
|
||||
|
||||
- BGI ≥ v0.55
|
||||
|
||||
1.2
|
||||
增加进入周本判断
|
||||
|
||||
1.1
|
||||
修复切换队伍问题
|
||||
|
||||
1.0
|
||||
切换队伍充能
|
||||
@@ -66,6 +66,7 @@ const repeatOperationUntilTextFound = async ({
|
||||
}
|
||||
|
||||
// Party Setup
|
||||
const PanduanRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("Assets/RecognitionObject/panduan.png"),0, 0, 1920, 1080);
|
||||
const QuickSetupButtonRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("Assets/RecognitionObject/Quick Setup Button.png"), 1100, 900, 400, 180);
|
||||
const ConfigureTeamButtonRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("Assets/RecognitionObject/Configure Team Button.png"), 0, 900, 200, 180);
|
||||
const ConfirmDeployButtonRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("Assets/RecognitionObject/Confirm Deploy Button.png"), 0, 900, 1920, 180);
|
||||
@@ -108,6 +109,27 @@ const RightSliderBottomRo = RecognitionObject.TemplateMatch(file.ReadImageMatSyn
|
||||
}
|
||||
}
|
||||
|
||||
async function waitUntilTemplateFound({
|
||||
ro,
|
||||
maxRetry = 50,
|
||||
interval = 200
|
||||
}) {
|
||||
for (let i = 0; i < maxRetry; i++) {
|
||||
let captureRegion = captureGameRegion();
|
||||
let res = captureRegion.find(ro);
|
||||
captureRegion.dispose();
|
||||
|
||||
if (res.isExist()) {
|
||||
log.info("检测到进入周本,继续执行后续逻辑");
|
||||
return true;
|
||||
}
|
||||
|
||||
await sleep(interval);
|
||||
}
|
||||
|
||||
throw new Error("等待判定模板超时,未识别到进入周本");
|
||||
}
|
||||
|
||||
async function goToWeeklyBossAndEnter() {
|
||||
// 确保主界面
|
||||
await genshin.returnMainUi();
|
||||
@@ -158,9 +180,19 @@ const RightSliderBottomRo = RecognitionObject.TemplateMatch(file.ReadImageMatSyn
|
||||
ifClick: true
|
||||
});
|
||||
log.info(`已进入周本`);
|
||||
await sleep(3000);
|
||||
await sleep(500);
|
||||
|
||||
await waitUntilTemplateFound({
|
||||
ro: PanduanRo,
|
||||
maxRetry: 60, // 最多等 60 次
|
||||
interval: 200 // 每 200ms 检查一次
|
||||
});
|
||||
|
||||
await sleep(2000);
|
||||
log.info("开始充能");
|
||||
|
||||
await keyMouseScript.runFile("222.json");
|
||||
|
||||
log.info("充能完成");
|
||||
}
|
||||
|
||||
@@ -185,8 +217,6 @@ const RightSliderBottomRo = RecognitionObject.TemplateMatch(file.ReadImageMatSyn
|
||||
}
|
||||
}
|
||||
if (foundQuickSetup) {
|
||||
await goToWeeklyBossAndEnter();
|
||||
await genshin.TpToStatueOfTheSeven();
|
||||
break; // 第一次找到就退出循环
|
||||
}
|
||||
}
|
||||
@@ -286,12 +316,13 @@ const RightSliderBottomRo = RecognitionObject.TemplateMatch(file.ReadImageMatSyn
|
||||
// Main
|
||||
if (!!settings.partyName) {
|
||||
try {
|
||||
log.info("强制传送到七天神像切换队伍");
|
||||
log.info("传送到七天神像切换队伍");
|
||||
await genshin.TpToStatueOfTheSeven();
|
||||
|
||||
log.info("正在尝试切换至" + settings.partyName);
|
||||
await SwitchParty(settings.partyName);
|
||||
|
||||
await goToWeeklyBossAndEnter();
|
||||
await genshin.TpToStatueOfTheSeven();
|
||||
genshin.clearPartyCache();
|
||||
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "切换队伍并传送博士周本充能",
|
||||
"version": "1.0",
|
||||
"version": "1.2",
|
||||
"bgi_version": "0.55.3",
|
||||
"description": "进入博士周本给角色充能",
|
||||
"authors": [
|
||||
|
||||
Reference in New Issue
Block a user