Skip to content

Commit

Permalink
fix: 进入模拟室
Browse files Browse the repository at this point in the history
  • Loading branch information
Zebartin committed Jan 17, 2024
1 parent 6e971da commit c0d960e
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions NIKKE/模拟室.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,26 @@ function 模拟室(fromIndex) {
let tryDiff = (Math.floor(tryDiffArea / 3) + 3).toString();
let tryArea = tryDiffArea % 3;
if (fromIndex) {
clickRect(ocrUntilFound((res, img) => res.find(e =>
e.text.includes('方舟') && e.bounds != null &&
e.bounds.bottom > img.height / 2
), 30, 1000));
clickRect(ocrUntilFound(res => res.find(e => e.text.includes('模拟室')), 30, 1000));
sleep(2000);
ocrUntilFound((res, img) => {
if (res.text.includes('开始') || res.text.includes('结'))
return true;
let arkBtn = res.find(e =>
e.text.includes('方舟') && e.bounds != null &&
e.bounds.bottom > img.height / 2
);
if (arkBtn != null) {
clickRect(arkBtn, 1, 0);
return null;
}
let simBtn = res.find(e =>
e.text.includes('模拟室') && e.bounds != null &&
e.bounds.bottom > img.height * 0.4
);
if (simBtn != null) {
clickRect(simBtn, 1, 0);
return null;
}
}, 50, 1000);
}
quitPrevSim();
// 检查今日模拟室是否已完成
Expand Down

0 comments on commit c0d960e

Please sign in to comment.