add daily watering
This commit is contained in:
parent
f5f26779bc
commit
aeaa2a644f
17
sign.js
17
sign.js
@ -15,7 +15,7 @@ const ACTION = {
|
||||
DAILY_DATI_ANSWER: 'DailyDatiAnswer',
|
||||
DAILY_DATI_ID: 4,
|
||||
DAILY_GAME_CATE_JUMP: 'DailyGameCateJump',
|
||||
|
||||
DAILY_WATERING: 'Watering'
|
||||
};
|
||||
|
||||
// const HYKB_SCOOKIE = process.env.HYKB_SCOOKIE;
|
||||
@ -148,6 +148,10 @@ async function execTodayTask() {
|
||||
const shareRegexPattern = /DailyShare\((\d+)\)/g;
|
||||
const gameRegexPattern = /DailyGameLing\((\d+)\)/g;
|
||||
const appRegexPattern = /DailyAppLing\((\d+)\)/g;
|
||||
|
||||
// 每日浇水
|
||||
await doWateringTask(scookie, deviceId);
|
||||
|
||||
// 分享任务
|
||||
let dailyShareIdList = [...html.matchAll(shareRegexPattern)]
|
||||
.filter(match => !dailyIdList.includes(match[1]))
|
||||
@ -170,6 +174,17 @@ async function execTodayTask() {
|
||||
}
|
||||
}
|
||||
}
|
||||
async function doWateringTask(scookie, deviceId){
|
||||
console.log("开始执行每日浇水任务");
|
||||
let watering = await postApiData(API, buildData(ACTION.DAILY_WATERING, null, scookie, deviceId, false), headers);
|
||||
if (watering.key === '501') {
|
||||
console.log(JSON.stringify(watering))
|
||||
console.log("开始执行每日浇水成功");
|
||||
} else {
|
||||
console.log(JSON.stringify(watering))
|
||||
console.log("每日浇水任务失败,原因:" + watering.info);
|
||||
}
|
||||
}
|
||||
|
||||
async function doShareTask(idList, scookie, deviceId) {
|
||||
for (const id of idList) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user