您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
QOL and helper scripts for FarmRPG
当前为
// ==UserScript== // @name FarmRPG Helper // @namespace https://greasyfork.org/users/1114461 // @version 1.0.0 // @description QOL and helper scripts for FarmRPG // @author Fewfre // @license GNU GPLv3 // @homepage https://github.com/fewfre/farmrpg-helper/tree/main // @match https://farmrpg.com/ // @icon https://www.google.com/s2/favicons?sz=64&domain=farmrpg.com // @resource scriptStyle https://raw.githubusercontent.com/fewfre/farmrpg-helper/main/greasyfork/index.css // @grant GM_getResourceURL // @grant GM_addStyle // @grant unsafeWindow // ==/UserScript== var Ye = Object.defineProperty; var je = (s, e, t) => e in s ? Ye(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t; var O = (s, e, t) => (je(s, typeof e != "symbol" ? e + "" : e, t), t); (function () { const e = document.createElement("link").relList; if (e && e.supports && e.supports("modulepreload")) return; for (const i of document.querySelectorAll('link[rel="modulepreload"]')) n(i); new MutationObserver(i => { for (const r of i) if (r.type === "childList") for (const o of r.addedNodes) o.tagName === "LINK" && o.rel === "modulepreload" && n(o) }).observe(document, { childList: !0, subtree: !0 }); function t(i) { const r = {}; return i.integrity && (r.integrity = i.integrity), i.referrerPolicy && (r.referrerPolicy = i.referrerPolicy), i.crossOrigin === "use-credentials" ? r.credentials = "include" : i.crossOrigin === "anonymous" ? r.credentials = "omit" : r.credentials = "same-origin", r } function n(i) { if (i.ep) return; i.ep = !0; const r = t(i); fetch(i.href, r) } })(); var B; (s => { const e = window.myApp; function t(r, o) { e.onPageInit(r, o) } s.onPageInit = t; function n(r, o) { e.onPageBeforeRemove(r, o) } s.onPageBeforeRemove = n; function i() { e.mainView.router.refreshPage() } s.refreshPage = i })(B || (B = {})); var ie; (s => { s.SOUND_FINISHED = new Audio("data:audio/mpeg;base64,/+OIZAAmbgceBaxkAalUbdgBQXgADBlj4luzGczlAw1dwUqQuWXjSLWOxNnbO2drvUEWIxByHcch3IpdfyHL0rdty3Ld+f+5DD+O4/kYpKSnp5XG43G43G3/chyH8hyMRiMRiMQ+/7/v+/8Py/tSNy+33WHJW5a7F2NchyWUlJGIcd9/5f2pGIxLMaSkpIYdhnC7F2Nca+1td6p0x0Vy4ZgjmeicEBwPG0saBAOEe1SsChmOKaBxnGGUMAhEUHUj7W2vs4UwLgAAAwgjCALiK4nXAa5DljDCpY5hhvOnzzzzwwwqUlJSUlJL6enjcbjdPT28P/9YYVKSnp6enp886enpKSMUljDDCkjcvp88869PTxiMRiMRiWUlJSU9PT09PT09PT0lJSUlJSUlJSU9PT09vPPO3SUlJSUlJgAB4eHh4YAAAAAB4f////wAX////////////////xS99/++////////7w36sVjyJrN7316UpSlKXve973v/////e973v/73/////////9KPHjyJe79+/fx94ve973u/fqxWRMv1ezzvEPQ9Rq9/e/vSlHjx48ePI98MCcORDIpfw1AhhkRU+aZpnWzvHjx48ePKZgRKf/wGBD0PUavf3wwIYTsnZpnWh6jV6vUZ0IYhiGKAAQUDIqCldQGyEWJkUMEAAkAQOErkkQnR7ZOPAsMABaYCEYx8YDG61MCAlEcyEkjUogS/MVCYOFJhUAmNgqYZGxjdDmcIQTCAwoUDby9MjDcz/+OIZFIw5d86VM5sACsLwgWhgXgAcdBwW474phycoLgoKGuFBhwmg8DQUQihn1YYaEoCgIOGbFaAx5KWVOhAEbliBbXYCEAErCzswEHMNDUVRQEMMEFKVgjCAxYAeCn1lnKOMSiAUvGYRhStkS5GgPKXXCAMQgKIhYBEoDGQVAa8AcFpAviLAZgggYyEOGyRdLPTAAVPEy4cMYBAcQI6KVs9FAgwQVDhkwEdNV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qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq") })(ie || (ie = {})); function Qe(s, e) { return Math.random() * (e - s) + s } async function F(s, e) { return new Promise(t => { setTimeout(t, e ? Qe(s * 1e3, e * 1e3) : s * 1e3) }) } function re(s, e = {}) { return new Promise((t, n) => { const i = o => $(o).is(":visible") && parseInt($(o).css("opacity")) > .1; if ($(s).length && (!e.visible || i(s))) return t($(s + ":visible").first()[0]); const r = new MutationObserver(o => { $(s).length && (!e.visible || i(s)) && (t($(s + ":visible").first()[0]), r.disconnect()) }); e.timeout && F(e.timeout).then(() => { r.disconnect(), n(new Error("observer timed out")) }), r.observe(e.target || document.body, { attributes: !0, childList: !0, subtree: !0, ...e.config }) }) } async function pe(s, e) { return fetch(`worker.php?go=buyitem&id=${s}&qty=${e}`, { method: "POST" }).then(t => t.text()).then(t => Number.isNaN(Number.parseInt(t)) ? t : pe(s, t)) } const we = class extends EventTarget { constructor() { super(); O(this, "active", !1); O(this, "stopRequested", !1) } get isActive() { return this.active } get isStopRequested() { return this.stopRequested } async start() { if (!this.active) { this.active = !0; try { if (!$(".explorebtn").length) throw new Error("No exploration area detected"); for (; this.getStaminaCount() > 0 && (await this.exploreOne(), !this.stopRequested);)await F(.12, .28); this.active = !1, this.stopRequested = !1, this.dispatchEvent(new Event(we.FINISHED)), ie.SOUND_FINISHED.play() } catch (t) { alert(t.message) } } } stop() { this.stopRequested || !this.active || (this.stopRequested = !0) } async exploreOne() { if (!$(".explorebtn").length) throw new Error("No exploration area detected"); $(".explorebtn").trigger("click") } getStaminaCount() { return parseInt($("#stamina").text() || "0") } }; let H = we; O(H, "FINISHED", "FINISHED"); function S() { } function Pe(s) { return s() } function ke() { return Object.create(null) } function qe(s) { s.forEach(Pe) } function Ue(s) { return typeof s == "function" } function x(s, e) { return s != s ? e == e : s !== e || s && typeof s == "object" || typeof s == "function" } let ne; function J(s, e) { return ne || (ne = document.createElement("a")), ne.href = e, s === ne.href } function Ze(s) { return Object.keys(s).length === 0 } function h(s, e) { s.appendChild(e) } function v(s, e, t) { s.insertBefore(e, t || null) } function E(s) { s.parentNode && s.parentNode.removeChild(s) } function ce(s, e) { for (let t = 0; t < s.length; t += 1)s[t] && s[t].d(e) } function p(s) { return document.createElement(s) } function R(s) { return document.createTextNode(s) } function L() { return R(" ") } function Ge() { return R("") } function Y(s, e, t, n) { return s.addEventListener(e, t, n), () => s.removeEventListener(e, t, n) } function _(s, e, t) { t == null ? s.removeAttribute(e) : s.getAttribute(e) !== t && s.setAttribute(e, t) } function Ve(s) { return Array.from(s.childNodes) } function Z(s, e) { e = "" + e, s.data !== e && (s.data = e) } function P(s, e, t, n) { t == null ? s.style.removeProperty(e) : s.style.setProperty(e, t, n ? "important" : "") } let _e; function X(s) { _e = s } const W = [], be = []; let z = []; const ye = [], We = Promise.resolve(); let ue = !1; function ze() { ue || (ue = !0, We.then(Te)) } function fe(s) { z.push(s) } const ae = new Set; let V = 0; function Te() { if (V !== 0) return; const s = _e; do { try { for (; V < W.length;) { const e = W[V]; V++, X(e), Je(e.$$) } } catch (e) { throw W.length = 0, V = 0, e } for (X(null), W.length = 0, V = 0; be.length;)be.pop()(); for (let e = 0; e < z.length; e += 1) { const t = z[e]; ae.has(t) || (ae.add(t), t()) } z.length = 0 } while (W.length); for (; ye.length;)ye.pop()(); ue = !1, ae.clear(), X(s) } function Je(s) { if (s.fragment !== null) { s.update(), qe(s.before_update); const e = s.dirty; s.dirty = [-1], s.fragment && s.fragment.p(s.ctx, e), s.after_update.forEach(fe) } } function Ke(s) { const e = [], t = []; z.forEach(n => s.indexOf(n) === -1 ? e.push(n) : t.push(n)), t.forEach(n => n()), z = e } const He = new Set; function $e(s, e) { s && s.i && (He.delete(s), s.i(e)) } function Xe(s, e, t, n) { const { fragment: i, after_update: r } = s.$$; i && i.m(e, t), n || fe(() => { const o = s.$$.on_mount.map(Pe).filter(Ue); s.$$.on_destroy ? s.$$.on_destroy.push(...o) : qe(o), s.$$.on_mount = [] }), r.forEach(fe) } function et(s, e) { const t = s.$$; t.fragment !== null && (Ke(t.after_update), qe(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []) } function tt(s, e) { s.$$.dirty[0] === -1 && (W.push(s), ze(), s.$$.dirty.fill(0)), s.$$.dirty[e / 31 | 0] |= 1 << e % 31 } function j(s, e, t, n, i, r, o, q = [-1]) { const l = _e; X(s); const c = s.$$ = { fragment: null, ctx: [], props: r, update: S, not_equal: i, bound: ke(), on_mount: [], on_destroy: [], on_disconnect: [], before_update: [], after_update: [], context: new Map(e.context || (l ? l.$$.context : [])), callbacks: ke(), dirty: q, skip_bound: !1, root: e.target || l.$$.root }; o && o(c.root); let g = !1; if (c.ctx = t ? t(s, e.props || {}, (d, m, ...w) => { const y = w.length ? w[0] : m; return c.ctx && i(c.ctx[d], c.ctx[d] = y) && (!c.skip_bound && c.bound[d] && c.bound[d](y), g && tt(s, d)), m }) : [], c.update(), g = !0, qe(c.before_update), c.fragment = n ? n(c.ctx) : !1, e.target) { if (e.hydrate) { const d = Ve(e.target); c.fragment && c.fragment.l(d), d.forEach(E) } else c.fragment && c.fragment.c(); e.intro && $e(s.$$.fragment), Xe(s, e.target, e.anchor, e.customElement), Te() } X(l) } class Q { $destroy() { et(this, 1), this.$destroy = S } $on(e, t) { if (!Ue(t)) return S; const n = this.$$.callbacks[e] || (this.$$.callbacks[e] = []); return n.push(t), () => { const i = n.indexOf(t); i !== -1 && n.splice(i, 1) } } $set(e) { this.$$set && !Ze(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1) } } function st(s) { let e; return { c() { e = R("AUTO EXPLORE") }, m(t, n) { v(t, e, n) }, d(t) { t && E(e) } } } function nt(s) { let e; return { c() { e = R("❌ STOP EXPLORING") }, m(t, n) { v(t, e, n) }, d(t) { t && E(e) } } } function it(s) { let e; return { c() { e = R("❌ STOPPING") }, m(t, n) { v(t, e, n) }, d(t) { t && E(e) } } } function rt(s) { let e, t, n, i, r, o, q; function l(d, m) { return d[0] ? it : d[1] ? nt : st } let c = l(s), g = c(s); return { c() { e = p("div"), t = p("div"), t.textContent = "🤖", n = L(), i = p("div"), g.c(), _(t, "class", "item-media"), _(i, "class", "item-inner"), _(e, "class", r = "item-content " + (s[0] ? "disabled" : "") + " svelte-i5qs34") }, m(d, m) { v(d, e, m), h(e, t), h(e, n), h(e, i), g.m(i, null), o || (q = Y(e, "click", s[2]), o = !0) }, p(d, [m]) { c !== (c = l(d)) && (g.d(1), g = c(d), g && (g.c(), g.m(i, null))), m & 1 && r !== (r = "item-content " + (d[0] ? "disabled" : "") + " svelte-i5qs34") && _(e, "class", r) }, i: S, o: S, d(d) { d && E(e), g.d(), o = !1, q() } } } function ot(s, e, t) { let n, i; const r = oe.bot; function o() { r.isActive ? r.stop() : r.start(), t(1, n = r.isActive), t(0, i = r.isStopRequested) } return r.addEventListener(H.FINISHED, () => { t(1, n = r.isActive), t(0, i = r.isStopRequested) }), t(1, n = r.isActive), t(0, i = r.isStopRequested), [i, n, o] } class lt extends Q { constructor(e) { super(), j(this, e, ot, rt, x, {}) } } var oe; (s => { s.bot = new H; function e({ container: n }) { const i = $("<li />").insertAfter($(n).find(".explorebtn").closest("li")); if (i.length) return new lt({ target: i[0] }) } function t() { B.onPageInit("area", e), B.onPageInit("*", ({ name: n }) => { n !== "area" && s.bot.stop() }) } s.setup = t })(oe || (oe = {})); function Ee(s, e, t) { const n = s.slice(); return n[5] = e[t].id, n[6] = e[t].name, n[7] = e[t].img, n } function ve(s) { let e, t; return { c() { e = p("div"), t = R(s[2]), P(e, "color", "red") }, m(n, i) { v(n, e, i), h(e, t) }, p(n, i) { i & 4 && Z(t, n[2]) }, d(n) { n && E(e) } } } function Ce(s) { let e, t, n, i, r = s[6] + "", o, q, l, c; function g() { return s[4](s[5]) } return { c() { e = p("button"), t = p("img"), o = R(r), q = L(), J(t.src, n = s[7]) || _(t, "src", n), _(t, "alt", i = s[6]), _(t, "height", "20"), e.disabled = s[1], _(e, "class", "svelte-x7uv6v") }, m(d, m) { v(d, e, m), h(e, t), h(e, o), h(e, q), l || (c = Y(e, "click", g), l = !0) }, p(d, m) { s = d, m & 1 && !J(t.src, n = s[7]) && _(t, "src", n), m & 1 && i !== (i = s[6]) && _(t, "alt", i), m & 1 && r !== (r = s[6] + "") && Z(o, r), m & 2 && (e.disabled = s[1]) }, d(d) { d && E(e), l = !1, c() } } } function qt(s) { let e, t, n, i, r, o, q, l, c, g, d, m, w, y = s[2] && ve(s), b = s[0], k = []; for (let I = 0; I < b.length; I += 1)k[I] = Ce(Ee(s, b, I)); return { c() { e = p("div"), t = p("div"), n = p("div"), i = p("div"), r = p("div"), o = R(`Quick buy and plant seeds\r `), q = p("span"), q.textContent = `(empty plots: ${K.getNumberOfEmptyPlots()})`, l = L(), y && y.c(), c = L(), g = p("ul"), d = p("li"), m = p("div"), w = p("div"); for (let I = 0; I < k.length; I += 1)k[I].c(); P(q, "font-size", "11px"), _(r, "class", "item-title"), _(i, "class", "item-content"), P(i, "display", "block"), P(i, "min-height", "auto"), _(w, "class", "item-inner seed-list svelte-x7uv6v"), _(m, "class", "item-content"), _(n, "class", "list-block"), _(t, "class", "card-content"), _(e, "class", "card") }, m(I, G) { v(I, e, G), h(e, t), h(t, n), h(n, i), h(i, r), h(r, o), h(r, q), h(i, l), y && y.m(i, null), h(n, c), h(n, g), h(g, d), h(d, m), h(m, w); for (let D = 0; D < k.length; D += 1)k[D] && k[D].m(w, null) }, p(I, [G]) { if (I[2] ? y ? y.p(I, G) : (y = ve(I), y.c(), y.m(i, null)) : y && (y.d(1), y = null), G & 11) { b = I[0]; let D; for (D = 0; D < b.length; D += 1) { const M = Ee(I, b, D); k[D] ? k[D].p(M, G) : (k[D] = Ce(M), k[D].c(), k[D].m(w, null)) } for (; D < k.length; D += 1)k[D].d(1); k.length = b.length } }, i: S, o: S, d(I) { I && E(e), y && y.d(), ce(k, I) } } } function ct(s, e, t) { let n, i, { seeds: r } = e; async function o(l) { t(1, n = !0), t(2, i = null); const c = K.getNumberOfEmptyPlots(); if (c <= 0) { t(2, i = "ERROR: No empty plots found"), t(1, n = !1); return } try { const g = await pe(l, c); g === "success" ? (await fetch(`worker.php?go=plantall&id=${K.getFarmID()}`, { method: "POST" }), B.refreshPage()) : t(2, i = `ERROR: ${g || "blank response; inventory already full?"}`) } catch (g) { console.error(g), t(2, i = "ERROR") } t(1, n = !1) } const q = l => o(l); return s.$$set = l => { "seeds" in l && t(0, r = l.seeds) }, t(1, n = !1), t(2, i = null), [r, n, i, o, q] } class at extends Q { constructor(e) { super(), j(this, e, ct, qt, x, { seeds: 0 }) } } var K; (s => { const e = [{ name: "Pepper", id: 12, img: "/img/items/seeds_peppers.png" }, { name: "Carrot", id: 20, img: "/img/items/seeds_carrots.png" }, { name: "Pea", id: 28, img: "/img/items/seeds_peas.png" }, { name: "Cucumber", id: 30, img: "/img/items/seeds_cucumber.png" }, { name: "Eggplant", id: 14, img: "/img/items/seeds_eggplants.png" }, { name: "Radish", id: 32, img: "/img/items/seeds_radish.png" }, { name: "Onion", id: 34, img: "/img/items/seeds_onions.png" }, { name: "Hops", id: 47, img: "/img/items/seeds_hops.png" }, { name: "Potato", id: 49, img: "/img/items/seeds_potato.png" }, { name: "Tomato", id: 16, img: "/img/items/seeds_tomato.png" }, { name: "Leek", id: 51, img: "/img/items/seeds_leek.png" }, { name: "Watermelon", id: 60, img: "/img/items/seeds_watermelon.png" }, { name: "Corn", id: 64, img: "/img/items/seeds_corn.png" }, { name: "Cabbage", id: 66, img: "/img/items/seeds_cabbage.png" }, { name: "Pine", id: 410, img: "/img/items/seeds_pine.png" }, { name: "Pumpkin", id: 68, img: "/img/items/seeds_pumpkin.png" }, { name: "Wheat", id: 70, img: "/img/items/seeds_wheet.png" }, { name: "Mushroom", id: 395, img: "/img/items/seeds_mushroom.png" }, { name: "Broccoli", id: 257, img: "/img/items/seeds_broccoli.png" }, { name: "Cotton", id: 255, img: "/img/items/seeds_cotton.png" }, { name: "Sunflower", id: 374, img: "/img/items/seeds_sunflower.png" }, { name: "Beet", id: 449, img: "/img/items/seeds_beet.png" }, { name: "Rice", id: 631, img: "/img/items/seeds_rice.png" }]; function t() { return $("#croparea [data-farm]").data("farm") } s.getFarmID = t; function n() { return $("#crops").find(".cropitem,.plantseed").length } s.getNumberOfPlots = n; function i() { return $("#crops").find(".plantseed").length } s.getNumberOfEmptyPlots = i; function r({ container: q }) { const l = $("<div />").insertAfter($(q).find("#croparea")); if (l.length) return new at({ target: l[0], props: { seeds: e } }) } function o() { B.onPageInit("xfarm", r) } s.setup = o })(K || (K = {})); const Ae = class extends EventTarget { constructor() { super(); O(this, "active", !1); O(this, "stopRequested", !1) } get isActive() { return this.active } get isStopRequested() { return this.stopRequested } async start() { if (!this.active) { this.active = !0; try { if (!$("#fishinwater").length) throw new Error("No fishing area detected"); for (; this.getBaitCount() > 0 && (await this.fishOne(), !this.stopRequested);)await F(.3, .4); this.active = !1, this.stopRequested = !1, this.dispatchEvent(new Event(Ae.FINISHED)), ie.SOUND_FINISHED.play() } catch (t) { alert(t.message) } } } stop() { this.stopRequested || !this.active || (this.stopRequested = !0) } async fishOne() { await this.clickFish(); try { await re(".picker-catch.modal-in", { visible: !0, timeout: .1 }) } catch { return this.stopRequested ? void 0 : await this.fishOne() } if (await F(.33), this.stopRequested) { this.catchFish(); return } await F(.23, .888), await this.catchFish(), await F(.05, .115) } async catchFish() { if (!$(".fishcaught").length) throw new Error("Cannot find fishing to catch"); $(".fishcaught").trigger("click") } async clickFish() { if (!$("#fishinwater").length) throw new Error("No fishing area detected"); (await re(".fish.catch")).click() } getBaitCount() { return parseInt($("#baitarea strong").first().text() || "0") } }; let ee = Ae; O(ee, "FINISHED", "FINISHED"); function ut(s) { let e; return { c() { e = R("🤖 AUTO FISH") }, m(t, n) { v(t, e, n) }, d(t) { t && E(e) } } } function ft(s) { let e; return { c() { e = R("🤖❌ STOP FISHING") }, m(t, n) { v(t, e, n) }, d(t) { t && E(e) } } } function dt(s) { let e; return { c() { e = R("🤖❌ STOPPING") }, m(t, n) { v(t, e, n) }, d(t) { t && E(e) } } } function mt(s) { let e, t, n; function i(q, l) { return q[0] ? dt : q[1] ? ft : ut } let r = i(s), o = r(s); return { c() { e = p("button"), o.c(), e.disabled = s[0] }, m(q, l) { v(q, e, l), o.m(e, null), t || (n = Y(e, "click", s[2]), t = !0) }, p(q, [l]) { r !== (r = i(q)) && (o.d(1), o = r(q), o && (o.c(), o.m(e, null))), l & 1 && (e.disabled = q[0]) }, i: S, o: S, d(q) { q && E(e), o.d(), t = !1, n() } } } function gt(s, e, t) { let n, i; const r = te.bot; function o() { r.isActive ? r.stop() : r.start(), t(1, n = r.isActive), t(0, i = r.isStopRequested) } return r.addEventListener(ee.FINISHED, () => { t(1, n = r.isActive), t(0, i = r.isStopRequested) }), t(1, n = r.isActive), t(0, i = r.isStopRequested), [i, n, o] } class ht extends Q { constructor(e) { super(), j(this, e, gt, mt, x, {}) } } function Ie(s, e, t) { const n = s.slice(); return n[8] = e[t].name, n[9] = e[t].num, n[10] = e[t].imgSrc, n } function pt(s) { let e, t = s[0], n = []; for (let i = 0; i < t.length; i += 1)n[i] = Me(Ie(s, t, i)); return { c() { for (let i = 0; i < n.length; i += 1)n[i].c(); e = Ge() }, m(i, r) { for (let o = 0; o < n.length; o += 1)n[o] && n[o].m(i, r); v(i, e, r) }, p(i, r) { if (r & 65) { t = i[0]; let o; for (o = 0; o < t.length; o += 1) { const q = Ie(i, t, o); n[o] ? n[o].p(q, r) : (n[o] = Me(q), n[o].c(), n[o].m(e.parentNode, e)) } for (; o < n.length; o += 1)n[o].d(1); n.length = t.length } }, d(i) { ce(n, i), i && E(e) } } } function _t(s) { let e; return { c() { e = R("No other baits available") }, m(t, n) { v(t, e, n) }, p: S, d(t) { t && E(e) } } } function wt(s) { let e; return { c() { e = R(s[1]) }, m(t, n) { v(t, e, n) }, p(t, n) { n & 2 && Z(e, t[1]) }, d(t) { t && E(e) } } } function At(s) { let e; return { c() { e = R("Loading...") }, m(t, n) { v(t, e, n) }, p: S, d(t) { t && E(e) } } } function Me(s) { let e, t, n, i, r, o = s[9] + "", q, l, c, g, d; function m() { return s[7](s[8]) } return { c() { e = p("span"), t = p("img"), r = L(), q = R(o), l = L(), J(t.src, n = s[10]) || _(t, "src", n), _(t, "height", "14"), _(t, "alt", i = s[8]), _(e, "class", "quick-swap-bttn svelte-ziplh9"), _(e, "title", c = s[8]) }, m(w, y) { v(w, e, y), h(e, t), h(e, r), h(e, q), h(e, l), g || (d = Y(e, "click", m), g = !0) }, p(w, y) { s = w, y & 1 && !J(t.src, n = s[10]) && _(t, "src", n), y & 1 && i !== (i = s[8]) && _(t, "alt", i), y & 1 && o !== (o = s[9] + "") && Z(q, o), y & 1 && c !== (c = s[8]) && _(e, "title", c) }, d(w) { w && E(e), g = !1, d() } } } function kt(s) { let e; return { c() { e = R("BUY 200 WORMS") }, m(t, n) { v(t, e, n) }, p: S, d(t) { t && E(e) } } } function bt(s) { let e; return { c() { e = R(s[3]) }, m(t, n) { v(t, e, n) }, p(t, n) { n & 8 && Z(e, t[3]) }, d(t) { t && E(e) } } } function yt(s) { let e, t, n, i, r, o, q, l, c; function g(k, I) { return k[2] ? At : k[1] ? wt : k[0].length <= 0 ? _t : pt } let d = g(s), m = d(s); function w(k, I) { return k[3] ? bt : kt } let y = w(s), b = y(s); return { c() { e = p("div"), t = p("div"), n = p("div"), i = p("div"), r = R(`Quick Swap:\r `), m.c(), o = L(), q = p("button"), b.c(), _(i, "class", "quick-swap-area svelte-ziplh9"), q.disabled = s[4], P(n, "display", "flex"), _(t, "class", "row"), P(t, "margin-bottom", "0"), _(e, "class", "card-content-inner"), P(e, "padding", "5px") }, m(k, I) { v(k, e, I), h(e, t), h(t, n), h(n, i), h(i, r), m.m(i, null), h(n, o), h(n, q), b.m(q, null), l || (c = Y(q, "click", s[5]), l = !0) }, p(k, [I]) { d === (d = g(k)) && m ? m.p(k, I) : (m.d(1), m = d(k), m && (m.c(), m.m(i, null))), y === (y = w(k)) && b ? b.p(k, I) : (b.d(1), b = y(k), b && (b.c(), b.m(q, null))), I & 16 && (q.disabled = k[4]) }, i: S, o: S, d(k) { k && E(e), m.d(), b.d(), l = !1, c() } } } function Et(s, e, t) { let n, i, r, o; async function q() { try { t(4, n = !0); const d = await pe(18, 200); t(4, n = !1), d == "success" || d === "" ? B.refreshPage() : t(3, i = d) } catch (d) { t(3, i = "ERROR"), console.error(d) } } let l; re("#last_bait").then(async () => { try { t(2, r = !1), t(0, l = await te.getCachedBaitData(jQuery("#last_bait").html())), t(0, l = l.filter(d => !d.selected)) } catch (d) { console.error(d) } }); async function c(d) { try { const m = await fetch(`worker.php?go=selectbait&bait=${d}`, { method: "POST" }).then(w => w.text()); m === "success" ? B.refreshPage() : t(1, o = `ERROR: ${m}`) } catch (m) { t(1, o = "ERROR"), console.error(m) } } const g = d => c(d); return t(4, n = !1), t(3, i = null), t(2, r = !0), t(0, l = []), t(1, o = null), [l, o, r, i, n, q, c, g] } class vt extends Q { constructor(e) { super(), j(this, e, Et, yt, x, {}) } } var te; (s => { s.bot = new ee; async function e() { return new Promise(l => { $("<div/>").load("changebait.php?from=fishing&id=" + $(".zone_id").html(), function () { l($(this).find(".selectbait").map(function () { return { name: $(this).data("bait"), num: $(this).find(".item-after").text(), imgSrc: $(this).find("img").attr("src"), selected: $(this).find(".item-title i").text() === "check" } }).get()) }) }) } let t; async function n(l) { var g; const c = t && l && t.active === l ? t.list : await e(); return t = { list: c.slice(), active: (g = c.find(d => d.selected)) == null ? void 0 : g.name }, c } s.getCachedBaitData = n; function i(l) { const c = $(l).find(".buttons-row").append("<div />"); if (c.length) return new ht({ target: c[0] }) } function r(l) { const c = $("<div />").insertAfter($(l).find("#baitarea")); if (c.length) return new vt({ target: c[0] }) } function o({ container: l }) { i(l), r(l) } function q() { B.onPageInit("fishing", o), B.onPageInit("*", ({ name: l }) => { l !== "fishing" && s.bot.stop() }) } s.setup = q })(te || (te = {})); function Se(s) { let e, t, n; return { c() { e = p("button"), e.textContent = "CLAIM ALL", P(e, "margin-left", "10px") }, m(i, r) { v(i, e, r), t || (n = Y(e, "click", s[1]), t = !0) }, p: S, d(i) { i && E(e), t = !1, n() } } } function Ct(s) { let e, t = s[0] && Se(s); return { c() { t && t.c(), e = Ge() }, m(n, i) { t && t.m(n, i), v(n, e, i) }, p(n, [i]) { n[0] ? t ? t.p(n, i) : (t = Se(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null) }, i: S, o: S, d(n) { t && t.d(n), n && E(e) } } } function It(s, e, t) { let n; function i() { t(0, n = !1), r() } async function r() { jQuery(".claimbtn").length && (jQuery(".claimbtn").first().click(), await re(".modal-button", { timeout: .25 }), await F(.5), jQuery(".modal-button").first().click(), await F(.25), await r()) } return t(0, n = !0), [n, i] } class Mt extends Q { constructor(e) { super(), j(this, e, It, Ct, x, {}) } } var de; (s => { function e({ container: n }) { if (!$(n).find(".claimbtn").length) return; const i = $("<span />").appendTo($(".claimbtn:first-of-type").closest(".list-block").prev()); if (i.length) return new Mt({ target: i[0] }) } function t() { B.onPageInit("mastery", e) } s.setup = t })(de || (de = {})); function Re(s, e, t) { const n = s.slice(); return n[1] = e[t].section, n[2] = e[t].links, n } function De(s, e, t) { const n = s.slice(); return n[5] = e[t].link, n[6] = e[t].text, n[7] = e[t].icon, n[8] = e[t].params, n[10] = t, n } function Oe(s) { let e, t, n = s[1] + "", i; return { c() { e = p("div"), t = p("strong"), i = R(n), P(e, "margin-top", "3px") }, m(r, o) { v(r, e, o), h(e, t), h(t, i) }, p(r, o) { o & 1 && n !== (n = r[1] + "") && Z(i, n) }, d(r) { r && E(e) } } } function St(s) { let e; return { c() { e = R(" •") }, m(t, n) { v(t, e, n) }, d(t) { t && E(e) } } } function Ne(s) { let e, t, n, i; return { c() { e = p("img"), i = L(), J(e.src, t = s[7]) || _(e, "src", t), _(e, "alt", n = s[6]), _(e, "height", "12") }, m(r, o) { v(r, e, o), v(r, i, o) }, p(r, o) { o & 1 && !J(e.src, t = r[7]) && _(e, "src", t), o & 1 && n !== (n = r[6]) && _(e, "alt", n) }, d(r) { r && E(e), r && E(i) } } } function Be(s) { let e, t, n = (s[6] ?? "") + "", i, r, o = s[10] != 0 && St(), q = s[7] && Ne(s); return { c() { o && o.c(), e = L(), t = p("a"), q && q.c(), i = R(n), _(t, "href", r = s[5] + ".php" + (s[8] ? "?" + new URLSearchParams(s[8]).toString() : "")), _(t, "data-view", ".view-main") }, m(l, c) { o && o.m(l, c), v(l, e, c), v(l, t, c), q && q.m(t, null), h(t, i) }, p(l, c) { l[7] ? q ? q.p(l, c) : (q = Ne(l), q.c(), q.m(t, i)) : q && (q.d(1), q = null), c & 1 && n !== (n = (l[6] ?? "") + "") && Z(i, n), c & 1 && r !== (r = l[5] + ".php" + (l[8] ? "?" + new URLSearchParams(l[8]).toString() : "")) && _(t, "href", r) }, d(l) { o && o.d(l), l && E(e), l && E(t), q && q.d() } } } function Le(s) { let e, t, n, i = s[1] && Oe(s), r = s[2], o = []; for (let q = 0; q < r.length; q += 1)o[q] = Be(De(s, r, q)); return { c() { e = p("div"), i && i.c(), t = L(); for (let q = 0; q < o.length; q += 1)o[q].c(); n = L() }, m(q, l) { v(q, e, l), i && i.m(e, null), h(e, t); for (let c = 0; c < o.length; c += 1)o[c] && o[c].m(e, null); h(e, n) }, p(q, l) { if (q[1] ? i ? i.p(q, l) : (i = Oe(q), i.c(), i.m(e, t)) : i && (i.d(1), i = null), l & 1) { r = q[2]; let c; for (c = 0; c < r.length; c += 1) { const g = De(q, r, c); o[c] ? o[c].p(g, l) : (o[c] = Be(g), o[c].c(), o[c].m(e, n)) } for (; c < o.length; c += 1)o[c].d(1); o.length = r.length } }, d(q) { q && E(e), i && i.d(), ce(o, q) } } } function Rt(s) { let e, t, n, i, r, o, q, l, c, g, d = s[0], m = []; for (let w = 0; w < d.length; w += 1)m[w] = Le(Re(s, d, w)); return { c() { e = p("li"), t = p("div"), n = p("div"), i = p("div"), r = p("div"), r.innerHTML = '<i class="fa fa-fw fa-lightbulb-o"></i>', o = L(), q = p("div"), l = p("div"), l.textContent = " Shortcuts", c = L(), g = p("div"); for (let w = 0; w < m.length; w += 1)m[w].c(); _(l, "class", "item-title"), P(g, "font-size", "14px"), P(i, "display", "grid"), P(i, "grid-template-columns", "1fr auto"), _(n, "class", "item-inner"), _(t, "class", "item-content") }, m(w, y) { v(w, e, y), h(e, t), h(t, n), h(n, i), h(i, r), h(i, o), h(i, q), h(q, l), h(q, c), h(q, g); for (let b = 0; b < m.length; b += 1)m[b] && m[b].m(g, null) }, p(w, [y]) { if (y & 1) { d = w[0]; let b; for (b = 0; b < d.length; b += 1) { const k = Re(w, d, b); m[b] ? m[b].p(k, y) : (m[b] = Le(k), m[b].c(), m[b].m(g, null)) } for (; b < m.length; b += 1)m[b].d(1); m.length = d.length } }, i: S, o: S, d(w) { w && E(e), ce(m, w) } } } function Dt(s, e, t) { let { sections: n } = e; return s.$$set = i => { "sections" in i && t(0, n = i.sections) }, [n] } class Ot extends Q { constructor(e) { super(), j(this, e, Dt, Rt, x, { sections: 0 }) } } var me; (s => { function e() { return $('.view-main a[href^="xfarm.php?id="]').attr("href").match(/\?id=(\d*)/)[1] } const t = [{ links: [{ link: "xfarm", text: "Farm", params: { id: e() } }, { link: "explore", text: "Explore" }, { link: "fish", text: "Fishing" }, { link: "town", text: "Town" }, { link: "quests", text: "Help" }, { link: "workshop", text: "Workshop" }] }, { section: "Town", links: [{ link: "store", text: "Store" }, { link: "market", text: "Sell" }, { link: "bank", text: "Bank" }, { link: "postoffice", text: "Mail" }, { link: "pets", text: "Pets" }, { link: "supply", text: "Upgrade" }, { link: "locksmith", text: "Locksmith" }, { link: "steakmarket", text: "Steak" }] }, { section: "Daily", links: [{ link: "daily", text: "Chores" }, { link: "well", text: "Well" }, { link: "crack", text: "Vault" }, { link: "comm", text: "Community Center" }] }, { section: "Skills", links: [{ link: "progress", params: { type: "Farming" }, icon: "/img/items/6137.png" }, { link: "progress", params: { type: "Fishing" }, icon: "/img/items/7783.png" }, { link: "progress", params: { type: "Crafting" }, icon: "/img/items/5868.png" }, { link: "progress", params: { type: "Exploring" }, icon: "/img/items/6075.png" }, { link: "perks", text: "Perks" }, { link: "mastery", text: "Mastery" }, { link: "npclevels", text: "Friendship" }] }]; function n({ container: r }) { const o = $(r).find(".list-block li:first-of-type").after("<li />"); if (o.length) return new Ot({ target: o[0], props: { sections: t } }) } function i() { n({ container: document.querySelector(".view.view-left.navbar-through .page") }) } s.setup = i })(me || (me = {})); function Nt(s) { let e, t; return { c() { e = R(`🤖 CHEAT\r `), t = p("abbr"), t.textContent = "ⓘ", _(t, "title", "Passwords fetched from the buddy.farm passwords list: https://buddy.farm/passwords/") }, m(n, i) { v(n, e, i), v(n, t, i) }, d(n) { n && E(e), n && E(t) } } } function Bt(s) { let e; return { c() { e = R("ALL USED") }, m(t, n) { v(t, e, n) }, d(t) { t && E(e) } } } function Lt(s) { let e; return { c() { e = R("Loading...") }, m(t, n) { v(t, e, n) }, d(t) { t && E(e) } } } function Pt(s) { let e, t, n, i; function r(l, c) { return l[1] ? Lt : l[0] ? Bt : Nt } let o = r(s), q = o(s); return { c() { e = p("button"), q.c(), e.disabled = t = s[0] || s[1], _(e, "class", "svelte-1bj479l") }, m(l, c) { v(l, e, c), q.m(e, null), n || (i = Y(e, "click", s[2]), n = !0) }, p(l, [c]) { o !== (o = r(l)) && (q.d(1), q = o(l), q && (q.c(), q.m(e, null))), c & 3 && t !== (t = l[0] || l[1]) && (e.disabled = t) }, i: S, o: S, d(l) { l && E(e), q.d(), n = !1, i() } } } function Ut(s, e, t) { let n, i; async function r() { t(1, n = !0); const { allPasswords: o, usedPasswords: q } = await le.getPasswordData(); t(1, n = !1); const l = o.filter(c => !q.includes(c)); if (l.length <= 0) { t(0, i = !0); return } jQuery("#popw").val(l[0]) } return t(1, n = !1), t(0, i = !1), [i, n, r] } class Gt extends Q { constructor(e) { super(), j(this, e, Ut, Pt, x, {}) } } var le; (s => { async function e() { return fetch("https://buddy.farm/page-data/passwords/page-data.json").then(l => l.json()).then(l => l.result.data.farmrpg.passwords.map(c => c.password)) } async function t() { return new Promise(l => { $("<div/>").load("popwlog.php", function () { l($(this).find(".list-block .item-title span:first-of-type").map((c, g) => $(g).text()).get()) }) }) } let n, i; async function r() { return n ?? (n = (await e()).map(l => l.toLowerCase())), i ?? (i = (await t()).map(l => l.toLowerCase())), { allPasswords: n, usedPasswords: i } } s.getPasswordData = r; function o({ container: l }) { const c = $(l).find("#popw").closest(".item-inner").append("<div />"); if ($(".popwbtn").on("click", function () { i == null || i.push($("#popw").val().toString()) }), !!c.length) return new Gt({ target: c[0] }) } function q() { B.onPageInit("postoffice", o) } s.setup = q })(le || (le = {})); var ge; (s => { const t = "0123456789".split(""), n = Array.from({ length: Math.pow(10, 4) }).map((M, a) => a.toString().padStart(4, "0")), i = { WRONG: 0, PARTIAL: 1, CORRECT: 2 }, r = (M, a) => Array.from({ length: M }).fill(a), o = M => M[Math.floor(Math.random() * M.length)], q = (M, a) => Array.from(M).filter(u => u == a).length, l = (M, a) => { let u = M.indexOf(a); return u > -1 && M.splice(u, 1)[0] }, c = (M, a) => Array.from(M).filter(u => !Array.from(a).includes(u)); class g { constructor(a) { O(this, "word_list"); O(this, "letter_count"); O(this, "word_scores"); O(this, "position_letter_count"); O(this, "position_word_scores"); this.word_list = (a == null ? void 0 : a()) ?? [], this.letter_count = {}, this.word_scores = {}, this.position_letter_count = r(4).map(() => ({})), this.position_word_scores = {}, this.gen_word_scores(), this.gen_positional_word_scores() } copy() { let a = new g; return a.word_list = this.word_list.slice(), a.word_scores = { ...this.word_scores }, a.position_word_scores = { ...this.position_word_scores }, a } get length() { return this.word_list.length } get_random_word() { return o(this.word_list) } get_hiscore_word(a = !1) { const u = a ? this.position_word_scores : this.word_scores; let f = "", A = 0; for (let C of this.word_list) u[C] > A && (A = u[C], f = C); return f } get_maximized_word(a) { this.gen_letter_count(); let u = "", f = 0; for (let A of this.word_list) { let C = 0; for (let N of a) A.indexOf(N) > -1 && (C += 1); C > f && (f = C, u = A) } return u } gen_letter_count() { this.letter_count = Object.fromEntries(t.map(a => [a, 0])); for (let a of this.word_list) for (let u of new Set(a)) this.letter_count[u] += 1 } gen_positional_letter_count() { for (let a = 0; a < 4; a++)this.position_letter_count[a] = Object.fromEntries(t.map(u => [u, 0])); for (let a of this.word_list) Array.from(a).forEach((u, f) => { this.position_letter_count[f][u] += 1 }) } gen_word_scores() { this.gen_letter_count(), this.word_scores = {}; for (let a of this.word_list) { let u = 0; for (let f of new Set(a)) u += this.letter_count[f]; this.word_scores[a] = u } } gen_positional_word_scores() { this.gen_positional_letter_count(), this.position_word_scores = {}; for (let a of this.word_list) { let u = {}; Array.from(a).forEach((f, A) => { u[f] !== void 0 ? u[f] = this.position_letter_count[A][f] : u[f] = Math.max(u[f], this.position_letter_count[A][f]) }), this.position_word_scores[a] = Object.values(u).length } } filter_by_mask(a, u, f) { let A = []; for (let C of this.word_list) if (!a.some((T, U) => !!T.length && C[U] != T[0])) { let T = !0; for (let U = 0; U < u.length; U++) { let se = !1; const Fe = u[U]; for (let xe of Fe) C[U] == xe && (se = !0); if (se) { T = !1; break } } T && (t.some(U => !f[q(C.split(""), U)].has(U)) || A.push(C)) } this.word_list = A } } class d { constructor(a, u, f) { O(this, "word"); O(this, "result"); O(this, "guessed_correctly"); this.word = a, this.result = f ?? this.get_result(u), this.guessed_correctly = q(this.result, i.CORRECT) === 4 } toString() { let a = `${this.word}: `; for (let u of this.result) return u == 2 ? a += "G" : u == 1 && (a += "Y"), u == 0 && (a += "_"), a } get_result(a) { let u = r(4, i.WRONG), f = [...a]; Array.from(this.word).forEach((A, C) => { A == f[C] && (u[C] = i.CORRECT, f[C] = "") }); for (let A = 0; A < this.word.length; A++)if (f.includes(this.word[A]) && u[A] != i.CORRECT) { u[A] = i.PARTIAL; for (let C = 0; C < 4; C++)if (f[C] == this.word[A]) { f[C] = ""; break } } return q(u, i.CORRECT) === 4 && (this.guessed_correctly = !0), u } } class m { constructor(a = "#random") { O(this, "correct_word"); O(this, "guesses"); a === "#random" ? this.correct_word = I.get_random_word() : I.word_list.indexOf(a) > -1 && (this.correct_word = a), this.guesses = [] } toString() { return `::${this.correct_word}::` + this.guesses.map((a, u) => ` ${u + 1}. ${a}`).join("") } guess(a, u) { return this.guesses.push(new d(a, this.correct_word, u)), this.guesses.at(-1).guessed_correctly } } class w { constructor(a) { O(this, "yes_mask"); O(this, "no_mask"); O(this, "allowed_mask"); O(this, "must_use"); O(this, "remaining_words"); this.yes_mask = r(4).map(() => []), this.no_mask = r(4).map(() => []), this.allowed_mask = r(4 + 1).map(() => new Set(t)), this.must_use = new Set, this.remaining_words = a.copy() } filter_word_list() { this.remaining_words.filter_by_mask(this.yes_mask, this.no_mask, this.allowed_mask) } reuse_green() { let a = r(4).map(() => []), u = this.yes_mask, f = new Set; this.yes_mask.concat(this.no_mask).forEach(U => { for (let se of U) f.add(se) }); let A = new Set(c(this.allowed_mask[1], f)), C = A, N = [new Set(t), ...r(4).map(() => new Set(C))], T = G.copy(); return T.filter_by_mask(a, u, N), T.length > 0 ? T.get_maximized_word(Array.from(A)) : "" } make_guess() { if (!D.includes("scored") || D.includes("firstrandom") && this.remaining_words.length == G.length) return this.remaining_words.get_random_word(); let a = 4 - this.yes_mask.filter(u => u.length === 0).length; if (D.includes("easymode") && a > 0 && this.remaining_words.length > 2) { let u = this.reuse_green(); if (u != "") return u } return D.includes("recount") && (this.remaining_words.gen_word_scores(), this.remaining_words.gen_positional_word_scores()), D.includes("position") ? this.remaining_words.get_hiscore_word(!0) : this.remaining_words.get_hiscore_word(!1) } update_yes_mask(a) { a.result.forEach((u, f) => { u == i.CORRECT && (this.yes_mask[f].includes(a.word[f]) || this.yes_mask[f].push(a.word[f])) }) } update_no_mask(a) { a.result.forEach((u, f) => { u == i.PARTIAL && (this.no_mask[f].includes(a.word[f]) || this.no_mask[f].push(a.word[f])), u == i.WRONG && q(a.word, a.word[f]) > 1 && (this.no_mask[f].includes(a.word[f]) || this.no_mask[f].push(a.word[f])) }) } update_allowed_mask(a) { let u = {}; Array.from(a.word).forEach((f, A) => { u[f] ? u[f].push(a.result[A]) : u[f] = [a.result[A]] }), Object.entries(u).forEach(([f, A]) => { if (A.includes(i.WRONG)) { let C = A.length - q(A, i.WRONG); for (let N = C + 1; N < 4; N++)this.allowed_mask[N].delete(f) } if (A.includes(i.PARTIAL) || A.includes(i.CORRECT)) { let C = q(A, i.PARTIAL) + q(A, i.CORRECT); for (let N = 0; N < C; N++)this.allowed_mask[N].delete(f) } }) } update_mask_with_guess(a) { this.update_yes_mask(a), this.update_no_mask(a), this.update_allowed_mask(a) } update_mask_with_remaining_words() { this.remaining_words.gen_letter_count(), Object.entries(this.remaining_words.letter_count).forEach(([a, u]) => { if (u == 0) for (let f = 1; f < this.allowed_mask.length; f++)this.allowed_mask[f].delete(a) }) } remove_word(a) { l(this.remaining_words.word_list, a) } } function y() { const M = new m(null), a = new w(G); return { getGuess() { return a.make_guess() }, submitResult(u, f) { const A = M.guess(u, (typeof f == "string" ? f.split("") : f).map(C => parseInt(C))); return a.remove_word(u), a.update_mask_with_guess(M.guesses.at(-1)), a.filter_word_list(), a.update_mask_with_remaining_words(), A } } } s.realtimeGameSolver = y; function b(M = !0, a = null) { M || console.log("game started"); const u = new m("9876"), f = new w(G); let A = !1, C = 10; for (; !A && C > 0;) { let N = f.make_guess(); u.guess(N) && (A = !0), f.remove_word(N), f.update_mask_with_guess(u.guesses.at(-1)), f.filter_word_list(), f.update_mask_with_remaining_words(), C-- } return M || console.log(u), u.guesses.at(-1).guessed_correctly ? u.guesses : -1 } function k() { let M = Date.now(); b(!1), console.log(`Time: ${Date.now() - M}`) } s.main = k; const I = new g(() => n), G = new g(() => n), D = ["scored", "recount", "firstrandom_off", "position", "easymode"] })(ge || (ge = {})); function Tt(s) { let e, t, n; return { c() { e = p("button"), e.textContent = "🤖 GUESS" }, m(i, r) { v(i, e, r), t || (n = Y(e, "click", s[0]), t = !0) }, p: S, i: S, o: S, d(i) { i && E(e), t = !1, n() } } } function Ft(s) { const e = { G: 0, Y: 1, B: 2 }; function t() { const n = ge.realtimeGameSolver(); jQuery(".col-25[data-type]").closest(".card-content-inner").find(".row").map((r, o) => ({ cellsResult: jQuery(o).find("[data-type]").map((q, l) => e[jQuery(l).data("type")]).get(), cellsGuess: jQuery(o).find("[data-type]").map((q, l) => jQuery(l).text()).get() })).get().forEach(r => n.submitResult(r.cellsGuess.join(""), r.cellsResult)), jQuery("#vaultcode").val(n.getGuess()) } return [t] } class xt extends Q { constructor(e) { super(), j(this, e, Ft, Tt, x, {}) } } var he; (s => { function e({ container: n }) { const i = $("<div />").appendTo($(n).find("#vaultcode").closest(".item-inner")); if (i.length) return new xt({ target: i[0] }) } function t() { B.onPageInit("crack", e) } s.setup = t })(he || (he = {})); typeof GM_getResourceURL < "u" && GM_addStyle(GM_getResourceURL("scriptStyle")); me.setup(); te.setup(); oe.setup(); le.setup(); he.setup(); de.setup(); K.setup();