Code: Select all
_customEvent_StartChat: function () {
if (0 == this._TextMode) {
this._DrawXY[3] = 0, this._TextMode = 1;
var t = this._mginst,
s = this.actor,
a = this._DrawXY[0];
a = null == a ? 0 : "number" == typeof a ? e.__cast(a, k) : "number" == typeof a && (0 | a) === a ? e.__cast(a, n) : "boolean" == typeof a ? e.__cast(a, l) ? 1 : 0 : "string" == typeof a ? parseFloat(a) : parseFloat(g.string(a));
var A = this._DrawXY[1];
h.attachImageToActor(t, s, a - 4 | 0, (null == A ? 0 : "number" == typeof A ? e.__cast(A, k) : "number" == typeof A && (0 | A) === A ? e.__cast(A, n) : "boolean" == typeof A ? e.__cast(A, l) ? 1 : 0 : "string" == typeof A ? parseFloat(A) : parseFloat(g.string(A))) - 6 | 0, 1), t = this._BlinkingImgInst, s = this.actor, a = null == (a = this._DrawXY[0]) ? 0 : "number" == typeof a ? e.__cast(a, k) : "number" == typeof a && (0 | a) === a ? e.__cast(a, n) : "boolean" == typeof a ? e.__cast(a, l) ? 1 : 0 : "string" == typeof a ? parseFloat(a) : parseFloat(g.string(a)), A = this._DrawXY[1], h.attachImageToActor(t, s, 0 | a, (null == A ? 0 : "number" == typeof A ? e.__cast(A, k) : "number" == typeof A && (0 | A) === A ? e.__cast(A, n) : "boolean" == typeof A ? e.__cast(A, l) ? 1 : 0 : "string" == typeof A ? parseFloat(A) : parseFloat(g.string(A))) - 1 | 0, 1)
} else this._UserInputto = "", this._UserInputto = Pc.replace(this._UserInputto, " ", "_"), h.removeImage(this._mginst), h.removeImage(this._BlinkingImgInst), this._TextMode = 0, t = this._TextMap, s = "" + this._UserInputto, null != d.chat ? t.setReserved("chat", s) : t.h.chat = s, t = b.engine.getGameAttribute("OtherPlayers"), s = "" + g.string(b.engine.getGameAttribute("UserInfo")[0]), t = null != d[s] ? t.getReserved(s) : t.h[s], s = this._TextMap, t.setValue("ActorEvents_20", "_ChatText", null != d.chat ? s.getReserved("chat") : s.h.chat)
},
init: function () {
var s = this;
b.engine.getGameAttribute("PixelHelperActor")[20] = this.actor, this.actor.anchorToScreen(), this._TextMap = new m, this._TextMode = 0, this._UserInputto = "", this._DrawXY = [], this._DrawXY.push(7 - this.actor.getX()), this._DrawXY.push(457 - this.actor.getY()), this._DrawXY.push(0), this._DrawXY.push(0), this._mginst = t._customBlock_addImgInst("chatUI.png"), this._BlinkingImgInst = t._customBlock_addImgInst("CharTxt.png"), this._GenInfo = [], this._GenInfo.push(0), this.addMouseOverActorListener(this.actor, (function (e, t) {
s.wrapper.enabled && 5 == e && -1 == h.getCurrentSceneName().indexOf("Tutorial") && 0 == b.engine.getGameAttribute("MenuType") && (1 != b.engine.getGameAttribute("OptionsListAccount")[13] && 1 != b.engine.getGameAttribute("OptionsList")[21] || -1 != b.engine.getGameAttribute("OptionsListAccount")[12] ? (1 != b.engine.getGameAttribute("OptionsListAccount")[13] && 1 != b.engine.getGameAttribute("OptionsList")[21] && -1 == b.engine.getGameAttribute("OptionsListAccount")[12] && (b.engine.getGameAttribute("PixelHelperActor")[19].getValue("ActorEvents_293", "_GenInfo")[5] = "Map", e = b.engine.getGameAttribute("DNSM"), null != d.ChatChnlSEL ? e.setReserved("ChatChnlSEL", "Map") : e.h.ChatChnlSEL = "Map", e = b.engine.getGameAttribute("DNSM"), null != d.ChatPgSEL ? e.setReserved("ChatPgSEL", 0) : e.h.ChatPgSEL = 0), s._customEvent_StartChat()) : b.engine.getGameAttribute("OptionsListAccount")[12] = 1)
})), this.addKeyStateListener("enter", (function (t, a, A) {
if (!s._ConsoleMode) s.wrapper.enabled && a && (6 == b.engine.getGameAttribute("MenuType2") && 1 == b.engine.getGameAttribute("PixelHelperActor")[1].getValue("ActorEvents_116", "_UIinventoryOn2")[232] ? 1 == b.engine.getGameAttribute("PixelHelperActor")[1].getValue("ActorEvents_116", "_GeneralINFO")[28] ? (a = b.engine, t = b.engine.getGameAttribute("Money"), A = null == (A = b.engine.getGameAttribute("PixelHelperActor")[1].getValue("ActorEvents_116", "_GeneralINFO")[23]) ? 0 : "number" == typeof A ? e.__cast(A, k) : "number" == typeof A && (0 | A) === A ? e.__cast(A, n) : "boolean" == typeof A ? e.__cast(A, l) ? 1 : 0 : "string" == typeof A ? parseFloat(A) : parseFloat(g.string(A)), a = a.gameAttributes, t = Math.round(t - A), null != d.Money ? a.setReserved("Money", t) : a.h.Money = t, a = b.engine, t = b.engine.getGameAttribute("MoneyBANK"), A = null == (A = b.engine.getGameAttribute("PixelHelperActor")[1].getValue("ActorEvents_116", "_GeneralINFO")[23]) ? 0 : "number" == typeof A ? e.__cast(A, k) : "number" == typeof A && (0 | A) === A ? e.__cast(A, n) : "boolean" == typeof A ? e.__cast(A, l) ? 1 : 0 : "string" == typeof A ? parseFloat(A) : parseFloat(g.string(A)), a = a.gameAttributes, t = Math.round(t + A), null != d.MoneyBANK ? a.setReserved("MoneyBANK", t) : a.h.MoneyBANK = t, b.engine.getGameAttribute("PixelHelperActor")[1].getValue("ActorEvents_116", "_GeneralINFO")[28] = 0, b.engine.getGameAttribute("PixelHelperActor")[1].getValue("ActorEvents_116", "_GeneralINFO")[23] = 0) : 6 == b.engine.getGameAttribute("MenuType2") && 2 == b.engine.getGameAttribute("PixelHelperActor")[1].getValue("ActorEvents_116", "_GeneralINFO")[28] ? (a = b.engine, t = b.engine.getGameAttribute("MoneyBANK"), A = null == (A = b.engine.getGameAttribute("PixelHelperActor")[1].getValue("ActorEvents_116", "_GeneralINFO")[23]) ? 0 : "number" == typeof A ? e.__cast(A, k) : "number" == typeof A && (0 | A) === A ? e.__cast(A, n) : "boolean" == typeof A ? e.__cast(A, l) ? 1 : 0 : "string" == typeof A ? parseFloat(A) : parseFloat(g.string(A)), a = a.gameAttributes, t = Math.round(t - A), null != d.MoneyBANK ? a.setReserved("MoneyBANK", t) : a.h.MoneyBANK = t, a = b.engine, t = b.engine.getGameAttribute("Money"), A = null == (A = b.engine.getGameAttribute("PixelHelperActor")[1].getValue("ActorEvents_116", "_GeneralINFO")[23]) ? 0 : "number" == typeof A ? e.__cast(A, k) : "number" == typeof A && (0 | A) === A ? e.__cast(A, n) : "boolean" == typeof A ? e.__cast(A, l) ? 1 : 0 : "string" == typeof A ? parseFloat(A) : parseFloat(g.string(A)), a = a.gameAttributes, t = Math.round(t + A), null != d.Money ? a.setReserved("Money", t) : a.h.Money = t, b.engine.getGameAttribute("PixelHelperActor")[1].getValue("ActorEvents_116", "_GeneralINFO")[28] = 0, b.engine.getGameAttribute("PixelHelperActor")[1].getValue("ActorEvents_116", "_GeneralINFO")[23] = 0) : 6 == b.engine.getGameAttribute("MenuType2") && 3 == b.engine.getGameAttribute("PixelHelperActor")[1].getValue("ActorEvents_116", "_GeneralINFO")[28] && h.runLater(20, (function (e) {
b.engine.getGameAttribute("PixelHelperActor")[1].getValue("ActorEvents_116", "_GeneralINFO")[28] = 0, b.engine.getGameAttribute("PixelHelperActor")[1].getValue("ActorEvents_116", "_GeneralINFO")[23] = 0
}), s.actor) : 0 == s._TextMode ? 1 != b.engine.getGameAttribute("OptionsListAccount")[13] && 1 != b.engine.getGameAttribute("OptionsList")[21] || -1 != b.engine.getGameAttribute("OptionsListAccount")[12] ? (1 != b.engine.getGameAttribute("OptionsListAccount")[13] && 1 != b.engine.getGameAttribute("OptionsList")[21] && -1 == b.engine.getGameAttribute("OptionsListAccount")[12] && (b.engine.getGameAttribute("PixelHelperActor")[19].getValue("ActorEvents_293", "_GenInfo")[5] = "Map", t = b.engine.getGameAttribute("DNSM"), null != d.ChatChnlSEL ? t.setReserved("ChatChnlSEL", "Map") : t.h.ChatChnlSEL = "Map", t = b.engine.getGameAttribute("DNSM"), null != d.ChatPgSEL ? t.setReserved("ChatPgSEL", 0) : t.h.ChatPgSEL = 0), s._customEvent_StartChat()) : b.engine.getGameAttribute("OptionsListAccount")[12] = 1 : 1 == s._TextMode && (s._UserInputto = Pc.replace(s._UserInputto, " ", "_"), h.removeImage(s._mginst), h.removeImage(s._BlinkingImgInst), s._TextMode = 0, t = s._TextMap, a = "" + s._UserInputto, null != d.chat ? t.setReserved("chat", a) : t.h.chat = a, s._customEvent_ChatSend()))
})), this.addAnyKeyPressedListener((function (e, t) {
// CustomCodeHere
if (e.keyCode === 192) {
if (!s._ConsoleMode) {
s._ConsoleMode = 1;
s._customEvent_StartChat();
} else {
s._ConsoleMode = 0;
const [command, ...params] = s._UserInputto.split('_');
const character = b.engine.getGameAttribute('OtherPlayers').h[b.engine.getGameAttribute('UserInfo')[0]];
s._customEvent_StartChat();
if (command === 'drop') {
const item = params[0];
const amount = params[1] || 1;
try {
if (x.itemDefs.h[item]) {
let x = character.getXCenter()
let y = character.getValue('ActorEvents_20', '_PlayerNode');
I._customBlock_DropSomething(item, amount, 0, 0, 2, y, 0, x, y);
}
} catch (err) {
console.error(err);
}
}
if (command === 'wipeforge') {
newinv = [];
newinv2 = []
for (i = 0; i < b.engine.getGameAttribute("ForgeItemOrder").length; i++) {
newinv.push("Blank")
}
for (i = 0; i < b.engine.getGameAttribute("ForgeItemQuantity").length; i++) {
newinv.push(0)
}
b.engine.setGameAttribute('ForgeItemOrder', newinv);
b.engine.setGameAttribute('ForgeItemQuantity', newinv2);
}
if (command === 'unlock') {
const whatToUnlock = params[0];
if (whatToUnlock === 'portals') {
let portals = b.engine.getGameAttribute('KillsLeft2Advance');
portals = portals.map(entry => {
entry[0] = 0;
return entry;
});
b.engine.setGameAttribute('KillsLeft2Advance', portals);
}
}
}
}
s.wrapper.enabled && (16 == e.keyCode ? (b.engine.getGameAttribute("PixelHelperActor")[7].getValue("ActorEvents_340", "_GenINFO")[42] = 1, s._DrawXY[2] = 1, h.runLater(200, (function (e) {
s._DrawXY[2] = 0
}), s.actor)) : 8 == e.keyCode && 0 == s._DrawXY[3] && (s._DrawXY[3] = 1))
})), this.addAnyKeyReleasedListener((function (e, t) {
if (s.wrapper.enabled && 1 == s._TextMode) {
if (s._character = h.charFromCharCode(e.charCode), 32 == e.keyCode && (s._character = "_"), 8 == e.keyCode) 3 != s._DrawXY[3] && (s._UserInputto = s._UserInputto.substring(0, s._UserInputto.length - 1)), s._DrawXY[3] = 0;
else if (e = b.engine.getGameAttribute("NormalText"), t = s._character, (null != d[t] ? e.existsReserved(t) : e.h.hasOwnProperty(t)) ? e = !0 : (e = b.engine.getGameAttribute("CustomMaps"), e = null != d.ExtraLetters4Chat ? e.getReserved("ExtraLetters4Chat") : e.h.ExtraLetters4Chat, t = s._character, e = null != d[t] ? e.existsReserved(t) : e.h.hasOwnProperty(t)), e && 100 > s._UserInputto.length)
if (e = b.engine.getGameAttribute("NormalText"), t = s._character, null != d[t] ? e.existsReserved(t) : e.h.hasOwnProperty(t))
if (1 == s._DrawXY[2] || h.isKeyDown("Shift") ? (e = b.engine.getGameAttribute("NormalText"), t = s._character, e = "_" != (null != d[t] ? e.getReserved(t) : e.h[t])) : e = !1, e) {
e = s._UserInputto, t = b.engine.getGameAttribute("NormalText");
var n = s._character;
t = null != d[n] ? t.getReserved(n) : t.h[n], s._UserInputto = "" + (e + ("" + g.string(t)).toUpperCase())
} else e = s._UserInputto, t = b.engine.getGameAttribute("NormalText"), n = s._character, t = null != d[n] ? t.getReserved(n) : t.h[n], s._UserInputto = e + "" + g.string(t);
else e = b.engine.getGameAttribute("CustomMaps"), e = null != d.ExtraLetters4Chat ? e.getReserved("ExtraLetters4Chat") : e.h.ExtraLetters4Chat, t = s._character, (null != d[t] ? e.existsReserved(t) : e.h.hasOwnProperty(t)) && (e = s._UserInputto, t = b.engine.getGameAttribute("CustomMaps"), t = null != d.ExtraLetters4Chat ? t.getReserved("ExtraLetters4Chat") : t.h.ExtraLetters4Chat, n = s._character, t = null != d[n] ? t.getReserved(n) : t.h[n], s._UserInputto = e + "" + g.string(t));
"Lava_Flame2" == b.engine.getGameAttribute("UserInfo")[0] && ("1" == s._character ? s._UserInputto = "King_Doot" : "2" == s._character ? s._UserInputto = "Baba_Yaga" : "3" == s._character ? s._UserInputto = "Big_Poop" : "4" == s._character ? s._UserInputto = "Random_Spawn" : "5" == s._character && (s._UserInputto = "Gem_Drop"))
}
})), this.addWhenDrawingListener(null, (function (t, a, A, i) {
if (s.wrapper.enabled && 1 == s._TextMode) {
null != (a = h.getFont(75)) && a != t.font && (t.font = a), A = (s._ConsoleMode ? 'Console;' : "Chat;") + s._UserInputto, a = null == (a = s._DrawXY[0]) ? 0 : "number" == typeof a ? e.__cast(a, k) : "number" == typeof a && (0 | a) === a ? e.__cast(a, n) : "boolean" == typeof a ? e.__cast(a, l) ? 1 : 0 : "string" == typeof a ? parseFloat(a) : parseFloat(g.string(a)), i = null == (i = s._DrawXY[1]) ? 0 : "number" == typeof i ? e.__cast(i, k) : "number" == typeof i && (0 | i) === i ? e.__cast(i, n) : "boolean" == typeof i ? e.__cast(i, l) ? 1 : 0 : "string" == typeof i ? parseFloat(i) : parseFloat(g.string(i)), null == t.font && (t.font = t.defaultFont, t.font.fontScale != b.SCALE && (t.font.fontScale = b.SCALE)), t.drawActor ? null != t.actor && t.actor.isHUD ? (a = t.x + a * t.scaleX, i = t.y + i * t.scaleY) : (a = t.x + a * t.scaleX - b.cameraX, i = t.y + i * t.scaleY - b.cameraY) : (a = t.x + a * t.scaleX, i = t.y + i * t.scaleY), t.mtx.identity(), t.mtx.translate(a, i);
var o = null,
u = t.font;
u = A + ":" + u.ID + ":" + t.alpha + ":" + u.letterSpacing + ":" + b.SCALE;
var m = r.drawnStringCache;
if (null != d[u] ? m.existsReserved(u) : m.h.hasOwnProperty(u)) A = r.drawnStringCache, (A = null != d[u] ? A.getReserved(u) : A.h[u]).lifetime = 5, o = A.img;
else {
m = t.font.font.getTextWidth(A, t.font.letterSpacing, t.font.fontScale);
var c = t.font.font.getFontHeight() * t.font.fontScale | 0;
0 < m && 0 < c && (o = new C(m, c, !0, 0), t.font.font.renderToImg(o, A, 0, t.alpha, 0, 0, t.font.letterSpacing, t.font.fontScale, 0, !1), (A = new H).img = o, A.lifetime = 5, m = r.drawnStringCache, null != d[u] ? m.setReserved(u, A) : m.h[u] = A, r.drawnStringCacheKeys.push(u))
}
null != o && (t.graphics.beginBitmapFill(o, t.mtx, !1, E.antialias), t.graphics.drawRect(a, i, o.width, o.height), t.graphics.endFill()), a = s._BlinkingImgInst, t = t.font.getTextWidth((s._ConsoleMode ? 'Console;' : "Chat;") + s._UserInputto) / b.SCALE, A = s._DrawXY[0], h.setXForImage(a, Math.floor(t + (-1 + (null == A ? 0 : "number" == typeof A ? e.__cast(A, k) : "number" == typeof A && (0 | A) === A ? e.__cast(A, n) : "boolean" == typeof A ? e.__cast(A, l) ? 1 : 0 : "string" == typeof A ? parseFloat(A) : parseFloat(g.string(A))))))
}
})), h.runPeriodically(550, (function (e) {
if (s.wrapper.enabled)
if (1 == s._TextMode && (0 == s._GenInfo[0] ? (s._GenInfo[0] = 1, s._BlinkingImgInst.set_alpha(1)) : (s._BlinkingImgInst.set_alpha(0), s._GenInfo[0] = 0)), 1 == s._DrawXY[3]) s._DrawXY[3] = 2, h.runLater(400, (function (e) {
2 == s._DrawXY[3] && (s._DrawXY[3] = 3)
}), s.actor);
else if ((3 == s._DrawXY[3] || 4 == s._DrawXY[3]) && 0 < s._UserInputto.length) {
for (s._UserInputto = s._UserInputto.substring(0, s._UserInputto.length - 1), e = 0; 7 > e;) {
var t = e++;
h.runLater(1e3 * (.07 + .07 * t), (function (e) {
0 < s._UserInputto.length && (s._UserInputto = s._UserInputto.substring(0, s._UserInputto.length - 1)), 4 == s._DrawXY[3] && (s._UserInputto = s._UserInputto.substring(0, s._UserInputto.length - 1))
}), s.actor)
}
h.runLater(1200, (function (e) {
3 == s._DrawXY[3] && (s._DrawXY[3] = 4)
}), s.actor)
}
}), this.actor), this.addMobileKeyboardListener(400, (function (e) {
if (s.wrapper.enabled) {
s._UserInputto = Pc.replace(e, " ", "_"), e = 0;
for (var t = ("" + s._UserInputto).length; e < t;) {
var n = e++,
a = b.engine.getGameAttribute("NormalText"),
A = s._UserInputto.charAt(n);
(null != d[A] ? a.existsReserved(A) : a.h.hasOwnProperty(A)) ? A = !1: (A = b.engine.getGameAttribute("CustomMaps"), a = null != d.ExtraLetters4Chat ? A.getReserved("ExtraLetters4Chat") : A.h.ExtraLetters4Chat, A = s._UserInputto.charAt(n), A = !(null != d[A] ? a.existsReserved(A) : a.h.hasOwnProperty(A))), A && (s._UserInputto = Pc.replace(s._UserInputto, s._UserInputto.charAt(n), ";"))
}
s._UserInputto = Pc.replace(s._UserInputto, ";", ""), 100 <= s._UserInputto.length && (s._UserInputto = s._UserInputto.substring(0, 100)), h.setKeyboardText(s._UserInputto)
}
})), this.addMobileKeyboardListener(401, (function (e) {
if (s.wrapper.enabled) {
if (h.hideKeyboard(), 1 == s._TextMode) {
s._UserInputto = Pc.replace(e, " ", "_"), e = 0;
for (var t = ("" + s._UserInputto).length; e < t;) {
var n = e++,
a = b.engine.getGameAttribute("NormalText"),
A = s._UserInputto.charAt(n);
(null != d[A] ? a.existsReserved(A) : a.h.hasOwnProperty(A)) ? A = !1: (A = b.engine.getGameAttribute("CustomMaps"), a = null != d.ExtraLetters4Chat ? A.getReserved("ExtraLetters4Chat") : A.h.ExtraLetters4Chat, A = s._UserInputto.charAt(n), A = !(null != d[A] ? a.existsReserved(A) : a.h.hasOwnProperty(A))), A && (s._UserInputto = Pc.replace(s._UserInputto, s._UserInputto.charAt(n), ";"))
}
s._UserInputto = Pc.replace(s._UserInputto, ";", ""), 100 <= s._UserInputto.length && (s._UserInputto = s._UserInputto.substring(0, 100)), h.removeImage(s._mginst), h.removeImage(s._BlinkingImgInst), s._TextMode = 0, e = s._TextMap, t = "" + s._UserInputto, null != d.chat ? e.setReserved("chat", t) : e.h.chat = t, s._customEvent_ChatSend()
}
s._UserInputto = "", h.setKeyboardText("")
}
}))
},
forwardMessage: function (e) {},
__class__: E8
});
so you just press ` to open console, type wipeforge and press ` again (since this code is without the fix to enable enter/return
there is some code in that block that is untouched but it was easier to say down until
I added a small fix to the command as it removed items but left quantities of blank items
if you're unsure, zip your z.js file up and pm me a link to it.