优化了自动秘境脚本。角色复活后重新战斗。

This commit is contained in:
何杰泽
2024-12-01 15:24:27 +08:00
parent 4861ae441d
commit 6c9c7545ef
2 changed files with 30 additions and 12 deletions

View File

@@ -266,6 +266,8 @@
let domainInfo = domainList.find(function (domain) {
return domain.name === domainName;
});
while(true){
try{
await genshin.tp(domainInfo.position[2], domainInfo.position[0]);
await sleep(1000);
@@ -278,4 +280,20 @@
// 执行自动秘境
await dispatcher.runTask(new SoloTask("AutoDomain"));
await sleep(500);
break;
}catch (ex)
{
if (ex.message.includes("检测到复苏界面"))
{
log.info("复活后,继续执行自动秘境。");
continue;
}
else
{
// 如果不包含 "检测到复苏界面",则继续抛出异常
throw ex;
}
}
}
})();

View File

@@ -1,11 +1,11 @@
{
"manifest_version": 1,
"name": "传送并自动秘境",
"version": "1.2",
"description": "BetterGI自带脚本用于传送后并执行自动秘境",
"version": "1.3",
"description": "BetterGI自带脚本用于传送后并执行自动秘境。秘境中角色死亡复活后继续回去战斗。",
"authors": [
{
"name": "huiyadanli",
"name": "huiyadanli&iris",
"link": "https://github.com/huiyadanli"
}
],