KR/jd_wxTeam.js

26 lines
88 KiB
JavaScript
Raw Normal View History

2023-08-01 16:47:55 +08:00
/*
活动名称组队瓜分奖品 · 超级无线/超级会员
活动链接https://lzkj-isv.isvjd.com/wxTeam/activity/activity?activityId=<活动id>
https://cjhydz-isv.isvjcloud.com/wxTeam/activity?activityId=<活动id>
环境变量jd_wxTeam_activityUrl // 活动链接(必填)
jd_wxTeam_joinMember // 是否入会true/false默认不入会
jd_wxTeam_Notify // 是否推送通知true/false默认不推送
2023-08-05 19:19:49 +08:00
jd_wxTeam_Concurrent // 是否启用并发模式true/false默认不开启
jd_wxTeam_maxConcurrency // 控制最大并发线程数默认3
2023-08-01 16:47:55 +08:00
队长无效或无法创建战队时会退出执行
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#组队瓜分奖品
1 1 1 1 * jd_wxTeam.js, tag=组队瓜分奖品, enabled=true
*/
const $ = new Env('组队瓜分奖品(超级无线/超级会员)')
2023-08-06 19:11:07 +08:00
var version_='jsjiami.com.v7';const i1i1iI=iii1II;(function(i11Ii,iII1I,iilli1,ilI1l1,Iil1l,Iil1i,i1i1i1){return i11Ii=i11Ii>>0x8,Iil1i='hs',i1i1i1='hs',function(iiiIli,IllIl,IllIi,IIli,iII11){const iilllI=iii1II;IIli='tfi',Iil1i=IIli+Iil1i,iII11='up',i1i1i1+=iII11,Iil1i=IllIi(Iil1i),i1i1i1=IllIi(i1i1i1),IllIi=0x0;const iilll1=iiiIli();while(!![]&&--ilI1l1+IllIl){try{IIli=parseInt(iilllI(0x18b,'YIwD'))/0x1*(parseInt(iilllI(0x456,'*N5i'))/0x2)+-parseInt(iilllI(0x2dd,'h^C4'))/0x3+parseInt(iilllI(0x51c,'GwJ6'))/0x4+parseInt(iilllI(0x58b,'f7%d'))/0x5*(parseInt(iilllI(0x32e,'5*&B'))/0x6)+-parseInt(iilllI(0x363,'QazA'))/0x7*(parseInt(iilllI(0x57a,'0$K4'))/0x8)+-parseInt(iilllI(0x557,'*N5i'))/0x9*(-parseInt(iilllI(0x2ab,'D0p4'))/0xa)+parseInt(iilllI(0x552,'Zjn%'))/0xb*(-parseInt(iilllI(0x2d9,'bVD@'))/0xc);}catch(l1iI11){IIli=IllIi;}finally{iII11=iilll1[Iil1i]();if(i11Ii<=ilI1l1)IllIi?Iil1l?IIli=iII11:Iil1l=iII11:IllIi=iII11;else{if(IllIi==Iil1l['replace'](/[LtQIGMuWCnYDgdKpeqHkV=]/g,'')){if(IIli===IllIl){iilll1['un'+Iil1i](iII11);break;}iilll1[i1i1i1](iII11);}}}}}(iilli1,iII1I,function(l1I11,i11I1,IlIiI,l1iI1I,ilI1i1,l1I1I,l1lII1){return i11I1='\x73\x70\x6c\x69\x74',l1I11=arguments[0x0],l1I11=l1I11[i11I1](''),IlIiI='\x72\x65\x76\x65\x72\x73\x65',l1I11=l1I11[IlIiI]('\x76'),l1iI1I='\x6a\x6f\x69\x6e',(0x137fff,l1I11[l1iI1I](''));});}(0xc000,0xc1829,Iii11l,0xc2),Iii11l)&&(version_=Iii11l);function iii1II(_0x330bd0,_0x350182){const _0x47e65d=Iii11l();return iii1II=function(_0x170c5f,_0x2fc755){_0x170c5f=_0x170c5f-0x189;let _0x304d6e=_0x47e65d[_0x170c5f];if(iii1II['LAbUSa']===undefined){var _0x2e2fa3=function(_0x165d70){const _0x5a9500='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4a391b='',_0x5682b7='';for(let _0x2a247d=0x0,_0x51a367,_0x503a55,_0x501165=0x0;_0x503a55=_0x165d70['charAt'](_0x501165++);~_0x503a55&&(_0x51a367=_0x2a247d%0x4?_0x51a367*0x40+_0x503a55:_0x503a55,_0x2a247d++%0x4)?_0x4a391b+=String['fromCharCode'](0xff&_0x51a367>>(-0x2*_0x2a247d&0x6)):0x0){_0x503a55=_0x5a9500['indexOf'](_0x503a55);}for(let _0x4813a8=0x0,_0x51100b=_0x4a391b['length'];_0x4813a8<_0x51100b;_0x4813a8++){_0x5682b7+='%'+('00'+_0x4a391b['charCodeAt'](_0x4813a8)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5682b7);};const _0x5d3a9d=function(_0x1d6a7b,_0xe2cfef){let _0x1e5c94=[],_0x56fca9=0x0,_0x3bfe93,_0x587026='';_0x1d6a7b=_0x2e2fa3(_0x1d6a7b);let _0xb4218c;for(_0xb4218c=0x0;_0xb4218c<0x100;_0xb4218c++){_0x1e5c94[_0xb4218c]=_0xb4218c;}for(_0xb4218c=0x0;_0xb4218c<0x100;_0xb4218c++){_0x56fca9=(_0x56fca9+_0x1e5c94[_0xb4218c]+_0xe2cfef['charCodeAt'](_0xb4218c%_0xe2cfef['length']))%0x100,_0x3bfe93=_0x1e5c94[_0xb4218c],_0x1e5c94[_0xb4218c]=_0x1e5c94[_0x56fca9],_0x1e5c94[_0x56fca9]=_0x3bfe93;}_0xb4218c=0x0,_0x56fca9=0x0;for(let _0x51d990=0x0;_0x51d990<_0x1d6a7b['length'];_0x51d990++){_0xb4218c=(_0xb4218c+0x1)%0x100,_0x56fca9=(_0x56fca9+_0x1e5c94[_0xb4218c])%0x100,_0x3bfe93=_0x1e5c94[_0xb4218c],_0x1e5c94[_0xb4218c]=_0x1e5c94[_0x56fca9],_0x1e5c94[_0x56fca9]=_0x3bfe93,_0x587026+=String['fromCharCode'](_0x1d6a7b['charCodeAt'](_0x51d990)^_0x1e5c94[(_0x1e5c94[_0xb4218c]+_0x1e5c94[_0x56fca9])%0x100]);}return _0x587026;};iii1II['HhAkbP']=_0x5d3a9d,_0x330bd0=arguments,iii1II['LAbUSa']=!![];}const _0x5d4cd7=_0x47e65d[0x0],_0x364b5b=_0x170c5f+_0x5d4cd7,_0x593ac8=_0x330bd0[_0x364b5b];return!_0x593ac8?(iii1II['sTlbnS']===undefined&&(iii1II['sTlbnS']=!![]),_0x304d6e=iii1II['HhAkbP'](_0x304d6e,_0x2fc755),_0x330bd0[_0x364b5b]=_0x304d6e):_0x304d6e=_0x593ac8,_0x304d6e;},iii1II(_0x330bd0,_0x350182);}const illI11=require(i1i1iI(0x493,'n(Ee')),ll11Ii=require(i1i1iI(0x1f7,'pc%)')),ll11Il=require('./function/sendJDNotify'),i11lI=require(i1i1iI(0x258,'2[l5')),Illl1=require('./function/krh5st'),iii1I=process['env'][i1i1iI(0x425,'pc%)')]||'',iliII=process[i1i1iI(0x19d,'U%A5')]['jd_wxTeam_joinMember']===i1i1iI(0x1e7,'AjuC'),ii1i1I=process[i1i1iI(0x263,'D0p4')][i1i1iI(0x21e,'Mx@s')]===i1i1iI(0x4bc,'h^C4'),liIlI1=process[i1i1iI(0x1c9,'Zjn%')][i1i1iI(0x56a,'YIwD')]===i1i1iI(0x4c0,'f7%d'),iillIl=process['env'][i1i1iI(0x1a3,'3)X*')]||'3';let
2023-08-01 16:47:55 +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