diff --git a/jd_opencardL86.js b/jd_opencardL86.js index a22f9e8..998cbbd 100644 --- a/jd_opencardL86.js +++ b/jd_opencardL86.js @@ -132,6 +132,7 @@ async function run() { if(o.status == 0){ flag = true $.joinVenderId = o.venderId + await $.wait(parseInt(Math.random() * 3000 + 2000, 10)) await joinShop() if($.joinShopresmessage === '活动太火爆,请稍后再试'){ console.log('重新开卡') @@ -172,19 +173,38 @@ async function run() { await $.wait(parseInt(Math.random() * 1000 + 3000, 10)) } - if(flag){ - await takePostRequest('activityContent'); - } - console.log(`${$.score}值 游戏:${$.point}`) + if(flag){ + await takePostRequest('activityContent'); + } + console.log(`${$.score}值`) $.runFalag = true - let count = parseInt($.score/100) + let count = parseInt($.score/50) + console.log(`集卡次数为:${count}`) + for(m=1;count--;m++){ + console.log(`第${m}次集卡`) + await takePostRequest('getCardInfo'); + await takePostRequest('集卡'); + if($.runFalag == false) break + if(Number(count) <= 0) break + if(m >= 5){ + console.log("集卡太多次,多余的次数请再执行脚本") + break + } + await $.wait(parseInt(Math.random() * 2000 + 2000, 10)) + } + if(flag){ + await takePostRequest('activityContent'); + } + console.log(`${$.score}值`) + $.runFalag = true + count = parseInt($.score/100) console.log(`抽奖次数为:${count}`) for(m=1;count--;m++){ console.log(`第${m}次抽奖`) await takePostRequest('抽奖'); if($.runFalag == false) break if(Number(count) <= 0) break - if(m >= 10){ + if(m >= 5){ console.log("抽奖太多次,多余的次数请再执行脚本") break } @@ -268,6 +288,14 @@ async function takePostRequest(type) { // url = `${domain}/dingzhi/dz/openCard/saveTask`; body = `activityId=${$.activityId}&pin=${encodeURIComponent($.Pin)}&actorUuid=${$.actorUuid}&taskType=1` break; + case 'getCardInfo': + url = `${domain}/collect/card/getCardInfo`; + body = `activityId=${$.activityId}&pin=${encodeURIComponent($.Pin)}&actorUuid=${$.actorUuid}` + break; + case '集卡': + url = `${domain}/collect/card/drawCard`; + body = `activityId=${$.activityId}&pin=${encodeURIComponent($.Pin)}&actorUuid=${$.actorUuid}` + break; case 'sign': case 'addCart': case 'browseGoods': @@ -572,6 +600,23 @@ async function dealReturn(type, data) { console.log(`${type} ${data}`) } break; + case 'getCardInfo': + case '集卡': + if(typeof res == 'object'){ + if(res.result && res.result === true && res.data){ + if(type == "集卡"){ + if(res.data.status == 1) console.log(`集卡成功->${res.data.cardName}`) + else console.log('集卡失败'+ res.data.cardName && '->'+res.data.cardName || '\n'+data) + } + }else if(res.errorMessage){ + console.log(`${type} ${res.errorMessage || ''}`) + }else{ + console.log(`${type} ${data}`) + } + }else{ + console.log(`${type} ${data}`) + } + break; case '邀请': case '助力': // console.log(data) diff --git a/jd_opencardL89.js b/jd_opencardL89.js index 2f638a7..40a50eb 100644 --- a/jd_opencardL89.js +++ b/jd_opencardL89.js @@ -173,19 +173,39 @@ async function run() { await $.wait(parseInt(Math.random() * 1000 + 3000, 10)) } - if(flag){ - await takePostRequest('activityContent'); - } - console.log(`${$.score}值 游戏:${$.point}`) + if(flag){ + await takePostRequest('activityContent'); + } + console.log(`${$.score}值`) $.runFalag = true - let count = parseInt($.score/100) + let count = parseInt($.score/50) + console.log(`集卡次数为:${count}`) + for(m=1;count--;m++){ + if($.compositeCardNum > 0) break + console.log(`第${m}次集卡`) + await takePostRequest('getCardInfo'); + await takePostRequest('集卡'); + if($.runFalag == false || $.compositeCardNum > 0) break + if(Number(count) <= 0) break + if(m >= 5){ + console.log("集卡太多次,多余的次数请再执行脚本") + break + } + await $.wait(parseInt(Math.random() * 2000 + 2000, 10)) + } + if(flag){ + await takePostRequest('activityContent'); + } + console.log(`${$.score}值`) + $.runFalag = true + count = parseInt($.score/100) console.log(`抽奖次数为:${count}`) for(m=1;count--;m++){ console.log(`第${m}次抽奖`) await takePostRequest('抽奖'); if($.runFalag == false) break if(Number(count) <= 0) break - if(m >= 10){ + if(m >= 5){ console.log("抽奖太多次,多余的次数请再执行脚本") break } @@ -269,6 +289,14 @@ async function takePostRequest(type) { // url = `${domain}/dingzhi/dz/openCard/saveTask`; body = `activityId=${$.activityId}&pin=${encodeURIComponent($.Pin)}&actorUuid=${$.actorUuid}&taskType=1` break; + case 'getCardInfo': + url = `${domain}/collect/card/getCardInfo`; + body = `activityId=${$.activityId}&pin=${encodeURIComponent($.Pin)}&actorUuid=${$.actorUuid}` + break; + case '集卡': + url = `${domain}/collect/card/drawCard`; + body = `activityId=${$.activityId}&pin=${encodeURIComponent($.Pin)}&actorUuid=${$.actorUuid}` + break; case 'sign': case 'addCart': case 'browseGoods': @@ -573,6 +601,23 @@ async function dealReturn(type, data) { console.log(`${type} ${data}`) } break; + case 'getCardInfo': + case '集卡': + if(typeof res == 'object'){ + if(res.result && res.result === true && res.data){ + if(type == "集卡"){ + if(res.data.status == 1) console.log(`集卡成功->${res.data.cardName}`) + else console.log('集卡失败'+ res.data.cardName && '->'+res.data.cardName || '\n'+data) + } + }else if(res.errorMessage){ + console.log(`${type} ${res.errorMessage || ''}`) + }else{ + console.log(`${type} ${data}`) + } + }else{ + console.log(`${type} ${data}`) + } + break; case '邀请': case '助力': // console.log(data)