Skip to content

Commit

Permalink
fix: 处理失败的指挥能力测试
Browse files Browse the repository at this point in the history
  • Loading branch information
Zebartin committed Apr 12, 2023
1 parent 7f2eacf commit 6dd755c
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions NIKKE/模拟室.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ function doWithOption(option, status) {
return res.find(e => e.text.includes('确认'));
}, 30, 1000));
let roomCnt = 0;
ocrUntilFound(res => {
let testDone = ocrUntilFound(res => {
if (keywordType == 0 && res.text.includes('不选'))
return null;
if (res.text.match(/ON[\s\S]*ROOM[\s\S]*RESET/) != null)
Expand All @@ -465,7 +465,21 @@ function doWithOption(option, status) {
clickRect(res.find(e => e.text.includes('确认')));
sleep(1000);
return false;
}, 30, 500);
}, 20, 500);
// 点了太多次确认
if (!testDone) {
let cancelBtn = ocrUntilFound(res => {
if (res.text.includes('确认') && res.text.includes('取消'))
return res.find(e => e.text.includes('取消'));
return null;
}, 2, 500);
log('无法处理当前情况,提前结束');
if (cancelBtn != null)
clickRect(cancelBtn);
else
back();
status.earlyStop = true;
}
return;
}
if (option.type == 'ICU') {
Expand Down

0 comments on commit 6dd755c

Please sign in to comment.