diff --git a/jd_dreamFactory.js b/jd_dreamFactory.js index 87e8339c..6bce9e33 100644 --- a/jd_dreamFactory.js +++ b/jd_dreamFactory.js @@ -1352,7 +1352,7 @@ function requireConfig() { }) } else { if ($.getdata('jd_jxFactory')) $.shareCodesArr = $.getdata('jd_jxFactory').split('\n').filter(item => item !== "" && item !== null && item !== undefined); - console.log(`\nBoxJs设置的京喜工厂邀请码:${$.getdata('jd_jxFactory')}\n`); + console.log(`\nBoxJs设置的${$.name}好友邀请码:${$.getdata('jd_jxFactory')}\n`); } // console.log(`\n种豆得豆助力码::${JSON.stringify($.shareCodesArr)}`); console.log(`您提供了${$.shareCodesArr.length}个账号的${$.name}助力码\n`); diff --git a/jd_fruit.js b/jd_fruit.js index ee6ad7b5..e996715f 100644 --- a/jd_fruit.js +++ b/jd_fruit.js @@ -1,6 +1,6 @@ /* 东东水果:脚本更新地址 https://gitee.com/lxk0301/jd_scripts/raw/master/jd_fruit.js -更新时间:2021-2-27 +更新时间:2021-4-9 活动入口:京东APP我的-更多工具-东东农场 东东农场活动链接:https://h5.m.jd.com/babelDiy/Zeus/3KSjXqQabiTuD1cJ28QskrpWoBKT/index.html 已支持IOS双京东账号,Node.js支持N个京东账号 @@ -1274,10 +1274,10 @@ function readShareCode() { } function shareCodesFormat() { return new Promise(async resolve => { - // console.log(`第${$.index}个京东账号的助力码:::${jdFruitShareArr[$.index - 1]}`) + // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`) newShareCodes = []; - if (jdFruitShareArr[$.index - 1]) { - newShareCodes = jdFruitShareArr[$.index - 1].split('@'); + if ($.shareCodesArr[$.index - 1]) { + newShareCodes = $.shareCodesArr[$.index - 1].split('@'); } else { console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`) const tempIndex = $.index > shareCodes.length ? (shareCodes.length - 1) : ($.index - 1); @@ -1311,46 +1311,20 @@ function requireConfig() { cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item); } console.log(`共${cookiesArr.length}个京东账号\n`) + $.shareCodesArr = []; if ($.isNode()) { Object.keys(jdFruitShareCodes).forEach((item) => { if (jdFruitShareCodes[item]) { - jdFruitShareArr.push(jdFruitShareCodes[item]) + $.shareCodesArr.push(jdFruitShareCodes[item]) } }) } else { - const boxShareCodeArr = ['jd_fruit1', 'jd_fruit2', 'jd_fruit3', 'jd_fruit4']; - const boxShareCodeArr2 = ['jd2_fruit1', 'jd2_fruit2', 'jd2_fruit3', 'jd2_fruit4']; - const isBox1 = boxShareCodeArr.some((item) => { - const boxShareCode = $.getdata(item); - return (boxShareCode !== undefined && boxShareCode !== null && boxShareCode !== ''); - }); - const isBox2 = boxShareCodeArr2.some((item) => { - const boxShareCode = $.getdata(item); - return (boxShareCode !== undefined && boxShareCode !== null && boxShareCode !== ''); - }); - isBox = isBox1 ? isBox1 : isBox2; - if (isBox1) { - let temp = []; - for (const item of boxShareCodeArr) { - if ($.getdata(item)) { - temp.push($.getdata(item)) - } - } - jdFruitShareArr.push(temp.join('@')); - } - if (isBox2) { - let temp = []; - for (const item of boxShareCodeArr2) { - if ($.getdata(item)) { - temp.push($.getdata(item)) - } - } - jdFruitShareArr.push(temp.join('@')); - } + if ($.getdata('jd_fruit_inviter')) $.shareCodesArr = $.getdata('jd_fruit_inviter').split('\n').filter(item => !!item); + console.log(`\nBoxJs设置的${$.name}好友邀请码:${$.getdata('jd_fruit_inviter')}\n`); } - // console.log(`jdFruitShareArr::${JSON.stringify(jdFruitShareArr)}`) - // console.log(`jdFruitShareArr账号长度::${jdFruitShareArr.length}`) - console.log(`您提供了${jdFruitShareArr.length}个账号的农场助力码\n`); + // console.log(`$.shareCodesArr::${JSON.stringify($.shareCodesArr)}`) + // console.log(`jdFruitShareArr账号长度::${$.shareCodesArr.length}`) + console.log(`您提供了${$.shareCodesArr.length}个账号的农场助力码\n`); resolve() }) } diff --git a/jd_pet.js b/jd_pet.js index 3a161545..70b5b4d6 100644 --- a/jd_pet.js +++ b/jd_pet.js @@ -1,6 +1,6 @@ /* 东东萌宠 更新地址: https://gitee.com/lxk0301/jd_scripts/raw/master/jd_pet.js -更新时间:2021-02-27 +更新时间:2021-04-9 活动入口:京东APP我的-更多工具-东东萌宠 已支持IOS双京东账号,Node.js支持N个京东账号 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js @@ -475,10 +475,10 @@ function readShareCode() { } function shareCodesFormat() { return new Promise(async resolve => { - // console.log(`第${$.index}个京东账号的助力码:::${jdPetShareArr[$.index - 1]}`) + // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`) newShareCodes = []; - if (jdPetShareArr[$.index - 1]) { - newShareCodes = jdPetShareArr[$.index - 1].split('@'); + if ($.shareCodesArr[$.index - 1]) { + newShareCodes = $.shareCodesArr[$.index - 1].split('@'); } else { console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`) const tempIndex = $.index > shareCodes.length ? (shareCodes.length - 1) : ($.index - 1); @@ -513,46 +513,20 @@ function requireConfig() { cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item); } console.log(`共${cookiesArr.length}个京东账号\n`) + $.shareCodesArr = []; if ($.isNode()) { Object.keys(jdPetShareCodes).forEach((item) => { if (jdPetShareCodes[item]) { - jdPetShareArr.push(jdPetShareCodes[item]) + $.shareCodesArr.push(jdPetShareCodes[item]) } }) } else { - const boxShareCodeArr = ['jd_pet1', 'jd_pet2', 'jd_pet3', 'jd_pet4', 'jd_pet5']; - const boxShareCodeArr2 = ['jd2_pet1', 'jd2_pet2', 'jd2_pet3', 'jd2_pet4', 'jd2_pet5']; - const isBox1 = boxShareCodeArr.some((item) => { - const boxShareCode = $.getdata(item); - return (boxShareCode !== undefined && boxShareCode !== null && boxShareCode !== ''); - }); - const isBox2 = boxShareCodeArr2.some((item) => { - const boxShareCode = $.getdata(item); - return (boxShareCode !== undefined && boxShareCode !== null && boxShareCode !== ''); - }); - isBox = isBox1 ? isBox1 : isBox2; - if (isBox1) { - let temp = []; - for (const item of boxShareCodeArr) { - if ($.getdata(item)) { - temp.push($.getdata(item)) - } - } - jdPetShareArr.push(temp.join('@')); - } - if (isBox2) { - let temp = []; - for (const item of boxShareCodeArr2) { - if ($.getdata(item)) { - temp.push($.getdata(item)) - } - } - jdPetShareArr.push(temp.join('@')); - } + if ($.getdata('jd_pet_inviter')) $.shareCodesArr = $.getdata('jd_pet_inviter').split('\n').filter(item => !!item); + console.log(`\nBoxJs设置的${$.name}好友邀请码:${$.getdata('jd_pet_inviter')}\n`); } - // console.log(`jdPetShareArr::${JSON.stringify(jdPetShareArr)}`) - // console.log(`jdPetShareArr账号长度::${jdPetShareArr.length}`) - console.log(`您提供了${jdPetShareArr.length}个账号的东东萌宠助力码\n`); + // console.log(`$.shareCodesArr::${JSON.stringify($.shareCodesArr)}`) + // console.log(`jdPetShareArr账号长度::${$.shareCodesArr.length}`) + console.log(`您提供了${$.shareCodesArr.length}个账号的东东萌宠助力码\n`); resolve() }) } diff --git a/jd_plantBean.js b/jd_plantBean.js index 78eb94c8..e256c9a1 100644 --- a/jd_plantBean.js +++ b/jd_plantBean.js @@ -1,6 +1,6 @@ /* 种豆得豆 脚本更新地址:https://gitee.com/lxk0301/jd_scripts/raw/master/jd_plantBean.js -更新时间:2021-3-30 +更新时间:2021-04-9 活动入口:京东APP我的-更多工具-种豆得豆 已支持IOS京东双账号,云端N个京东账号 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js @@ -555,10 +555,10 @@ function readShareCode() { //格式化助力码 function shareCodesFormat() { return new Promise(async resolve => { - // console.log(`第${$.index}个京东账号的助力码:::${jdPlantBeanShareArr[$.index - 1]}`) + // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`) newShareCodes = []; - if (jdPlantBeanShareArr[$.index - 1]) { - newShareCodes = jdPlantBeanShareArr[$.index - 1].split('@'); + if ($.shareCodesArr[$.index - 1]) { + newShareCodes = $.shareCodesArr[$.index - 1].split('@'); } else { console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`) const tempIndex = $.index > shareCodes.length ? (shareCodes.length - 1) : ($.index - 1); @@ -591,45 +591,19 @@ function requireConfig() { cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item); } console.log(`共${cookiesArr.length}个京东账号\n`) + $.shareCodesArr = []; if ($.isNode()) { Object.keys(jdPlantBeanShareCodes).forEach((item) => { if (jdPlantBeanShareCodes[item]) { - jdPlantBeanShareArr.push(jdPlantBeanShareCodes[item]) + $.shareCodesArr.push(jdPlantBeanShareCodes[item]) } }) } else { - const boxShareCodeArr = ['jd_plantBean1', 'jd_plantBean2', 'jd_plantBean3']; - const boxShareCodeArr2 = ['jd2_plantBean1', 'jd2_plantBean2', 'jd2_plantBean3']; - const isBox1 = boxShareCodeArr.some((item) => { - const boxShareCode = $.getdata(item); - return (boxShareCode !== undefined && boxShareCode !== null && boxShareCode !== ''); - }); - const isBox2 = boxShareCodeArr2.some((item) => { - const boxShareCode = $.getdata(item); - return (boxShareCode !== undefined && boxShareCode !== null && boxShareCode !== ''); - }); - isBox = isBox1 ? isBox1 : isBox2; - if (isBox1) { - let temp = []; - for (const item of boxShareCodeArr) { - if ($.getdata(item)) { - temp.push($.getdata(item)) - } - } - jdPlantBeanShareArr.push(temp.join('@')); - } - if (isBox2) { - let temp = []; - for (const item of boxShareCodeArr2) { - if ($.getdata(item)) { - temp.push($.getdata(item)) - } - } - jdPlantBeanShareArr.push(temp.join('@')); - } + if ($.getdata('jd_plantbean_inviter')) $.shareCodesArr = $.getdata('jd_plantbean_inviter').split('\n').filter(item => !!item); + console.log(`\nBoxJs设置的${$.name}好友邀请码:${$.getdata('jd_plantbean_inviter')}\n`); } - // console.log(`\n种豆得豆助力码::${JSON.stringify(jdPlantBeanShareArr)}`); - console.log(`您提供了${jdPlantBeanShareArr.length}个账号的种豆得豆助力码\n`); + // console.log(`\n种豆得豆助力码::${JSON.stringify($.shareCodesArr)}`); + console.log(`您提供了${$.shareCodesArr.length}个账号的种豆得豆助力码\n`); resolve() }) } diff --git a/lxk0301.boxjs.json b/lxk0301.boxjs.json index 460813d2..4dc36973 100644 --- a/lxk0301.boxjs.json +++ b/lxk0301.boxjs.json @@ -90,18 +90,11 @@ { "id": "jd_fruit", "name": "东东农场", - "keys": [ - "jd_fruit_name", - "jd_fruit1", - "jd_fruit2", - "jd_fruit3", - "jd2_fruit_name", - "jd2_fruit1", - "jd2_fruit2", - "jd2_fruit3" - ], + "keys": ["jd_fruit_inviter"], "descs_html": [ - "

获取Cookie请查看NobyDa京东签到脚本说明脚本注释

" + "请在输入框输入跟你互助的东东农场的好友互助码", + "同一个京东账号的好友邀请码用@隔开,不同京东账号互助码用换行(return按键)隔开。例:账号1-好友1@账号1-好友2
账号2-好友1@账号2-好友2", + "下方输入框给出一个示例,自己使用时删除示例邀请码然后按示例填写即可" ], "settings": [ { @@ -112,67 +105,13 @@ "desc": "运行东东农场脚本时不发出系统通知" }, { - "id": "jdFruitBeanCard", - "name": "使用水滴换豆卡", - "val": false, - "type": "boolean", - "desc": "使用水滴换豆卡(如果出现限时活动是100g水换20豆,此时比浇水划算,推荐换豆)" - }, - { - "id": "jd_fruit_name", - "name": "京东账号一昵称", + "id": "jd_fruit_inviter", + "name": "东东农场好友邀请码 列表", "val": "", - "type": "text", - "desc": "京东账号昵称,用于区分自己的京东账号(非必填,建议多个京东账号使用)" - }, - { - "id": "jd_fruit1", - "name": "账号一的互助码1", - "val": "", - "type": "text", - "desc": "京东水果互助码.这是别人的shareCode,你帮别人助力." - }, - { - "id": "jd_fruit2", - "name": "账号一的互助码2", - "val": "", - "type": "text", - "desc": "京东水果互助码." - }, - { - "id": "jd_fruit3", - "name": "账号一的互助码3", - "val": "", - "type": "text", - "desc": "京东水果互助码.这是别人的shareCode,你帮别人助力." - }, - { - "id": "jd2_fruit_name", - "name": "京东账号二昵称", - "val": "", - "type": "text", - "desc": "京东账号昵称,用于区分自己的京东账号(非必填,建议多个京东账号使用)" - }, - { - "id": "jd2_fruit1", - "name": "账号二的互助码1", - "val": "", - "type": "text", - "desc": "京东水果互助码.这是别人的shareCode,你帮别人助力." - }, - { - "id": "jd2_fruit2", - "name": "账号二的互助码2", - "val": "", - "type": "text", - "desc": "京东水果互助码." - }, - { - "id": "jd2_fruit3", - "name": "账号二的互助码3", - "val": "", - "type": "text", - "desc": "京东水果互助码.这是别人的shareCode,你帮别人助力." + "type": "textarea", + "autoGrow": true, + "rows": 8, + "desc": "好友邀请码,同一个京东账号的好友邀请码用@隔开,不同京东账号互助码用换行(return按键)隔开" } ], "author": "@lxk0301", @@ -186,19 +125,11 @@ { "id": "jd_pet", "name": "东东萌宠", - "keys": [ - "jd_pet_name", - "jd_pet1", - "jd_pet2", - "jd_pet3", - "jd_pet4", - "jd_pet5", - "jd2_pet_name", - "jd2_pet1", - "jd2_pet2", - "jd2_pet3", - "jd2_pet4", - "jd2_pet5" + "keys": ["jd_pet_inviter"], + "descs_html": [ + "请在输入框输入跟你互助的东东萌宠的好友互助码", + "同一个京东账号的好友邀请码用@隔开,不同京东账号互助码用换行(return按键)隔开。例:账号1-好友1@账号1-好友2
账号2-好友1@账号2-好友2", + "下方输入框给出一个示例,自己使用时删除示例邀请码然后按示例填写即可" ], "settings": [ { @@ -209,88 +140,13 @@ "desc": "运行东东萌宠脚本时不发出系统通知" }, { - "id": "jd_pet_name", - "name": "京东账号昵称", + "id": "jd_pet_inviter", + "name": "东东萌宠好友邀请码 列表", "val": "", - "type": "text", - "desc": "京东账号昵称,用于区分自己的京东账号(非必填,建议多个京东账号使用)" - }, - { - "id": "jd_pet1", - "name": "互助码1", - "val": "", - "type": "text", - "desc": "东东萌宠互助码.这是别人的shareCode,你帮别人助力." - }, - { - "id": "jd_pet2", - "name": "互助码2", - "val": "", - "type": "text", - "desc": "东东萌宠互助码.这是别人的shareCode,你帮别人助力." - }, - { - "id": "jd_pet3", - "name": "互助码3", - "val": "", - "type": "text", - "desc": "东东萌宠互助码.这是别人的shareCode,你帮别人助力." - }, - { - "id": "jd_pet4", - "name": "互助码4", - "val": "", - "type": "text", - "desc": "东东萌宠互助码.这是别人的shareCode,你帮别人助力." - }, - { - "id": "jd_pet5", - "name": "互助码5", - "val": "", - "type": "text", - "desc": "东东萌宠互助码.这是别人的shareCode,你帮别人助力." - }, - { - "id": "jd2_pet_name", - "name": "京东账号2昵称", - "val": "", - "type": "text", - "desc": "京东账号2昵称,用于区分自己的京东账号(非必填,建议多个京东账号使用)" - }, - { - "id": "jd2_pet1", - "name": "账号二互助码1", - "val": "", - "type": "text", - "desc": "东东萌宠互助码.这是别人的shareCode,你帮别人助力." - }, - { - "id": "jd2_pet2", - "name": "账号二互助码2", - "val": "", - "type": "text", - "desc": "东东萌宠互助码.这是别人的shareCode,你帮别人助力." - }, - { - "id": "jd2_pet3", - "name": "账号二互助码3", - "val": "", - "type": "text", - "desc": "东东萌宠互助码.这是别人的shareCode,你帮别人助力." - }, - { - "id": "jd2_pet4", - "name": "账号二互助码4", - "val": "", - "type": "text", - "desc": "东东萌宠互助码.这是别人的shareCode,你帮别人助力." - }, - { - "id": "jd2_pet5", - "name": "账号二互助码5", - "val": "", - "type": "text", - "desc": "东东萌宠互助码.这是别人的shareCode,你帮别人助力." + "type": "textarea", + "autoGrow": true, + "rows": 8, + "desc": "好友邀请码,同一个京东账号的好友邀请码用@隔开,不同京东账号互助码用换行(return按键)隔开" } ], "author": "@lxk0301", @@ -304,15 +160,11 @@ { "id": "jd_plantBean", "name": "京东种豆", - "keys": [ - "jd_plant_bean_name", - "jd_plantBean1", - "jd_plantBean2", - "jd_plantBean3", - "jd2_plant_bean_name", - "jd2_plantBean1", - "jd2_plantBean2", - "jd2_plantBean3" + "keys": ["jd_plantbean_inviter"], + "descs_html": [ + "请在输入框输入跟你互助的京东种豆得豆的好友互助码", + "同一个京东账号的好友邀请码用@隔开,不同京东账号互助码用换行(return按键)隔开。例:账号1-好友1@账号1-好友2
账号2-好友1@账号2-好友2", + "下方输入框给出一个示例,自己使用时删除示例邀请码然后按示例填写即可" ], "settings": [ { @@ -323,60 +175,13 @@ "desc": "运行种豆脚本时不发出系统通知" }, { - "id": "jd_plant_bean_name", - "name": "京东账号一昵称", + "id": "jd_plantbean_inviter", + "name": "京东种豆好友邀请码 列表", "val": "", - "type": "text", - "desc": "京东账号昵称,用于区分自己的京东账号(非必填,建议多个京东账号使用)" - }, - { - "id": "jd_plantBean1", - "name": "京东账号一互助码1", - "val": "", - "type": "text", - "desc": "种豆得豆互助码.这是别人的助力码,你帮别人助力." - }, - { - "id": "jd_plantBean2", - "name": "京东账号一互助码2", - "val": "", - "type": "text", - "desc": "种豆得豆互助码.这是别人的助力码,你帮别人助力." - }, - { - "id": "jd_plantBean3", - "name": "京东账号一互助码3", - "val": "", - "type": "text", - "desc": "种豆得豆互助码.这是别人的助力码,你帮别人助力." - }, - { - "id": "jd2_plant_bean_name", - "name": "京东账号二昵称", - "val": "", - "type": "text", - "desc": "京东账号二昵称,用于区分自己的京东账号(非必填,建议多个京东账号使用)" - }, - { - "id": "jd2_plantBean1", - "name": "京东账号二互助码1", - "val": "", - "type": "text", - "desc": "种豆得豆互助码.这是别人的助力码,你帮别人助力." - }, - { - "id": "jd2_plantBean2", - "name": "京东账号二互助码2", - "val": "", - "type": "text", - "desc": "种豆得豆互助码.这是别人的助力码,你帮别人助力." - }, - { - "id": "jd2_plantBean3", - "name": "京东账号二互助码3", - "val": "", - "type": "text", - "desc": "种豆得豆互助码.这是别人的助力码,你帮别人助力." + "type": "textarea", + "autoGrow": true, + "rows": 8, + "desc": "好友邀请码,同一个京东账号的好友邀请码用@隔开,不同京东账号互助码用换行(return按键)隔开" } ], "author": "@lxk0301",