-
Notifications
You must be signed in to change notification settings - Fork 1
/
script.js
3202 lines (3121 loc) · 108 KB
/
script.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
auto.waitFor();//申请无障碍权限
$images.requestScreenCapture();//申请截图权限
const HEIGHT = device.height;
const WIDTH = device.width;
const Storage = storages.create("autoFlipper");
const scriptPath = engines.myEngine().cwd();
var packageName = Storage.get("packageName");
var shuagou = false;
var danren = true;
var flag = true;
//const events.broadcast = events.emitter();
events.broadcast.on("init", function () {
toastLog("初始化中……");
initPic("cy", 0, 1);
initPic("切换账号", 1, 1);
initPic("菜单", 2, 1);
initPic("ok", 3, 0);
initPic("等待", 4, 1);
initPic("关闭", 5, 0);
initPic("体力已满", 6, 1);
initPic("邮件", 7, 1);
initPic("公告", 8, 0);
initPic("主城", 9, 1);
initPic("放弃", 10, 0);
initPic("旗子", 11, 1);
initPic("推荐任务", 12, 1);
//initPic("火素材", 13, 0);
//initPic("水素材", 14, 0);
//initPic("雷素材", 15, 0);
//initPic("风素材", 16, 0);
//initPic("光素材", 17, 0);
//initPic("暗素材", 18, 0);
initPic("玛娜", 19, 1);
initPic("返回", 20, 1);
//initPic("lv60", 21, 1);
initPic("是", 22, 0);
initPic("单倍挑战", 23, 1);
initPic("双倍挑战", 24, 1);
initPic("继续", 25, 1);
initPic("再次挑战", 26, 1);
initPic("离开房间", 27, 1);
initPic("返回房间", 28, 1);
initPic("续战", 29, 1);
initPic("暂停", 30, 1);
initPic("退出战斗", 31, 1);
initPic("取消", 32, 0);
initPic("挑战", 33, 0);
initPic("小红", 34, 0);
initPic("中红", 35, 0);
initPic("大红", 36, 0);
initPic("使用", 37, 0);
initPic("深层", 38, 0);
initPic("暗深层", 39, 1);
initPic("光深层", 40, 0);
initPic("风深层", 41, 0);
initPic("雷深层", 42, 0);
initPic("水深层", 43, 0);
initPic("火深层", 44, 0);
initPic("足体", 45, 0);
initPic("铃铛", 46, 1);
initPic("参加", 47, 0);
initPic("准备", 48, 1);
initPic("全部收取", 49, 1);
initPic("领取", 50, 1);
initPic("无法收取", 51, 1);
//initPic("公主", 52, 1);
initPic("多人领主", 53, 1);
//initPic("刷新", 54, 0);
let t0 = new pic(54, 2, WIDTH, HEIGHT * 0.5625, 0, 0);
Storage.put("刷新", t0);
//initPic("互关", 55, 0);
let t1 = new pic(55, 2, WIDTH, HEIGHT * 0.76, 0, 0);
Storage.put("互关", t1);
initPic("紫色互关", 56, 0);
initPic("已开续战", 57, 1);
initPic("未开续战", 58, 1);
initPic("出发前", 59, 0);
initPic("主城2", 60, 1);
initPic("主城3", 61, 1);
initPic("领主", 62, 1);
initPic("紫色领主", 63, 1);
initPic("紫色出发前", 64, 0);
initPic("单人铃铛", 65, 1);
initPic("等待中", 66, 1);
initPic("多人活动", 67, 0);
initPic("管理者", 68, 0);
initPic("弧魔", 69, 0);
initPic("白虎", 70, 0);
initPic("螃蟹", 71, 0);
initPic("魔像", 72, 0);
initPic("不死王", 73, 0);
initPic("大蛇", 74, 0);
initPic("机器人", 75, 0);
initPic("鱿鱼", 76, 0);
initPic("猫头鹰", 77, 0);
initPic("超级", 78, 0);
initPic("高+", 79, 0);
initPic("高级", 80, 0);
initPic("中级", 81, 0);
initPic("初级", 82, 0);
initPic("多人游戏", 83, 1);
initPic("招募", 84, 1);
initPic("已勾互关", 85, 1);
initPic("未勾互关", 86, 1);
initPic("招募互关", 87, 1);
initPic("已勾单向", 88, 1);
initPic("未勾单向", 89, 1);
initPic("招募单向", 90, 1);
initPic("已勾铃铛", 91, 1);
initPic("未勾铃铛", 92, 1);
initPic("招募铃铛", 93, 1);
initPic("开始招募", 94, 0);
initPic("解散", 95, 1);
initPic("表情", 96, 1);
initPic("商店", 97, 1);
initPic("活动道具", 98, 0);
initPic("水荒龙", 99, 0);
initPic("每日兑换", 100, 1);
initPic("兑换", 101, 1);
initPic("扭蛋", 102, 1);
initPic("角色单抽", 103, 1);
initPic("武器单抽", 104, 1);
initPic("角色抽过", 105, 1);
initPic("武器抽过", 106, 1);
initPic("抽取扭蛋", 107, 0);
initPic("购买", 108, 1);
initPic("巨龙高+", 109, 0);
initPic("名字", 110, 0);
initPic("紫色名字", 111, 0);
initPic("高难", 112, 0);
initPic("光高难", 113, 0);
initPic("雷高难", 114, 0);
initPic("暗高难", 115, 0);
initPic("水高难", 116, 0);
initPic("火高难", 117, 0);
initPic("风高难", 118, 0);
initPic("超+", 119, 0);
initPic("地狱", 120, 0);
initPic("0次", 121, 0);
initPic("无限池", 122, 0);
initPic("抽取", 123, 0);
initPic("抽完", 124, 1);
initPic("下页", 125, 1);
//initPic("挑战关卡", 126, 1);
let t2 = new pic(126, 2, WIDTH, HEIGHT * 0.5625, 0, 0);
Storage.put("挑战关卡", t2);
initPic("一次", 127, 0);
initPic("单人活动", 128, 0);
initPic("黄色铃铛", 129, 1);
initPic("黄色参加", 130, 0);
initPic("培育道具", 131, 0);
initPic("火素材", 132, 0);
initPic("水素材", 133, 0);
initPic("雷素材", 134, 0);
initPic("风素材", 135, 0);
initPic("光素材", 136, 0);
initPic("暗素材", 137, 0);
initPic("小黄", 138, 0);
initPic("单人续战开", 139, 0);
initPic("单人续战关", 140, 0);
initPic("战阵", 141, 0);
initPic("战阵地狱", 142, 0);
initPic("紫色旗子", 143, 0);
initPic("续战结束", 144, 1);
initPic("体力不足", 145, 1);
initPic("加体", 146, 1);
initPic("加药", 147, 1);
toastLog("初始化完成")
Storage.put("init", true);
});
function initPic(name, id, fixed) {
var p = new pic(id, fixed);
getSize(p);
Storage.put(name, p);
return 0;
}
function getSize(p) {
p.img = images.read("./res/" + WIDTH + "/" + p.id + ".png");
p.w = p.img.getWidth() + 40;
p.h = p.img.getHeight() + 40;
p.img.recycle();
p.img = null;
return 0;
}
function pic(id, fixed, w, h, rx, ry, img) {
this.id = id;
this.fixed = fixed;
this.w = w;
this.h = h;
this.rx = rx;
this.ry = ry;
this.img = img;
}
events.broadcast.on("start", function () {//监听到"start"消息
console.info("start");
flag = true;
start();
});
events.broadcast.on("dengluqian", () => {
console.info("登陆前");
if (flag == false) {
return 0;
}
events.broadcast.emit("message2", "登陆中");
for (let i = 0; i < 3;) {
var re = findPicTimes(60, 1000, [WIDTH / 4, HEIGHT / 4], "放弃", "关闭", "ok", "公告");
if (re[0] < 3) {
clickp(re[1]);
} else if (re[0] == 3) {
i++;
} else if (re == 0) {
qqerror(screen, "登录失败")
events.broadcast.emit("kasi");
console.info("from登陆前to卡死");
return 0;
}
}
if (Storage.get("youjian") == true) {
events.broadcast.emit("message2", "领取邮件");
let y = findPicTimes(1, 0, 0, "邮件")
if (y != 0) {
clickp(y[1]);
sleep(2000);
let p = findPic("全部收取", "无法收取");
if (p[0] == 0) {
clickp(p[1]);
{ let a = findPic("领取"); if (a == false) return 0; else clickp(a[1]) };
{ let a = findPic("关闭"); if (a == false) return 0; else clickp(a[1]) };
} else if (p == false) return 0;
{ let a = findPic("返回"); if (a == false) return 0; else clickp(a[1]) };
}
}
/*
if (Storage.get("zhanzhen") == true) {
events.broadcast.emit("message1", "刷战阵!");
events.broadcast.emit("shuazhanzhen");
console.info("刷战阵刷战阵");
}
*/
if (Storage.get("wuxian") == true) {
console.info("无限池");
events.broadcast.emit("message2", "抽无限池");
while (1) {
let jr = findPic("抽取", "无限池", "活动道具", "商店"); if (jr == false) return 0;
if (jr[0] == 3) {
clickp(jr[1]);
} else if (jr[0] == 2) {
clickp(jr[1]);
} else if (jr[0] == 1) {
clickp(jr[1]);
} else if (jr[0] == 0) {
break;
}
}
while (1) {
let c = findPic("抽完", "刷新", "抽取"); if (c == false) return 0;
clickp(c[1]);
if (c[0] == 1) {
while (1) {
let o = findPic("抽取", "ok"); if (o == false) return0;
if (o[0] == 1) {
clickp(o[1]);
} else if (o[0] == 0) {
break;
}
}
} else if (c[0] == 2) {
clickp(c[1]);
} else if (c[0] == 0) {
break;
}
}
backHome();
}
/*if (Storage.get("goumai") == true) {
events.broadcast.emit("message2", "购买每日素材");
{ let a = findPic("商店"); if (a == false) return 0; else clickp(a[1]) };
{ let a = findPic("活动道具"); if (a == false) return 0; else clickp(a[1]) };
{ let a = findPic("水荒龙"); if (a == false) return 0; else clickp(a[1]) };
let dh = findPicTimes(10, 1000, 0, "每日兑换");
if (dh == 0) {
}
else {
clickp(dh[1]);
{ let a = findPic("兑换"); if (a == false) return 0; else clickp(a[1]) };
}
events.broadcast.emit("message2", "每日素材已购买");
backHome();
events.broadcast.emit("zhuye");
console.info("from登陆前to主页");
}*/
if (Storage.get("juese") == true) {
events.broadcast.emit("message2", "角色单抽");
let j = Storage.get("jinrijuese");
if (j.state == false) {
while (1) {
let p = findPic("扭蛋", "角色单抽", "角色抽过");
if (p == false) {
return 0;
} else if (p[0] == 0) {
clickp(p[1]);
} else if (p[0] == 1) {
clickp(p[1]);
sleep(2000);
let a = findPic("抽取扭蛋", "购买");
if (a == false) {
return 0;
} else if (a[0] == 0) {
clickp(a[1]);
let c = findPicTimes(30, 2000, [WIDTH / 2, HEIGHT * 0.7], "返回");
if (c == 0) {
qqerror(screen, "怎么没抽到?");
return 0;
} else if (c[0] == 0) {
j.state = true;
qqnotice(screen, "快看看你抽到了什么");
clickp(c[1]);
break;
}
} else if (a[0] == 1) {
j.state = true;
qqnotice(screen, "好好想想自己是不是该充钱了");
break;
}
} else if (p[0] == 2) {
j.state = true;
break;
}
}
}
Storage.put("jinrijuese", j);
}
if (Storage.get("wuqi") == true) {
events.broadcast.emit("message2", "武器单抽");
let j = Storage.get("jinriwuqi");
if (j.state == false) {
while (1) {
let p = findPic("扭蛋", "角色单抽", "角色抽过", "武器单抽", "武器抽过");
if (p == false) {
return 0;
} else if (p[0] == 0) {
clickp(p[1]);
} else if (p[0] == 1 || p[0] == 2) {
click(WIDTH * 0.9, HEIGHT * 0.43);
}
else if (p[0] == 3) {
clickp(p[1]);
sleep(2000);
let a = findPic("抽取扭蛋", "购买");
if (a == false) {
return 0;
} else if (a[0] == 0) {
clickp(a[1]);
let c = findPicTimes(30, 2000, [WIDTH / 2, HEIGHT * 0.7], "返回");
if (c == 0) {
qqerror(screen, "怎么没抽到?");
return 0;
} else if (c[0] == 0) {
j.state = true;
qqnotice(screen, "快看看你抽到了什么");
clickp(c[1]);
break;
}
} else if (a[0] == 1) {
j.state = true;
qqnotice(screen, "好好想想自己是不是该充钱了");
break;
}
} else if (p[0] == 4) {
j.state = true;
break;
}
}
}
Storage.put("jinriwuqi", j);
}
events.broadcast.emit("zhuye");
console.info("from登陆前to主页");
return 0;
})
events.broadcast.on("kasi", () => {
console.warn("卡死");
if (flag == false) {
return 0;
}
toastLog("卡死,尝试重新启动");
state();
})
events.broadcast.on("zhuye", () => {
console.info("主页");
if (flag == false) {
return 0;
}
events.broadcast.emit("message1", "等待下一项任务");
for (let t = 0; ;) {
t = findPicTimes(1, 500, 0, "公告");
if (t == 0) {
backHome();
} else {
break;
}
}
if (Storage.get("zhanzhen") == true) {
events.broadcast.emit("message1", "刷战阵!");
events.broadcast.emit("shuazhanzhen");
console.info("刷战阵刷战阵");
return 0;
}
if (findPicTimes(1, 600, 0, "足体") == 0) {
events.broadcast.emit("tilihaojin");
console.info("from主页to体力耗尽");
return 0;
} else {
console.log("今日活动挑战完成情况:" + Storage.get("jinrigaonan").state);
console.log("今日地狱完成情况:" + Storage.get("jinrigaonan").state);
console.log("今日双倍完成情况:" + Storage.get("jinrigaonan").state);
if (Storage.get("jinrigaonan").state == false && Storage.get("gaonan") == true) {
events.broadcast.emit("shuagaonan");
console.info("from主页to刷高难");
return 0;
} else if (Storage.get("jinrihuodong").state == false && Storage.get("huodongdanren") == true) {
events.broadcast.emit("shuahuodong");
console.info("from主页to刷活动");
return 0;
} else if (Storage.get("jinrishuangbei").state == false && Storage.get("shuangbei") == true) {
events.broadcast.emit("shuashuangbei");
console.info("from主页to刷双倍");
return 0;
} else if (Storage.get("sucai") == true && shuagou == false) {
events.broadcast.emit("shuasucai");
console.info("from主页to刷素材");
return 0;
} else if (Storage.get("shenceng") == true && shuagou == false) {
events.broadcast.emit("shuashenceng");
console.info("from主页to刷深层");
return 0;
} else {
danren = false;
events.broadcast.emit("budadanren");
console.info("from主页to不打单人");
return 0;
}
}
})
events.broadcast.on("tilihaojin", () => {
console.info("体力耗尽");
if (flag == false) {
return 0;
}
if (Storage.get("lingdang") == true) {
if (Storage.get("lingzhu") == true) {
events.broadcast.emit("lingzhulingdang");
console.info("from体力耗尽to领主铃铛");
return 0;
} else if (Storage.get("huodong") == true) {
events.broadcast.emit("huodonglingdang");
console.info("from体力耗尽to活动铃铛");
return 0;
} else {
events.broadcast.emit("lingdang");
console.info("from体力耗尽to铃铛");
return 0;
}
} else if (Storage.get("lingzhu") == true) {
events.broadcast.emit("lingzhu");
console.info("from体力耗尽to领主");
return 0;
} else if (Storage.get("huodong") == true) {
events.broadcast.emit("huodong");
console.info("from体力耗尽to活动");
return 0;
} else {
events.broadcast.emit("close");
console.info("from体力耗尽to关闭");
return 0;
}
})
events.broadcast.on("budadanren", () => {
console.info("无可执行单人任务");
if (flag == false) {
return 0;
}
if (Storage.get("lingdang") == true) {
if (Storage.get("lingzhu") == true) {
events.broadcast.emit("lingzhulingdang");
console.info("from不打单人to领主铃铛");
return 0;
} else if (Storage.get("huodong") == true) {
events.broadcast.emit("huodonglingdang");
console.info("from不打单人to活动铃铛");
return 0;
} else {
events.broadcast.emit("lingdang");
console.info("from不打单人to铃铛");
return 0;
}
} else if (Storage.get("lingzhu") == true) {
events.broadcast.emit("lingzhu");
console.info("from不打单人to领主");
return 0;
} else if (Storage.get("huodong") == true) {
events.broadcast.emit("huodong");
console.info("from不打单人to活动");
return 0;
} else if (Storage.get("kaiche1") == true || Storage.get("kaiche2") == true) {
events.broadcast.emit("kaiche");
console.info("from不打单人to开车");
return 0;
}
})
events.broadcast.on("shuagaonan", () => {
console.info("刷高难关卡");
if (flag == false) {
return 0;
}
backHome();
var sx = Storage.get("gaonanshuxing");
switch (sx) {
case 0:
sx = "光高难";
break;
case 1:
sx = "雷高难";
break;
case 2:
sx = "暗高难";
break;
case 3:
sx = "水高难";
break;
case 4:
sx = "火高难";
break;
case 5:
sx = "风高难";
break;
}
var nd = Storage.get("gaonannandu");
switch (nd) {
case 0:
nd = "超+";
break;
case 1:
nd = "地狱";
break;
}
events.broadcast.emit("message1", "刷" + sx + nd);
events.broadcast.emit("message2", "查找" + sx);
{ let a = findPic("旗子", "紫色旗子"); if (a == false) return 0; else clickp(a[1]) }
{ let a = findPic("推荐任务"); if (a == false) return 0; }
swipeup();
swipeup();
let sy = findPic("0次", "高难");
if (sy[0] == 0) {
let j = Storage.get("jinrigaonan");
j.state = true;
Storage.put("jinrigaonan", j);
events.broadcast.emit("message1", "高难关卡已刷完");
backHome();
events.broadcast.emit("zhuye");
console.info("from刷高难to主页");
return 0;
} else if (sy[0] == 1) {
clickp(sy[1]);
{ let a = findPic("光高难"); if (a == false) return 0; }
for (let i = 0; ; i++) {
var p = findPicTimes(2, 800, 0, sx);
if (p == 0) {
swipeup();
} else {
clickp(p[1]);
break;
}
if (i > 3) {
var text = "未找到" + sx;
events.broadcast.emit("message2", text);
qqerror(screen, text);
backHome();
events.broadcast.emit("zhuye");
console.info("from刷高难to主页");
return 0;
}
}
events.broadcast.emit("message2", "开始刷" + sx + nd);
{ let a = findPic(nd); if (a == false) return 0; else click(a[1].x, a[1].y) }
{ let a = findPic("是"); if (a == false) return 0; else clickp(a[1]) }
{ let a = findPic("挑战"); if (a == false) return 0; else clickp(a[1]) }
events.broadcast.emit("message2", "判断体力");
sleep(2000);
var tl = findPicTimes(1, 1000, 0, "取消");
if (tl == 0) {
var q = quest(false);
if (q == 0) {
backHome();
events.broadcast.emit("shuagaonan");
console.info("from刷高难to刷高难");
return 0;
} else {
backHome();
events.broadcast.emit("shuagaonan");
console.info("from刷高难to刷高难");
return 0;
}
} else {
clickp(tl[1]);
events.broadcast.emit("message1", "体力耗尽");
sleep(1000);
backHome();
events.broadcast.emit("tilihaojin");
console.info("from刷高难to体力耗尽");
return 0;
}
}
})
events.broadcast.on("wuxianchi", () => {
console.info("无限池");
events.broadcast.emit("message2", "抽无限池");
backHome();
while (1) {
let jr = findPic("抽取", "无限池", "活动道具", "商店"); if (jr == false) return 0;
if (jr[0] == 3) {
clickp(jr[1]);
} else if (jr[0] == 2) {
clickp(jr[1]);
} else if (jr[0] == 1) {
clickp(jr[1]);
} else if (jr[0] == 0) {
break;
}
}
while (1) {
let c = findPic("抽完", "刷新", "抽取"); if (c == false) return 0;
clickp(c[1]);
if (c[0] == 1) {
while (1) {
let o = findPic("抽取", "ok"); if (o == false) return0;
if (o[0] == 1) {
clickp(o[1]);
} else if (o[0] == 0) {
break;
}
}
} else if (c[0] == 2) {
clickp(c[1]);
} else if (c[0] == 0) {
break;
}
}
backHome();
events.broadcast.emit("zhuye");
console.info("from无限池to主页");
return 0;
})
events.broadcast.on("shuazhanzhen", () => {
console.info("刷战阵");
if (flag == false) {
return 0;
}
backHome();
var wxc = Storage.get("yichouwuxianchi");
if (wxc != true) {
wxc = true;
Storage.put("yichouwuxianchi", wxc);
events.broadcast.emit("message1", "抽无限池");
events.broadcast.emit("wuxianchi");
console.info("from主页to抽无限池");
return 0;
}
var cs = Storage.get("yidazhanzhen");
var h = new Array(0, 0, 0, 0);
events.broadcast.emit("message1", "刷战阵,已刷" + cs + "次");
events.broadcast.emit("message2", "进入战阵");
for (let i = 0; ; i++) {
if (i >= 3) {
var text = "未找到单人";
events.broadcast.emit("message2", text);
qqerror(screen, text);
backHome();
events.broadcast.emit("zhuye")
console.info("from刷深层to主页");
return 0;
}
let a = findPic("紫色旗子", "旗子");
if (a == false) {
backHome();
}
else clickp(a[1]);
sleep(1000);
let b = findPic("推荐任务");
if (a == false) {
continue;
}
else break;
}
for (let i = 0; ; i++) {
var p = findPicTimes(2, 800, 0, "战阵");
if (p == 0) {
swipeup();
} else {
clickp(p[1]);
break;
}
if (i > 3) {
var text = "未找到战阵";
events.broadcast.emit("message2", text);
qqerror(screen, text);
backHome();
events.broadcast.emit("zhuye")
console.info("from刷双倍to主页");
return 0;
}
}
while (1) {
var p = findPic("关闭", "战阵地狱");
if (p == false) {
var text = "未找到战阵地狱";
events.broadcast.emit("message2", text);
qqerror(screen, text);
backHome();
events.broadcast.emit("zhuye");
console.info("from刷战阵to主页");
return 0;
} else if (p[0] == 0) {
clickp(p[1]);
} else if (p[0] == 1) {
clickp(p[1]);
break;
}
}
Storage.put("yichouwuxianchi", false);
events.broadcast.emit("message2", "开始刷战阵");
while (1) {
if (cs >= 150) {
cs = 0;
Storage.put("yidazhanzhen", cs);
Storage.put("yichouwuxianchi", true);
events.broadcast.emit("message1", "抽无限池");
events.broadcast.emit("wuxianchi");
console.info("from刷战阵to抽无限池");
return 0;
}
let tmp = findPic("挑战");
if (tmp[0] == 0) {
let xz = findPic("单人续战关");
if (xz != false) {
clickp(xz[1]);
} else return 0;
let bz = findPicTimes(2, 400, 0, "体力不足");
if (bz != 0) {
let a = findPic("ok");
if (a == false) return 0;
else clickp(a[1]);
{ let a = findPic("加体"); if (a == false) return 0; else clickp(a[1]) };
let y = findPicTimes(5, 200, 0, "小黄", "小红");
clickp(y[1]);
let j = findPicTimes(2, 800, 0, "加药", "使用");
if (j == 0) {
let y = findPicTimes(2, 800, 0, "中红");
clickp(y[1]);
let j = findPicTimes(2, 800, 0, "加药", "使用");
if (j == 0) {
let y = findPicTimes(2, 800, 0, "大红");
clickp(y[1]);
let j = findPicTimes(2, 800, 0, "使用");
if (j == 0) {
qqerror(screen, "你药没啦!");
return 0;
} else if (j[0] == 0) {
h[3] = h[3] + 1;
}
} else if (j[0] == 0) {
clickp(j[1]);
h[2] = h[2] + 2;
} else if (j[0] == 1) {
clickp(j[1]);
events.broadcast.emit("zhuye")
console.info("from刷战阵to主页");
return 0;
}
} else if (j[0] == 0) {
clickp(j[1]);
clickp(j[1]);
h[y[0]] = h[y[0]] + 3;
} else if (j[0] == 1) {
clickp(j[1]);
events.broadcast.emit("zhuye")
console.info("from刷战阵to主页");
return 0;
}
{ let a = findPic("使用"); if (a == false) return 0; else clickp(a[1]) };
{ let a = findPic("ok"); if (a == false) return 0; else clickp(a[1]) };
var text = "已刷" + cs + "次战阵,";
if (h[0] > 0) {
text += h[0] + "小黄";
}
if (h[1] > 0) {
text += h[1] + "小红";
}
if (h[2] > 0) {
text += h[2] + "中红";
}
if (h[3] > 0) {
text += h[3] + "大红";
}
events.broadcast.emit("message1", text);
clickp(xz[1]);
}
} else if (tmp == false) return 0;
clickp(tmp[1]);
//events.broadcast.emit("message2", "判断体力");
var tl = findPic("ok", "取消");
if (tl[0] == 0) {
clickp(tl[1]);
while (1) {
let ks = findPic("续战结束", "等待中", "暂停");
if (ks[0] == 2) {
if (Storage.get("dianban") == true) {
events.broadcast.emit("message2", "开局点板");
for (let i = 0; i < 12; i++) {
clickp(WIDTH * 0.5, HEIGHT * 0.7);
sleep(200);
}
}
let js = findPic("ok");
cs++;
Storage.put("yidazhanzhen", cs);
var text = "已刷" + cs + "次战阵,";
if (h[0] > 0) {
text += h[0] + "小黄";
}
if (h[1] > 0) {
text += h[1] + "小红";
}
if (h[2] > 0) {
text += h[2] + "中红";
}
if (h[3] > 0) {
text += h[3] + "大红";
}
events.broadcast.emit("message1", text);
events.broadcast.emit("message2", "准备下次战斗");
continue;
} else if (ks[0] == 0) {
events.broadcast.emit("message2", "续战已结束,开始补体");
let js = findPic("ok");
clickp(js[1]);
{ let a = findPic("加体"); if (a == false) return 0; else clickp(a[1]) };
let y = findPicTimes(5, 200, 0, "小黄", "小红");
clickp(y[1]);
let j = findPicTimes(2, 800, 0, "加药", "使用");
if (j == 0) {
let y = findPicTimes(2, 800, 0, "中红");
clickp(y[1]);
let j = findPicTimes(2, 800, 0, "加药", "使用");
if (j == 0) {
let y = findPicTimes(2, 800, 0, "大红");
clickp(y[1]);
let j = findPicTimes(2, 800, 0, "使用");
if (j == 0) {
qqerror(screen, "你药没啦!");
return 0;
} else if (j[0] == 0) {
h[3] = h[3] + 1;
}
} else if (j[0] == 0) {
clickp(j[1]);
h[2] = h[2] + 2;
} else if (j[0] == 1) {
clickp(j[1]);
events.broadcast.emit("zhuye")
console.info("from刷战阵to主页");
return 0;
}
} else if (j[0] == 0) {
clickp(j[1]);
clickp(j[1]);
h[y[0]] = h[y[0]] + 3;
} else if (j[0] == 1) {
clickp(j[1]);
events.broadcast.emit("zhuye")
console.info("from刷战阵to主页");
return 0;
}
{ let a = findPic("使用"); if (a == false) return 0; else clickp(a[1]) };
{ let a = findPic("ok"); if (a == false) return 0; else clickp(a[1]) };
var text = "已刷" + cs + "次战阵,";
if (h[0] > 0) {
text += h[0] + "小黄";
}
if (h[1] > 0) {
text += h[1] + "小红";
}
if (h[2] > 0) {
text += h[2] + "中红";
}
if (h[3] > 0) {
text += h[3] + "大红";
}
events.broadcast.emit("message1", text);
break;
}
}
continue;
}
}
/*else {
let y = findPicTimes(1, 200, 0, "小黄", "小红", "中红", "大红");
if (y == 0) {
qqerror(screen, "你药没啦!");
break;
} else {
clickp(y[1]);
let j = findPic("+");
clickp(j[1]);
{ let a = findPic("使用"); if (a == false) return 0; else clickp(a[1]) };
{ let a = findPic("ok"); if (a == false) return 0; else clickp(a[1]) };
h[y[0]]++;
var text = "已刷" + cs + "次战阵,";
if (h[0] > 0) {
text += h[0] + "小黄";
}
if (h[1] > 0) {
text += h[1] + "小红";
}
if (h[2] > 0) {
text += h[2] + "中红";
}
if (h[3] > 0) {
text += h[3] + "大红";
}
events.broadcast.emit("message1", text);
}
}
}
clickp(tl[1]);
Storage.put("yidazhanzhen", cs);
events.broadcast.emit("message1", "体力耗尽");
sleep(1000);
backHome();
events.broadcast.emit("tilihaojin");
console.info("from刷战阵to体力耗尽");
return 0;*/
})
events.broadcast.on("shuahuodong", () => {
console.info("刷活动单人");
events.broadcast.emit("message1", "刷活动单人挑战");
events.broadcast.emit("message2", "进入活动单人挑战");
if (flag == false) {
return 0;
}
backHome();
{ let a = findPic("旗子", "紫色旗子"); if (a == false) return 0; else clickp(a[1]) }
{ let a = findPic("推荐任务"); if (a == false) return 0; }
{ let a = findPic("单人活动"); if (a == false) return 0; else clickp(a[1]) }
{ let a = findPic("挑战关卡"); if (a == false) return 0; else clickp(a[1]) }
sleep(2000);
let yc = findPicTimes(4, 500, 0, "一次");
if (yc == 0) {
let j = Storage.get("jinrihuodong");
j.state = true;
Storage.put("jinrihuodong", j);
events.broadcast.emit("message1", "活动单人已刷完");
backHome();
events.broadcast.emit("zhuye");
console.info("from刷活动to主页");
} else {
clickp(yc[1]);
{ let a = findPic("是"); if (a == false) return 0; else clickp(a[1]) }
{ let a = findPic("挑战"); if (a == false) return 0; else clickp(a[1]) }