forked from pxyztiny/APPSIGN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBBB.js
1458 lines (1335 loc) · 50.2 KB
/
BBB.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
/*
adwktt
轉載備註名字
打开App获取Cookie
下載地址:http://bububao.yichengw.cn/?id=524855
圈x
[rewrite_local]
#步步宝
https://bububao.duoshoutuan.com/user/profile url script-request-header https://raw.githubusercontent.com/adwktt/adwktt/master/BBB.js
[task_local]
0 8-23/2 * * * https://raw.githubusercontent.com/adwktt/adwktt/master/BBB.js, tag=步步宝,
loon
[Script]
http-request https://bububao.duoshoutuan.com/user/profile script-path= https://raw.githubusercontent.com/adwktt/adwktt/master/BBB.js, timeout=10, tag= 步步宝
cron "0 8-23/2 * * *" script-path= https://raw.githubusercontent.com/adwktt/adwktt/master/BBB.js, tag= 步步宝
surge
步步宝 = type=cron,cronexp="0 8-23/2 * * *",wake-system=1,script-path=https://raw.githubusercontent.com/adwktt/adwktt/master/BBB.js,script-update-interval=0
步步宝 = type=http-request,pattern=https://bububao.duoshoutuan.com/user/profile,requires-body=0,max-size=0,script-path=https://raw.githubusercontent.com/adwktt/adwktt/master/BBB.js,script-update-interval=0
hostname = bububao.duoshoutuan.com,
*/
const $ = new Env('步步寶')
let notice = ''
//let CookieVal = $.getdata('bbb_ck')
let CookieVal = process.env.BBBCK
if ($.isNode()) {
console.log(`============ 脚本执行-国际标准时间(UTC):${new Date().toLocaleString()} =============\n`)
console.log(`============ 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleString()} =============\n`)
}
now = new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000);
if (typeof $request !== 'undefined') {
if ($request && $request.method != `OPTIONS` && $request.url.indexOf('user/profile') != -1) {
const CookieVal = JSON.stringify($request.headers)
if(CookieVal)$.setdata(CookieVal,'bbb_ck')
$.log(`CookieVal:${CookieVal}`)
$.msg($.name,"获取Cookie成功")
$.done()
}
} else {
!(async () => {
$.msg($.name,"開始🎉🎉🎉")
await cashCheck()
await signIn()
await checkWaterNum()
await zaoWanDkInfo()
await sleepStatus()
await clickTaskStatus()
await watchTaskStatus()
//await helpStatus()
await getNewsId()
await checkWaterNum()
await getQuestionId()
await guaList()
await checkWaterNum()
await checkHomeJin()
await userInfo()
await showmsg()
})()
.catch((e) => $.logErr(e))
.finally(() => $.done())
}
function showmsg(){
$.msg($.name, '', notice)
}
var getBoxId = (function () {
var i = 0;
return function () {
return ++i;
};
})();
function userInfo() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let userInfo ={
url: 'https://bububao.duoshoutuan.com/user/profile',
headers: JSON.parse(CookieVal),
}
$.post(userInfo,async(error, response, data) =>{
const userinfo = JSON.parse(data)
if(response.statusCode == 200 && userinfo.code != -1){
$.log('\n🎉模擬登陸成功\n')
notice += '🎉步步寶帳號: '+userinfo.username+'\n'+'🎉當前金幣: '+userinfo.jinbi+'💰 約'+userinfo.money+'元💸\n'
}else{
notice += '⚠️異常原因: '+userinfo.msg+'\n'
}
resolve()
})
})
}
function signIn() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let signin ={
url: `https://bububao.duoshoutuan.com/user/sign`,
headers: JSON.parse(CookieVal),
}
$.post(signin,async(error, response, data) =>{
$.log('\n🔔開始签到\n')
const sign = JSON.parse(data)
if(sign.code == 1) {
$.log('\n🎉'+sign.msg+'簽到金幣+ '+sign.jinbi+'💰\n')
signInStr = sign.nonce_str
await signDouble()
}else{
$.log('\n🎉'+sign.msg+'\n')
}
resolve()
})
})
}
function signDouble() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let signdouble ={
url: `https://bububao.duoshoutuan.com/you/callback`,
headers: JSON.parse(CookieVal),
body: `nonce_str=${signInStr}&tid=2&pos=1&`,
}
$.post(signdouble,async(error, response, data) =>{
const signin2 = JSON.parse(data)
$.log('\n🔔開始領取每日觀看獎勵\n')
if(signin2.code == 1) {
$.log('\n🎉簽到翻倍成功\n')
}else{
$.log('\n⚠️簽到翻倍失敗敗:'+signin2.msg+'\n')
}
resolve()
})
})
}
function zaoWanDkInfo() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let zaowandkinfo ={
url: `https://bububao.duoshoutuan.com/mini/dk_info`,
headers: JSON.parse(CookieVal),
}
$.post(zaowandkinfo,async(error, response, data) =>{
const zwdkinfo = JSON.parse(data)
if(zwdkinfo.code == 1 && zwdkinfo.is_dk == 0) {
nowTime = zwdkinfo.now_time
title1 = zwdkinfo.title1
title2 = zwdkinfo.title2
await zaoWanDk()
}
resolve()
})
})
}
function zaoWanDk() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let zaowandk ={
url: `https://bububao.duoshoutuan.com/user/chuansj`,
headers: JSON.parse(CookieVal),
body: `mini_pos=3&c_type=1&`,
}
$.post(zaowandk,async(error, response, data) =>{
const zwdk = JSON.parse(data)
if(zwdk.code == 1) {
zwdkStr = zwdk.nonce_str
await $.wait(30000)
await dkClick()
}
resolve()
})
})
}
function dkClick() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let dkclick ={
url: `https://bububao.duoshoutuan.com/mini/dk_click`,
headers: JSON.parse(CookieVal),
body: `now_time=${nowTime}&`,
}
$.post(dkclick,async(error, response, data) =>{
const clickdk = JSON.parse(data)
if(clickdk.code == 1) {
$.log('\n🎉'+clickdk.msg+'+ '+clickdk.jinbi+'💰\n')
$.msg(`${title1}`,`${title2}`,'')
await checkWaterNum()
}else{
$.log('\n⚠️'+clickdk.msg)
await checkWaterNum()
}
resolve()
})
})
}
function guaList() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let gualist ={
url: `https://bububao.duoshoutuan.com/gua/gualist?`,
headers: JSON.parse(CookieVal),
}
$.post(gualist,async(error, response, data) =>{
$.log('\n🔔開始查詢刮刮卡ID\n')
const guaid = JSON.parse(data)
if(guaid.ka > 0){
for (guaId of guaid.list)
if(guaId.is_ad == 0){
GID = guaId.id
$.log('\n🔔查詢刮刮卡ID成功,5s後開始查询刮卡签名\n')
$.log('\nGID: '+GID+'\n')
await $.wait(5000)
await guaDet()
}}else{
$.log('\n⚠️刮刮卡已用完,請明天再刮吧!\n')
await checkWaterNum()
}
resolve()
})
})
}
function guaDet() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let guadet ={
url: `https://bububao.duoshoutuan.com/gua/guadet?`,
headers: JSON.parse(CookieVal),
body: `gid=${GID}&`
}
$.post(guadet,async(error, response, data) =>{
$.log('\n🔔開始查詢刮卡簽名\n')
const guasign= JSON.parse(data)
if(response.statusCode == 200) {
$.log('\n🔔查詢刮卡簽名成功\n')
SIGN = guasign.sign
GLID = guasign.glid
$.log('\nsign: '+SIGN+'\n')
$.log('\nglid: '+GLID+'\n')
await guaPost()
}
resolve()
})
})
}
function guaPost() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let guapost ={
url: `https://bububao.duoshoutuan.com/gua/guapost?`,
headers: JSON.parse(CookieVal),
body: `sign=${SIGN}&gid=${GID}&glid=${GLID}&`
}
$.post(guapost,async(error, response, data) =>{
$.log('\n🔔開始刮卡\n')
const guaka= JSON.parse(data)
if(typeof guaka.jf === 'number') {
guaStr = guaka.nonce_str
$.log('\n🎉刮卡成功\n恭喜您刮出'+guaka.tp+'張相同圖案\n金幣+ '+guaka.jf+'\n等待45s後開始翻倍刮卡獎勵')
await $.wait(45000)
await guaDouble()
}
resolve()
})
})
}
function guaDouble() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let guadouble ={
url: `https://bububao.duoshoutuan.com/you/callback`,
headers: JSON.parse(CookieVal),
body: `nonce_str=${guaStr}&tid=6&pos=1&`,
}
$.post(guadouble,async(error, response, data) =>{
const guaka2 = JSON.parse(data)
$.log('\n🔔開始領取刮卡翻倍獎勵\n')
if(guaka2.code == 1) {
$.log('\n🎉刮卡翻倍成功,等待2s後查詢下一張刮刮卡ID\n')
await $.wait(2000)
//await guaList()
}else{
$.log('\n⚠️刮卡翻倍失敗:'+guaka2.msg+'\n')
}
resolve()
})
})
}
function checkWaterNum() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let checkwaternum ={
url: `https://bububao.duoshoutuan.com/mini/water_info`,
headers: JSON.parse(CookieVal),
}
$.post(checkwaternum,async(error, response, data) =>{
$.log('\n🔔開始查詢喝水杯數\n')
const waternum = JSON.parse(data)
if(waternum.code == 1 && waternum.day_num < 7) {
waterNum = waternum.day_num
if(waternum.is_sp == 1){
$.log('\n🎉喝水前需要看廣告喔!,1s後開始看廣告\n')
await $.wait(1000)
await checkWaterSp()
}else{
$.log('\n🎉查詢成功,1s後領取喝水獎勵\n')
await $.wait(1000)
await waterClick()
}}else{
$.log('\n⚠️喝水失敗: 今日喝水已上限\n')
}
resolve()
})
})
}
function checkWaterSp() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let checksp ={
url: `https://bububao.duoshoutuan.com/user/chuansj`,
headers: JSON.parse(CookieVal),
body: `mini_pos=2&c_type=1&`,
}
$.post(checksp,async(error, response, data) =>{
const sp = JSON.parse(data)
if(sp.code == 1) {
waterSpStr = sp.nonce_str
await WaterSp()
}
resolve()
})
})
}
function WaterSp() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let watersp ={
url: `https://bububao.duoshoutuan.com/mini/water_sp`,
headers: JSON.parse(CookieVal),
body: `day_num=${waterNum}&`,
}
$.post(watersp,async(error, response, data) =>{
const spwater = JSON.parse(data)
if(spwater.code == 1) {
$.log('\n🎉正在觀看喝水廣告, 30後領取喝水獎勵\n')
await $.wait(30000)
await waterClick()
}
resolve()
})
})
}
function waterClick() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let waterclick ={
url: `https://bububao.duoshoutuan.com/mini/water_click`,
headers: JSON.parse(CookieVal),
body: `day_num=0${waterNum}&`,
}
$.post(waterclick,async(error, response, data) =>{
const clickwater = JSON.parse(data)
$.log('\n🔔開始領取喝水獎勵\n')
if(clickwater.code == 1) {
$.log('\n🎉'+clickwater.msg+'喝水金幣+ '+clickwater.jinbi+'💰\n')
}else{
$.log('\n⚠️喝水失敗:'+clickwater.msg+'\n')
}
resolve()
})
})
}
function sleepStatus() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let sleepstatus ={
url: `https://bububao.duoshoutuan.com/mini/sleep_info`,
headers: JSON.parse(CookieVal),
}
$.post(sleepstatus,async(error, response, data) =>{
$.log('\n🔔開始查詢睡覺狀態\n')
const slpstatus = JSON.parse(data)
if(slpstatus.code == 1) {
if(slpstatus.is_lq == 1 && now.getHours() >= 8 && now.getHours() <= 18) {
sleepStr = slpstatus.nonce_str
sleepId = slpstatus.taskid
}else{
$.log('🔔大白天的就不要睡覺啦!')
}
if(slpstatus.is_sleep == 0 && slpstatus.is_lq == 1 && now.getHours() >= 20) {
$.log('🔔都幾點了,還不睡?5s後開始睡覺!')
await $.wait(5000)
await sleepStart()
}else if((slpstatus.is_sleep == 1 || slpstatus.is_sleep == 0)&& slpstatus.is_lq == 0 && now.getHours() >= 8 && now.getHours() <= 12){
$.log('🔔都幾點了,還不起?5s後準備起床!')
await $.wait(5000)
await sleepEnd()
}else if(slpstatus.is_sleep == 0 && slpstatus.is_lq == 1 && now.getHours() >= 8 && now.getHours() <= 12){
await sleepDone()
}else if(slpstatus.is_sleep == 1 && slpstatus.is_lq == 1 && now.getHours() >= 22){
$.log('⚠️睡覺的時候不要玩手機!!!')
}else if(slpstatus.is_sleep == 0 &&
now.getHours() >= 18){
$.log('😘這麼早就準備睡覺了嗎?是身體不舒服嗎?要保重身體呀!')
}}
resolve()
})
})
}
function sleepStart() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let sleepstart ={
url: `https://bububao.duoshoutuan.com/mini/sleep_start`,
headers: JSON.parse(CookieVal),
}
$.post(sleepstart,async(error, response, data) =>{
const startsleep = JSON.parse(data)
$.log('\n🔔開始睡覺\n')
if(startsleep.code == 1) {
$.log('\n🎉睡覺成功!早睡早起身體好!\n')
}else{
$.log('\n⚠️睡覺失敗敗:'+startsleep.msg+'\n')
}
resolve()
})
})
}
function sleepEnd() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let sleepend ={
url: `https://bububao.duoshoutuan.com/mini/sleep_end`,
headers: JSON.parse(CookieVal),
}
$.post(sleepend,async(error, response, data) =>{
const endsleep = JSON.parse(data)
$.log('\n🔔開始起床\n')
if(endsleep.code == 1) {
$.log('\n🎉起床了!別睡了!\n')
await sleepStatus()
}else{
$.log('\n⚠️起床失敗:'+endsleep.msg+'\n')
}
resolve()
})
})
}
function sleepDone() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let sleepdone ={
url: `https://bububao.duoshoutuan.com/mini/sleep_done`,
headers: JSON.parse(CookieVal),
body: `taskid=${sleepId}&nonce_str=${sleepStr}&`
}
$.post(sleepdone,async(error, response, data) =>{
const donesleep = JSON.parse(data)
$.log('\n🔔開始領取睡覺金幣\n')
if(donesleep.code == 1) {
$.log('\n🎉'+donesleep.msg+'金幣+ '+donesleep.jinbi+'💰\n')
}else{
$.log('\n⚠️領取睡覺金幣失敗敗:'+donesleep.msg+'\n')
}
resolve()
})
})
}
function clickTaskStatus() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let clicktaskstatus ={
url: `https://bububao.duoshoutuan.com/user/renwu`,
headers: JSON.parse(CookieVal),
body: `idfa=${JSON.parse(CookieVal)['idfa']}&`,
}
$.post(clicktaskstatus,async(error, response, data) =>{
const clicktask = JSON.parse(data)
if(clicktask.first.admobile_st != 2) {
$.log('\n🔔開始查詢每日點擊任務狀態\n')
await checkDailyClickAdId()
}else{
$.log('\n⚠️每日點擊廣告任務已上限\n')
}
resolve()
})
})
}
function watchTaskStatus() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let watchtaskstatus ={
url: `https://bububao.duoshoutuan.com/user/renwu`,
headers: JSON.parse(CookieVal),
body: `idfa=${JSON.parse(CookieVal)['idfa']}&`,
}
$.post(watchtaskstatus,async(error, response, data) =>{
const watchtask = JSON.parse(data)
$.log('\n🔔開始查詢每日觀看廣告任務狀態\n')
if(watchtask.v_st != 2) {
$.log('\n🔔每日觀看廣告任務狀態查詢成功,1s後查詢每日觀看廣告ID\n')
await $.wait(1000)
await checkDailyWatchAdId()
}else{
$.log('\n⚠️每日看廣告任務已上限\n')
await checkWaterNum()
}
resolve()
})
})
}
function checkDailyWatchAdId() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let checkdailywatchadid ={
url: `https://bububao.duoshoutuan.com/user/chuansj`,
headers: JSON.parse(CookieVal),
body: `mini_pos=0&c_type=1&`,
}
$.post(checkdailywatchadid,async(error, response, data) =>{
$.log('\n🔔開始查詢每日觀看廣告ID\n')
const dailywatchid = JSON.parse(data)
if(dailywatchid.code == 1) {
dailyWatchStr = dailywatchid.nonce_str
// $.log('\n'+dailyWatchStr+'\n')
$.log('\n🎉查詢成功,30s後領取獎勵\n')
await $.wait(30000)
await DailyWatchAd()
}
resolve()
})
})
}
function DailyWatchAd() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let dailywatchad ={
url: `https://bububao.duoshoutuan.com/you/callback`,
headers: JSON.parse(CookieVal),
body: `nonce_str=${dailyWatchStr}&tid=9&pos=1&`,
}
$.post(dailywatchad,async(error, response, data) =>{
const dailywatch = JSON.parse(data)
$.log('\n🔔開始領取每日觀看獎勵\n')
if(dailywatch.code == 1) {
$.log('\n🎉每日觀看獎勵領取成功,5m(300s)後查詢下一次廣告\n')
for(let i=1;i<=60;i++){
(function(){
setTimeout(() => {
$.log('\n⏱請等待'+(60-i)*5+'s後查詢下一次廣告\n')
}, 5000*i);
})()
}
await $.wait(300000)
await watchTaskStatus()
}else{
$.log('\n⚠️每日獎勵領取失敗:'+dailywatch.msg+'\n')
}
resolve()
})
})
}
function checkDailyClickAdId() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let checkdailyclickadid ={
url: `https://bububao.duoshoutuan.com/user/admobile_show`,
headers: JSON.parse(CookieVal),
}
$.post(checkdailyclickadid,async(error, response, data) =>{
$.log('\n🔔開始查詢每日廣告ID\n')
const dailyclickid = JSON.parse(data)
if(dailyclickid.code == 1) {
dailyClickAdId = dailyclickid.ad_id
// $.log('\n'+dailyClickAdId+'\n')
$.log('\n🎉查詢成功,1s後領取獎勵\n')
await $.wait(1000)
await checkDailyClickAd()
}
resolve()
})
})
}
function checkDailyClickAd() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let checkdailyclickad ={
url: `https://bububao.duoshoutuan.com/user/admobile_click`,
headers: JSON.parse(CookieVal),
body: `ad_id=${dailyClickAdId}&`,
}
$.post(checkdailyclickad,async(error, response, data) =>{
$.log('\n🔔開始查詢每日廣告點擊ID\n')
const dailyclick = JSON.parse(data)
if(dailyclick.code == 1) {
dailyClickStr = dailyclick.nonce_str
// $.log('\n'+dailyClickStr+'\n')
$.log('\n🎉查詢成功,5s後返回領取獎勵\n')
await $.wait(5000)
await DailyClickAd()
}
resolve()
})
})
}
function DailyClickAd() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let dailyclickad ={
url: `https://bububao.duoshoutuan.com/user/admobile_done`,
headers: JSON.parse(CookieVal),
body: `nonce_str=${dailyClickStr}&ad_id=${dailyClickAdId}&`,
}
$.post(dailyclickad,async(error, response, data) =>{
const dailyclick = JSON.parse(data)
$.log('\n🔔開始領取每日點擊獎勵\n')
if(dailyclick.code == 1) {
$.log('\n🎉每日點擊獎勵領取成功,1s後查詢下一次廣告ID\n')
await $.wait(1000)
await clickTaskStatus()
}else{
$.log('\n⚠️每日點擊領取失敗:'+dailyclick.msg+'\n')
}
resolve()
})
})
}
function checkHomeJin() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let checkhomejin ={
url: 'https://bububao.duoshoutuan.com/user/home',
headers: JSON.parse(CookieVal),
}
$.post(checkhomejin,async(error, response, data) =>{
const checkhomejb = JSON.parse(data)
if(checkhomejb.right_st == 0){
await homeJin()
}else if(checkhomejb.right_st == 1){
$.log('\n🔔開始查詢首頁金幣狀態\n')
$.log('\n🔔等待'+(checkhomejb.right_time+5)+'s领取首页金币')
await $.wait(checkhomejb.right_time*1000+5000)
await homeJin()
}else if(checkhomejb.right_st == 2 && checkhomejb.jindan_show == 0){
$.log('\n🔔開始查詢首頁金蛋狀態\n')
$.log('\n🔔等待'+(checkhomejb.jindan_djs+5)+'s领取金蛋獎勵')
await $.wait(checkhomejb.jindan_djs*1000+5000)
await checkGoldEggId()
}else if(checkhomejb.right_st == 2 && checkhomejb.jindan_show == 1){
$.log('\n🔔開始查詢首頁金蛋狀態\n')
$.log('\n🔔等待'+(checkhomejb.jindan_djs+5)+'s领取金蛋獎勵')
await $.wait(checkhomejb.jindan_djs*1000+5000)
await checkGoldEggId()
}else if(checkhomejb.right_st == 2 && checkhomejb.jindan_show == 2 && checkhomejb.hb_st == 0){
$.log('\n🔔開始查詢首頁紅包狀態\n')
await checkRedBagId()
}else if(checkhomejb.right_st == 2 && checkhomejb.jindan_show == 2 && checkhomejb.hb_st == 1){
$.log('\n🔔開始查詢首頁紅包狀態\n')
$.log('\n🔔等待'+(checkhomejb.hb_time+5)+'s領取首頁紅包')
time = checkhomejb.hb_time+5
for(let i=1;i<=(time/5);i++){
(function(){
setTimeout(() => {
$.log('\n⏱請等待'+((time/5-i)*5)+'s後領取首頁紅包\n')
}, 5000*i);
})()
}
await $.wait(checkhomejb.hb_time*1000+5000)
await checkRedBagId()
}else if(checkhomejb.right_st == 2 && checkhomejb.jindan_show == 2 && checkhomejb.hb_st == 2){
$.log('\n🔔首頁金幣狀態:'+checkhomejb.right_text+'\n🔔首頁紅包狀態:'+checkhomejb.hb_text+'\n🔔首頁金蛋狀態:'+checkhomejb.jindan_text+'\n')
await checkWaterNum()
}
resolve()
})
})
}
function homeJin() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let homejin ={
url: 'https://bububao.duoshoutuan.com/user/homejin',
headers: JSON.parse(CookieVal),
}
$.post(homejin,async(error, response, data) =>{
const homejb = JSON.parse(data)
if(homejb.code == 1){
$.log('\n🔔開始領取首頁金幣\n')
$.log('\n🎉首頁金幣:'+homejb.msg+'\n金幣+ '+homejb.jinbi+'等待30s後開始翻倍金幣\n')
homeJinStr = homejb.nonce_str
//$.log('\n'+homeJinStr+'\n')
await $.wait(30000)
await homeJinCallBack()
}else{
$.log('\n⚠️首頁金幣失敗:'+homejb.msg+'\n')
}
resolve()
})
})
}
function homeJinCallBack() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let homejincallback ={
url: `https://bububao.duoshoutuan.com/you/callback`,
headers: JSON.parse(CookieVal),
body: `nonce_str=${homeJinStr}&tid=21&pos=1&`,
}
$.post(homejincallback,async(error, response, data) =>{
const hmjcallback = JSON.parse(data)
$.log('\n🔔開始翻倍首頁金幣\n')
if(hmjcallback.code == 1) {
$.log('\n🎉首頁金幣翻倍成功\n')
await checkHomeJin()
}else{
$.log('\n🔔首頁金幣翻倍失敗'+hmjcallback.msg+'\n')
}
resolve()
})
})
}
function checkRedBagId() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let checkredbagid ={
url: `https://bububao.duoshoutuan.com/user/chuansj`,
headers: JSON.parse(CookieVal),
body: `mini_pos=0&c_type=2&`,
}
$.post(checkredbagid,async(error, response, data) =>{
$.log('\n🔔開始查詢首頁紅包ID\n')
const code = JSON.parse(data)
if(code.code == 1) {
redBagStr = code.nonce_str
$.log('\n🔔查詢首頁紅包ID成功,等待30s後領取首頁紅包\n')
await $.wait(30000)
await redBagCallback()
}
resolve()
})
})
}
function redBagCallback() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let redbagcallback ={
url: `https://bububao.duoshoutuan.com/you/callback`,
headers: JSON.parse(CookieVal),
body: `nonce_str=${redBagStr}&tid=17&pos=1&`,
}
$.post(redbagcallback,async(error, response, data) =>{
const redbag = JSON.parse(data)
$.log('\n🔔開始領取首頁紅包\n')
if(redbag.code == 1) {
$.log('\n🎉首頁紅包領取成功\n')
await checkHomeJin()
}else{
$.log('\n⚠️首頁紅包領取失敗:'+redbag.msg+'\n')
await checkHomeJin()
}
resolve()
})
})
}
function checkGoldEggId() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let checkgoldeggid ={
url: `https://bububao.duoshoutuan.com/user/jindan_click`,
headers: JSON.parse(CookieVal),
}
$.post(checkgoldeggid,async(error, response, data) =>{
const goldeggid = JSON.parse(data)
if(goldeggid.code == 1) {
$.log('\n🔔金蛋ID data'+data)
$.log('\n🔔開始查詢首頁金蛋ID\n')
goldEggStr = goldeggid.nonce_str
$.log('\n'+goldEggStr+'\n')
goldEggId = goldeggid.taskid
$.log('\n'+goldEggId+'\n')
await goldEggDone()
}else{
$.log('\n⚠️首頁金蛋失敗:'+goldeggid.msg+'\n')
await checkHomeJin()
}
resolve()
})
})
}
function goldEggDone() {
return new Promise((resolve, reject) => {
let timestamp= Date.parse(new Date())/1000;
let goldeggdone ={
url: `https://bububao.duoshoutuan.com/user/jindan_done`,
headers: JSON.parse(CookieVal),
body: `taskid=${goldEggId}&clicktime=${timestamp}&donetime=${timestamp}+1000&nonce_str=${goldEggStr}&`
}
$.post(goldeggdone,async(error, response, data) =>{
const goldegg2 = JSON.parse(data)
if(goldegg2.code == 1) {
$.log('\n🔔開始領取首頁金蛋獎勵\n')
$.log('\n🎉首頁金蛋:'+goldegg2.msg+'\n金幣+ '+goldegg2.jinbi+'\n')
await goldEggCallback()
}else{
$.log('\n⚠️首頁金蛋失敗:'+goldegg2.msg+'\n')
await checkHomeJin()
}
resolve()
})
})
}
function goldEggCallback() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let goldeggcallback ={
url: `https://bububao.duoshoutuan.com/you/callback`,
headers: JSON.parse(CookieVal),
body: `nonce_str=${goldEggStr}&tid=5&pos=1&`,
}
$.post(goldeggcallback,async(error, response, data) =>{
const goldeggback = JSON.parse(data)
$.log('\n🔔開始翻倍首頁金蛋\n')
if(goldeggback.code == 1) {
$.log('\n🎉金蛋翻倍成功\n')
await checkHomeJin()
}else{
$.log('\n⚠️金蛋翻倍失敗:'+goldeggback.msg+'\n')
await checkHomeJin()
}
resolve()
})
})
}
function helpStatus() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let helpstatus ={
url: `https://bububao.duoshoutuan.com/user/help_index`,
headers: JSON.parse(CookieVal),
}
$.post(helpstatus,async(error, response, data) =>{
const help = JSON.parse(data)
$.log('\n🔔開始查詢助力視頻狀態\n')
if(help.status == 0) {
$.log('\n🔔查詢助力視頻狀態成功, 1s後獲取助力視頻ID\n')
await checkCode()
}else{
$.log('\n🔔今日助力已上限,請明天再試!\n')
}
resolve()
})
})
}
function checkCode() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let checkcode ={
url: `https://bububao.duoshoutuan.com/user/chuansj`,
headers: JSON.parse(CookieVal),
body: `mini_pos=5&c_type=1&`,
}
$.post(checkcode,async(error, response, data) =>{
const code = JSON.parse(data)
$.log('\n🔔開始查詢助力視頻ID\n')
if(code.code == 1) {
nonce_str = code.nonce_str
$.log('\n🔔查詢助力視頻ID成功, 開始觀看助力視頻\n')
await helpClick()
}
resolve()
})
})
}
function helpClick() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let helpclick ={
url: `https://bububao.duoshoutuan.com/user/help_click`,
headers: JSON.parse(CookieVal),
body: `nonce_str=${nonce_str}`,
}
$.post(helpclick,async(error, response, data) =>{
const help = JSON.parse(data)
if(help.code == 1) {
$.log('\n🔔開始觀看助力視頻, 60s後領取助力視頻獎勵\n')
await $.wait(60000)
$.log('\n🎉觀看助力視頻成功, 1s後領取金幣+ '+help.jinbi+'\n')
await callBack()
}else{
$.log('\n⚠️觀看助力視頻失敗: '+help.msg+'\n')
}
resolve()
})
})
}
function callBack() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let callback ={
url: `https://bububao.duoshoutuan.com/you/callback`,
headers: JSON.parse(CookieVal),
body: `nonce_str=${nonce_str}&tid=22&pos=1&`,
}
$.post(callback,async(error, response, data) =>{
const back = JSON.parse(data)
$.log('\n🔔開始領取助力視頻獎勵\n')
if(back.code == 1) {
$.log('\n🎉領取助力視頻獎勵成功,1s後查詢下一次助力視頻狀態\n')
await $.wait(1000)
await helpStatus()
}else{
$.log('\n⚠️助力視頻獎勵失敗:'+back.msg+'\n')
}
resolve()
})
})
}
function getNewsId() {
return new Promise((resolve, reject) => {
let timestamp=new Date().getTime();
let getnewsid ={