Version features:
- Built-in simulation pumping mechanism, prevent rare prizes hit low!
- Cache gold!
- Prize statistics!
👇 Copy the code, open the console and paste, you can fly to the bottom!
! (into= > {
into({
log(msg) {
console.log(msg);
},
clear() {
console.clear();
},
async wait(time = 0) {
return new Promise(resolve= > setTimeout(resolve, time));
},
async fetch({ path, method }) {
return fetch(path, {
headers: {
cookie: document.cookie
},
method: method,
credentials: "include"
})
.then(res= > res.json())
.then(res= > {
if (res.err_no) {
throw new Error(res.err_msg);
}
return res.data;
});
},
async getCurrentPoint() {
return this.fetch({
path: "https://api.juejin.cn/growth_api/v1/get_cur_point".method: "GET"
});
},
async lottery() {
return this.fetch({
path: "https://api.juejin.cn/growth_api/v1/lottery/draw".method: "POST"
});
},
checkGold(result) {
const list = [
["lottery_id"."6981716980386496552"],
["lottery_name"."66 ore"],
["lottery_type".1]].return list.findIndex(([prop, value]) = >result[prop] === value) ! = = -1;
}
});
})(async api => {
await api.wait(100);
api.clear();
api.log("Ready for Soha!");
let total = await api.getCurrentPoint();
api.log('Current balance:${total}`);
const simulateSpeed = 100; // ms/ run a lucky draw
let counter = 0;
const prize = {};
while (total >= 200) {
const result = await api.lottery();
total -= 200;
if (api.checkGold(result)) {
total += 66;
}
counter++;
prize[result.lottery_name] = (prize[result.lottery_name] || 0) + 1;
api.log('[win prize] :${result.lottery_name}`);
await api.wait(simulateSpeed);
}
api.log('Low ammo, current balance:${total}`);
api.log('Save your strength for another day! `);
const recordInfo = [];
recordInfo.push("===[combat details]===");
if (counter > 0) {
const prizeList = [];
for (const key in prize) {
prizeList.push(`${key}: ${prize[key]}`); } recordInfo.push(... prizeList); recordInfo.push("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -");
recordInfo.push(` total:${counter}`);
} else {
recordInfo.push("No prizes for now.");
}
recordInfo.push("= = = = = = = = = = = = = = = =");
api.log(recordInfo.join("\n"));
});
Copy the code
Good luck!