KR/jd_fruit_watering.js

11 lines
64 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
东东农场快速浇水
默认使用快速浇水卡成熟了自动收取红包和种植新的水果
11 11 11 11 * jd_fruit_watering.js, tag=东东农场快速浇水, enabled=true
*/
const $ = new Env('东东农场快速浇水');
2023-08-24 22:33:22 +08:00
var version_='jsjiami.com.v7';const _0xf6766e=_0x2ca2;(function(_0x11a7aa,_0x18c3ed,_0x1bbbf8,_0x4c164e,_0xa9940c,_0xcac975,_0x5538fd){return _0x11a7aa=_0x11a7aa>>0x2,_0xcac975='hs',_0x5538fd='hs',function(_0x3caf14,_0x50eab7,_0x1cfac2,_0x26b462,_0x16fe4b){const _0x23d327=_0x2ca2;_0x26b462='tfi',_0xcac975=_0x26b462+_0xcac975,_0x16fe4b='up',_0x5538fd+=_0x16fe4b,_0xcac975=_0x1cfac2(_0xcac975),_0x5538fd=_0x1cfac2(_0x5538fd),_0x1cfac2=0x0;const _0x487b56=_0x3caf14();while(!![]&&--_0x4c164e+_0x50eab7){try{_0x26b462=-parseInt(_0x23d327(0x1de,'WCGo'))/0x1+parseInt(_0x23d327(0x23d,'&DCi'))/0x2*(-parseInt(_0x23d327(0x31a,'$ka!'))/0x3)+parseInt(_0x23d327(0x1fa,'lkFc'))/0x4*(parseInt(_0x23d327(0x2ba,'Lz3e'))/0x5)+-parseInt(_0x23d327(0x315,'2)6#'))/0x6*(parseInt(_0x23d327(0x2fc,'tO%B'))/0x7)+-parseInt(_0x23d327(0x352,'#9Q('))/0x8*(parseInt(_0x23d327(0x391,'cw^O'))/0x9)+-parseInt(_0x23d327(0x2f2,'%0SW'))/0xa*(-parseInt(_0x23d327(0x380,'2)6#'))/0xb)+parseInt(_0x23d327(0x1be,'FQsH'))/0xc*(parseInt(_0x23d327(0x32e,'Dsm$'))/0xd);}catch(_0x20ab24){_0x26b462=_0x1cfac2;}finally{_0x16fe4b=_0x487b56[_0xcac975]();if(_0x11a7aa<=_0x4c164e)_0x1cfac2?_0xa9940c?_0x26b462=_0x16fe4b:_0xa9940c=_0x16fe4b:_0x1cfac2=_0x16fe4b;else{if(_0x1cfac2==_0xa9940c['replace'](/[hOWdeuBfnJTFGqCUXQHR=]/g,'')){if(_0x26b462===_0x50eab7){_0x487b56['un'+_0xcac975](_0x16fe4b);break;}_0x487b56[_0x5538fd](_0x16fe4b);}}}}}(_0x1bbbf8,_0x18c3ed,function(_0x1ff6db,_0x550998,_0x25f248,_0xf2cd2,_0x100d9c,_0x79f994,_0x3e74c0){return _0x550998='\x73\x70\x6c\x69\x74',_0x1ff6db=arguments[0x0],_0x1ff6db=_0x1ff6db[_0x550998](''),_0x25f248='\x72\x65\x76\x65\x72\x73\x65',_0x1ff6db=_0x1ff6db[_0x25f248]('\x76'),_0xf2cd2='\x6a\x6f\x69\x6e',(0x13afca,_0x1ff6db[_0xf2cd2](''));});}(0x30c,0xa50a3,_0x471c,0xc5),_0x471c)&&(version_=_0x471c);let _0x1f4779=[],_0x1d5c6f='',_0x26b6aa,_0x438d65='',_0xeecd40='',_0x1d460d='',_0x1c699a={},_0xcd3b55=![],_0x5974fe=![];const _0x19658a=process[_0xf6766e(0x170,'@0v3')]['FRUIT_PLANT_LEVEL']?process[_0xf6766e(0x170,'@0v3')][_0xf6766e(0x1d2,'6NBg')]:'2',_0x23cd12=require(_0xf6766e(0x194,'Dsm$')),_0x8fb23e=require(_0xf6766e(0x2de,'sdQk')),_0x49303f=require(_0xf6766e(0x258,'WCGo'));let _0x302730=_0x67cdb7(0x28),_0x4bdeef=_0x67cdb7(0xa,_0xf6766e(0x1ac,'pfTJ')),_0xe438a2=_0x67cdb7(0x20,'1234567890qwertyuiopasdfghjklzxcvbnm'),_0x4ccc0f=_0x67cdb7(0x2,'1234567890')+'-'+_0x67cdb7(0x4,'1234567890')+'-'+_0x67cdb7(0x4,'1234567890')+'-'+_0x67cdb7(0x5,'1234567890'),_0x7eb474=_0xf6766e(0x35c,'AyCF')+Math[_0xf6766e(0x39e,'rhL)')](Math[_0xf6766e(0x2e1,'7eC7')]()*0x383+0x64),_0x2e1895=_0xf6766e(0x206,'8zva')+Math['floor'](Math['random']()*0x383+0x64);const _0xd89477=_0xf6766e(0x1ad,'uQc)');!(async()=>{const _0x4ec6e7=_0xf6766e,_0x3cb526={'lzdzr':function(_0x20940b){return _0x20940b();},'dYqIF':function(_0x29532b,_0x5ab0e2){return _0x29532b!==_0x5ab0e2;},'nHgBL':_0x4ec6e7(0x230,'2)6#'),'DLpTg':_0x4ec6e7(0x262,'AyCF'),'AeyOR':_0x4ec6e7(0x25a,'rhL)'),'KLmnt':'CosBs','StSSj':function(_0x48d596,_0x3f4895){return _0x48d596(_0x3f4895);},'fiDRR':function(_0xbf1f39,_0x7ed81){return _0xbf1f39+_0x7ed81;},'hZGKw':function(_0x220a78,_0x208c07){return _0x220a78+_0x208c07;},'fccWN':_0x4ec6e7(0x2bb,'cw^O'),'sANvO':_0x4ec6e7(0x38a,'rQpM'),'FMJlH':'nqqgS','ncGkz':_0x4ec6e7(0x2e0,'9S1G'),'PtfkN':function(_0x1d41d8,_0x1ef621){return _0x1d41d8+_0x1ef621;},'MPekG':function(_0x1395d5,_0x245232){return _0x1395d5*_0x245232;}};await _0x3cb526[_0x4ec6e7(0x360,'Xpns')](_0x41a1e4);if(!_0x1f4779[0x0]){if(_0x3cb526['dYqIF'](_0x3cb526[_0x4ec6e7(0x2c8,'cw^O')],_0x3cb526[_0x4ec6e7(0x387,'t6u1')]))_0x2f585e[_0x4ec6e7(0x2b0,'OpdL')](_0x4ec6e7(0x1f6,')w!2')),_0xc3e3a6[_0x4ec6e7(0x213,'&DCi')](_0x4ec6e7(0x1fe,'BBd5')+_0xa643b8+'的'+_0x19e91f[_0x4ec6e7(0x3b6,'4s)P')]?.[_0x4ec6e7(0x1f4,'%D5I')]?.[_0x4ec6e7(0x1f2,'@0v3')]);else{$[_0x4ec6e7(0x351,'b[X)')]($[_0x4ec6e7(0x2ca,'AyCF')],_0x3cb526[_0x4ec6e7(0x207,'Dsm$')],_0x3cb526['AeyOR'],{'open-url':_0x4ec6e7(0x389,'P!jR')});return;}}console[_0x4ec6e7(0x223,'T0o%')](_0x4ec6e7(0x20a,'9S1G'));for(let _0x2d4052=0x0;_0x2d4052<_0x1f4779[_0x4ec6e7(0x1d5,'dxLT')];_0x2d4052++){i
2023-07-27 16:14:01 +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.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"])