KR/jd_dongDongFarm_task.js

27 lines
83 KiB
JavaScript
Raw Normal View History

2023-10-30 10:31:30 +08:00
/*
新东东农场任务
种植任务浇水 暂无助力
环境变量
jd_dongDongFarm_plantSkuId // 需要种植的作物ID详见脚本打印
jd_dongDongFarm_Notify // 是否推送通知true/false默认不推送
代理变量
JD_Farm_PROXY_OPEN // 代理启用变量默认不开启true/false
JD_Farm_PROXY_TUNNRL // 代理池代理地址变量,默认不开启,仅支持代理池模式(auto-proxy-pool)格式为http://ip:port
JD_Farm_PROXY_URL // API代理地址变量默认不开启仅支持 数据格式:txt;提取数量:每次一个格式为http://api.xxx.xxx
JD_Farm_NO_PROXY // 禁止走代理,默认 127.0.0.1,*.baidu.com 需要自行修改
2023-10-30 21:20:32 +08:00
cron:45 2-22/6 * * *
2023-10-30 10:31:30 +08:00
============Quantumultx===============
[task_local]
#新东东农场任务
2023-10-30 23:35:21 +08:00
45 2-22/6 * * * jd_dongDongFarm_task.js, tag=新东东农场任务, enabled=true
2023-10-30 10:31:30 +08:00
*/
const $ = new Env('新东东农场任务')
2023-10-31 09:27:54 +08:00
var version_='jsjiami.com.v7';const i1Ii1=iii1II;function iii1II(_0x134018,_0x4d60d7){const _0x6e2fc8=Iii11l();return iii1II=function(_0x4bc524,_0x4ef8a2){_0x4bc524=_0x4bc524-0x198;let _0x2c1b12=_0x6e2fc8[_0x4bc524];if(iii1II['KisyOf']===undefined){var _0x21b43a=function(_0x31ff79){const _0x5bc775='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2d87de='',_0x4cdd25='';for(let _0x34a436=0x0,_0xae754f,_0x274298,_0x2c7181=0x0;_0x274298=_0x31ff79['charAt'](_0x2c7181++);~_0x274298&&(_0xae754f=_0x34a436%0x4?_0xae754f*0x40+_0x274298:_0x274298,_0x34a436++%0x4)?_0x2d87de+=String['fromCharCode'](0xff&_0xae754f>>(-0x2*_0x34a436&0x6)):0x0){_0x274298=_0x5bc775['indexOf'](_0x274298);}for(let _0x4bb120=0x0,_0xcbed7c=_0x2d87de['length'];_0x4bb120<_0xcbed7c;_0x4bb120++){_0x4cdd25+='%'+('00'+_0x2d87de['charCodeAt'](_0x4bb120)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4cdd25);};const _0x2ee50f=function(_0x3a7320,_0x4f6423){let _0x276b29=[],_0xebd5c8=0x0,_0x54ddeb,_0x542173='';_0x3a7320=_0x21b43a(_0x3a7320);let _0x12dc50;for(_0x12dc50=0x0;_0x12dc50<0x100;_0x12dc50++){_0x276b29[_0x12dc50]=_0x12dc50;}for(_0x12dc50=0x0;_0x12dc50<0x100;_0x12dc50++){_0xebd5c8=(_0xebd5c8+_0x276b29[_0x12dc50]+_0x4f6423['charCodeAt'](_0x12dc50%_0x4f6423['length']))%0x100,_0x54ddeb=_0x276b29[_0x12dc50],_0x276b29[_0x12dc50]=_0x276b29[_0xebd5c8],_0x276b29[_0xebd5c8]=_0x54ddeb;}_0x12dc50=0x0,_0xebd5c8=0x0;for(let _0xb6ca90=0x0;_0xb6ca90<_0x3a7320['length'];_0xb6ca90++){_0x12dc50=(_0x12dc50+0x1)%0x100,_0xebd5c8=(_0xebd5c8+_0x276b29[_0x12dc50])%0x100,_0x54ddeb=_0x276b29[_0x12dc50],_0x276b29[_0x12dc50]=_0x276b29[_0xebd5c8],_0x276b29[_0xebd5c8]=_0x54ddeb,_0x542173+=String['fromCharCode'](_0x3a7320['charCodeAt'](_0xb6ca90)^_0x276b29[(_0x276b29[_0x12dc50]+_0x276b29[_0xebd5c8])%0x100]);}return _0x542173;};iii1II['pyqQNn']=_0x2ee50f,_0x134018=arguments,iii1II['KisyOf']=!![];}const _0x656f7a=_0x6e2fc8[0x0],_0x3e0cea=_0x4bc524+_0x656f7a,_0x1743fa=_0x134018[_0x3e0cea];return!_0x1743fa?(iii1II['RpvmoU']===undefined&&(iii1II['RpvmoU']=!![]),_0x2c1b12=iii1II['pyqQNn'](_0x2c1b12,_0x4ef8a2),_0x134018[_0x3e0cea]=_0x2c1b12):_0x2c1b12=_0x1743fa,_0x2c1b12;},iii1II(_0x134018,_0x4d60d7);}function Iii11l(){const l1iI1l=(function(){return[...[version_,'MSjsHgjiygamnhiNG.TcEBoeWmECC.lvE7uwdAkd==','WQWxhSkSuZ3cR8oCycyKiGWjW6SGWRhcNq','5y6f5ykF5lIB5yUcFs/MR5FMLPVNRBBLIRpcNW','WR7cO8kSzNa','WQ4WlSkkoW','o8oRieJdUmknW5THWRfGW7JcSq','j0NdHhe','W50FW7H/W6quWPGAW6ZcJG','WPSHaSkmuW','mu3dG2uAsq','DYJcUt/cPSkCCmkDWQVdIMK','W7alW6bNW78','WOxdUWGyWQW','b2VdG2C+','rmk0WO8vda','8lQ8IeS','tuFdG1q/sW','WRWbymoNW6y','W74LW6u5oConv8kPW7JdNSkwiq','csxcHG7dGW','WQJdHYOzWQy','WPBcHc/cPuO0WQq','WQBdPt0kW7ldG8ov','s8k9kW8TW7PDW67cSXrcW7NdPqLbzW','juNdGN0PsCoIWO3dN2FdGCoXWRaHW5K','ASoEnSonW7SmBCklk8kyg8ow','W4/cKSoOm8kzpG','DmkLWQNdGmo5','WQxcKCkJ','vCk/dsS6','WOFdVIJcMSoL','h8oKyfPd','zmkHWPVdISoM','wmkhWRFdO8k3','WQWrzSoSW5qLp0WS','WP3cGSkwEhe','WQCvz8oYW6OQnq','sYpcJdJcSa','BdXKW4BdHq','ysXgW5VdMmkup8klWOegWPTDbmkK','W6JcN8ovtg8','W5BcHSolnSkK','W7njjIaO','WP7cLdxcTMC','BCoBkmoaEb4SDwi','WQiopmkMEa','W4TnWQBdGCk8','8kIlL8oh','W5XoWQddRmok','5lIn5PwM5O+m55UE6kYJ5RkB5PAN5RcT','WQFcKMb2WRm','xsNcNwed','WPRdHgZcHra','W5FcQSkKW4P8W5O0Eq','W5f1cd0w','W4biaXqq','fWVcNGldOa','W7pcGmocdSkD','rIOvihRdJge1WRmkWP8','W6PnkSkH','F18B','WO3dNqmwWOK','ASkjWOz2','lUIUKEAYJEwtV+w7PIa','W7KLv1S6aW','sCk9lqm','c3ldUCkSWOi','rN9ircK','44oA5OYy56sJ44c96kYX5yEt6iYQ5y+mlmkbj8oWWPTc','q8o3hmoRW74Hs8k5','W4NdSb4sdCohWQu','cXlcIrfLc8okWOJcVIBcPCksWRO','WOyrc8kBhG','vCkQWOSKda','wmk8WONdRW','p8klBSkCfeqZC34+WOBdTG','iKVdMCkGWQ3cPbJdVSo8WQahW43dV8oTqCosW5asW5O','p3/cKZpdHG','6lw75y6l5Psh5PsJ','5RkR5PY55y+856sb5Qwo55Qk5lYM54MB772c','s8kqWRChlW','WPGCWRvH','s8k9kW8TW7PDW67cSXrkW7xdOHW','WPBcMmk3WROx','nLJdICkOWQ/cQc/dUmo3WQC9W5pdPW','W7Tuda','W7NdKmoc','x8k8WQRdJ8kJ','zmksiYeC','WPiEW5/cLmkxBSk/5B6l5AsH44kZ5lUF5lIV6ls/5y6i','WQ8DbmkdiIhcTq','WPDE56+15yIK5AAg6lwfW5K','WP1qWRK','WPSQlmkmfgv6wSoKbtfV','WR7cIK57WPq','W48mW6r5','A8kdWQj0W7O','W7qYWOapomoTW4lcTq','WPtcGJW','5BwB5Rs55Rk/','W4r0oquG','W
2023-10-30 10:31:30 +08:00
// prettier-ignore
function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.d