From ec15ccb596719c3954a93a5aa1affafc97453fbc Mon Sep 17 00:00:00 2001 From: Zebartin <16185081+Zebartin@users.noreply.github.com> Date: Wed, 5 Jun 2024 21:32:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=BB=91=E5=8A=A8=E5=AF=BB=E6=89=BELIP?= =?UTF-8?q?=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NIKKE/NIKKEutils.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/NIKKE/NIKKEutils.js b/NIKKE/NIKKEutils.js index b3495f2..a5d448d 100644 --- a/NIKKE/NIKKEutils.js +++ b/NIKKE/NIKKEutils.js @@ -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; @@ -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 ); @@ -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;