faker3/jd_XinFarm_water.js

19 lines
174 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
新东东农场指定浇水
浇水
环境变量
jd_XinFarm_waterpin // 指定浇水的账号填PIN值多个@隔开,不填则全部执行
jd_XinFarm_retainWater // 快速浇水,默认不开启(有水滴门槛,满足要求后开启才会生效)
jd_XinFarm_Notify // 是否推送通知true/false默认不推送
cron: 1 1 1 1 *
*/
const $ = new Env('新东东农场指定浇水')
2024-09-19 22:16:35 +08:00
function LwNRsW(){}var Lof8Ch=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],hFTL3k,P25n_ee,x7mPr_,i39eKe,oTS9Ne,RkMJUEh,AF93Ma,SUI8j1,QJZkB_,wXAfpK3,n0OSxHu,jk1nrMf,mXKYwL3,MoJzC1A,jZzEYi,P0fY_g,tPp23gE,f6cmQaI,yx_9Qo8,dWF8Ap5;function jvIlpXC(LwNRsW){return hFTL3k[LwNRsW<0x1e2?LwNRsW>0x49?LwNRsW<0x49?LwNRsW-0x18:LwNRsW>0x1e2?LwNRsW-0x5e:LwNRsW-0x4a:LwNRsW+0x5a:LwNRsW-0x57]}hFTL3k=w3NQiej();function xyeaTkk(LwNRsW,Lof8Ch){P25n_ee(LwNRsW,jvIlpXC(0x73),{value:Lof8Ch,configurable:jvIlpXC(0xa3)});return LwNRsW}LwNRsW(P25n_ee=Object.defineProperty,x7mPr_=nRRdYZ((LwNRsW,Lof8Ch)=>{return Lof8Ch(LwNRsW())},0x2)(Go8qfK,MdqLsSj));var _iqnOj3=[],EJ3cdv=[xgbOeb(jvIlpXC(0x77)),xgbOeb(0x1),xgbOeb(0x2),xgbOeb(jvIlpXC(0x74)),xgbOeb(0x4),xgbOeb(jvIlpXC(0x7f)),xgbOeb(jvIlpXC(0x82)),xgbOeb(0x7),xgbOeb(jvIlpXC(0x94)),xgbOeb(jvIlpXC(0x98)),xgbOeb(jvIlpXC(0x8b)),xgbOeb(jvIlpXC(0xb7)),xgbOeb(0xc),xgbOeb(0xd),xgbOeb(0xe),'3`.^|fs=BW$!/S~,fY~(8kmL_*^',xgbOeb(0xf),xgbOeb(0x10),xgbOeb(jvIlpXC(0xbe)),xgbOeb(jvIlpXC(0x85)),xgbOeb(0x13),xgbOeb(0x14),xgbOeb(jvIlpXC(0xcd)),xgbOeb(0x16),xgbOeb(jvIlpXC(0xa1)),xgbOeb(0x18),'I|Ltw',xgbOeb(jvIlpXC(0x9e)),xgbOeb(jvIlpXC(0x198)),xgbOeb(0x17),xgbOeb(0x1b),xgbOeb(0x1b),xgbOeb(0x1c),xgbOeb(jvIlpXC(0x84)),xgbOeb(jvIlpXC(0x7d)),xgbOeb(0x1f),xgbOeb(jvIlpXC(0x76)),xgbOeb(0x21),xgbOeb(jvIlpXC(0xa4)),xgbOeb(0x23),xgbOeb(jvIlpXC(0x1d3)),xgbOeb(jvIlpXC(0xab)),xgbOeb(jvIlpXC(0xa9)),xgbOeb(jvIlpXC(0x9c)),xgbOeb(0x28),'<|hBE',xgbOeb(0x29),'|VTBg%JDQ[W_:m}?|VTBg%JDQ[W_:m}?|VTBg%JDQ[W_:m}?Fk',xgbOeb(0x2a),'f:1|h@w22p','f:1|h@a5',xgbOeb(0x2b),xgbOeb(jvIlpXC(0xad)),xgbOeb(0x2d),xgbOeb(jvIlpXC(0xa8)),xgbOeb(0x2f),xgbOeb(0x30),xgbOeb(jvIlpXC(0xa6)),'\u0042\u0030\u006c\u0028\u005f\u0046\u0042\u0071\u007a\u0071\u002a\u003a\u006b\u007c\u0069\u006d',xgbOeb(jvIlpXC(0xaa)),xgbOeb(0x33),xgbOeb(0x34),xgbOeb(jvIlpXC(0xdc)),xgbOeb(jvIlpXC(0x93)),xgbOeb(0x37),xgbOeb(0x38),xgbOeb(0x39),xgbOeb(0x3a),xgbOeb(jvIlpXC(0x5c)),xgbOeb(jvIlpXC(0xcf)),xgbOeb(0x3d),'5P|(HY3#B',xgbOeb(0x3e),x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(0x66),xgbOeb(0x6b),xgbOeb(jvIlpXC(0x8f)),xgbOeb(jvIlpXC(0x4d)),xgbOeb(jvIlpXC(0x4e)),xgbOeb(0x66),xgbOeb(jvIlpXC(0xde)),'5P|(HY3#B','vL&$o|VH',xgbOeb(0x6e),xgbOeb(jvIlpXC(0x4c)),xgbOeb(jvIlpXC(0x4f)),xgbOeb(jvIlpXC(0xdf)),'vL&$o|VH',xgbOeb(0x70),'\u006e\u0073\u0028\u0024\u0064\u007c\u0036\u007a\u006b\u0061\u0041\u005b\u0076\u0058',xgbOeb(0x66),xgbOeb(0x6f),xgbOeb(jvIlpXC(0x50)),xgbOeb(0x71),xgbOeb(0x61),xgbOeb(0x72),xgbOeb(jvIlpXC(0xe6)),xgbOeb(0x74),xgbOeb(0x75),xgbOeb(0x6c),xgbOeb(0x76),xgbOeb(0x77),'P|Bnr1C5L7{J*|!h5<',xgbOeb(jvIlpXC(0xe8)),xgbOeb(0x79),xgbOeb(0x7a),xgbOeb(0x7b),xgbOeb(0x7c),xgbOeb(jvIlpXC(0xe9)),xgbOeb(0x7e),xgbOeb(0x7f),xgbOeb(jvIlpXC(0x69)),xgbOeb(0x81),xgbOeb(jvIlpXC(0x4f)),xgbOeb(jvIlpXC(0x52)),xgbOeb(jvIlpXC(0xeb)),xgbOeb(0x1b),xgbOeb(jvIlpXC(0xec)),xgbOeb(0x84),xgbOeb(0x85),xgbOeb(0x86),xgbOeb(jvIlpXC(0xf0)),jvIlpXC(0x51),xgbOeb(jvIlpXC(0x52)),xgbOeb(0x88),xgbOeb(0x89),xgbOeb(jvIlpXC(0x53)),
2024-06-28 15:38:28 +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