Skip to content

Commit ceebf70

Browse files
author
ziye12
authored
多看点 完善判定
1 parent 0825241 commit ceebf70

File tree

1 file changed

+32
-31
lines changed

1 file changed

+32
-31
lines changed

Task/duokandian.js

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ boxjs链接 https://raw.githubusercontent.com/ziye12/JavaScript/main/Task/ziye.
1111
1212
2.9 制作
1313
2.10 增加看视频,基本完善
14+
2.11 完善判定
1415
1516
⚠️一共1个位置 1个ck 👉 2条 Secrets
1617
多账号换行
@@ -282,51 +283,51 @@ async function all() {
282283

283284
await user(); //用户信息
284285
await signindex(); //签到
285-
if ($.user.data.today_gold >= 2000 && $.signindex.data.sign_status == 0) {
286+
if ($.user.data&&$.user.data.today_gold >= 2000 && $.signindex.data.sign_status == 0) {
286287
await sign(); //签到
287288
}
288289
await days(); //任务列表
289290
await lottoindex(); //转盘查询
290-
if ($.lottoindex.data.times >= 1) {
291+
if ($.lottoindex.data&&$.lottoindex.data.times >= 1) {
291292
await lotto(); //转盘抽奖
292293
}
293-
if (gg.status != 2) {
294+
if (gg&&gg.status != 2) {
294295
await advideo(); //广告视频
295296
await extratime(); //时段刷新
296-
if ($.extratime.data.status == 1) {
297+
if ($.extratime.data&&$.extratime.data.status == 1) {
297298
await timeaward(); //时段奖励
298299
await timeawardsss(); //时段翻倍
299300
}
300301
await boxaward(); //宝箱奖励
301302
await boxbox(); //宝箱翻倍
302303
}
303-
if (sp.status == 1) {
304+
if (sp&&sp.status == 1) {
304305
await spaward(); //视频达成
305306
}
306-
if (yi.status == 1) {
307+
if (yi&&yi.status == 1) {
307308
await rw1(); //日常任务1
308309
}
309-
if (er.status == 1) {
310+
if (er&&er.status == 1) {
310311
await rw2(); //日常任务2
311312
}
312313
await txcx(); //提现查询
313-
if (CASH == 1 && $.user.data.cash >= 1 && txtx >= 5) {
314+
if (CASH == 1 &&$.user.data&& $.user.data.cash >= 1 && txtx >= 5) {
314315
await tx(); //提现
315316
}
316-
if (CASH == 3 && $.user.data.cash >= 3 && txtx >= 10) {
317+
if (CASH == 3 && $.user.data&&$.user.data.cash >= 3 && txtx >= 10) {
317318
await tx(); //提现
318319
}
319-
if (CASH == 5 && $.user.data.cash >= 5 && txtx >= 15) {
320+
if (CASH == 5 &&$.user.data&& $.user.data.cash >= 5 && txtx >= 15) {
320321
await tx(); //提现
321322
}
322-
if (CASH == 15 && $.user.data.cash >= 15 && txtx >= 30) {
323+
if (CASH == 15 &&$.user.data&& $.user.data.cash >= 15 && txtx >= 30) {
323324
await tx(); //提现
324325
}
325326

326327
console.log(`【视频统计】:共有${videoBODY.length}个body,预计运行${tt}秒\n`);
327328
$.message += `【视频统计】:共有${videoBODY.length}个body,预计运行${tt}秒\n`
328329

329-
if (videoBODY.length != 0 && sp.status != 2) {
330+
if (videoBODY.length != 0 && sp&&sp.status != 2) {
330331
await video(); //刷视频
331332
await $.wait(tt * 1000)
332333
}
@@ -369,7 +370,7 @@ function user(timeout = 0) {
369370
try {
370371
if (logs) $.log(`${O}, 用户信息🚩: ${data}`);
371372
$.user = JSON.parse(data);
372-
if ($.user.status_code == 200) {
373+
if ($.user.data&&$.user.status_code == 200) {
373374
console.log(`\n${O}\n========== 【${$.user.data.nickname}】 ==========\n`);
374375
$.message += `\n${O}\n========== 【${$.user.data.nickname}】 ==========\n`;
375376
$.message += `【账户信息】:账户余额${$.user.data.cash}元,今日获得${$.user.data.today_gold / 10000}元\n`;
@@ -400,7 +401,7 @@ function days(timeout = 0) {
400401
try {
401402
if (logs) $.log(`${O}, 任务列表🚩: ${data}`);
402403
$.days = JSON.parse(data);
403-
if ($.days.status_code == 200) {
404+
if ($.days.data&&$.days.status_code == 200) {
404405
sp = $.days.data.list.find(item => item.id === 11);
405406
gg = $.days.data.list.find(item => item.id === 12);
406407
yi = $.days.data.Task_comp.data.find(item => item.pro === 20);
@@ -442,7 +443,7 @@ function signindex(timeout = 0) {
442443
try {
443444
if (logs) $.log(`${O}, 签到查询🚩: ${data}`);
444445
$.signindex = JSON.parse(data);
445-
if ($.signindex.status_code == 200 && $.signindex.data.sign_status == 1) {
446+
if ($.signindex.data&&$.signindex.status_code == 200 && $.signindex.data.sign_status == 1) {
446447
console.log(`【签到查询】: 今日已签到\n`);
447448
$.message += `【签到查询】: 今日已签到\n`;
448449
}
@@ -472,7 +473,7 @@ function sign(timeout = 0) {
472473
try {
473474
if (logs) $.log(`${O}, 今日签到🚩: ${data}`);
474475
$.sign = JSON.parse(data);
475-
if ($.sign.status_code == 200) {
476+
if ($.sign.data&&$.sign.status_code == 200) {
476477
console.log(`【今日签到】: ${$.sign.data.sign_award}金币\n`);
477478
$.message += `【今日签到】: ${$.sign.data.sign_award}金币\n`;
478479
}
@@ -502,7 +503,7 @@ function spaward(timeout = 0) {
502503
try {
503504
if (logs) $.log(`${O}, 视频达成🚩: ${data}`);
504505
$.spaward = JSON.parse(data);
505-
if ($.spaward.status_code == 200) {
506+
if ($.spaward.data&&$.spaward.status_code == 200) {
506507
console.log(`【视频达成】:${$.spaward.data.award}金币\n`);
507508
$.message += `【视频达成】:${$.spaward.data.award}金币\n`;
508509
}
@@ -532,7 +533,7 @@ function lottoindex(timeout = 0) {
532533
try {
533534
if (logs) $.log(`${O}, 抽奖次数🚩: ${data}`);
534535
$.lottoindex = JSON.parse(data);
535-
if ($.lottoindex.status_code == 200) {
536+
if ($.lottoindex.data&&$.lottoindex.status_code == 200) {
536537
console.log(`【抽奖次数】:剩余${$.lottoindex.data.times}次\n`);
537538
$.message += `【抽奖次数】:剩余${$.lottoindex.data.times}次\n`;
538539
}
@@ -563,7 +564,7 @@ function lotto(timeout = 0) {
563564
if (logs) $.log(`${O}, 转盘抽奖🚩: ${data}`);
564565
$.lotto = JSON.parse(data);
565566
A = 1
566-
if ($.lotto.status_code == 200) {
567+
if ($.lotto.data&&$.lotto.status_code == 200) {
567568
console.log(`【转盘抽奖】:奖励 ${$.lotto.data.award}金币\n`);
568569
$.message += `【转盘抽奖】:奖励 ${$.lotto.data.award}金币\n`;
569570
}
@@ -593,7 +594,7 @@ function advideo(timeout = 0) {
593594
try {
594595
if (logs) $.log(`${O}, 广告视频🚩: ${data}`);
595596
$.advideo = JSON.parse(data);
596-
if ($.advideo.status_code == 200) {
597+
if ($.advideo.data&&$.advideo.status_code == 200) {
597598
console.log(`【广告视频】:奖励 ${$.advideo.data.award}金币\n`);
598599
$.message += `【广告视频】:奖励 ${$.advideo.data.award}金币\n`;
599600
}
@@ -653,7 +654,7 @@ function timeaward(timeout = 0) {
653654
try {
654655
if (logs) $.log(`${O}, 时段奖励🚩: ${data}`);
655656
$.timeaward = JSON.parse(data);
656-
if ($.timeaward.status_code == 200 && !$.timeaward.data.status) {
657+
if ($.timeaward.data&&$.timeaward.status_code == 200 && !$.timeaward.data.status) {
657658
console.log(`【时段奖励】:奖励 ${$.timeaward.data.award}金币\n`);
658659
$.message += `【时段奖励】:奖励 ${$.timeaward.data.award}金币\n`;
659660
}
@@ -683,7 +684,7 @@ function timeawardsss(timeout = 0) {
683684
try {
684685
if (logs) $.log(`${O}, 时段翻倍🚩: ${data}`);
685686
$.timeawardsss = JSON.parse(data);
686-
if ($.timeawardsss.status_code == 200 && !$.timeaward.data.status) {
687+
if ($.timeawardsss.data&&$.timeawardsss.status_code == 200 && !$.timeaward.data.status) {
687688
console.log(`【时段翻倍】:奖励 ${$.timeawardsss.data.award}金币\n`);
688689
$.message += `【时段翻倍】:奖励 ${$.timeawardsss.data.award}金币\n`;
689690
}
@@ -713,7 +714,7 @@ function boxaward(timeout = 0) {
713714
try {
714715
if (logs) $.log(`${O}, 宝箱奖励🚩: ${data}`);
715716
$.boxaward = JSON.parse(data);
716-
if ($.boxaward.status_code == 200) {
717+
if ($.boxaward.data&&$.boxaward.status_code == 200) {
717718
console.log(`【宝箱奖励】:奖励 ${$.boxaward.data.award}金币\n`);
718719
$.message += `【宝箱奖励】:奖励 ${$.boxaward.data.award}金币\n`;
719720
}
@@ -743,7 +744,7 @@ function boxbox(timeout = 0) {
743744
try {
744745
if (logs) $.log(`${O}, 宝箱翻倍🚩: ${data}`);
745746
$.boxbox = JSON.parse(data);
746-
if ($.boxbox.status_code == 200) {
747+
if ($.boxbox.data&&$.boxbox.status_code == 200) {
747748
console.log(`【宝箱翻倍】:奖励 ${$.boxbox.data.award}金币\n`);
748749
$.message += `【宝箱翻倍】:奖励 ${$.boxbox.data.award}金币\n`;
749750
}
@@ -773,7 +774,7 @@ function rw1(timeout = 0) {
773774
try {
774775
if (logs) $.log(`${O}, 日常任务1🚩: ${data}`);
775776
$.rw1 = JSON.parse(data);
776-
if ($.rw1.status_code == 200) {
777+
if ($.rw1.data&&$.rw1.status_code == 200) {
777778
console.log(`【日常任务1】:领取 ${$.rw1.data.award}金币\n`);
778779
$.message += `【日常任务1】:领取 ${$.rw1.data.award}金币\n`;
779780
}
@@ -803,7 +804,7 @@ function rw2(timeout = 0) {
803804
try {
804805
if (logs) $.log(`${O}, 日常任务2🚩: ${data}`);
805806
$.rw2 = JSON.parse(data);
806-
if ($.rw2.status_code == 200) {
807+
if ($.rw2.data&&$.rw2.status_code == 200) {
807808
console.log(`【日常任务2】:领取 ${$.rw2.data.award}金币\n`);
808809
$.message += `【日常任务2】:领取 ${$.rw2.data.award}金币\n`;
809810
}
@@ -839,7 +840,7 @@ function video(timeout = 0) {
839840
try {
840841
if (logs) $.log(`${O}, 刷视频🚩: ${data}`);
841842
$.video = JSON.parse(data);
842-
if ($.video.status_code == 200) {
843+
if ($.video.data&&$.video.status_code == 200) {
843844
console.log(`【刷视频】:开始领取第${i+1}次视频奖励,获得${$.video.data.award}金币,等待30秒继续\n`);
844845
inss += $.video.data.award;
845846
ins += 1;
@@ -885,10 +886,10 @@ function videoyz(timeout = 0) {
885886
try {
886887
if (logs) $.log(`${O}, 验证视频🚩: ${data}`);
887888
$.videoyz = JSON.parse(data);
888-
if ($.videoyz.status_code == 200 && $.videoyz.data.status == 2) {
889+
if ($.videoyz.data&&$.videoyz.status_code == 200 && $.videoyz.data.status == 2) {
889890
console.log(`【验证视频】:剩余 ${$.videoyz.data.red_time}圈\n`);
890891
}
891-
if ($.videoyz.status_code == 200 && $.videoyz.data.status == 3) {
892+
if ($.videoyz.data&&$.videoyz.status_code == 200 && $.videoyz.data.status == 3) {
892893
console.log(`【验证视频】:验证通过\n`);
893894
}
894895
if ($.videoyz.status_code == 10020) {
@@ -917,7 +918,7 @@ function awardpost(timeout = 0) {
917918
try {
918919
if (logs) $.log(`${O}, 红包奖励🚩: ${data}`);
919920
$.awardpost = JSON.parse(data);
920-
if ($.awardpost.status_code == 200) {
921+
if ($.awardpost.data&&$.awardpost.status_code == 200) {
921922
console.log(`【红包奖励】:开始领取第${ABB+1}次奖励,获得 ${$.awardpost.data.award}金币\n`);
922923
ADD += $.awardpost.data.award;
923924
ABB += 1;
@@ -999,7 +1000,7 @@ function txcx(timeout = 0) {
9991000
try {
10001001
if (logs) $.log(`${O}, 提现查询🚩: ${data}`);
10011002
$.txcx = JSON.parse(data);
1002-
if ($.txcx.status_code == 200) {
1003+
if ($.txcx.data&&$.txcx.status_code == 200) {
10031004
txtx = $.txcx.data.with_list[0].msg3.substr($.txcx.data.with_list[0].msg3.indexOf('已签到') + 3, 3).split('天')[0];
10041005
console.log(`【提现查询】:已连续签到${txtx}天\n`);
10051006
$.message += `【提现查询】:已连续签到${txtx}天\n`;

0 commit comments

Comments
 (0)