faker3/jd_XinFarm_task.js

23 lines
200 KiB
JavaScript
Raw Normal View History

2024-11-12 11:17:55 +08:00
/*
新东东农场任务
种植任务浇水
2024-11-21 14:54:16 +08:00
作物名称显示接口未返回种植商品名称 是因为自己手动种的只选了等级没选商品这是正常情况
2024-11-12 11:17:55 +08:00
环境变量
jd_XinFarm_plantSkuId // 需要种植的作物ID详见脚本打印
jd_XinFarm_autoPlant // 种植模式true/false 默认自动种植,自动随机种植等级价值最高的物品
jd_XinFarm_waternum // 浇水次数,默认 10次 自行修改
jd_XinFarm_retainWater // 快速浇水,默认不开启(有水滴门槛,满足要求后开启才会生效)
jd_XinFarm_Notify // 是否推送通知true/false默认不推送
cron:45 2-22/6 * * *
*/
const $ = new Env('新东东农场任务')
function yGmz97(){}var Wj1HLg=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],B_TMZiQ,tDQfUbz,QL3uAPq,CvImKa,uleGKcT,zkB7pf,BACKiI,WhEMDm,qfPP2_,A3vlQIg,E3Jy93,tNOJnI5,DU10IV,YDT7YGn,YRarBH,qrK4Qn,dP60kW,HR2u9D,i2sx7O,E20FRuj,OWPJbW;function eAO1BXl(yGmz97){return B_TMZiQ[yGmz97<0x35?yGmz97-0x53:yGmz97-0x36]}B_TMZiQ=eyUUpDz();function rDv6m5(yGmz97,Wj1HLg){return tDQfUbz.call(eAO1BXl(0x176),yGmz97,'\x6c\x65\x6e\x67\x74\x68',{value:Wj1HLg,configurable:!0x0})}yGmz97(tDQfUbz=Object.defineProperty,QL3uAPq=EyJQD7a((yGmz97,Wj1HLg)=>{return Wj1HLg(yGmz97())},0x2)(PbeB5u,_TfW7iT));var qX264a8=[],Xb46iNV=[l1MNv1(0x0),l1MNv1(0x1),l1MNv1(eAO1BXl(0x7e)),l1MNv1(0x3),l1MNv1(0x4),l1MNv1(0x5),l1MNv1(eAO1BXl(0x85)),'\u0058\u006d\u0053\u002b\u007c\u0042\u006e\u0048',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MNv1(0x3b),l1MNv1(eAO1BXl(0x45)),l1MNv1(0x3d),l1MNv1(eAO1BXl(0x6c)),l1MNv1(eAO1BXl(0x86)),l1MNv1(eAO1BXl(0x18a)),l1MNv1(eAO1BXl(0xd7)),l1MNv1(eAO1BXl(0x36)),l1MNv1(eAO1BXl(0x90)),l1MNv1(0x43),l1MNv1(eAO1BXl(0xda)),l1MNv1(0x45),l1MNv1(0x46),l1MNv1(0x47),l1MNv1(eAO1BXl(0x3b)),l1MNv1(eAO1BXl(0x43)),l1MNv1(eAO1BXl(0x41)),l1MNv1(0x4b),l1MNv1(eAO1BXl(0x94)),'\x3a\x7c\x5e\x42\x3f\x4e\x59\x6c',l1MNv1(eAO1BXl(0x46)),l1MNv1(0x4e),l1MNv1(0x4f),l1MNv1(eAO1BXl(0xdc)),l1MNv1(0x51),l1MNv1(0x52),l1MNv1(eAO1BXl(0xdd)),l1MNv1(eAO1BXl(0x36)),'iq8$?|TpE',l1MNv1(0x54),l1MNv1(eAO1BXl(0xec)),l1MNv1(0x1b),l1MNv1(eAO1BXl(0xab)),l1MNv1(0x57),l1MNv1(eAO1BXl(0x36)),l1MNv1(0x1d),'\u004f\u0053\u0051\u003e\u002a\u0048\u0033\u0052\u0028\u0065\u0069\u0046\u0031\u0025\u007e\u007c\u0078\u0037\u0053',l1MNv1(eAO1BXl(0x3c)),l1MNv1(0x48),l1MNv1(eAO1BXl(0x96)),l1MNv1(eAO1BXl(0x37)),l1MNv1(eAO1BXl(0x38)),l1MNv1(eAO1BXl(0xce)),l1MNv1(eAO1BXl(0x9e)),l1MNv1(eAO1BXl(0xcd)),l1MNv1(0x5d),l1MNv1(eAO1BXl(0xcb)),l1MNv1(0x5f),l1MNv1(eAO1BXl(0xe0)),l1MNv1(0x61),l1MNv1(eAO1BXl(0xe1)),l1MNv1(0x63),l1MNv1(eAO1BXl(0x1ed)),l1MNv1(eAO1BXl(0xdf)),l1MNv1(0x60),l1MNv1(0x5e),l1MNv1(eAO1BXl(0x39)),'Z|<]#X{j4{7kW5',l1MNv1(eAO1BXl(0x3a)),l1MNv1(0x67),l1MNv1(0x63),l1MNv1(0x64),l1MNv1(0x68),l1MNv1(0x69),l1MNv1(eAO1BXl(0x38)),l1MNv1(0x51),l1MNv1(0x60),l1MNv1(0x6a),l1MNv1(eAO1BXl(0xe8)),l1MNv1(eAO1BXl(0xbb)),l1MNv1(eAO1BXl(0x39)),l1MNv1(0x6d),l1MNv1(0x6e),l1MNv1(eAO1BXl(0xea)),l1MNv1(0x64),l1MNv1(0x70),l1MNv1(0x71),l1MNv1(0x72),l1MNv1(eAO1BXl(0x3a)),l1MNv1(0x59),l1MNv1(eAO1BXl(0xed)),l1MNv1(0x74),'\u007d\u002a\u0028\u0062\u0044\u007c\u0075\u0037\u006c\u0023\u0079\u007e\u0022\u0024\u0066\u0033\u0079\u0052\u0043\u0062\u0049',l1MNv1(0x43),l1MNv1(0x75),l1MNv1(eAO1BXl(0xa8)),l1MNv1(0x77),l1MNv1(0x78),l1MNv1(0x79),l1MNv1(0x7a),l1MNv1(0x7b),l1MNv1(0x7c),l1MNv1(0x1d),'\u0056\u006e\u005a\u002e\u005e\u0062\u0056\u0076\u0035\u0047\u0074\u005d\u003e\u0029\u0030\u0041\u007e\u0029\u0022\u0056\u0041\u004a\u0071\u0054\u0048\u004f\u0069\u007d\u0031\u002a\u0042\u0065\u007c\u0043',l1MNv1(eAO1BXl(0x57)),l1MNv1(0x47),l1MNv1(eAO1BXl(0x3b)),l1MNv1(eAO1BXl(0x36)),l1MNv1(eAO1BXl(0x56)),l1MNv1(0x7f),l1MNv1(0x48),l1MNv1(0x80),l1M
// 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