faker3/jd_new_task.js

26 lines
133 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
新东东农场任务
种植任务浇水
环境变量
jd_XinFarm_plantSkuId // 需要种植的作物ID详见脚本打印
jd_XinFarm_autoPlant // 种植模式 默认自动种植,自动随机种植等级价值最高的物品
jd_XinFarm_waternum // 浇水次数,默认 10次 自行修改
jd_XinFarm_retainWater // 快速浇水,默认不开启(有水滴门槛,满足要求后开启才会生效)
jd_XinFarm_Notify // 是否推送通知true/false默认不推送
代理变量
支持API 代理池 具体请查看 Wiki
2024.3.6 建议上代理
cron:45 2-22/6 * * *
*/
const $ = new Env('新东东农场任务')
var il='jsjiami.com.v7';const I1iI=iii1II;if(function(lliII,iiiiI,iiIlIl,iiIlIi,iIlIli,iIlIll,il11I1){return lliII=lliII>>0x3,iIlIll='hs',il11I1='hs',function(lll1i1,iIl11l,I1ii,I1il,I1Iiil){const IlIili=iii1II;I1il='tfi',iIlIll=I1il+iIlIll,I1Iiil='up',il11I1+=I1Iiil,iIlIll=I1ii(iIlIll),il11I1=I1ii(il11I1),I1ii=0x0;const I1Iiii=lll1i1();while(!![]&&--iiIlIi+iIl11l){try{I1il=parseInt(IlIili(0x1e1,'bLYY'))/0x1*(parseInt(IlIili(0x1da,'kRS['))/0x2)+-parseInt(IlIili(0x482,'i@xn'))/0x3+-parseInt(IlIili(0x285,'oyv$'))/0x4+parseInt(IlIili(0x3cf,'11dd'))/0x5+parseInt(IlIili(0x522,'@Kqq'))/0x6+parseInt(IlIili(0x1e5,'dK9O'))/0x7*(parseInt(IlIili(0x54a,'SHv]'))/0x8)+-parseInt(IlIili(0x600,'SHv]'))/0x9*(-parseInt(IlIili(0x272,'Mg$B'))/0xa);}catch(lIIliI){I1il=I1ii;}finally{I1Iiil=I1Iiii[iIlIll]();if(lliII<=iiIlIi)I1ii?iIlIli?I1il=I1Iiil:iIlIli=I1Iiil:I1ii=I1Iiil;else{if(I1ii==iIlIli['replace'](/[WyDFAnxgUlQKwBEITY=]/g,'')){if(I1il===iIl11l){I1Iiii['un'+iIlIll](I1Iiil);break;}I1Iiii[il11I1](I1Iiil);}}}}}(iiIlIl,iiiiI,function(IiI111,i11llI,iIIi1,iIiIIl,iIiIIi,IlIill,iiI1I1){return i11llI='\x73\x70\x6c\x69\x74',IiI111=arguments[0x0],IiI111=IiI111[i11llI](''),iIIi1=`\x72\x65\x76\x65\x72\x73\x65`,IiI111=IiI111[iIIi1]('\x76'),iIiIIl=`\x6a\x6f\x69\x6e`,(0x16ec21,IiI111[iIiIIl](''));});}(0x608,0xe4e4c,Iii11l,0xc3),Iii11l){}const jdCookie=require(I1iI(0x2bd,'il$L')),notify=require(I1iI(0x3e7,'WM2J')),common=require(I1iI(0x21f,'yGNi')),{H5st}=require('./utils/Rebels_H'),CryptoJS=require(I1iI(0x107,'sFII')),querystring=require('querystring');console[I1iI(0x1d0,'*RZC')](''),console['log'](I1iI(0x52f,'SqLq')+$[I1iI(0x184,'KYtB')]+I1iI(0x3e4,'exYa')),console['log'](I1iI(0x1f9,'z%%b')),console[I1iI(0x4b2,'kRS[')](I1iI(0x39f,'0%so')),console[I1iI(0x2c5,'[)vG')](I1iI(0x689,'11dd')),console['log'](I1iI(0x6c6,'lc(%')),console['log'](I1iI(0x33f,'lc(%')),console['log']('=========='+$[I1iI(0x30d,'0%so')]+I1iI(0x2be,'iCdQ')),console[I1iI(0x1c9,'dK9O')]('');const autoPlant=!(process[I1iI(0x1a6,'B%6T')][I1iI(0x573,'Lo*N')]===I1iI(0x6ae,'RCrL')),waternum=process[I1iI(0x168,'kRS[')][I1iI(0x3c8,'SmzW')]||'10',plantSkuId=process['env'][I1iI(0x1c3,'aH6A')]||'',retainWater=process[I1iI(0x63a,'zIDY')][I1iI(0x55f,'WM2J')]===I1iI(0x381,'Gr0r'),isNotify=process['env']['jd_XinFarm_Notify']==='true',sign_linkId=I1iI(0x4de,'yGNi'),draw_linkId=I1iI(0x5d9,'i@xn'),award_map={0x1:'水滴',0x2:'水滴'};let cookie='';const cookiesArr=Object[I1iI(0x35c,'8O3M')](jdCookie)[I1iI(0x417,'lc(%')](iII1i=>jdCookie[iII1i])[I1iI(0x261,'zIDY')](ilI1ii=>ilI1ii);!cookiesArr[0x0]&&($[I1iI(0x5ef,'0%so')]($[I1iI(0x331,'zIDY')],I1iI(0x535,'Mg$B')),process[I1iI(0x5d2,'bLYY')](0x1));!(async()=>{const I1IiiI=I1iI,iII1l={'yCyXS':function(i11Il,i11Ii){return i11Il!==i11Ii;},'vIacv':'vslew','VyLAf':function(iII1I,iilli1){return iII1I+iilli1;},'lwfKy':'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx','hJSNq':function(ilI1l1,Iil1l){return ilI1l1*Iil1l;},'IsfpQ':'\x20➜\x20','CxpIm':function(Iil1i,i1i1i1){return Iil1i===i1i1i1;},'ejhjF':I1IiiI(0xf0,'yNfK')};notify[I1IiiI(0x67a,'sFII')]({'title':$['name']});for(let iiiIli=0x0;iiiIli<cookiesArr['length'];iiiIli++){if(iII1l[I1IiiI(0x10d,'Mg$B')](iII1l[I1IiiI(0x658,'TJ2U')],I1IiiI(0x42d,'[)vG'))){$[I1IiiI(0x19e,'a9Rj')]=iII1l[I1IiiI(0x62e,'kRS[')](iiiIli,0x1),cookie=cookiesArr[iiiIli],common['setCookie'](cookie),$['UserName']=decodeURIComponent(common['getCookieValue'](cookie,I1IiiI(0x22c,'z%%b'))),$['UA']=common[I1IiiI(0x2c8,'exYa')]($['UserName']),$[I1IiiI(0x139,'RaO3')]=common[I1IiiI(0x41e,'sFII')](iII1l[I1IiiI(0xf9,'[)vG')]),$[I1IiiI(0x66c,'a9Rj')]=notify[I1IiiI(0x544,'aH6A')]($[I1IiiI(0x3ae,'a4Kz')],$[I1IiiI(0x14c,'@Kqq')]),$[I1IiiI(0x257,'KYtB')]='',console['log'](I1IiiI(0x656,'SmzW')+$[I1IiiI(0x670,'SqLq')]+'】'+($['nickName']||$['UserName'])+'******\x0a'),await Main(),common['unsetCookie']();if($[I1IiiI(0x192,'lc(%')])break;await $[I1IiiI(0x16d,'11dd')](parseInt(iII1l[I1IiiI(0x673,'RCrL')](Math[I1IiiI(0x3a5,'bseJ')](),0x3e8)+0x3e8,0xa));}else il1lI[I1IiiI(0x171,'LzrV')](IliIIl[I1IiiI(0x15f,'WM2J')]?.[I1IiiI(0x6db,'i@xn')]);}const ilI1il=notify[I1Ii
// 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