Skip to content

Commit

Permalink
fix: 滑动寻找LIP入口
Browse files Browse the repository at this point in the history
  • Loading branch information
Zebartin committed Jun 5, 2024
1 parent f227f3b commit ec15ccb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions NIKKE/NIKKEutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var {
ocrUntilFound, clickRect, unlockIfNeed,
requestScreenCaptureAuto, getDisplaySize,
killApp, findImageByFeature, findContoursRect,
rgbToGray, getRandomArea, ocrInfo
rgbToGray, getRandomArea, swipeRandom, ocrInfo
} = require('./utils.js');
var firstBoot = true;
var firstCheckAuto = true;
Expand Down Expand Up @@ -151,7 +151,7 @@ function checkInLIP() {
return;
}
// 领取超值好礼 -> tap to enter
const enterLIP = ocrUntilFound(res => {
const enterLIP = ocrUntilFound((res, img) => {
const tapToEnter = res.find(e =>
e.text.match(/tap\s*t.\s*enter/i) != null
);
Expand All @@ -173,7 +173,11 @@ function checkInLIP() {
clickRect(entrance, 1, 0);
return false;
}
}, 3, 700);
swipeRandom(new android.graphics.Rect(
img.width * 0.2, annoucementBtn.bounds.bottom,
img.width * 0.8, random(img.height * 0.4, img.height * 0.6)
), 'up');
}, 6, 700);
if (!enterLIP) {
log('没有找到Level Infinite Pass入口');
return;
Expand Down

0 comments on commit ec15ccb

Please sign in to comment.