()
| 719 | } |
| 720 | //打卡领水活动 |
| 721 | async function clockInIn() { |
| 722 | console.log('开始打卡领水活动(签到,关注,领券)'); |
| 723 | await clockInInitForFarm(); |
| 724 | if ($.clockInInit.code === '0') { |
| 725 | // 签到得水滴 |
| 726 | if (!$.clockInInit.todaySigned) { |
| 727 | console.log('开始今日签到'); |
| 728 | await clockInForFarm(); |
| 729 | console.log(`打卡结果${JSON.stringify($.clockInForFarmRes)}`); |
| 730 | if ($.clockInForFarmRes.code === '0') { |
| 731 | // message += `【第${$.clockInForFarmRes.signDay}天签到】获得${$.clockInForFarmRes.amount}g💧\n`; |
| 732 | console.log(`【第${$.clockInForFarmRes.signDay}天签到】获得${$.clockInForFarmRes.amount}g💧\n`) |
| 733 | if ($.clockInForFarmRes.signDay === 7) { |
| 734 | //可以领取惊喜礼包 |
| 735 | console.log('开始领取--惊喜礼包38g水滴'); |
| 736 | await gotClockInGift(); |
| 737 | if ($.gotClockInGiftRes.code === '0') { |
| 738 | // message += `【惊喜礼包】获得${$.gotClockInGiftRes.amount}g💧\n`; |
| 739 | console.log(`【惊喜礼包】获得${$.gotClockInGiftRes.amount}g💧\n`); |
| 740 | } |
| 741 | } |
| 742 | } |
| 743 | } |
| 744 | if ($.clockInInit.todaySigned && $.clockInInit.totalSigned === 7) { |
| 745 | console.log('开始领取--惊喜礼包38g水滴'); |
| 746 | await gotClockInGift(); |
| 747 | if ($.gotClockInGiftRes.code === '0') { |
| 748 | // message += `【惊喜礼包】获得${$.gotClockInGiftRes.amount}g💧\n`; |
| 749 | console.log(`【惊喜礼包】获得${$.gotClockInGiftRes.amount}g💧\n`); |
| 750 | } |
| 751 | } |
| 752 | // 限时关注得水滴 |
| 753 | if ($.clockInInit.themes && $.clockInInit.themes.length > 0) { |
| 754 | for (let item of $.clockInInit.themes) { |
| 755 | if (!item.hadGot) { |
| 756 | console.log(`关注ID${item.id}`); |
| 757 | await clockInFollowForFarm(item.id, "theme", "1"); |
| 758 | console.log(`themeStep1--结果${JSON.stringify($.themeStep1)}`); |
| 759 | if ($.themeStep1.code === '0') { |
| 760 | await clockInFollowForFarm(item.id, "theme", "2"); |
| 761 | console.log(`themeStep2--结果${JSON.stringify($.themeStep2)}`); |
| 762 | if ($.themeStep2.code === '0') { |
| 763 | console.log(`关注${item.name},获得水滴${$.themeStep2.amount}g`); |
| 764 | } |
| 765 | } |
| 766 | } |
| 767 | } |
| 768 | } |
| 769 | // 限时领券得水滴 |
| 770 | if ($.clockInInit.venderCoupons && $.clockInInit.venderCoupons.length > 0) { |
| 771 | for (let item of $.clockInInit.venderCoupons) { |
| 772 | if (!item.hadGot) { |
| 773 | console.log(`领券的ID${item.id}`); |
| 774 | await clockInFollowForFarm(item.id, "venderCoupon", "1"); |
| 775 | console.log(`venderCouponStep1--结果${JSON.stringify($.venderCouponStep1)}`); |
| 776 | if ($.venderCouponStep1.code === '0') { |
| 777 | await clockInFollowForFarm(item.id, "venderCoupon", "2"); |
| 778 | if ($.venderCouponStep2.code === '0') { |
no test coverage detected