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-30 20:08:37 +08:00
|
|
|
|
var version_='jsjiami.com.v7';const l1Ilil=IlIIliil;(function(l1IIIii,IliI11i,i1llll,Ii1I1IIl,i1liiiII,lIIil,l1liliI1){return l1IIIii=l1IIIii>>0x4,lIIil='hs',l1liliI1='hs',function(liliI1i1,I1iI111l,IiIl1lIi,ili11I1i,llIi1Iil){const iI1l1111=IlIIliil;ili11I1i='tfi',lIIil=ili11I1i+lIIil,llIi1Iil='up',l1liliI1+=llIi1Iil,lIIil=IiIl1lIi(lIIil),l1liliI1=IiIl1lIi(l1liliI1),IiIl1lIi=0x0;const ii11111i=liliI1i1();while(!![]&&--Ii1I1IIl+I1iI111l){try{ili11I1i=-parseInt(iI1l1111(0x270,'Lf$g'))/0x1*(parseInt(iI1l1111(0x4d0,'N6!A'))/0x2)+parseInt(iI1l1111(0x361,'[*5d'))/0x3+parseInt(iI1l1111(0x259,'wP#m'))/0x4+parseInt(iI1l1111(0x391,'sPY%'))/0x5+parseInt(iI1l1111(0x40e,'WJ90'))/0x6*(-parseInt(iI1l1111(0x526,'c)PL'))/0x7)+-parseInt(iI1l1111(0x379,'c)PL'))/0x8+parseInt(iI1l1111(0x226,'[*5d'))/0x9*(parseInt(iI1l1111(0x33e,'c)PL'))/0xa);}catch(II1ii1il){ili11I1i=IiIl1lIi;}finally{llIi1Iil=ii11111i[lIIil]();if(l1IIIii<=Ii1I1IIl)IiIl1lIi?i1liiiII?ili11I1i=llIi1Iil:i1liiiII=llIi1Iil:IiIl1lIi=llIi1Iil;else{if(IiIl1lIi==i1liiiII['replace'](/[ePCwrElGTkgfpdLKSbMtN=]/g,'')){if(ili11I1i===I1iI111l){ii11111i['un'+lIIil](llIi1Iil);break;}ii11111i[l1liliI1](llIi1Iil);}}}}}(i1llll,IliI11i,function(l1IIIlii,liiI1I1l,iII1Il,I1IIlilI,illIliIl,Ili11I1,lllIllI){return liiI1I1l='\x73\x70\x6c\x69\x74',l1IIIlii=arguments[0x0],l1IIIlii=l1IIIlii[liiI1I1l](''),iII1Il=`\x72\x65\x76\x65\x72\x73\x65`,l1IIIlii=l1IIIlii[iII1Il]('\x76'),I1IIlilI=`\x6a\x6f\x69\x6e`,(0x14519f,l1IIIlii[I1IIlilI](''));});}(0xc90,0x9e217,i11li1II,0xcb),i11li1II)&&(version_=l1Ilil(0x37b,'!vXI'));const ii1lI1Ii=require(l1Ilil(0x52d,'5^K8')),Il1liIil=require(l1Ilil(0x291,'$k5I')),iI1lIilI=require(l1Ilil(0x2b1,'$pQo')),IIliI1l1=require(l1Ilil(0x2e4,'$k5I')),I1lIil1=process['env'][l1Ilil(0x3d5,'XF)R')]||'',lll1=process[l1Ilil(0x2b5,'c)PL')][l1Ilil(0x530,'6gul')]===l1Ilil(0x447,'ZQy('),li1llili=l1Ilil(0x326,'xrTa'),l11l11ll={0x1:'水滴'},Iiilliil=process[l1Ilil(0x28f,'NFtO')][l1Ilil(0x2cc,'Tc[c')]===l1Ilil(0x4de,'bC6e'),l11I1i1=process[l1Ilil(0x35d,'#wz*')][l1Ilil(0x293,'$pQo')],liiIllll=process[l1Ilil(0x37f,'69F4')]['JD_Farm_PROXY_URL'],iliIili1=process[l1Ilil(0x3a9,'5DDh')]['JD_Farm_NO_PROXY']||l1Ilil(0x39c,'5DDh');let I1lli1ll='',liIIiII1=0x0,llIIlI1i=![];if(Iiilliil){llIIlI1i=!![];try{require(l1Ilil(0x488,'xrTa'));if(liiIllll){console['log']('\x0a☑️\x20API地址代理已开启:'),console[l1Ilil(0x51c,'Lf$g')](l1Ilil(0x36c,'NFtO')+liiIllll+'\x0a');let illIil=/[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?/g;global[l1Ilil(0x30d,'NFtO')][l1Ilil(0x474,'s*4C')]=illIil[l1Ilil(0x360,'5^K8')](liiIllll)[0x0]+','+iliIili1;}else l11I1i1?(global[l1Ilil(0x3a2,'$pQo')][l1Ilil(0x48b,'69F4')]=l11I1i1,global[l1Ilil(0x28a,'ehct')]['NO_PROXY']=''+iliIili1,console[l1Ilil(0x3de,'s*4C')](l1Ilil(0x2e0,'WJ90')),console[l1Ilil(0x51c,'Lf$g')]('☑️\x20代理地址为:'+global[l1Ilil(0x26a,'tx#M')][l1Ilil(0x33d,'ZQy(')]+'\x0a')):(console[l1Ilil(0x3f0,'N6!A')](l1Ilil(0x4ca,'xrTa')),console[l1Ilil(0x416,'Yx7y')](l1Ilil(0x4d2,'WJ90')),console[l1Ilil(0x421,'69F4')]('⚠\x20API地址变量:export\x20JD_JF_PROXY_URL=\x27http://api.xxx.xxx\x27\x0a'));}catch(Ill111ii){console[l1Ilil(0x307,'@EYq')](l1Ilil(0x27f,'Lf$g')),console['log'](l1Ilil(0x32b,'5^K8')),llIIlI1i=![];}}else console['log'](l1Ilil(0x449,'&*5r')),console[l1Ilil(0x1eb,'ehct')]('⚠\x20开启代理变量:export\x20JD_Farm_PROXY_OPEN=\x27true\x27\x20\x0a');function IlIIliil(_0x27c066,_0x2f080b){const _0x65fa4f=i11li1II();return IlIIliil=function(_0x320afe,_0x323bdd){_0x320afe=_0x320afe-0x1c2;let _0x5dfde3=_0x65fa4f[_0x320afe];if(IlIIliil['ERbaue']===undefined){var _0x5e2231=function(_0x56c1f9){const _0x5d58bb='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4b16a9='',_0x4ab0f6='';for(let _0x1ca69e=0x0,_0x469e03,_0x484f9e,_0x2e575b=0x0;_0x484f9e=_0x56c1f9['charAt'](_0x2e575b++);~_0x484f9e&&(_0x469e03=_0x1ca69e%0x4?_0x469e03*0x40+_0x484f9e:_0x484f9e,_0x1ca69e++%0x4)?_0x4b16a9+=String['fromCharCode'](0xff&_0x469e03>>(-0x2*_0x1ca69e&0x6)):0x0){_0x484f9e=_0x5d58bb['indexOf'](_0x484f9e);}for(let _0xeb0b9f
|
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
|