JS脚本:切换队伍加速版feat:增加切换成功/失败通知 (#548)
This commit is contained in:
@@ -64,6 +64,7 @@ const RightSliderBottomRo = RecognitionObject.TemplateMatch(file.ReadImageMatSyn
|
||||
log.info("当前队伍名称位置:({x},{y},{w},{h}), 识别结果:{text}", res.x, res.y, res.Width, res.Height, res.text);
|
||||
if (res.text.includes(partyName)) {
|
||||
log.info("当前队伍即为目标队伍,无需切换");
|
||||
notification.send(`当前队伍即为目标队伍:${partyName},无需切换`);
|
||||
keyPress("VK_ESCAPE");
|
||||
await sleep(500);
|
||||
} else {
|
||||
@@ -100,6 +101,7 @@ const RightSliderBottomRo = RecognitionObject.TemplateMatch(file.ReadImageMatSyn
|
||||
if (DeployButton.isExist()) {
|
||||
log.info("识别到部署按钮:({x},{y},{w},{h})", DeployButton.x, DeployButton.y, DeployButton.Width, DeployButton.Height);
|
||||
DeployButton.click();
|
||||
notification.send(`寻找到目标队伍:${partyName},点击部署`);
|
||||
ConfigureStatue = true;
|
||||
break;
|
||||
}
|
||||
@@ -113,7 +115,8 @@ const RightSliderBottomRo = RecognitionObject.TemplateMatch(file.ReadImageMatSyn
|
||||
}
|
||||
}
|
||||
if (!ConfigureStatue) {
|
||||
log.warn("\n\n队伍切换失败,可能是:\n1.处于联机模式 \n2.无法正确识别\n3.JS自定义配置中的队伍名称设置错误,请检查!\n");
|
||||
log.error("\n\n队伍切换失败,可能是:\n1.处于联机模式 \n2.无法正确识别\n3.JS自定义配置中的队伍名称设置错误,请检查!\n");
|
||||
notification.error("队伍切换失败,可能是:\n1.处于联机模式 \n2.无法正确识别\n3.JS自定义配置中的队伍名称设置错误,请检查!");
|
||||
await genshin.returnMainUi();
|
||||
break;
|
||||
}
|
||||
@@ -140,7 +143,8 @@ const RightSliderBottomRo = RecognitionObject.TemplateMatch(file.ReadImageMatSyn
|
||||
// await genshin.returnMainUi();
|
||||
// }
|
||||
} else {
|
||||
log.warn("没有设置切换队伍");
|
||||
log.error("没有设置切换队伍");
|
||||
notification.error("没有设置切换队伍");
|
||||
await genshin.returnMainUi();
|
||||
}
|
||||
})();
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "返回七天神像切换指定队伍加速版",
|
||||
"version": "1.0",
|
||||
"BgiVersion": "0.44.1",
|
||||
"version": "1.1",
|
||||
"BgiVersion": "0.44.4",
|
||||
"description": "",
|
||||
"authors": [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user