-
Notifications
You must be signed in to change notification settings - Fork 5
/
ele.js
75 lines (69 loc) · 2.33 KB
/
ele.js
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
//初始化
var dev_hight = device.height;
var dev_width = device.width;
if(dev_hight && dev_width == 0) {toastLog('BUG啦,请重启手机');exit();}
console.show();
var times = 1;
//子线程 音量键关闭
threads.start(function(){
events.observeKey();
events.onKeyDown("volume_up", function(event){toastLog("\n音量+被按下,即将结束脚本!");sleep(3000);console.hide();exit();});
});
//检测并点击
function check_click() {
outer:
while(1){
let list_15sec = textContains('15秒').find();
let list_0sec = textMatches('浏览.+|看看.+').find();
for(i = 0; i < list_15sec.length; i++){
if(list_15sec[i] && list_15sec[i].parent().child(2).text() != '奖励已到账') {
sleep(1000);
list_15sec[i].parent().child(2).click();
console.log(times+++'.'+list_15sec[i].parent().child(0).getText())
console.log('等待...');
textMatches("任务完成|点击返回").waitFor();
back();sleep(500);
if(text('晚点再来').findOne(2000)) text('晚点再来').click();
sleep(1000);
text('逛逛任务').waitFor();
sleep(1000);
continue outer;
}
}
for(i = 0; i < list_0sec.length; i++){
if(list_0sec[i] && list_0sec[i].parent().child(2).text() != '奖励已到账') {
list_0sec[i].parent().child(2).click();
sleep(3000);
back();
if(text('晚点再来').findOne(2000)) text('晚点再来').click();
sleep(1000);
text('逛逛任务').waitFor();
sleep(1000);
continue outer;
}
}
toastLog('任务1 基本完成');
break;
}
}
function video() {
text('馋了饿了,说两句~').waitFor();
toastLog('\n已进入视频页\n吃货豆圈圈旋转完,自动退回桌面');
text('明日再领').waitFor();
home();
toastLog('已经刷完 自动结束')
}
//启动并跳转
toastLog('启动饿了么\n按下音量+ 脚本停止');
home();sleep(1000);
app.startActivity({
packageName: "me.ele",
data: 'eleme://web?&url=https://h5.ele.me/svip/task-list'
});
text('下单任务').waitFor();
sleep(2000);
//主程序
check_click();
log('1.请手动双击,点进"真香"视频页中...\n 点进去,不要停留在外面 \n等待中...');
video();
exit();