Skip to content

Commit

Permalink
微调逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
e1399579 committed Aug 17, 2023
1 parent 71ae163 commit a921f22
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions lib/WidgetAutomator.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ function WidgetAutomator(robot) {
this.clickCenterText = function (_text) {
this.robot.clickCenter(text(_text).findOnce());
};

this.clickCenterTextContains = function (_text) {
this.robot.clickCenter(textContains(_text).findOnce());
};

this.clickCenterId = function (_id) {
this.robot.clickCenter(id(_id).findOnce());
Expand Down
4 changes: 2 additions & 2 deletions 京东签到.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ sleep(10000);
//关闭弹窗
if (text("我知道了").exists()) {
toastLog("关闭弹窗");
widget.clickCenterText("我知道了");
text("我知道了").click();
sleep(500);
}

// 点击签到
if (textContains("已连签").exists()) {
toastLog("已签");
} else {
widget.clickCenterText("签到领京豆");
widget.clickCenterTextContains("签到领京豆");
toastLog("签到成功");
sleep(1500);
}
Expand Down
6 changes: 5 additions & 1 deletion 支付宝签到.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sleep(2000);

// 进入支付宝会员
widget.clickCenterClass("android.view.ViewGroup");
sleep(5000);
sleep(8000);

// 请求截图并点击开始
threads.start(function () {
Expand All @@ -40,6 +40,10 @@ let img2 = images.clip(img, 0, 0, 1080, 1200);
toastLog("OCR开始");
let list = paddle.ocr(img2);
toastLog("OCR结束");
img = null;
img2 = null;
images = null;
paddle = null;
let sign = [];
let get_all = [];
for (let obj of list) {
Expand Down

0 comments on commit a921f22

Please sign in to comment.