This commit is contained in:
Faker
2022-03-04 16:07:27 +08:00
parent a73a1bde61
commit fae0e1ef98
2 changed files with 246 additions and 39 deletions

View File

@@ -75,7 +75,7 @@ RemainMessage += '【其他】京喜红包只能在京喜使用,其他同理';
let WP_APP_TOKEN_ONE = ""; let WP_APP_TOKEN_ONE = "";
let TempBaipiao = ""; let TempBaipiao = "";
let llgeterror=false;
let doExJxBeans ="false"; let doExJxBeans ="false";
let time = new Date().getHours(); let time = new Date().getHours();
@@ -359,14 +359,19 @@ if(DisableIndex!=-1){
if(EnableJdMs) if(EnableJdMs)
await getMs(); await getMs();
//东东农场 //东东农场
if(EnableJdFruit){ if (EnableJdFruit) {
await jdfruitRequest('taskInitForFarm', { llgeterror = false;
"version": 14, await getjdfruit();
"channel": 1, if (llgeterror) {
"babelChannel": "120" console.log(`东东农场API查询失败,等待10秒后再次尝试...`)
}); await $.wait(10 * 1000);
await getjdfruit(); await getjdfruit();
}
if (llgeterror) {
console.log(`东东农场API查询失败,有空重启路由器换个IP吧.`)
}
} }
//极速金币 //极速金币
if(EnableJdSpeed) if(EnableJdSpeed)
@@ -1827,10 +1832,13 @@ async function getjdfruit() {
$.post(option, (err, resp, data) => { $.post(option, (err, resp, data) => {
try { try {
if (err) { if (err) {
console.log('\n东东农场: API查询请求失败 ‼️‼️'); if(!llgeterror){
console.log(JSON.stringify(err)); console.log('\n东东农场: API查询请求失败 ‼️‼️');
$.logErr(err); console.log(JSON.stringify(err));
}
llgeterror = true;
} else { } else {
llgeterror = false;
if (safeGet(data)) { if (safeGet(data)) {
$.farmInfo = JSON.parse(data) $.farmInfo = JSON.parse(data)
if ($.farmInfo.farmUserPro) { if ($.farmInfo.farmUserPro) {
@@ -1857,33 +1865,6 @@ async function getjdfruit() {
}) })
} }
function jdfruitRequest(function_id, body = {}, timeout = 1000) {
return new Promise(resolve => {
setTimeout(() => {
$.get(taskfruitUrl(function_id, body), (err, resp, data) => {
try {
if (err) {
console.log('\n东东农场: API查询请求失败 ‼️‼️')
console.log(JSON.stringify(err));
console.log(`function_id:${function_id}`)
$.logErr(err);
} else {
if (safeGet(data)) {
data = JSON.parse(data);
$.JDwaterEveryDayT = data.totalWaterTaskInit.totalWaterTaskTimes;
}
}
} catch (e) {
$.logErr(e, resp);
}
finally {
resolve(data);
}
})
}, timeout)
})
}
async function PetRequest(function_id, body = {}) { async function PetRequest(function_id, body = {}) {
await $.wait(3000); await $.wait(3000);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {

226
jd_plusLottery.js Normal file

File diff suppressed because one or more lines are too long