we do a little trolling
// ==UserScript==
// @name Minebuns
// @description we do a little trolling
// @version 1.0.0
// @author crackbob
// @homepage https://github.com/crackbob/Minebuns
// @supportURL https://github.com/crackbob/Minebuns
// @match *://minefun.io/*
// @grant none
// @namespace https://greasyfork.org/users/1555234
// ==/UserScript==
(() => {
"use strict";
var e = {
679: (e, t, n) => {
n.d(t, {
A: () => r
});
var s = n(601),
o = n.n(s),
i = n(314),
a = n.n(i)()(o());
a.push([e.id, "@font-face {\n font-family: \"Product Sans\";\n src: url(https://fonts.gstatic.com/s/productsans/v19/pxiDypQkot1TnFhsFMOfGShVF9eO.woff2);\n}\n\n:root {\n --Minebuns-accent-color: linear-gradient(90deg, rgb(64, 190, 255) 0%, rgb(129, 225, 255) 100%);\n --button-color: rgb(40, 40, 40, 0.9);\n --hover-color: rgb(50, 50, 50, 0.9);\n --panel-bg: rgb(34, 34, 34, 0.85);\n --panel-bg: rgb(10, 10, 10, 0.85);\n --text-color: #ffffff;\n --header-text-size: 25px;\n --button-text-size: 20px;\n --setting-text-size: 15px;\n}\n\n.gui-panel {\n position: fixed;\n z-index: 1000;\n width: 200px;\n border-radius: 8px;\n background-color: var(--panel-bg);\n box-shadow: 0 4px 8px rgba(0,0,0,0.3);\n font-family: 'Product Sans', sans-serif;\n color: var(--text-color);\n overflow: hidden;\n}\n\n.gui-header {\n background-color: var(--header-bg);\n height: 40px;\n font-weight: 900;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--header-text-size);\n cursor: grab;\n}\n\n.gui-header:active {\n cursor: grabbing;\n}\n\n.gui-button {\n height: 35px;\n display: flex;\n align-items: center;\n padding-left: 10px;\n box-sizing: border-box;\n cursor: pointer;\n border-radius: 0;\n transition: all 0.3s;\n font-size: var(--button-text-size);\n font-weight: 200;\n outline: none;\n background: var(--button-color);\n color: var(--text-color);\n}\n\n.gui-button.enabled {\n background: var(--Minebuns-accent-color);\n}\n\n.gui-button:not(.enabled):hover {\n background: var(--hover-color);\n}\n\n.gui-background {\n position: absolute;\n left: 0;\n top: 0;\n z-index: 999;\n height: 100%;\n width: 100%;\n backdrop-filter: blur(15px);\n background: rgba(0, 0, 0, 0.3);\n}\n\n.gui-setting-container {\n display: flex;\n align-items: center;\n justify-content: space-between;\n background-color: var(--panel-bg);\n padding: 2px;\n}\n\n.gui-setting-label {\n font-size: var(--setting-text-size);\n margin-left: 10px;\n font-weight: 300;\n color: var(--text-color);\n}\n\n.gui-checkbox {\n width: 15px;\n height: 15px;\n border-radius: 4px;\n background: var(--button-color);\n position: relative;\n margin: 8px;\n cursor: pointer;\n transition: background 0.3s;\n}\n\n.gui-checkbox.enabled {\n background: var(--Minebuns-accent-color);\n}\n\n.gui-color-picker {\n width: 15px;\n height: 15px;\n border-radius: 4px;\n position: relative;\n margin: 8px;\n cursor: pointer;\n}\n\n.gui-color-input {\n width: 20px;\n height: 20px;\n opacity: 0;\n cursor: pointer;\n}\n\n.gui-button-container {\n background-color: var(--panel-bg);\n display: flex;\n flex-direction: column;\n}\n\n.gui-text-input {\n background: var(--button-color);\n border: none;\n color: var(--text-color);\n font-family: 'Product Sans', sans-serif;\n font-size: var(--setting-text-size);\n width: 40px;\n border-radius: 4px;\n outline: none;\n transition: background 0.3s;\n text-align: center;\n margin: 5px;\n margin-right: 10px;\n}\n\n.gui-text-input:hover {\n background: var(--hover-color);\n}\n\n.gui-text-input:focus {\n background: var(--hover-color);\n}\n\n.with-animations .gui-panel {\n animation: fadeInScale 0.3s ease-out;\n}\n\n@keyframes fadeInScale {\n from {\n opacity: 0;\n transform: scale(0.9);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n\n.with-animations .gui-background {\n animation: fadeIn 0.3s ease-out;\n}\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n.with-animations .gui-button {\n transition: transform 0.2s ease, background 0.2s ease;\n}\n\n.with-animations .gui-button:hover {\n transform: scale(1.01);\n}\n\n.with-animations .gui-setting-container {\n will-change: transform, opacity;\n transform-origin: top;\n animation: slideDown 0.25s ease-out forwards;\n}\n\n@keyframes slideDown {\n from {\n opacity: 0;\n transform: scaleY(0.8);\n }\n to {\n opacity: 1;\n transform: scaleY(1);\n }\n}\n", ""]);
const r = a
},
314: e => {
e.exports = function(e) {
var t = [];
return t.toString = function() {
return this.map((function(t) {
var n = "",
s = void 0 !== t[5];
return t[4] && (n += "@supports (".concat(t[4], ") {")), t[2] && (n += "@media ".concat(t[2], " {")), s && (n += "@layer".concat(t[5].length > 0 ? " ".concat(t[5]) : "", " {")), n += e(t), s && (n += "}"), t[2] && (n += "}"), t[4] && (n += "}"), n
})).join("")
}, t.i = function(e, n, s, o, i) {
"string" == typeof e && (e = [
[null, e, void 0]
]);
var a = {};
if (s)
for (var r = 0; r < this.length; r++) {
var l = this[r][0];
null != l && (a[l] = !0)
}
for (var d = 0; d < e.length; d++) {
var c = [].concat(e[d]);
s && a[c[0]] || (void 0 !== i && (void 0 === c[5] || (c[1] = "@layer".concat(c[5].length > 0 ? " ".concat(c[5]) : "", " {").concat(c[1], "}")), c[5] = i), n && (c[2] ? (c[1] = "@media ".concat(c[2], " {").concat(c[1], "}"), c[2] = n) : c[2] = n), o && (c[4] ? (c[1] = "@supports (".concat(c[4], ") {").concat(c[1], "}"), c[4] = o) : c[4] = "".concat(o)), t.push(c))
}
}, t
}
},
601: e => {
e.exports = function(e) {
return e[1]
}
},
72: e => {
var t = [];
function n(e) {
for (var n = -1, s = 0; s < t.length; s++)
if (t[s].identifier === e) {
n = s;
break
} return n
}
function s(e, s) {
for (var i = {}, a = [], r = 0; r < e.length; r++) {
var l = e[r],
d = s.base ? l[0] + s.base : l[0],
c = i[d] || 0,
p = "".concat(d, " ").concat(c);
i[d] = c + 1;
var u = n(p),
h = {
css: l[1],
media: l[2],
sourceMap: l[3],
supports: l[4],
layer: l[5]
};
if (-1 !== u) t[u].references++, t[u].updater(h);
else {
var m = o(h, s);
s.byIndex = r, t.splice(r, 0, {
identifier: p,
updater: m,
references: 1
})
}
a.push(p)
}
return a
}
function o(e, t) {
var n = t.domAPI(t);
return n.update(e),
function(t) {
if (t) {
if (t.css === e.css && t.media === e.media && t.sourceMap === e.sourceMap && t.supports === e.supports && t.layer === e.layer) return;
n.update(e = t)
} else n.remove()
}
}
e.exports = function(e, o) {
var i = s(e = e || [], o = o || {});
return function(e) {
e = e || [];
for (var a = 0; a < i.length; a++) {
var r = n(i[a]);
t[r].references--
}
for (var l = s(e, o), d = 0; d < i.length; d++) {
var c = n(i[d]);
0 === t[c].references && (t[c].updater(), t.splice(c, 1))
}
i = l
}
}
},
659: e => {
var t = {};
e.exports = function(e, n) {
var s = function(e) {
if (void 0 === t[e]) {
var n = document.querySelector(e);
if (window.HTMLIFrameElement && n instanceof window.HTMLIFrameElement) try {
n = n.contentDocument.head
} catch (e) {
n = null
}
t[e] = n
}
return t[e]
}(e);
if (!s) throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
s.appendChild(n)
}
},
540: e => {
e.exports = function(e) {
var t = document.createElement("style");
return e.setAttributes(t, e.attributes), e.insert(t, e.options), t
}
},
56: (e, t, n) => {
e.exports = function(e) {
var t = n.nc;
t && e.setAttribute("nonce", t)
}
},
825: e => {
e.exports = function(e) {
if ("undefined" == typeof document) return {
update: function() {},
remove: function() {}
};
var t = e.insertStyleElement(e);
return {
update: function(n) {
! function(e, t, n) {
var s = "";
n.supports && (s += "@supports (".concat(n.supports, ") {")), n.media && (s += "@media ".concat(n.media, " {"));
var o = void 0 !== n.layer;
o && (s += "@layer".concat(n.layer.length > 0 ? " ".concat(n.layer) : "", " {")), s += n.css, o && (s += "}"), n.media && (s += "}"), n.supports && (s += "}");
var i = n.sourceMap;
i && "undefined" != typeof btoa && (s += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i)))), " */")), t.styleTagTransform(s, e, t.options)
}(t, e, n)
},
remove: function() {
! function(e) {
if (null === e.parentNode) return !1;
e.parentNode.removeChild(e)
}(t)
}
}
}
},
113: e => {
e.exports = function(e, t) {
if (t.styleSheet) t.styleSheet.cssText = e;
else {
for (; t.firstChild;) t.removeChild(t.firstChild);
t.appendChild(document.createTextNode(e))
}
}
}
},
t = {};
function n(s) {
var o = t[s];
if (void 0 !== o) return o.exports;
var i = t[s] = {
id: s,
exports: {}
};
return e[s](i, i.exports, n), i.exports
}
n.n = e => {
var t = e && e.__esModule ? () => e.default : () => e;
return n.d(t, {
a: t
}), t
}, n.d = (e, t) => {
for (var s in t) n.o(t, s) && !n.o(e, s) && Object.defineProperty(e, s, {
enumerable: !0,
get: t[s]
})
}, n.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t), n.nc = void 0;
const s = {
listeners: {},
activeKeys: new Set,
on: function(e, t) {
this.listeners[e] || (this.listeners[e] = []), this.listeners[e].push(t)
},
remove: function(e, t) {
this.listeners[e] && (this.listeners[e] = this.listeners[e].filter((e => e !== t)))
},
emit: function(e, t) {
this.listeners[e] && this.listeners[e].forEach((e => e(t)))
},
trackKey: function(e, t, n) {
"keydown" === e && moduleManager.handleKeyPress(n), "keydown" !== e || this.activeKeys.has(t) || (this.activeKeys.add(t), this.emit("keyPress", {
key: t,
code: n
})), "keyup" === e && this.activeKeys.has(t) && (this.activeKeys.delete(t), this.emit("keyRelease", {
key: t,
code: n
}))
}
};
class o {
constructor(e, t, n, s) {
this.name = e, this.category = t, this.options = n, this.keybind = s, this.waitingForBind = !1, this.isEnabled = !1, this.toggle = this.toggle.bind(this)
}
onEnable() {}
onDisable() {}
onRender() {}
onSettingUpdate() {}
enable() {
this.isEnabled = !0, s.emit("module.update", this), this.onEnable()
}
disable() {
this.isEnabled = !1, s.emit("module.update", this), this.onDisable()
}
toggle() {
this.isEnabled ? this.disable() : this.enable()
}
}
class i extends o {
constructor() {
super("Arraylist", "Visual"), this.namesMap = {}, this.arraylistContainer = null, this.initialized = !1
}
update(e, t) {
if (t) {
if (!this.namesMap[e]) {
let t = document.createElement("div");
t.style.backgroundColor = "rgba(10, 10, 10, 0.7)", t.style.color = "white", t.style.padding = "2px 10px 2px 10px", t.style.display = "flex", t.style.alignItems = "center", t.style.boxSizing = "border-box", t.style.margin = "0", t.style.fontFamily = "'Product Sans', sans-serif", t.style.boxShadow = "rgb(0, 0, 0, 0.05) -5px 1px", t.style.transition = "max-height 0.2s ease-in-out, opacity 0.2s ease-in-out", t.style.overflow = "hidden", t.style.maxHeight = "0", t.style.opacity = "0";
let n = document.createElement("span");
n.style.fontWeight = "800", n.style.fontSize = "16px", n.style.backgroundImage = "var(--Minebuns-accent-color)", n.style.color = "transparent", n.style.backgroundClip = "text", n.innerHTML = e, t.appendChild(n), this.arraylistContainer.appendChild(t), setTimeout((() => {
t.style.maxHeight = "50px", t.style.opacity = "1"
}), 1), this.namesMap[e] = t
}
} else if (this.namesMap[e]) {
const t = this.namesMap[e];
t.style.maxHeight = "0", t.style.opacity = "0", setTimeout((() => {
this.arraylistContainer.removeChild(t), delete this.namesMap[e]
}), 5)
}
const n = Object.values(this.namesMap).sort(((e, t) => this.measureElementWidth(t) - this.measureElementWidth(e)));
this.arraylistContainer.innerHTML = "", n.forEach((e => {
this.arraylistContainer.appendChild(e)
}))
}
onEnable() {
this.initialized ? this.arraylistContainer.style.opacity = "1" : (this.arraylistContainer = document.createElement("div"), this.arraylistContainer.style.flexDirection = "column", this.arraylistContainer.style.position = "absolute", this.arraylistContainer.style.zIndex = "1000", this.arraylistContainer.style.display = "flex", this.arraylistContainer.style.right = "5px", this.arraylistContainer.style.top = "5px", this.arraylistContainer.style.alignItems = "flex-end", this.arraylistContainer.style.pointerEvents = "none", this.arraylistContainer.style.textTransform = "lowercase", this.arraylistContainer.style.border = "2px solid transparent", this.arraylistContainer.style.borderImage = "var(--Minebuns-accent-color)", this.arraylistContainer.style.borderImageSlice = "1", this.arraylistContainer.style.borderBottom = "0", this.arraylistContainer.style.borderLeft = "0", document.body.appendChild(this.arraylistContainer), s.on("module.update", (e => {
this.update(e.name, e.isEnabled)
})), this.initialized = !0)
}
measureElementWidth(e) {
return e.getBoundingClientRect().width
}
onDisable() {
this.arraylistContainer.style.opacity = "0"
}
}
const a = {
get stores() {
if (this._stores) return this._stores;
{
let e = app._vnode.component.appContext.provides,
t = e[Object.getOwnPropertySymbols(e).find((t => e[t]._s))];
return this._stores = t._s
}
},
get gameWorld() {
return this.stores.get("gameState").gameWorld
}
};
class r extends o {
constructor() {
super("Watermark", "Visual", {
Text: "quang_"
})
}
onSettingUpdate() {
let e = document.querySelector(".Minebuns-overlay-title");
e && (e.textContent = this.options.Text)
}
onEnable() {
let e = document.querySelector(".Minebuns-overlay-title");
e || (e = document.createElement("div"), e.className = "Minebuns-overlay-title", e.textContent = this.options.Text, e.style.position = "absolute", e.style.top = "0", e.style.left = "0", e.style.padding = "0.5em", e.style.userSelect = "none", e.style.display = "none", e.style.zIndex = "1000", e.style.textShadow = "var(--Minebuns-accent-color) 0px 0px 10px", e.style.fontFamily = "'Product Sans', sans-serif", e.style.fontSize = "24px", e.style.background = "var(--Minebuns-accent-color)", e.style.backgroundClip = "text", e.style.webkitFontSmoothing = "antialiased", e.style.webkitTextFillColor = "transparent", document.body.appendChild(e)), document.querySelector(".Minebuns-overlay-title").style.display = "flex"
}
onDisable() {
document.querySelector(".Minebuns-overlay-title").style.display = "none"
}
}
class l {
constructor(e, t) {
this.module = e, this.container = t, this.components = [], this.initialized = !1, this.isOpen = !1
}
initialize() {
!this.initialized && this.module?.options && (Object.keys(this.module.options).forEach((e => {
const t = this.module.options[e],
n = typeof t;
e.toLowerCase().includes("color") ? this.addColorPicker(e) : "boolean" === n || "true" === t || "false" === t ? this.addCheckbox(e) : "string" === n ? this.addStringInput(e) : this.addNumberInput(e)
})), this.components.forEach((e => e.style.display = "none")), this.initialized = !0)
}
toggle() {
this.isOpen = !this.isOpen, this.components.forEach((e => {
e.style.display = this.isOpen ? "flex" : "none", this.isOpen ? this.container.style.marginBottom = "5px" : this.container.style.marginBottom = "0px"
}))
}
addNumberInput(e) {
const t = document.createElement("div");
t.className = "gui-setting-container";
const n = document.createElement("span");
n.className = "gui-setting-label", n.textContent = e;
const o = document.createElement("input");
o.type = "text", o.className = "gui-text-input", o.value = this.module.options[e];
let i = o.value;
o.addEventListener("input", (() => {
const t = o.value.trim();
isNaN(t) || "" === t || (i = t, this.module.options[e] = t, s.emit("setting.update", this.module))
})), o.addEventListener("blur", (() => {
(isNaN(o.value) || "" === o.value.trim()) && (o.value = i)
})), o.addEventListener("keydown", (e => {
"Enter" === e.key && o.blur()
})), t.appendChild(n), t.appendChild(o), this.container.appendChild(t), this.components.push(t)
}
addStringInput(e) {
const t = document.createElement("div");
t.className = "gui-setting-container";
const n = document.createElement("span");
n.className = "gui-setting-label", n.textContent = e;
const o = document.createElement("input");
o.type = "text", o.className = "gui-text-input", o.value = this.module.options[e], o.addEventListener("input", (() => {
const t = o.value.trim();
this.module.options[e] = t, s.emit("setting.update", this.module)
})), t.appendChild(n), t.appendChild(o), this.container.appendChild(t), this.components.push(t)
}
addCheckbox(e) {
const t = document.createElement("div");
t.className = "gui-setting-container";
const n = document.createElement("span");
n.className = "gui-setting-label", n.textContent = e;
const o = document.createElement("div");
o.className = "gui-checkbox", o.classList.toggle("enabled", !0 === this.module.options[e] || "true" === this.module.options[e]), o.addEventListener("click", (() => {
const t = o.classList.contains("enabled");
o.classList.toggle("enabled"), this.module.options[e] = (!t).toString(), s.emit("setting.update", this.module)
})), t.appendChild(n), t.appendChild(o), this.container.appendChild(t), this.components.push(t)
}
addColorPicker(e) {
const t = document.createElement("div");
t.className = "gui-setting-container";
const n = document.createElement("span");
n.className = "gui-setting-label", n.textContent = e;
const o = document.createElement("div");
o.className = "gui-color-picker", o.style.background = this.module.options[e];
const i = document.createElement("input");
i.type = "color", i.className = "gui-color-input", o.appendChild(i), i.addEventListener("input", (t => {
o.style.background = t.target.value, this.module.options[e] = t.target.value, s.emit("setting.update", this.module)
})), t.appendChild(n), t.appendChild(o), this.container.appendChild(t), this.components.push(t)
}
}
class d {
constructor(e, t = {
top: "200px",
left: "200px"
}) {
this.panel = document.createElement("div"), this.panel.className = "gui-panel", this.panel.style.top = t.top, this.panel.style.left = t.left, this.header = document.createElement("div"), this.header.className = "gui-header", this.header.textContent = e, this.panel.appendChild(this.header), document.body.appendChild(this.panel), this.buttons = [], this.setupDragHandling()
}
setupDragHandling() {
let e = !1,
t = {
x: 0,
y: 0
};
this.header.addEventListener("mousedown", (n => {
e = !0, t.x = n.clientX - this.panel.offsetLeft, t.y = n.clientY - this.panel.offsetTop
})), document.addEventListener("mousemove", (n => {
e && (this.panel.style.left = n.clientX - t.x + "px", this.panel.style.top = n.clientY - t.y + "px")
})), document.addEventListener("mouseup", (() => e = !1))
}
addButton(e) {
const t = document.createElement("div");
t.className = "gui-button-container";
const n = document.createElement("div");
n.className = "gui-button " + (e.isEnabled ? "enabled" : ""), n.textContent = e.name;
const s = new l(e, t);
return n.addEventListener("mousedown", (t => {
0 === t.button && (e.toggle(), n.classList.toggle("enabled", e.isEnabled)), 1 === t.button && (n.textContent = "waiting for bind..", e.waitingForBind = !0)
})), n.addEventListener("contextmenu", (e => {
e.preventDefault(), s.initialize(), s.toggle()
})), n.setAttribute("tabindex", -1), n.addEventListener("keydown", (t => {
n.textContent = e.name, e.waitingForBind && (t.preventDefault(), t.stopPropagation(), t.stopImmediatePropagation(), "Escape" === t.key ? e.keybind = null : e.keybind = String(t.code), e.waitingForBind = !1)
})), t.appendChild(n), this.panel.appendChild(t), this.buttons.push(n), n
}
show() {
this.panel.style.display = "block"
}
hide() {
this.panel.style.display = "none"
}
}
var c = n(72),
p = n.n(c),
u = n(825),
h = n.n(u),
m = n(659),
y = n.n(m),
g = n(56),
f = n.n(g),
v = n(540),
b = n.n(v),
x = n(113),
S = n.n(x),
E = n(679),
C = {};
C.styleTagTransform = S(), C.setAttributes = f(), C.insert = y().bind(null, "head"), C.domAPI = h(), C.insertStyleElement = b(), p()(E.A, C), E.A && E.A.locals && E.A.locals;
class k extends o {
constructor() {
super("ClickGUI", "Visual", {
"Accent Color 1": "rgb(64, 190, 255)",
"Accent Color 2": "rgb(129, 225, 255)",
"Button Color": "rgb(40, 40, 40, 0.9)",
"Hover Color": "rgb(50, 50, 50, 0.9)",
"Header Color": "rgb(0, 0, 0, 0.85)",
"Panel Color": "rgb(18 18 18)",
"Text Color": "#ffffff",
"Enable Animations": !0
}, "Comma"), this.GUILoaded = !1, this.panels = [], this.blurredBackground = null, this.updateColors()
}
updateAnimations() {
this.options["Enable Animations"] ? document.body.classList.add("with-animations") : document.body.classList.remove("with-animations")
}
updateColors() {
document.body.style.setProperty("--Minebuns-accent-color", `linear-gradient(90deg, ${this.options["Accent Color 1"]} 0%, ${this.options["Accent Color 2"]} 100%)`), document.body.style.setProperty("--button-color", this.options["Button Color"]), document.body.style.setProperty("--hover-color", this.options["Hover Color"]), document.body.style.setProperty("--header-bg", this.options["Header Color"]), document.body.style.setProperty("--panel-bg", this.options["Panel Color"]), document.body.style.setProperty("--text-color", this.options["Text Color"])
}
onEnable() {
document.pointerLockElement && document.exitPointerLock(), this.GUILoaded ? (this.showGUI(), this.updateAnimations()) : (this.setupBackground(), this.createPanels(), this.setupEventListeners(), this.GUILoaded = !0, this.updateAnimations())
}
setupBackground() {
this.blurredBackground = document.createElement("div"), this.blurredBackground.className = "gui-background", document.body.appendChild(this.blurredBackground)
}
createPanels() {
this.panels.forEach((e => {
e.panel && e.panel.parentNode && e.panel.parentNode.removeChild(e.panel)
})), this.panels = [], [{
title: "Combat",
position: {
top: "100px",
left: "100px"
}
}, {
title: "Movement",
position: {
top: "100px",
left: "320px"
}
}, {
title: "Visual",
position: {
top: "100px",
left: "540px"
}
}, {
title: "Misc",
position: {
top: "100px",
left: "760px"
}
}].forEach((e => {
const t = new d(e.title, e.position);
this.panels.push(t)
}));
const e = {};
Object.values(ee.modules).forEach((t => {
e[t.category] || (e[t.category] = []), e[t.category].push(t)
})), Object.entries(e).forEach((([e, t]) => {
const n = this.panels.find((t => t.header.textContent === e));
n && (t.sort(((e, t) => t.name.length - e.name.length)), t.forEach((e => n.addButton(e))))
}))
}
setupEventListeners() {
s.on("module.update", (e => {
const t = this.panels.find((t => t.header.textContent === e.category));
if (!t) return;
const n = t.buttons.find((t => t.textContent === e.name));
n && n.classList.toggle("enabled", e.isEnabled)
}))
}
showGUI() {
this.panels.forEach((e => e.show())), this.blurredBackground.style.display = "block"
}
onDisable() {
this.panels.forEach((e => e.hide())), this.blurredBackground.style.display = "none"
}
onSettingUpdate() {
this.updateColors(), this.updateAnimations()
}
}
class M extends o {
constructor() {
super("Airjump", "Movement", null)
}
onRender() {
a?.gameWorld?.player && (a.gameWorld.player.collision.isGrounded = !0)
}
}
class W extends o {
constructor() {
super("Instabreak", "Misc", null), this.originalHardness = new Map
}
onEnable() {
Object.values(a.gameWorld.items).forEach((e => {
e?.destruction && (this.originalHardness.has(e) || this.originalHardness.set(e, e.destruction.durability), e.destruction.durability = 0)
}))
}
onDisable() {
Object.values(a.gameWorld.items).forEach((e => {
e?.destruction && this.originalHardness.has(e) && (e.destruction.durability = this.originalHardness.get(e))
}))
}
}
class w extends o {
constructor() {
super("Nuker", "Misc", {
Radius: 3,
"Chunk Interval": 1e3
}), this.lastExecutionTime = 0
}
onRender() {
if (!a?.gameWorld?.player) return;
let e = this.options.Radius;
const t = this.options["Chunk Interval"],
n = Date.now();
if (n - this.lastExecutionTime >= t) {
this.lastExecutionTime = n;
let t = Object.values(a.gameWorld.player.position).splice(0, 3).map(Math.floor);
for (let n = -e; n <= e; n++)
for (let s = -e; s <= e; s++)
for (let o = -e; o <= e; o++) {
const [e, i, r] = [t[0] + n, t[1] + s, t[2] + o];
0 !== a.gameWorld.chunkManager.getBlock(e, i, r) && a.gameWorld.chunkManager.setBlock(e, i, r, 0, !0, !0)
}
}
}
}
class _ extends o {
constructor() {
super("AdBypass", "Misc")
}
onEnable() {
this._reward = this._reward || a.stores.get("adsStore").rewardCommercialVideoWrapper, a.stores.get("adsStore").rewardCommercialVideoWrapper = () => !0
}
onDisable() {
a.stores.get("adsStore").rewardCommercialVideoWrapper = () => this._reward
}
}
class P extends o {
constructor() {
super("Fly", "Movement", {
"Vertical Speed": 5
})
}
onRender() {
a?.gameWorld?.player && (a.gameWorld.player.velocity.gravity = 0, a?.gameWorld?.player?.inputs.jump ? a.gameWorld.player.velocity.velVec3.y = this.options["Vertical Speed"] : a?.gameWorld?.player?.inputs.crouch ? a.gameWorld.player.velocity.velVec3.y = -this.options["Vertical Speed"] : a.gameWorld.player.velocity.velVec3.y = 0)
}
onDisable() {
a.gameWorld.player.velocity.gravity = 23
}
}
class I extends o {
constructor() {
super("Speed", "Movement", {
Speed: 5
})
}
onRender() {
a?.gameWorld?.player && (a.gameWorld.player.velocity.moveSpeed = this.options.Speed, a.gameWorld.player.velocity.fastMoveSpeed = this.options.Speed)
}
onDisable() {
a.gameWorld.player.velocity.moveSpeed = 4.5, a.gameWorld.player.velocity.fastMoveSpeed = 6.4
}
}
class B extends o {
constructor() {
super("FreeHeadcoins", "Misc")
}
async onEnable() {
let e = await a.network.get("users/freeSpinner");
a.stores.get("userState").user.balance.headcoins += e.data.amount, ee.modules.FreeHeadcoins.disable()
}
}
class A extends o {
constructor() {
super("Fill", "Misc", {
Radius: 4,
"Block ID": 652,
"Chunk Interval": 50
}), this.lastExecutionTime = 0
}
onRender() {
if (!a?.gameWorld?.player) return;
let e = this.options.Radius;
const t = this.options["Chunk Interval"],
n = Date.now();
if (n - this.lastExecutionTime >= t) {
this.lastExecutionTime = n;
let t = Object.values(a.gameWorld.player.position).splice(0, 3).map(Math.floor);
for (let n = -e; n <= e; n++)
for (let s = -e; s <= e; s++)
for (let o = -e; o <= e; o++) {
const [e, i, r] = [t[0] + n, t[1] + s, t[2] + o];
0 == a.gameWorld.chunkManager.getBlock(e, i, r) && a.gameWorld.chunkManager.setBlock(e, i, r, this.options["Block ID"], !0, !0)
}
}
}
}
class T extends o {
constructor() {
super("Chams", "Visual", null)
}
onRender() {
a?.gameWorld?.player && a.gameWorld.server.players.forEach((e => {
e.playerMaterial.depthTest = !1, e.playerMaterial.wireframe = !0
}))
}
onDisable() {
a.gameWorld.server.players.forEach((e => {
e.playerMaterial.depthTest = !0, e.playerMaterial.wireframe = !1
}))
}
}
class N extends o {
constructor() {
super("FOVChanger", "Visual", {
FOV: 120
})
}
onRender() {
let e = a?.gameWorld?.threeScene?.camera || null;
e?.updateProjectionMatrix && e.fov !== parseFloat(this.options.FOV) && (e.fov = parseFloat(this.options.FOV), e.updateProjectionMatrix(), a.gameWorld.player.settings.__defineGetter__("fov", (() => parseFloat(this.options.FOV))))
}
onDisable() {
a.gameWorld.threeScene.camera = 70, a.gameWorld.threeScene.camera.updateProjectionMatrix(), delete a.gameWorld.player.settings.fov, a.gameWorld.player.settings.fov = 70
}
}
class R extends o {
constructor() {
super("Scaffold", "Movement", null)
}
onRender() {
if (!a?.gameWorld?.player) return;
let e = Object.values(a.gameWorld.player.position).splice(0, 3).map(Math.floor);
e[1]--;
let t = a.gameWorld.player.currentInventoryItemId,
n = a.gameWorld.chunkManager.getBlock(...e),
s = a.gameWorld.items[n]?.replaceable || !1;
(0 == n || s) && t && a.gameWorld.chunkManager.setBlock(...e, t, !0, !0)
}
}
const z = {
normalizeVector(e) {
const t = e.x * e.x + e.y * e.y + e.z * e.z;
if (t > 0) {
const n = 1 / Math.sqrt(t);
return [e.x * n, e.y * n, e.z * n]
}
return e
},
distanceBetween(e, t) {
const n = t.x - e.x,
s = t.y - e.y,
o = t.z - e.z;
return n * n + s * s + o * o
},
distanceBetweenSqrt(e, t) {
return Math.sqrt(this.distanceBetween(e, t))
},
calculateDistance: (e, t) => Math.hypot(t.x - e.x, t.y - e.y, t.z - e.z),
calculateDistanceArr: (e, t) => Math.hypot(t[0] - e[0], t[1] - e[1], t[2] - e[2])
},
D = {
getClosestPlayer() {
let e = a.gameWorld.player.position,
t = a.gameWorld.server.players,
n = [];
return t.forEach((function(t, s) {
let o = z.distanceBetween(e, {
x: t._model.position.x,
y: t._model.position.y,
z: t._model.position.z
});
t.id = s, n.push({
player: t,
distance: o
})
})), n.sort(((e, t) => e.distance - t.distance)), n.map((e => e.player))[0]
},
hexToRgb(e) {
var t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
return t ? {
r: parseInt(t[1], 16),
g: parseInt(t[2], 16),
b: parseInt(t[3], 16)
} : null
}
};
class O extends o {
constructor() {
super("Killaura", "Combat", {
"Y Offset": 1.62,
Reach: 5,
Delay: 100
}), this.lastExecutionTime = null
}
onRender() {
const e = Date.now();
a?.gameWorld?.player && e - this.lastExecutionTime >= this.options.Delay && (this.lastExecutionTime = e, this.tryKill())
}
tryKill() {
let e = this.options.Reach,
t = this.options["Y Offset"],
n = D.getClosestPlayer();
var s = {
x: a.gameWorld.player.position.x,
y: a.gameWorld.player.position.y + t,
z: a.gameWorld.player.position.z
},
o = n._model.position,
i = {
x: s.x - o.x,
y: s.y - o.y,
z: s.z - o.z
},
r = Math.sqrt(i.x * i.x + i.y * i.y + i.z * i.z);
0 !== r && (i.x /= r, i.y /= r, i.z /= r), i.x = -i.x, i.y = -i.y, i.z = -i.z;
var l = Math.sqrt(Math.pow(s.x - o.x, 2) + Math.pow(s.y - o.y, 2) + Math.pow(s.z - o.z, 2));
l < e && a.gameWorld.server.sendData(13, [a.gameWorld.time.localServerTimeMs, s.x, s.y, s.z, i.x, i.y, i.z, l, n.id])
}
}
class L extends o {
constructor() {
super("GunModifier", "Combat", {
Spread: .5,
"Bullets per shot": 100,
"Firerate (ms)": 1,
"Bullet distance": 1e3,
"Reload Time": 1,
Recoil: !1
})
}
get gunSystem() {
return a.gameWorld.systemsManager.activeSystems.find((e => e?.bulletsSystem))
}
onEnable() {
let e = this.gunSystem.playerShooter.currPlayerWeaponSpec;
e.bulletsPerShot = this.options["Bullets per shot"], e.firerateMs = this.options["Firerate (ms)"], e.distance = this.options["Bullet distance"], e.startSpread = this.options.Spread, e.reloadTimeMs = this.options["Reload Time"], this.options.Recoil || (e.recoilAttackY = 0, e.recoilAttackY = 0)
}
}
class F extends o {
constructor() {
super("Aimbot", "Combat", {
"On Aim": "true",
"On Shoot": "true",
"Y Offset": .5
}), this.lastExecutionTime = null
}
getClosestEnemy(e, t) {
let n = null,
s = 1 / 0;
return t.forEach((t => {
if (t?.model?.position && t.isAlive) {
let o = z.calculateDistance(e.position, t.model.position);
o < s && (s = o, n = t)
}
})), n
}
aimAtEnemy() {
let e = a.gameWorld.player,
t = a.gameWorld.server.players;
if (!e || !t) return;
let n = this.getClosestEnemy(e, t);
if (n) {
let t = n.model.position,
s = e.position,
o = {
x: t.x - s.x,
z: t.z - s.z
},
i = Math.atan2(o.x, o.z),
a = parseFloat(this.options["Y Offset"]),
r = t.y + a - s.y,
l = Math.hypot(o.x, o.z),
d = Math.atan2(r, l);
d = Math.max(Math.min(d, Math.PI / 2), -Math.PI / 2);
let c = (i + Math.PI) % (2 * Math.PI);
e.rotation.y = c, e.rotation.x = d
}
}
onRender() {
a?.gameWorld?.server && ("true" == this.options["On Aim"] && a.gameWorld.player.inputs.rightMB || "true" == this.options["On Shoot"] && a.gameWorld.player.inputs.leftMB || "true" !== this.options["On Shoot"] && "true" !== this.options["On Aim"]) && this.aimAtEnemy()
}
}
class H extends o {
constructor() {
super("NoClip", "Movement")
}
get playerPhysicsSystem() {
return a.gameWorld.systemsManager.activeSystems.find((e => e?.playerPhysicsSystem)).playerPhysicsSystem
}
onRender() {
a?.gameWorld?.player && (this._og = this._og || this.playerPhysicsSystem.resolveBlockCollision, this.playerPhysicsSystem.resolveBlockCollision == this._og && (this.playerPhysicsSystem.resolveBlockCollision = () => {}))
}
onDisable() {
this.playerPhysicsSystem.resolveBlockCollision = this._og
}
}
class U extends o {
constructor() {
super("Timer", "Movement", {
Multiplier: 1.2
}), this.interval = null
}
onEnable() {
this.interval && clearInterval(this.interval), this.interval = setInterval((() => {
a.gameWorld.time.elapsedTimeMs += 20 * this.options.Multiplier
}), 20)
}
onDisable() {
this.interval && clearInterval(this.interval)
}
}
const j = {
toServer: {
TIME_STEP_INFO: 1,
REQUEST_RESPAWN: 4,
GOT_DAMAGE: 27,
PARKOUR_REQUEST_RESPAWN: 1004,
ONE_BLOCK_REQUEST_RESPAWN: 1552,
BED_WARS_REQUEST_RESPAWN: 1600,
SANDBOX_REQUEST_RESPAWN: 1700
},
listeners: {},
packetListener(e, t) {
Object.values(this.listeners).forEach((n => {
let s = n(e, t);
null != s && (t = s)
})), a.gameWorld.server.msgsToSend.push(e, t)
},
init() {
s.on("render", (() => {
a?.gameWorld?.server?.sendData && (a.gameWorld.server.sendData = this.packetListener.bind(this))
}))
}
};
class K extends o {
constructor() {
super("NoFall", "Movement", null)
}
onEnable() {
j.listeners.NoFall = function(e, t) {
if (e == j.toServer.TIME_STEP_INFO && t.lp) {
let e = t.lp[3];
e > 0 && (t.lp[3] *= .01), e < 0 && (t.lp[3] = -.01), 0 == e && (t.lp[3] = -.01)
}
}
}
onDisable() {
delete j.listeners.NoFall
}
}
class V extends o {
constructor() {
super("HighJump", "Movement", {
"Jump Height": 25
})
}
onRender() {
a.gameWorld.player.velocity.jumpSpeed = parseFloat(this.options["Jump Height"])
}
onDisable() {
a.gameWorld.player.velocity.jumpSpeed = 8.285714285714286
}
}
class G extends o {
constructor() {
super("NoHunger", "Misc", null)
}
onEnable() {
j.listeners.NoHunger = function(e, t) {
e == j.toServer.TIME_STEP_INFO && (t.m && delete t.m, t.s && delete t.s, t.j && delete t.j)
}
}
onDisable() {
delete j.listeners.NoHunger
}
}
class q extends o {
constructor() {
super("NoDrown", "Misc", null)
}
get damageListener() {
return a.gameWorld.eventEmitter._events.get(48).values().next().value
}
onRender() {
a?.gameWorld?.eventEmitter?._events && this.damageListener.callback.toString().includes("damageToApply") && (this.damageListener.callback = () => {})
}
onDisable() {
a?.gameWorld?.eventEmitter?._events && (this.damageListener.callback = e => {
this.damageToApply += e
})
}
}
class Y extends o {
constructor() {
super("GroundSpeed", "Movement", {
Speed: 15
})
}
get playerPhysicsSystem() {
return a.gameWorld.systemsManager.activeSystems.find((e => e?.playerPhysicsSystem)).playerPhysicsSystem
}
resetMovementSpeed() {
a.gameWorld.player.velocity.moveSpeed = 4.5, a.gameWorld.player.velocity.fastMoveSpeed = 6.4
}
onRender() {
a?.gameWorld?.player && (a.gameWorld.player.collision.isGrounded ? (a.gameWorld.player.velocity.moveSpeed = this.options.Speed, a.gameWorld.player.velocity.fastMoveSpeed = this.options.Speed) : this.resetMovementSpeed())
}
onEnable() {
let e = 0,
t = 0;
this.playerPhysicsSystem.BB.min.__defineGetter__("y", (() => e - .1)), this.playerPhysicsSystem.BB.max.__defineGetter__("y", (() => t - .1)), this.playerPhysicsSystem.BB.min.__defineSetter__("y", (t => {
e = t
})), this.playerPhysicsSystem.BB.max.__defineSetter__("y", (e => {
t = e
}))
}
onDisable() {
this.resetMovementSpeed(), delete this.playerPhysicsSystem.BB.min.y, delete this.playerPhysicsSystem.BB.max.y
}
}
class Q extends o {
constructor() {
super("InstantRespawn", "Misc")
}
get gamemode() {
return location.pathname.replace("/match/", "")
}
onRender() {
if (a.gameWorld?.player.isAlive) return;
let e = !1;
switch (this.gamemode) {
case "one-block":
a.gameWorld.server.sendData(j.toServer.ONE_BLOCK_REQUEST_RESPAWN, !0), e = !0;
case "parkour":
a.gameWorld.server.sendData(j.toServer.PARKOUR_REQUEST_RESPAWN, !0), e = !0;
case "bedwars":
a.gameWorld.server.sendData(j.toServer.BED_WARS_REQUEST_RESPAWN, !0), e = !0;
case "survival":
a.gameWorld.server.sendData(j.toServer.SANDBOX_REQUEST_RESPAWN, !0), e = !0
}
e && a.stores.get("gameState").setLayoutState(0)
}
}
class Z extends o {
constructor() {
super("ShopAnywhere", "Misc")
}
get npcSystem() {
return a?.gameWorld?.systemsManager?.activeSystems.find((e => e?.isPlayerInShoppingZone))
}
onRender() {
this?.npcSystem?.isPlayerInShoppingZone && (this._og = this._og || this.npcSystem.isPlayerInShoppingZone, this.npcSystem.isPlayerInShoppingZone == this._og && (this.npcSystem.isPlayerInShoppingZone = () => !0))
}
onDisable() {
this.npcSystem.isPlayerInShoppingZone = this._og
}
}
class $ extends o {
constructor() {
super("SelfHarm", "Misc", {
Amount: 1
})
}
onEnable() {
a.gameWorld.server.msgsToSend.push(j.toServer.GOT_DAMAGE, parseFloat(this.options.Amount)), this.disable()
}
}
class X extends o {
constructor() {
super("BlockFinder", "Misc", {
"Search Radius": 16,
"Block ID": 581
}), this.CHUNK_SIZE = 16, this.CHUNK_CHECK_MS = 200, this.foundBlocks = [], this.lastChunkKey = "", this.chunkInterval = null, this.raf = null, this.ui = null, this.listEl = null
}
getPlayerChunk() {
const e = a.gameWorld.player.position;
return [Math.floor(e.x / this.CHUNK_SIZE), Math.floor(e.y / this.CHUNK_SIZE), Math.floor(e.z / this.CHUNK_SIZE)]
}
createUI() {
if (this.ui) return;
const e = document.createElement("div");
e.style.cssText = "\n position:fixed;\n top:80px;\n left:80px;\n width:260px;\n background:#111;\n color:#ddd;\n font:11px system-ui, sans-serif;\n border-radius:6px;\n box-shadow:0 6px 20px rgba(0,0,0,.4);\n z-index:99999;\n user-select:none;\n ", e.innerHTML = '\n <div class="bf-head" style="\n padding:6px 8px;\n cursor:move;\n opacity:.85;\n ">\n Block Finder\n </div>\n <div class="bf-list" style="\n max-height:260px;\n overflow:auto;\n padding:4px 8px 8px;\n font-family:monospace;\n white-space:pre;\n "></div>\n ', document.body.appendChild(e), this.ui = e, this.listEl = e.querySelector(".bf-list");
let t = !1,
n = 0,
s = 0;
e.querySelector(".bf-head").onmousedown = o => {
t = !0, n = o.clientX - e.offsetLeft, s = o.clientY - e.offsetTop
}, document.addEventListener("mousemove", this._dragMove = o => {
t && (e.style.left = o.clientX - n + "px", e.style.top = o.clientY - s + "px")
}), document.addEventListener("mouseup", this._dragUp = () => {
t = !1
})
}
destroyUI() {
this.ui && (this.ui.remove(), this.ui = null, this.listEl = null, document.removeEventListener("mousemove", this._dragMove), document.removeEventListener("mouseup", this._dragUp))
}
scanChunks() {
const e = 0 | this.options["Search Radius"],
t = 0 | this.options["Block ID"],
n = a.gameWorld.chunkManager,
s = this.getPlayerChunk();
this.foundBlocks.length = 0;
for (let o = -e; o <= e; o++)
for (let i = -e; i <= e; i++)
for (let r = -e; r <= e; r++) {
const e = s[0] + o,
l = s[1] + i,
d = s[2] + r,
c = n.getChunkArray(e, l, d);
if (c)
for (let n = 0; n < c.length; n++) {
if (c[n] !== t) continue;
const s = (e << 4) + (15 & n),
o = (l << 4) + (n >> 4 & 15),
i = (d << 4) + (n >> 8);
a.gameWorld.chunkManager.getBlock(s, o, i) === t && this.foundBlocks.push([s, o, i])
}
}
}
renderDistances = () => {
if (!this.listEl) return;
const e = [...a.gameWorld.player.position];
0 === this.foundBlocks.length ? this.listEl.textContent = "none nearby" : this.listEl.textContent = this.foundBlocks.map((t => ({
pos: t,
d: z.calculateDistanceArr(e, t)
}))).sort(((e, t) => e.d - t.d)).map((e => `${e.pos[0]}, ${e.pos[1]}, ${e.pos[2]} ${e.d.toFixed(1)}m`)).join("\n"), this.raf = requestAnimationFrame(this.renderDistances)
};
onEnable() {
this.createUI(), this.scanChunks(), this.renderDistances(), this.chunkInterval = setInterval((() => {
const e = this.getPlayerChunk().join(",");
e !== this.lastChunkKey && (this.lastChunkKey = e, this.scanChunks())
}), this.CHUNK_CHECK_MS)
}
onDisable() {
clearInterval(this.chunkInterval), cancelAnimationFrame(this.raf), this.chunkInterval = null, this.raf = null, this.foundBlocks.length = 0, this.lastChunkKey = "", this.destroyUI()
}
}
class J extends o {
constructor() {
super("Spider", "Movement", {
Speed: 5
})
}
get playerPhysicsSystem() {
return a.gameWorld.systemsManager.activeSystems.find((e => e?.playerPhysicsSystem)).playerPhysicsSystem
}
get upAgainstWall() {
return 0 == this.playerPhysicsSystem.playerVelVec3.x || 0 == this.playerPhysicsSystem.playerVelVec3.z
}
onRender() {
a?.gameWorld?.player && a?.gameWorld?.player?.inputs.jump && this.upAgainstWall && (a.gameWorld.player.velocity.velVec3.y = this.options.Speed)
}
}
const ee = {
modules: {},
addModules: function(...e) {
for (const t of e) {
let e = new t;
this.modules[e.name] = e
}
},
addModule: function(e) {
this.modules[e.name] = e
},
handleKeyPress: function(e) {
for (let t in this.modules) {
let n = this.modules[t];
n.waitingForBind ? (n.keybind = e, n.waitingForBind = !1) : n.keybind == e && n.toggle()
}
},
init() {
this.addModules(i, r, k, M, W, w, _, P, I, Y, B, A, T, N, R, O, L, F, H, U, K, V, G, q, Q, Z, $, X, J), s.on("render", (() => {
for (let e in this.modules) this.modules[e].isEnabled && this.modules[e].onRender()
})), s.on("keydown", this.handleKeyPress.bind(this)), s.on("setting.update", (() => {
for (let e in this.modules) this.modules[e].isEnabled && this.modules[e].onSettingUpdate()
})), this.modules.Arraylist.enable()
}
};
window.minebuns = new class {
constructor() {
this.version = "1.0.0", this.init()
}
init() {
setInterval((() => {
s.emit("render")
}), 1e3 / 60), document.addEventListener("keydown", (e => {
s.emit("keydown", e.code)
})), ee.init(), j.init(), this.packets = j, this.moduleManager = ee, this.hooks = a
}
disable() {}
}
})();