mirror of https://github.com/KingRan/KR.git
parent
3c36dd4991
commit
35b674d012
12
jd_pet.js
12
jd_pet.js
|
@ -183,6 +183,7 @@ async function feedPetsAgain() {
|
|||
if (foodAmount - 100 >= 10) {
|
||||
for (let i = 0; i < parseInt((foodAmount - 100) / 10); i++) {
|
||||
const feedPetRes = await request('feedPets');
|
||||
await $.wait(5 * 1000);
|
||||
console.log(`投食feedPetRes`);
|
||||
if (feedPetRes.resultCode == 0 && feedPetRes.code == 0) {
|
||||
console.log('投食成功')
|
||||
|
@ -256,7 +257,13 @@ async function doTask() {
|
|||
}
|
||||
// 投食10次
|
||||
if (feedReachInit && !feedReachInit.finished) {
|
||||
lnrun++;
|
||||
await feedReachInitFun();
|
||||
if (lnrun == 5) {
|
||||
console.log(`\n【访问接口次数达到5次,休息半分钟.....】\n`);
|
||||
await $.wait(30 * 1000);
|
||||
lnrun = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 好友助力信息
|
||||
|
@ -418,10 +425,11 @@ async function feedReachInitFun() {
|
|||
console.log('投食任务开始...');
|
||||
let finishedTimes = $.taskInfo.feedReachInit.hadFeedAmount / 10; //已经喂养了几次
|
||||
let needFeedTimes = 10 - finishedTimes; //还需要几次
|
||||
let tryTimes = 20; //尝试次数
|
||||
let tryTimes = 10; //尝试次数
|
||||
do {
|
||||
console.log(`还需要投食${needFeedTimes}次`);
|
||||
const response = await request('feedPets');
|
||||
await $.wait(5 * 1000);
|
||||
console.log(`本次投食结果: ${JSON.stringify(response)}`);
|
||||
if (response.resultCode == 0 && response.code == 0) {
|
||||
needFeedTimes--;
|
||||
|
@ -498,7 +506,7 @@ function TotalBean() {
|
|||
}
|
||||
// 请求
|
||||
async function request(function_id, body = {}) {
|
||||
await $.wait(6000); //歇口气儿, 不然会报操作频繁
|
||||
await $.wait(10 * 1000); //歇口气儿, 不然会报操作频繁
|
||||
return new Promise((resolve, reject) => {
|
||||
$.post(taskUrl(function_id, body), (err, resp, data) => {
|
||||
try {
|
||||
|
|
|
@ -85,7 +85,7 @@ console.log(`共${cookiesArr.length}个京东账号\n`);
|
|||
taskInfoKey = [];
|
||||
option = {};
|
||||
await GetShareCode();
|
||||
await $.wait(3 * 1000);
|
||||
await $.wait(4 * 1000);
|
||||
}
|
||||
}
|
||||
console.log('\n互助码收集完毕,开始执行内部助力...\n');
|
||||
|
@ -183,6 +183,7 @@ async function jdPet() {
|
|||
$.taskInfo = $.taskInit.result;
|
||||
if (llhelp){
|
||||
await slaveHelp(); //助力好友
|
||||
await $.wait(30 * 1000);
|
||||
}
|
||||
await showMsg();
|
||||
|
||||
|
@ -455,7 +456,7 @@ function TotalBean() {
|
|||
}
|
||||
// 请求
|
||||
async function request(function_id, body = {}) {
|
||||
await $.wait(3000); //歇口气儿, 不然会报操作频繁
|
||||
await $.wait(10000); //歇口气儿, 不然会报操作频繁
|
||||
return new Promise((resolve, reject) => {
|
||||
$.post(taskUrl(function_id, body), (err, resp, data) => {
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue