This commit is contained in:
Faker 2022-11-21 16:55:57 +08:00
parent 940d90e167
commit 74ac7b4a4e
2 changed files with 5 additions and 0 deletions

View File

@ -221,10 +221,12 @@ class JDJRValidator {
this.data = {};
this.x = 0;
this.t = Date.now();
this.trynum = 0;
}
async run(scene) {
try {
if (this.trynum > 5) return '';
const tryRecognize = async () => {
const x = await this.recognize(scene);
@ -250,6 +252,7 @@ class JDJRValidator {
return result;
} else {
console.count("验证失败");
this.trynum++
// console.count(JSON.stringify(result));
await sleep(300);
return await this.run(scene);
@ -542,6 +545,7 @@ function injectToRequest2(fn, scene = 'cww') {
async function injectToRequest(scene = 'cww') {
console.log('JDJR验证中......');
const res = await new JDJRValidator().run(scene);
if (res == '') return;
return res.validate;
}

View File

@ -59,6 +59,7 @@ let FEED_NUM = 20; //喂食数量默认20g,可选 10,20,40,80 , 其他数字
}
$.validate = '';
$.validate = await Slider.injectToRequest()
if (!$.validate) {console.log('滑块验证失败过多,跳出');continue};
await feedPets(FEED_NUM);//喂食
//await ThreeMeals();//三餐
await showMsg();