forked from Zebartin/autoxjs-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0点日常.js
More file actions
97 lines (92 loc) · 2.73 KB
/
Copy path0点日常.js
File metadata and controls
97 lines (92 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
auto.waitFor();
var { unlockIfNeed, getDisplaySize } = require('./utils.js');
const [width, height] = getDisplaySize();
unlockIfNeed();
// 饿了么签到();
米游社签到();
function 饿了么签到() {
app.launchApp("饿了么");
const threadClose = threads.start(() => {
const adClose = className('ImageView').depth(7).drawingOrder(2);
const negativeClose = id('negative_btn');
const close = id('close_btn');
const openNotify = textMatches(/(立即开启|放弃)/);
const closeQueue = [adClose, negativeClose, close, openNotify];
while (true) {
for (let i of closeQueue) {
let t = i.findOne(1000);
if (t != null) {
log('关闭弹窗');
if (t.clickable() && t.text() != '放弃')
t.click();
else
back();
}
}
}
});
log("打开饿了么");
sleep(random(3000, 7000));
const myBtn = id('home_bottom_tab_4_text').findOne();
click(myBtn.bounds().centerX(), myBtn.bounds().centerY());
log("进入我的");
sleep(random(3000, 7000));
const memberPage = textStartsWith("成长值").findOne();
click(memberPage.bounds().centerX(), memberPage.bounds().centerY());
log("查看详情");
sleep(random(3000, 7000));
text('赚吃货豆').click();
log("赚吃货豆");
sleep(random(3000, 7000));
// 签到
const checkIn = textMatches(/(立即签到|今日已签到.*)/).findOne();
if (checkIn.text() === '立即签到') {
checkIn.click();
log("点击签到");
sleep(random(3000, 7000));
if (text('开心收下').exists()) {
text('开心收下').click();
sleep(random(3000, 7000));
}
}
log('饿了么已签到');
threadClose.interrupt();
// 连按返回退出程序
for (let i = 0; i < 4; ++i) {
back();
sleep(500);
}
}
function 米游社签到() {
app.launchApp("米游社");
log("打开米游社");
const threadClose = threads.start(() => {
const btn = textMatches(/(我知道了|下次再说)/);
btn.waitFor();
btn.click();
});
for (let name of ['原神', '崩坏:星穹铁道']) {
text(name).findOne().parent().click();
sleep(random(1000, 2000));
for (let i = 0; i < 10; ++i) {
text('签到福利').filter(w => w.bounds().right > w.bounds().left).findOne().parent().parent().click();
textMatches(/.*(天空岛|星穹列车)$/).waitFor();
sleep(random(1000, 2000));
let day = textMatches(/^.+第\d+天$/).findOne(2000);
if (day != null) {
textMatches(/.*第\d+天$/).click();
break;
}
back();
sleep(random(300, 1000));
}
back();
}
log("米游社已签到");
threadClose.interrupt();
// 连按返回退出程序
for (let i = 0; i < 3; ++i) {
back();
sleep(500);
}
}