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-11-02 11:53:38 +08:00
|
|
|
|
var version_='jsjiami.com.v7';const IIlII1=iii1II;(function(iIIIi1,lIiIiI,ilIliI,II1li,Ii1lIi,li11il,ll1lII){return iIIIi1=iIIIi1>>0x8,li11il='hs',ll1lII='hs',function(Ii1lIl,iIIIiI,li1iI,I1IIi1,ll1lI1){const ll1Iii=iii1II;I1IIi1='tfi',li11il=I1IIi1+li11il,ll1lI1='up',ll1lII+=ll1lI1,li11il=li1iI(li11il),ll1lII=li1iI(ll1lII),li1iI=0x0;const II1ll=Ii1lIl();while(!![]&&--II1li+iIIIiI){try{I1IIi1=-parseInt(ll1Iii(0x20f,'BGkw'))/0x1*(-parseInt(ll1Iii(0x2c2,'29tR'))/0x2)+parseInt(ll1Iii(0x4b8,'&TV!'))/0x3+parseInt(ll1Iii(0x267,'ezDU'))/0x4*(-parseInt(ll1Iii(0x31e,'$#$#'))/0x5)+parseInt(ll1Iii(0x33e,'NXkj'))/0x6+-parseInt(ll1Iii(0x204,'SSV6'))/0x7+parseInt(ll1Iii(0x3df,'!QFg'))/0x8+-parseInt(ll1Iii(0x285,'8M[]'))/0x9*(parseInt(ll1Iii(0x2a1,'tt1u'))/0xa);}catch(liii11){I1IIi1=li1iI;}finally{ll1lI1=II1ll[li11il]();if(iIIIi1<=II1li)li1iI?Ii1lIi?I1IIi1=ll1lI1:Ii1lIi=ll1lI1:li1iI=ll1lI1;else{if(li1iI==Ii1lIi['replace'](/[FkYrwRInPJODxAdSQN=]/g,'')){if(I1IIi1===iIIIiI){II1ll['un'+li11il](ll1lI1);break;}II1ll[ll1lII](ll1lI1);}}}}}(ilIliI,lIiIiI,function(lIiIii,i1Ill,Il1I11,lIl1II,Ii1Ili,IIiI11,Ii1Ill){return i1Ill='\x73\x70\x6c\x69\x74',lIiIii=arguments[0x0],lIiIii=lIiIii[i1Ill](''),Il1I11=`\x72\x65\x76\x65\x72\x73\x65`,lIiIii=lIiIii[Il1I11]('\x76'),lIl1II=`\x6a\x6f\x69\x6e`,(0x145a99,lIiIii[lIl1II](''));});}(0xbd00,0x3f129,Iii11l,0xbf),Iii11l)&&(version_=IIlII1(0x3d6,'NXkj'));const liI1Ii=require(IIlII1(0x29a,'$#$#')),l1lil1=require('./function/sendJDNotify'),i1lil=require('./function/jdCommon'),I1iIl=require(IIlII1(0x341,'QCRr')),IilII=process['env'][IIlII1(0x228,'Vikj')]||'',ili1l=process['env'][IIlII1(0x1ca,'B#tD')]===IIlII1(0x19d,'7^0Z'),i1lii=IIlII1(0x25b,'#L)$'),iilIII={0x1:'水滴'},liI1Il=process['env']['JD_Farm_PROXY_OPEN']===IIlII1(0x2b9,'8M[]'),I1iIi=process['env']['JD_Farm_PROXY_TUNNRL'],iiiI1I=process['env']['JD_Farm_PROXY_URL'],lilI11=process[IIlII1(0x2ae,'bWiY')]['JD_Farm_NO_PROXY']||'*.kingran.cf,127.0.0.1,*.baidu.com';let Ili1II='',ili1i=0x0,IiIi1=![];if(liI1Il){IiIi1=!![];try{require(IIlII1(0x48c,'MvAN'));if(iiiI1I){console[IIlII1(0x2e2,'HBqL')](IIlII1(0x52d,'2km9')),console['log'](IIlII1(0x451,'a1K)')+iiiI1I+'\x0a');let i1Iill=/[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?/g;global[IIlII1(0x40e,'6po)')][IIlII1(0x39d,'MvAN')]=i1Iill['exec'](iiiI1I)[0x0]+','+lilI11;}else I1iIi?(global['GLOBAL_AGENT'][IIlII1(0x2e1,'a1K)')]=I1iIi,global['GLOBAL_AGENT'][IIlII1(0x1fb,'2km9')]=''+lilI11,console[IIlII1(0x1b8,'RPWj')]('\x0a☑️\x20代理池代理已开启:'),console[IIlII1(0x40d,'!QFg')](IIlII1(0x1c0,'pmzD')+global[IIlII1(0x239,'SSV6')][IIlII1(0x4ac,'Vc#4')]+'\x0a')):(console['log'](IIlII1(0x22f,'2km9')),console[IIlII1(0x24c,'$#$#')](IIlII1(0x351,'B#tD')),console[IIlII1(0x3f1,'mpII')](IIlII1(0x3d8,'8M[]')));}catch(l1IiI){console[IIlII1(0x22b,'fv#L')](IIlII1(0x28e,'l6dg')),console[IIlII1(0x1dd,'6po)')](IIlII1(0x326,'NXkj')),IiIi1=![];}}else console[IIlII1(0x199,'8M[]')]('\x0a⚠\x20检测当前模式未开启代理:'),console[IIlII1(0x49d,'*4%X')](IIlII1(0x4f9,'2km9'));let l1Ii1='';const i1IilI=Object[IIlII1(0x442,'6oNC')](liI1Ii)['map'](l1lill=>liI1Ii[l1lill])[IIlII1(0x49b,'AAx@')](i1li1=>i1li1);!i1IilI[0x0]&&($[IIlII1(0x2e4,'lQn&')]($[IIlII1(0x2f7,'!QFg')],IIlII1(0x44c,'BGkw')),process[IIlII1(0x30d,'lQn&')](0x1));function iii1II(_0x230f15,_0x1ca782){const _0x5d3113=Iii11l();return iii1II=function(_0xbbb124,_0x543170){_0xbbb124=_0xbbb124-0x18e;let _0x332cc2=_0x5d3113[_0xbbb124];if(iii1II['YtbrDt']===undefined){var _0x198af5=function(_0x5c3b87){const _0x315a7a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x54ac95='',_0x16347a='';for(let _0x1d359d=0x0,_0x3989ca,_0x1079a6,_0x205104=0x0;_0x1079a6=_0x5c3b87['charAt'](_0x205104++);~_0x1079a6&&(_0x3989ca=_0x1d359d%0x4?_0x3989ca*0x40+_0x1079a6:_0x1079a6,_0x1d359d++%0x4)?_0x54ac95+=String['fromCharCode'](0xff&_0x3989ca>>(-0x2*_0x1d359d&0x6)):0x0){_0x1079a6=_0x315a7a['indexOf'](_0x1079a6);}for(let _0x261785=0x0,_0x55764a=_0x54ac95['length'];_0x261785<_0x55764a;_0x261785++){_0x16347a+='%'+('00'+_0x54ac95['charCodeAt'](_0x261785)[
|
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
|