From a5fbbd8d6e7a7892ebebbf1409e707976d4358fa Mon Sep 17 00:00:00 2001 From: gitupdate Date: Mon, 26 Apr 2021 17:46:07 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=91=E8=9E=8D=E7=8C=AA=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BA=A7=E5=93=81=E6=88=90=E7=86=9F=E5=90=8E=E7=9A=84?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Loon/lxk0301_LoonTask.conf | 2 +- QuantumultX/lxk0301_gallery.json | 2 +- Surge/lxk0301_Task.sgmodule.sgmodule | 2 +- docker/crontab_list.sh | 2 +- jd_jin_tie.js | 2 +- jd_pigPet.js | 44 ++++++++++++++++++---------- 6 files changed, 33 insertions(+), 21 deletions(-) diff --git a/Loon/lxk0301_LoonTask.conf b/Loon/lxk0301_LoonTask.conf index 9c7f89c7..677dee75 100644 --- a/Loon/lxk0301_LoonTask.conf +++ b/Loon/lxk0301_LoonTask.conf @@ -137,7 +137,7 @@ cron "35 1,23 * * *" script-path=https://gitee.com/lxk0301/jd_scripts/raw/master cron "15 6-18/6 * * *" script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_pet.js,tag=东东萌宠 # 金融养猪 -cron "12 * * * *" script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_pigPet.js, tag=京东金融养猪猪 +cron "12 0-23/6 * * *" script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_pigPet.js, tag=京东金融养猪猪 # 京东种豆得豆 cron "1 7-21/2 * * *" script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_plantBean.js,tag=京东种豆得豆 diff --git a/QuantumultX/lxk0301_gallery.json b/QuantumultX/lxk0301_gallery.json index d96d2b5d..2a09da22 100644 --- a/QuantumultX/lxk0301_gallery.json +++ b/QuantumultX/lxk0301_gallery.json @@ -41,7 +41,7 @@ "10 0,20 * * * https://gitee.com/lxk0301/jd_scripts/raw/master/jd_necklace.js, tag=点点券, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true", "35 1,23 * * * https://gitee.com/lxk0301/jd_scripts/raw/master/jd_nzmh.js, tag=女装盲盒, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true", "15 6-18/6 * * * https://gitee.com/lxk0301/jd_scripts/raw/master/jd_pet.js, tag=东东萌宠, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdmc.png, enabled=true", - "12 * * * * https://gitee.com/lxk0301/jd_scripts/raw/master/jd_pigPet.js, tag=京东金融养猪猪, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdyz.png, enabled=true", + "12 0-23/6 * * * https://gitee.com/lxk0301/jd_scripts/raw/master/jd_pigPet.js, tag=京东金融养猪猪, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdyz.png, enabled=true", "1 7-21/2 * * * https://gitee.com/lxk0301/jd_scripts/raw/master/jd_plantBean.js, tag=种豆得豆, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdzd.png, enabled=true", "0 2 * * * https://gitee.com/lxk0301/jd_scripts/raw/master/jd_price.js, tag=京东保价, img-url=https://raw.githubusercontent.com/Orz-3/task/master/jd.png, enabled=true", "1 1,2,23 * * * https://gitee.com/lxk0301/jd_scripts/raw/master/jd_redPacket.js, tag=京东全民开红包, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png, enabled=true", diff --git a/Surge/lxk0301_Task.sgmodule.sgmodule b/Surge/lxk0301_Task.sgmodule.sgmodule index 4ba29a42..09a13b28 100644 --- a/Surge/lxk0301_Task.sgmodule.sgmodule +++ b/Surge/lxk0301_Task.sgmodule.sgmodule @@ -51,7 +51,7 @@ crazyJoy挂机 = type=cron,cronexp="10 1,12 * * *",wake-system=1,timeout=20,scri 点点券 = type=cron,cronexp="10 0,20 * * *",wake-system=1,timeout=3600,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_necklace.js 女装盲盒 = type=cron,cronexp="35 1,23 * * *",wake-system=1,timeout=3600,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_nzmh.js 东东萌宠 = type=cron,cronexp="15 6-18/6 * * *",wake-system=1,timeout=3600,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_pet.js -京东金融养猪猪 = type=cron,cronexp="12 * * * *",wake-system=1,timeout=3600,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_pigPet.js +京东金融养猪猪 = type=cron,cronexp="12 0-23/6 * * *",wake-system=1,timeout=3600,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_pigPet.js 京东种豆得豆 = type=cron,cronexp="1 7-21/2 * * *",wake-system=1,timeout=3600,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_plantBean.js 京东保价 = type=cron,cronexp="0 2 * * *",wake-system=1,timeout=3600,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_price.js 京东全民开红包 = type=cron,cronexp=1 1,2,23 * * *,wake-system=1,timeout=3600,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_redPacket.js diff --git a/docker/crontab_list.sh b/docker/crontab_list.sh index ef1156b3..ab694e4d 100644 --- a/docker/crontab_list.sh +++ b/docker/crontab_list.sh @@ -59,7 +59,7 @@ # 天天提鹅 28 * * * * node /scripts/jd_daily_egg.js >> /scripts/logs/jd_daily_egg.log 2>&1 # 金融养猪 -25 * * * * node /scripts/jd_pigPet.js >> /scripts/logs/jd_pigPet.log 2>&1 +32 0-23/6 * * * node /scripts/jd_pigPet.js >> /scripts/logs/jd_pigPet.log 2>&1 # 点点券 40 0,20 * * * node /scripts/jd_necklace.js >> /scripts/logs/jd_necklace.log 2>&1 # 京喜工厂 diff --git a/jd_jin_tie.js b/jd_jin_tie.js index fec25456..d4a500ef 100644 --- a/jd_jin_tie.js +++ b/jd_jin_tie.js @@ -1,5 +1,5 @@ /* -领金贴 +领金贴(只做签到以及互助任务里面的部分任务) 活动入口:京东APP首页-领金贴,[活动地址](https://active.jd.com/forever/cashback/index/) 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js =================QuantumultX============== diff --git a/jd_pigPet.js b/jd_pigPet.js index 08166019..61c3bb42 100644 --- a/jd_pigPet.js +++ b/jd_pigPet.js @@ -2,7 +2,7 @@ * @Author: LXK9301 https://github.com/LXK9301 * @Date: 2020-11-10 14:07:07 * @Last Modified by: LXK9301 - * @Last Modified time: 2020-11-23 12:27:16 + * @Last Modified time: 2021-4-26 12:27:16 */ /* 活动入口:京东金融养猪猪 @@ -16,21 +16,21 @@ ===============Quantumultx=============== [task_local] #京东金融养猪猪 -12 * * * * https://gitee.com/lxk0301/jd_scripts/raw/master/jd_pigPet.js, tag=京东金融养猪猪, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdyz.png, enabled=true +12 0-23/6 * * * https://gitee.com/lxk0301/jd_scripts/raw/master/jd_pigPet.js, tag=京东金融养猪猪, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdyz.png, enabled=true ================Loon============== [Script] -cron "12 * * * *" script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_pigPet.js, tag=京东金融养猪猪 +cron "12 0-23/6 * * *" script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_pigPet.js, tag=京东金融养猪猪 ===============Surge================= -京东金融养猪猪 = type=cron,cronexp="12 * * * *",wake-system=1,timeout=3600,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_pigPet.js +京东金融养猪猪 = type=cron,cronexp="12 0-23/6 * * *",wake-system=1,timeout=3600,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_pigPet.js ============小火箭========= -京东金融养猪猪 = type=cron,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_pigPet.js, cronexpr="12 * * * *", timeout=3600, enable=true +京东金融养猪猪 = type=cron,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_pigPet.js, cronexpr="12 0-23/6 * * *", timeout=3600, enable=true */ const $ = new Env('金融养猪'); -let cookiesArr = [], cookie = ''; +let cookiesArr = [], cookie = '', allMessage = ''; const JD_API_HOST = 'https://ms.jr.jd.com/gw/generic/uc/h5/m'; const MISSION_BASE_API = `https://ms.jr.jd.com/gw/generic/mission/h5/m`; const notify = $.isNode() ? require('./sendNotify') : ''; @@ -68,6 +68,10 @@ if ($.isNode()) { await jdPigPet(); } } + if (allMessage && new Date().getHours() % 6 === 0) { + if ($.isNode()) await notify.sendNotify($.name, allMessage); + $.msg($.name, '', allMessage); + } })() .catch((e) => { $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') @@ -76,16 +80,20 @@ if ($.isNode()) { $.done(); }) async function jdPigPet() { - await pigPetLogin(); - if (!$.hasPig) return - await pigPetSignIndex(); - await pigPetSign(); - await pigPetOpenBox(); - await pigPetLotteryIndex(); - await pigPetLottery(); - await pigPetMissionList(); - await missions(); - await pigPetUserBag(); + try { + await pigPetLogin(); + if (!$.hasPig) return + await pigPetSignIndex(); + await pigPetSign(); + await pigPetOpenBox(); + await pigPetLotteryIndex(); + await pigPetLottery(); + await pigPetMissionList(); + await missions(); + await pigPetUserBag(); + } catch (e) { + $.logErr(e) + } } async function pigPetLottery() { if ($.currentCount > 0) { @@ -244,6 +252,10 @@ function pigPetLogin() { $.hasPig = data.resultData.resultData.hasPig; if (!$.hasPig) { console.log(`\n京东账号${$.index} ${$.nickName} 未开启养猪活动,请手动去京东金融APP开启此活动\n`) + return + } + if (data.resultData.resultData.wished) { + allMessage += `京东账号${$.index} ${$.nickName || $.UserName}\n${data.resultData.resultData.wishAward.name}已可兑换${$.index !== cookiesArr.length ? '\n\n' : ''}` } } else { console.log(`Login其他情况:${JSON.stringify(data)}`)