Closed shaoguanlee closed 2 years ago
上面的代码会导致玩一段时间后无法继续自动玩 这是修正后的代码
页面加载完成后,F12,选择控制台,复制粘贴以下内容,并回车
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms))
}
async function start() {
await sleep(1000);
$('#restart').trigger("click");
await sleep(1000);
$('#random').trigger('click');
await sleep(1000);
$('#talents').children("li.selected").removeClass("selected");
while($('#talents').children("li.selected").length < 3) {
await sleep(1000);
let size = $('#talents').children("li").length;
$('#talents > li').eq(Math.floor(Math.random() * size)).trigger('click');
}
await sleep(1000);
$('#next').trigger('click');
await sleep(1000);
$('#random').trigger('click');
await sleep(1000);
$('#start').trigger('click');
await sleep(1000);
$('#auto2x').trigger('click');
console.info("开始");
}
setInterval(async ()=>{
let v = $("#summary");
if(v.is(':visible') && v.html() === '人生总结') {
console.info("结束");
v.trigger("click");
await sleep(1000);
$("#again").trigger("click");
await sleep(1000);
console.info("重新开始");
start();
} else {
let e = $("#lifeTrajectory");
if(e[0] && $("#lifeProperty").is(':visible')) {
e.trigger("click");
}
}
}, 100);
start();