mirror of https://github.com/KingRan/KR.git
11 lines
46 KiB
JavaScript
11 lines
46 KiB
JavaScript
|
/*
|
||
|
新东东农场幸运转盘
|
||
|
|
||
|
cron "55 5 * * *" script-path=jd_dongDongFarm_draw.js, tag=新东东农场幸运转盘
|
||
|
|
||
|
*/
|
||
|
const $ = new Env('新东东农场幸运转盘')
|
||
|
var version_='jsjiami.com.v7';function I1ilIiIi(){const ili1IIii=(function(){return[...[version_,'LjlusCjgiuaudmqRiDME.nEXcQJoWmBl.CSQvGr7==','WP8fWPtdO8kMkeldQW','b8k2na','FSoQW5lcR8kHW7zq','xCkpWR1I','qCkusq','WR13ctvtk8kvW6y5WQudi8obWO8MW4izW4VdTuS','hmo/WPRcNZRcJrPsWPaWW4qWgca','pdZdPWay','W7jiW4WEWRO','WQSMWQ4','A1VdTgfTW5q7W6a','rCo2iexdTG9muSk/W5dcRaO','EtldG8k0zG','W5TGgdpdUW','WOhcGCkvWOhcNmkQWRtcSIjvWR5ZW6W','WRNcSbn5nvWRFmoPoSk6xgFdNCkPxCo7WPBcQ1PJhCk5WOPFWO5CbCoLvCkIWQNdHa','c8kqWQbFdqnYWR8/WOroWOW','Emkoq8kV','nSoHkHGSo3vlfCkHlgDLW4KjWOKDvIlcQG','vSk9hNxcGq','WQ8JkuyA','WORcG8okumkdDvxdGLe2','xehdG3S','W5ZdNCoa','W7tdMSol','W5RdKXldGG','cIZcQtas','oslcIIKoW73dJmkPW58','5lM55lIF6lwB5y6Y','W5PcjJtdTW','W6RdScbkW4pcVK7dQc3dJ8kpvgqLW7XvxYFdQZ19d3TlhmkBW63dKbDc','i8kmWPH/W6xcOq','5lUJ5lQX5P215yMH5zMI6kYC6zwu5PAa5O6n5lMQ56Q+77YO6kY75QcF5P+N6iA56lQL6k2I5AwH57+b57Qm5OcE5yAo','WPNdHa7dQSkTW5PqpmofW5TKvta','WObWgdDUCmoxWQW','d8k4j0e','W6NdS1eNAGL9z8otnSkNpvu','nSk7WQH5W6a','lCoHlaeXzJmcdq','W6tdPCoMW6hdHa','rmkZtWCR','DmkfWQ5/WRm','W7FdVrddGe4','WRFcMContG','WRTIeca','xd7dOfa','A1ON','v8kgxmoG','s8kMW6GNWR4','W5ddG8oZqmkYC1tdJG','W43cHutcKCoVWO8','fwJcQXfFWQngCSohW74UzrC','W7pdHSocW4hdIq','kc3dGZPmEmkB','v8o6WR59eq','laJdQMTy','W51XW68QWR3cS0VdNmoIkf/cLL3cKJTyW5PEaWxdUSkphSkKW6r/AGSVaCovBGO9g0JdVZ1SWR3cRrFcGSotWPpdLSoXbvdcSJv2t0JcGbCHDCoYD8ovcrxdRLuHhCkBc8keWQZdQLRdVe9WWR7dPSkgDSoavCoGcq','FCo3W5lcP8kZW7i','hJhdJtGB','lCkSWRLdW48','5B2V5yU85OMp5Awe5Q2s5PA077+z','W4FdNCoZW4ldRW','W7BcQSkJxmkB','WR0xWPJdPq','W6RcLmkGFmkJ','5OUw5lU0772j','W5VdQ8ospNddHG','W47cGCkOw8kT','WQjGW5j4WOddQSo8xrJdQ1lcMH7cIeHGWQpcUuagjKe','AwC4rSou','5A6Y5OUW5lII5yQM5AE16lECiG','wCoiW70k','h8k4ieVdJaj2uCkU','isNdMHC','yKG0Cq','v8owW74KtG','W7a7WRpdOmkcW6ZcRq','5A2S5OQ65lU35yI+5AsA6lEviW','AMNdT8ohW5W','W5ldMq/dLa','kSoFcSknECoe','d8krm0tcRa','W4RdNmoqW5FdMG','WQDvWPxdNSko','gtZdIf1O','F8otWPLcmG','DSo/W7tcSmkL','wSkTfvtcNmk1','DmkyW485WQtdRa','sSkbWQPSWOlcKgdcO8onWQC9dq','umoDW5SLAa','W5BdJCooumkVDW','W5JcLKtcVCoXWPS','W43dP8ocxCkb','WPfMpI5P','W4JdHmocamkIrvxdMv09','W4FdPCoh','xSoJW4FcNmkk','W7jMds3dGW','W7VdP3ldQmo+','W4NcH0BcSmo5','fmk7n1BcHq','mSkoWP5qW5i','g8ogWQtcKHa','DSkpW4KqWRBdV2C','yCklW48hWRi','WRCgWPVdKSkE','DhZdJcNcHq','W7bJW6inWOO','rILXWRpdQ8oNW7GKCSo/WQKGCq','hSoXWOpcJG','rmkWWQTwWPe','W5FdOmoGW5pdN8opW4/dGIe','WQ/cH8oaxbRdP8k3WQe','D2JdILFcHG','WRpdQwpdJgu','ocBdI3Te','xKpdHq','WPldSbldMa','E8oLWRzloW','rhSpr8oKbaW','W4rlW5aGWRK','W5tdTCoGW4NdLa','W5JdNWldJNPaA8kksConWRORW7n9amoSWOdcUNO','BwBdQq','wmkFrHek','W7POda','WR7cKCorFmkF','W6FdU8o9W5hdMmonW6ZdOa','xCkgrCoK','W6zw5AEa6lA0W4LP5y6W5zMUWQyz','tCkxxHixW4bmW6/cMSkHzCoJyZNcL8kkiCkvWO8iWQrWW48rf8olhqlcOSoSW43dGSkr','bCkJb3RdVq','W5hcV0dcUCoE','WQ9Thaj5','A3eIq8o2','EYddN2iu','vSooW7qgtwj/WQm','EIhdNCkkCmow'],...(function(){return[...['x8kXl0/cNCkIc8kRcLRcKSowv8kb','uCk6BvJdGa','F8kdW54FWPNdQMTT','WQicWOxdOCkBCWdcOCoWvSouwLZcRSkXAJ3dULhcRGbtWQZdNLJcNKxcLCo8ya','W43dUSo2W5/dIq','wSkMW6GHWOi','x8kixmo1j0/dOsFdJSktdCkDWRGo','W5xdGmovW77dMCo7','kCk3WO7dMSoUWQq','W6VcKmkSwSkqFa','WQa6WOhdOSk6','W5zQW7qXWQFdRow2LUwNGUAxHMCgW4i','o8oKmtSM','b8kXymkwpq','oSo0kGK','FSkFvSoWjmks','W6pdVuZdQSoi','yg7dG8oJW5i','W4FcPmkKW5JcHG','WO/dOuJdIK8','y8oNzGldK1u7WPWGsSkpWOy','uMyjw8o6','x8ovW6SIsLy','y8kyEmkxeq','W6JcP8kixmkx','rmktwG4nWPKcWRtcKCkRASkIjYFdLSkoACkBWPGcWReRWOiegSoewX/dP8kRWONcPmovx3hdO8oltSkdWRfSWPxcGW','WPqkWRddOmkj','oYNdHbK/ySkbWQVdTvy/W5y','uSk9l1lcJSk5bSkbb0JcO8ofxSktDCk4WQPmWRC','fmoXWPRcIG','W4NcH0xcMmoZWRWbb8oA','zHNdOKKo','nqFdVh1f','WOiBWPddLCkn','W5BdU8oQzHS','WR0/WQ/dPmkI','5A2K5OMR5lQe5yQG5Awa6lwDW4u','y1SYxCoejG','dSk3jq','W6NdSSoOrbi','W5HKW6S','W53dNqldHG','W67cJmkwqCkrA0L0WPFcTNyJa8op','W77dNmocrcBdVmkn','5OUR5AAc5AwV6lsuW4S','ahhLPQlOTifhWRRLJ6hLM73cSSk1','vCoFWPf+bSkGWQy7','qd7dP1adW6GhxSoGW7qUFJxdUG','FCkfW5O','WQpcMColxmkG','W4JdHMNdKSooW690fdjjiHtcL8obaGtcSSo0WQ4','WOdcOCo8DSkc','t0/dHgO','u8knW444WOm','WQasWPa','zmk1nCkzuHW','WPBcM8ktbCo2q0ddMeehfq','psBdKvDt','W73dG8odW5RdVW','zSkzW7WYWOC','lSk0petdRq','5Q295P2t5l6c','ACkZm8kKuKfKWQXywu4nWOyXWQVcKYlcV8k7pG','
|
||
|
// 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
|