Revert "优化收金币逻辑,8s收取一次金币,运行多账号时收获金币更多; 适当增加观看视频时长,减少开宝箱金币为0的概率"
This reverts commit 9d1f38e1
This commit is contained in:
@@ -166,15 +166,6 @@ if ($.isNode()) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let count = 0
|
let count = 0
|
||||||
|
|
||||||
if (cookiesArr.length) {
|
|
||||||
console.log(`\n挂机开始,自动8s收一次金币`);
|
|
||||||
setInterval(async () => {
|
|
||||||
const promiseArr = cookiesArr.map(ck => getCoinForInterval(ck));
|
|
||||||
await Promise.all(promiseArr);
|
|
||||||
}, 8000);
|
|
||||||
}
|
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
count++
|
count++
|
||||||
console.log(`============开始第${count}次挂机=============`)
|
console.log(`============开始第${count}次挂机=============`)
|
||||||
@@ -191,7 +182,7 @@ if ($.isNode()) {
|
|||||||
$.log(`\n京东账号${$.index} ${$.nickName || $.UserName}\ncookie已过期,请重新登录获取\n`)
|
$.log(`\n京东账号${$.index} ${$.nickName || $.UserName}\ncookie已过期,请重新登录获取\n`)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
await jdCrazyJoy()
|
await jdJxStory()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$.log(`\n\n`)
|
$.log(`\n\n`)
|
||||||
@@ -204,7 +195,7 @@ if ($.isNode()) {
|
|||||||
$.done();
|
$.done();
|
||||||
})
|
})
|
||||||
|
|
||||||
async function jdCrazyJoy() {
|
async function jdJxStory() {
|
||||||
$.coin = 0
|
$.coin = 0
|
||||||
$.bean = 0
|
$.bean = 0
|
||||||
|
|
||||||
@@ -522,35 +513,6 @@ function getCoin() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 需传入cookie,不能使用全局的cookie
|
|
||||||
function getCoinForInterval(taskCookie) {
|
|
||||||
return new Promise(async resolve => {
|
|
||||||
$.get(taskUrl('crazyJoy_joy_produce', '', taskCookie), async (err, resp, data) => {
|
|
||||||
try {
|
|
||||||
if (err) {
|
|
||||||
console.log(`${JSON.stringify(err)}`)
|
|
||||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
|
||||||
} else {
|
|
||||||
if (safeGet(data)) {
|
|
||||||
// const userName = decodeURIComponent(taskCookie.match(/pt_pin=(.+?);/) && taskCookie.match(/pt_pin=(.+?);/)[1])
|
|
||||||
// data = JSON.parse(data);
|
|
||||||
// if (data.data && data.data.tryMoneyJoyBeans) {
|
|
||||||
// console.log(`【京东账号 ${userName}】分红狗生效中,预计获得 ${data.data.tryMoneyJoyBeans} 京豆奖励`)
|
|
||||||
// }
|
|
||||||
// if (data.data) {
|
|
||||||
// $.log(`【京东账号 ${userName}】此次在线收益:获得 ${data.data['coins']} 金币`)
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
$.logErr(e, resp)
|
|
||||||
} finally {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function openBox(eventType = 'LUCKY_BOX_DROP', boxId) {
|
function openBox(eventType = 'LUCKY_BOX_DROP', boxId) {
|
||||||
let body = { eventType, "eventRecordId": boxId}
|
let body = { eventType, "eventRecordId": boxId}
|
||||||
return new Promise(async resolve => {
|
return new Promise(async resolve => {
|
||||||
@@ -563,9 +525,9 @@ function openBox(eventType = 'LUCKY_BOX_DROP', boxId) {
|
|||||||
if (safeGet(data)) {
|
if (safeGet(data)) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
if (data['success']) {
|
if (data['success']) {
|
||||||
$.log(`点击幸运盒子成功,剩余观看视频次数:${data.data.advertViewTimes}, ${data.data.advertViewTimes > 0 ? '等待32秒' : '跳出'}`)
|
$.log(`点击幸运盒子成功,剩余观看视频次数:${data.data.advertViewTimes}, ${data.data.advertViewTimes > 0 ? '等待30秒' : '跳出'}`)
|
||||||
if (data.data.advertViewTimes > 0) {
|
if (data.data.advertViewTimes > 0) {
|
||||||
await $.wait(32000)
|
await $.wait(30000)
|
||||||
await rewardBox(eventType, boxId);
|
await rewardBox(eventType, boxId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -637,7 +599,7 @@ function getGrowState() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
function taskUrl(functionId, body = '', taskCookie = cookie) {
|
function taskUrl(functionId, body = '') {
|
||||||
let t = Date.now().toString().substr(0, 10)
|
let t = Date.now().toString().substr(0, 10)
|
||||||
let e = body || ""
|
let e = body || ""
|
||||||
e = $.md5("aDvScBv$gGQvrXfva8dG!ZC@DA70Y%lX" + e + t)
|
e = $.md5("aDvScBv$gGQvrXfva8dG!ZC@DA70Y%lX" + e + t)
|
||||||
@@ -645,7 +607,7 @@ function taskUrl(functionId, body = '', taskCookie = cookie) {
|
|||||||
return {
|
return {
|
||||||
url: `${JD_API_HOST}?uts=${e}&appid=crazy_joy&functionId=${functionId}&body=${escape(body)}&t=${t}`,
|
url: `${JD_API_HOST}?uts=${e}&appid=crazy_joy&functionId=${functionId}&body=${escape(body)}&t=${t}`,
|
||||||
headers: {
|
headers: {
|
||||||
'Cookie': taskCookie,
|
'Cookie': cookie,
|
||||||
'Host': 'api.m.jd.com',
|
'Host': 'api.m.jd.com',
|
||||||
'Accept': '*/*',
|
'Accept': '*/*',
|
||||||
'Connection': 'keep-alive',
|
'Connection': 'keep-alive',
|
||||||
|
Reference in New Issue
Block a user