Giter Site home page Giter Site logo

Comments (4)

e1399579 avatar e1399579 commented on July 18, 2024 2

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

from autojs.

thumike avatar thumike commented on July 18, 2024
 我改了一下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;
};

from autojs.

SuperMonster003 avatar SuperMonster003 commented on July 18, 2024

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

from autojs.

SuperMonster003 avatar SuperMonster003 commented on July 18, 2024

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

from autojs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.