Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug反馈: 20180414 13e22b3 依然无法收取能量 #11

Closed
SuperMonster003 opened this issue Apr 14, 2018 · 4 comments
Closed

Bug反馈: 20180414 13e22b3 依然无法收取能量 #11

SuperMonster003 opened this issue Apr 14, 2018 · 4 comments

Comments

@SuperMonster003
Copy link

  1. 前一版 20180412 eee0fd3 进入好友森林无法收取能量的问题 依然存在
    目前以下方法依然有效

582-583行
我测试的时候会卡在好友能量界面
var cover;
if (cover = descMatches(/\d{2}:\d{2}:\d{2}/).findOnce())
我自己改为:
var cover = descMatches(/\d{2}:\d{2}:\d{2}/);
if (cover.exists())
后 测试正常 不知道是不是个例

-- from thumike @ Apr 13, 2018, 7:20 PM GMT+8 (slightly revised)

  1. 能量罩的剩余时间提示 变为"undefined"
@SuperMonster003 SuperMonster003 changed the title Bug反馈: 20180416 13e22b3 依然无法收取能量 Bug反馈: 20180414 13e22b3 依然无法收取能量 Apr 14, 2018
@e1399579
Copy link
Owner

更新一下安装包,https://pan.baidu.com/s/1i6KBbnv

@thumike
Copy link

thumike commented Apr 14, 2018

 我改了一下this.takeFromImage函数如下,可以实现指定好友不偷(只要将好友备注名加上不偷),然后觉得应该可以在每次检测到有保护罩之后,将信息记录下来。在下次偷取能量时根据保护罩消失时间自动判断是否将有保护罩的人名单加入不偷之列,以免每次收能量都得进去又出来。

因为是初学,这样简单的文件信息写入读取都还不太会,见笑了😂


this.takeFromImage2 = function (icon) {
var point;
var row_height = HEIGHT / 10;
var total = 0;
var times = 0;
var x = WIDTH / 2;
var takeSets=descMatches(/^((?!不偷|环保证书).)+/).boundsInside(200,200,1000,device.height*0.9).find()
// takeSets.forEach(function(child){log(child.contentDescription)});
if (takeSets.size()>0) {
while (times <this.options.max_retry_times) {
this.capture = captureScreen();
if (null ===this.capture) {
toastLog("截图失败");
times++;
sleep(200);
continue;
}
else{
break;
}
}
var options = {
region: [WIDTH - 200, 200],
threshold: 0.8}
point= findImage(this.capture, icon, options);
if (null != point) {
for (var i = takeSets.size() - 1; i >= 0; i--) {
var y=takeSets[i].bounds().centerY()
options = {
region: [device.width / 2,y-100, device.width / 2, 220],
threshold: 0.8
};
point = findImage(this.capture, icon, options);
if (null === point) {
continue;
}
else{
this.robot.click(x, y);
var title = "好友森林";
if (this.waitForLoading()) {
title = id("com.alipay.mobile.nebula:id/h5_tv_title").findOnce();
log("进入" + title.text() + "成功");
total++;
var cover=descMatches(/\d{2}:\d{2}:\d{2}/);
if (cover.exists() ) {
toastLog("保护罩还剩" + cover.findOne().contentDescription + ",忽略");
} else {
// 收取
this.take();
}
}
else {
toastLog("进入好友森林失败");
}
this.back();// 返回好友列表
sleep(1000);
}
}
}
}
return total;
};

@SuperMonster003
Copy link
Author

@e1399579
通过更新 Auto.js-3.1.1 alpha5 问题解决 😁😄

@SuperMonster003
Copy link
Author

@thumike
有新的代码分享或讨论 可以再另开帖
这个issue我先关了哈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants