Merge remote-tracking branch 'origin/master'

This commit is contained in:
anonymous
2021-02-01 09:38:46 +08:00

View File

@@ -197,8 +197,6 @@ async function jdCrazyJoy() {
$.canBuy = true
await getJoyList()
await $.wait(1000)
await getJoyShop()
await $.wait(1000)
if ($.joyIds && $.joyIds.length > 0) {
$.log('当前JOY分布情况')
$.log(`\n${$.joyIds[0]} ${$.joyIds[1]} ${$.joyIds[2]} ${$.joyIds[3]}`)
@@ -206,27 +204,37 @@ async function jdCrazyJoy() {
$.log(`${$.joyIds[8]} ${$.joyIds[9]} ${$.joyIds[10]} ${$.joyIds[11]}\n`)
}
await getJoyShop()
await $.wait(1000)
// 如果格子全部被占有且没有可以合并的JOY只能回收低级的JOY (且最低等级的JOY小于30级)
if(checkHasFullOccupied() && !checkCanMerge() && finMinJoyLevel() < 30) {
const minJoyId = Math.min(...$.joyIds);
const boxId = $.joyIds.indexOf(minJoyId);
console.log(`格子全部被占有且没有可以合并的JOY回收${boxId + 1}号位等级为${minJoyId}的JOY`)
await sellJoy(minJoyId, boxId);
await $.wait(1000)
await getJoyList();
await $.wait(1000)
}
await hourBenefit()
await $.wait(1000)
await getCoin()
await $.wait(1000)
for (let i = 0; i < $.joyIds.length; ++i) {
if (!$.canBuy) {
$.log(`金币不足,跳过购买`)
break
}
if ($.joyIds[i] === 0) {
await buyJoy($.buyJoyLevel)
await $.wait(1000)
await getJoyList()
await $.wait(1000)
}
}
// await buyJoyLogic()
await getJoyList()
let obj = {};
$.joyIds.map((vo, idx) => {
if (vo !== 0) {
@@ -243,28 +251,32 @@ async function jdCrazyJoy() {
$.log(`开始合并两只${idx}级joy\n`)
await mergeJoy(vo[0], vo[1])
await $.wait(3000)
await getJoyList()
await $.wait(1000)
if ($.joyIds && $.joyIds.length > 0) {
$.log('合并后的JOY分布情况')
$.log(`\n${$.joyIds[0]} ${$.joyIds[1]} ${$.joyIds[2]} ${$.joyIds[3]}`)
$.log(`${$.joyIds[4]} ${$.joyIds[5]} ${$.joyIds[6]} ${$.joyIds[7]}`)
$.log(`${$.joyIds[8]} ${$.joyIds[9]} ${$.joyIds[10]} ${$.joyIds[11]}\n`)
}
}
if (idx === '34' && vo.length >= 8) {
await getCoin();
if ($.coin >= 6000000000000000) {
//当存在8个34级JOY并且剩余金币可为后面继续合成两只新的34级JOY(按全部用30级JOY合成一只34级JOY计算需:1.66T * 2 * 2 * 2 * 2 = 26.56T = 2.6Q)时,则此条件下合并两个34级JOY
$.log(`开始合并两只${idx}级joy\n`)
await mergeJoy(vo[0], vo[1])
await $.wait(3000)
await getJoyList()
await $.wait(1000)
if ($.joyIds && $.joyIds.length > 0) {
$.log('合并后的JOY分布情况')
$.log(`\n${$.joyIds[0]} ${$.joyIds[1]} ${$.joyIds[2]} ${$.joyIds[3]}`)
$.log(`${$.joyIds[4]} ${$.joyIds[5]} ${$.joyIds[6]} ${$.joyIds[7]}`)
$.log(`${$.joyIds[8]} ${$.joyIds[9]} ${$.joyIds[10]} ${$.joyIds[11]}\n`)
}
}
}
}
await getJoyList()
if ($.joyIds && $.joyIds.length > 0) {
$.log('合并后的JOY分布情况')
$.log(`\n${$.joyIds[0]} ${$.joyIds[1]} ${$.joyIds[2]} ${$.joyIds[3]}`)
$.log(`${$.joyIds[4]} ${$.joyIds[5]} ${$.joyIds[6]} ${$.joyIds[7]}`)
$.log(`${$.joyIds[8]} ${$.joyIds[9]} ${$.joyIds[10]} ${$.joyIds[11]}\n`)
}
await hourBenefit()
await $.wait(1000)
await getCoin()
await $.wait(1000)
await getUserBean()
await $.wait(5000)
console.log(`当前信息:${$.bean} 京豆,${$.coin} 金币`)
@@ -370,6 +382,7 @@ function getJoyList() {
} else {
if (safeGet(data)) {
data = JSON.parse(data);
//console.log(data)
if (data.success && data.data.joyIds) {
$.joyIds = data.data.joyIds
} else
@@ -477,6 +490,7 @@ function buyJoy(joyId) {
if (data.success) {
if (data.data.eventInfo) {
await openBox(data.data.eventInfo.eventType, data.data.eventInfo.eventRecordId)
await $.wait(1000)
$.log('金币不足')
$.canBuy = false
return
@@ -510,6 +524,7 @@ function sellJoy(joyId, boxId) {
if (data.success) {
if (data.data.eventInfo) {
await openBox(data.data.eventInfo.eventType, data.data.eventInfo.eventRecordId)
await $.wait(1000)
$.canBuy = false
return
}
@@ -597,6 +612,7 @@ function getCoin() {
}
if (data.data && data.data.luckyBoxRecordId) {
await openBox('LUCKY_BOX_DROP',data.data.luckyBoxRecordId)
await $.wait(1000)
}
if (data.data) {
$.log(`此次在线收益:获得 ${data.data['coins']} 金币`)