Skip to content

Commit

Permalink
fix: 返回首页后点一下“大厅”
Browse files Browse the repository at this point in the history
  • Loading branch information
Zebartin committed Mar 13, 2023
1 parent 962c22c commit 052ce48
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
15 changes: 12 additions & 3 deletions NIKKE/NIKKEutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,23 +149,32 @@ function 退出NIKKE() {

function 返回首页() {
const homeImage = images.read('./images/home.jpg');
let [width, height] = getDisplaySize();
var result = null;
for (let i = 0; i < 10; ++i) {
result = findImageByFeature(captureScreen(), homeImage, {
threshold: 0.6,
region: [0, height * 0.8]
region: [0, height * 0.8, width / 2, height * 0.2]
});
if (result != null)
break;
sleep(300);
}
result.text = '首页图标'
homeImage.recycle();
sleep(1000);
for (let i = 0; i < 10; ++i) {
clickRect(result);
sleep(4000);
if (ocrUntilFound(res => res.text.match(/(大厅|基地|物品|方舟)/), 3, 400) != null)
let hallBtn = ocrUntilFound(res => {
if (res.text.match(/(大厅|基地|物品|方舟)/) == null)
return null;
return res.find(e => e.text == '大厅');
}, 3, 400)
if (hallBtn != null) {
clickRect(hallBtn);
break;
}
}
log('返回首页');
}
Expand Down Expand Up @@ -228,7 +237,7 @@ function 刷刷刷() {
let img = captureScreen();
let hasBlue = images.findColor(img, '#00a1ff', {
region: [
0, clickNext.bounds.bottom,
0, clickNext.bounds.bottom,
clickNext.bounds.right, img.height - clickNext.bounds.bottom
],
threshold: 20
Expand Down
1 change: 1 addition & 0 deletions NIKKE/NIKKE日常.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ function 商店() {
break;
sleep(300);
}
arenaShop.text = '竞技场商店图标';
arenaShopImage.recycle();
clickRect(arenaShop);
ocrUntilFound(res => {
Expand Down

0 comments on commit 052ce48

Please sign in to comment.