KingRan 2022-03-01 14:40:16 +08:00
parent a174dc04dd
commit 7d17d64b6a
2 changed files with 102 additions and 12 deletions

View File

@ -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('重新开卡')
@ -175,16 +176,35 @@ async function run() {
if(flag){
await takePostRequest('activityContent');
}
console.log(`${$.score} 游戏:${$.point}`)
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)

View File

@ -176,16 +176,36 @@ async function run() {
if(flag){
await takePostRequest('activityContent');
}
console.log(`${$.score} 游戏:${$.point}`)
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)