faker3/jd_XinFarm_water.js

19 lines
145 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-12 10:57:47 +08:00
function CMOt_R1(){}var CWf7sNP=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],WIJF6t7,WixU3ot,h0QvHE,KlLzt4a,sP0X7f,fJpbFs,TV6leQA,x6r5PO,qlQeOn,FBPriyn,WgufWN,e0OuUG,uXoTlJw,iisSsUU,Qil3MH8,MszD9e,Uuef1U,KKqvNTH,WQrD0Gw;function j8Y1NS4(CMOt_R1){return WIJF6t7[CMOt_R1>0x51?CMOt_R1<0x1b1?CMOt_R1<0x1b1?CMOt_R1<0x51?CMOt_R1-0x4d:CMOt_R1-0x52:CMOt_R1+0x14:CMOt_R1+0x1:CMOt_R1-0x3a]}WIJF6t7=DsYHjk();function egMGuB(CMOt_R1,CWf7sNP){return WixU3ot.call(null,CMOt_R1,'length',{value:CWf7sNP,configurable:j8Y1NS4(0xca)})}CMOt_R1(WixU3ot=Object.defineProperty,h0QvHE=NTRaGTg((CMOt_R1,CWf7sNP)=>{return CWf7sNP(CMOt_R1())},0x2)(LU_xEm,zdbcL7));var iNHg5wI=[],yF49MF=[AfIuIB(j8Y1NS4(0x6b)),AfIuIB(j8Y1NS4(0x6d)),AfIuIB(j8Y1NS4(0x6a)),AfIuIB(j8Y1NS4(0x73)),AfIuIB(j8Y1NS4(0x69)),'i!.|7#m=',AfIuIB(0x5),'LL+q5c*6D{RYdx|fT$',AfIuIB(0x6),AfIuIB(0x7),AfIuIB(0x8),AfIuIB(j8Y1NS4(0x76)),AfIuIB(0xa),AfIuIB(0xb),AfIuIB(j8Y1NS4(0x72)),AfIuIB(j8Y1NS4(0x81)),AfIuIB(0xe),AfIuIB(0xf),AfIuIB(0x10),AfIuIB(j8Y1NS4(0x7c)),AfIuIB(0x12),AfIuIB(0x13),AfIuIB(0x14),AfIuIB(0x15),AfIuIB(0x16),AfIuIB(j8Y1NS4(0x7b)),AfIuIB(j8Y1NS4(0xa8)),AfIuIB(j8Y1NS4(0x9d)),AfIuIB(j8Y1NS4(0x52)),AfIuIB(j8Y1NS4(0x91)),AfIuIB(0x1c),AfIuIB(j8Y1NS4(0x53)),AfIuIB(j8Y1NS4(0x52)),AfIuIB(j8Y1NS4(0xad)),AfIuIB(0x1f),AfIuIB(j8Y1NS4(0xa1)),AfIuIB(j8Y1NS4(0x7a)),AfIuIB(0x22),AfIuIB(j8Y1NS4(0x5a)),AfIuIB(0x24),AfIuIB(0x25),AfIuIB(0x26),AfIuIB(0x27),'\x45\x4c\x21\x50\x7c\x46\x79',AfIuIB(0x28),AfIuIB(0x29),AfIuIB(j8Y1NS4(0xdc)),AfIuIB(0x2b),AfIuIB(0x2c),AfIuIB(0x2d),'C34mKG|a>nFH$',AfIuIB(0x2e),'|_uH0,tG',AfIuIB(0x2f),AfIuIB(j8Y1NS4(0x62)),AfIuIB(0x31),AfIuIB(0x32),AfIuIB(0x33),'C34mKG|a>nFH$',AfIuIB(0x34),'j`/N0|d',AfIuIB(0x35),AfIuIB(j8Y1NS4(0x79)),AfIuIB(0x37),AfIuIB(0x38),AfIuIB(0x39),AfIuIB(0x3a),AfIuIB(0x3b),j8Y1NS4(0x55),AfIuIB(0x3c),AfIuIB(0x3d),'C34mKG|a>nFH$',AfIuIB(j8Y1NS4(0x53)),AfIuIB(0x3e),AfIuIB(0x2b),AfIuIB(0x3f),AfIuIB(0x1d),AfIuIB(j8Y1NS4(0xb8)),AfIuIB(0x41),AfIuIB(0x42),'\u005b\u0022\u0068\u0050\u005b\u0065\u007c\u0061\u0032',AfIuIB(0x43),AfIuIB(0x44),AfIuIB(0x45),AfIuIB(j8Y1NS4(0x12f)),'|QF!}>8',AfIuIB(j8Y1NS4(0x118)),AfIuIB(0x48),AfIuIB(j8Y1NS4(0x67)),AfIuIB(0x4a),AfIuIB(0x4b),'f|}mNf]!NWp$)Gtr#~zVbUM',AfIuIB(j8Y1NS4(0x57)),AfIuIB(0x4c),AfIuIB(0x4d),AfIuIB(j8Y1NS4(0x63)),AfIuIB(0x4f),AfIuIB(j8Y1NS4(0x54)),AfIuIB(0x50),AfIuIB(0x51),AfIuIB(j8Y1NS4(0xbb)),AfIuIB(0x4d),AfIuIB(j8Y1NS4(0x93)),AfIuIB(0x4f),AfIuIB(j8Y1NS4(0x54)),AfIuIB(0x54),AfIuIB(j8Y1NS4(0x97)),AfIuIB(0x31),AfIuIB(j8Y1NS4(0xbe)),AfIuIB(0x57),AfIuIB(0x58),AfIuIB(j8Y1NS4(0x56)),'["hPDsn|r.e','["hP[e|a2','ELsPz_W|R{SNv#',j8Y1NS4(0x55),AfIuIB(0x1d),'ELsPz_W|R{SNv#',j8Y1NS4(0x55),AfIuIB(0x1d),'\x5b\x22\x68\x50\x44\x73\x6e\x7c\x72\x2e\x65',AfIuIB(0x5a),AfIuIB(j8Y1NS4(0x56)),'(c|1/g;m9F$ST3{aorc',AfIuIB(0x5b),AfIuIB(0x5c),AfIuIB(j8Y1NS4(0xc0)),j8Y1NS4(0x58),AfIuIB(0x1d),AfIuIB(0x5e),AfIuIB(0x5f),AfIuIB(j8Y1NS4(0x59)),AfIuIB(j8Y1NS4(0x56)),'C34mKG|a>nFH$',j8Y1NS4(0x55),AfIuIB(j8Y1NS4(0x53)),AfIuIB(0x60),AfIuIB(j8Y1NS4(0x57)),AfIuIB(0x61),'=r;?|jo}QxkhPmf&^xj*?RJB#J','\u0045\u004c\u0073\u0050\u007a\u005f\u0057\u007c\u0052\u007b\u0053\u004e\u0076\u0023',AfIuIB(0x1d),AfIuIB(0x2b),AfIuIB(0x61),'=r;?|jo}QxkhPmf&^xt*:l/iO7',j8Y1NS4(0x58),AfIuIB(j8Y1NS4(0x53)),AfIuIB(j8Y1NS4(0x57)),AfIuIB(0x61),'=r;?|jo}QxkhPmf&^xt*:l/iO7',AfIuIB(0x62),AfIuIB(0x63),AfIuIB(j8Y1NS4(0xc6)),'aP|#r',AfIuIB(j8Y1NS4(0x59)),AfIuIB(j8Y1NS4(0x56)),AfIuIB(j8Y1NS4(0x5b)),AfIuIB(j8Y1NS4(0x84)),AfIuIB(j8Y1NS4(0x10a)),AfIuIB(0x67),AfIuIB(0x68),AfIuIB(0x69),AfIuIB(j8Y1NS4(0xba)),AfIuIB(0x6a),AfIuIB(0x6b),AfIuIB(0x6c),AfIuIB(0x1e),AfIuIB(j8Y1NS4(0x5f)),AfIuIB(0x1d),AfIuIB(j8Y1NS4(0x53)),AfIuIB(j8Y1NS4(0x65)),AfIuIB(0x40),AfIuIB(j8Y1NS4(0x53)),'TL.`Ok|avEs_$',AfIuIB(0x1a),AfIuIB(j8Y1NS4(0x5a)),AfIuIB(j8Y1NS4(0xcc)),j8Y1NS4(0x58),AfIuIB(j8Y1NS4(0x53)),AfIuIB(0x6e),AfIuIB(j8Y1NS4(0xc7)),AfIuIB(0x70),AfIuIB(0x54),AfIuIB(0x71),'|W;{^c%%j>',AfIuIB(j8Y1NS4(0xbc)),AfIuIB(j8Y1NS4(0xc8)),j8Y1NS4(0x58),AfIuIB(0x40),AfIuIB(0x1d),AfIuIB(0x72),AfIuIB(0x73),AfIuIB(j8Y1NS4(0x5b)),AfIuIB(j8Y1NS4(0x5c)),AfIuIB(0x75),AfIuIB(0x1d),AfIuIB(j8Y1NS4(0x5c)),AfIuIB(0
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