-
Notifications
You must be signed in to change notification settings - Fork 8
/
欢乐币脚本_1201.js
123 lines (114 loc) · 3.98 KB
/
欢乐币脚本_1201.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/**
* 作者:迷失@萌
* 时间:2020-10-21 14:21:53
*/
var i = 0;
var j = 0;
var taskList = ['去浏览','去逛逛','去搜索','去完成'];
var height = device.height;
var width = device.width;
setScreenMetrics(width, height);
var speed = 1;
dialogs.alert("请确认无障碍和悬浮窗权限已开启,感谢使用,\n作者:迷失@萌\n仅供娱乐, 禁止盈利");
menu: while (true) {
var choose = dialogs.select("选择脚本速度", "干就完了,给我上最快的", "网速不太好,别整太快了", "手机和网速都不咋滴", "我太难了,整个最慢的叭");
switch (choose) {
case -1:
toast("请选择");
continue menu;
case 0:
toast("牛批啊,火箭已准备就绪");
speed = 1;
break menu;
case 1:
toast("慢慢来,稳中求胜");
speed = 1.25;
break menu;
case 2:
toast("老铁666,自行车发车啦");
speed = 1.5;
break menu;
case 3:
toast("村通网,莫得办法");
speed = 2;
break menu;
default:
break;
}
}
console.show();
auto.waitFor();
sleep(1000 * speed);
log("正在打开淘宝");
launch("com.taobao.taobao");
sleep(1000 * speed);
log("正在等待进入吸猫活动页面");
log("请手动进入活动页面")
className("android.widget.Button").text("领欢乐币").waitFor()
sleep(1000);
if (!textContains("累计任务奖励").exists()) {
className("android.widget.Button").text("领欢乐币").findOne().click()
log("进入活动成功");
}
sleep(1500 * speed);
if (className("android.widget.Button").text("签到").exists()) {
className("android.widget.Button").text("签到").click()
sleep(200);
log("签到成功");
} else { log("已签到"); }
sleep(1500 * speed);
taskList.forEach(task => {
while (textContains(task).exists()) {
log("当前开始做第" + (i+1) + "次任务!");
var a = text(task).findOnce(j);
log("task = "+task);
switch (task) {
case '去完成':
case '去搜索':
sleep(random(501, 515) * speed);
a.click();
sleep(random(1501, 1515) * speed);
swipe(width / 2, height - 500, width / 2, 0, random(801, 818)* speed);
sleep(random(2501, 2601) * speed);
swipe(width / 2, height - 500, width / 2, 0, random(801, 818) * speed);
sleep(random(8001, 8042) * speed);
swipe(width / 2, height - 500, width / 2, 0, random(801, 818) * speed);
textContains("完成").findOne(random(10001, 10018) * speed);
i++;
log("去搜索------任务结束")
sleep(random(601, 615) * speed);
back();
break;
case '去逛逛':
case '去浏览':
sleep(500 * speed);
a.click();
sleep(1500 * speed);
if (!textContains("跟主播聊").exists() || !textContains("赚金币").exists()) {
swipe(width / 2, height - 500, width / 2, 0, 800 * speed);
sleep(3500 * speed);
swipe(width / 2, height - 500, width / 2, 0, 800 * speed);
sleep(12000 * speed);
swipe(width / 2, height - 500, width / 2, 0, 800 * speed);
}else{
sleep(15000 * speed);
}
textContains("任务完成").findOne(10000 * speed);
i++;
log("已完成第" + i + "次任务!")
back();
break;
case '领取奖励':
sleep(random(501, 515) * speed);
a.click();
log('奖励领取成功');
break;
default:
log("俺觉得没有任务可以干了,要不你再看看?")
break;
}
sleep(2000 * speed);
}
});
log("Done!");
exit();