0% found this document useful (0 votes)
233 views9 pages

POLLA

This document contains code for a Tampermonkey userscript. It defines several functions related to creating a GUI for a game settings menu, including functions for adding toggle buttons, dropdown selectors, and input fields to manage settings like sound options, view mode, frame rate, and more. It also includes code for managing player lists, room information, notifications, and connecting to a game server.

Uploaded by

j0s3 k1k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
233 views9 pages

POLLA

This document contains code for a Tampermonkey userscript. It defines several functions related to creating a GUI for a game settings menu, including functions for adding toggle buttons, dropdown selectors, and input fields to manage settings like sound options, view mode, frame rate, and more. It also includes code for managing player lists, room information, notifications, and connecting to a game server.

Uploaded by

j0s3 k1k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 9

// ==UserScript==

// @name New Userscript


// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.haxball.com/play
// @icon https://www.google.com/s2/favicons?sz=64&domain=haxball.com
// @grant none
// ==/UserScript==

(function (qc) {
function hc() { }
function r() { }
function q(a) {
this.Ta = a;
Error.captureStackTrace && Error.captureStackTrace(this, q)
}
function Wa(a) {
this.g = v.Ga(Wa.N);
v.Ea(this.g).get("features").textContent = a.join(", ")
}
function Xa() {
this.nl = new Qb;
this.g = v.Ga(Xa.N);
var a = v.Ea(this.g);
this.rg = a.get("ping");
this.wp = a.get("max-ping");
this.wo = a.get("fps");
v.xe(a.get("graph"), this.nl.g)
}
function P(a, b, c) {
var d = this;
this.g = v.Ga(P.N);
var e = v.Ea(this.g);
e.get("ok");
e.get("cancel");
this.Vd = e.get("content");
for (var f = e.get("title"), e = e.get("buttons"), g = 0, k = 0; k <
c.length;) {
var l = c[k++]
, t = window.document.createElement("button");
t.textContent = l;
t.onclick = function (a) {
return function () {
y.i(d.Va, a[0])
}
}([g++]);
e.appendChild(t)
}
this.Vd.textContent = b;
f.textContent = a
}
function aa(a) {
function b(a) {
var b = window.document.createElement("div");
b.className = "inputrow";
var c = window.document.createElement("div");
c.textContent = a;
b.appendChild(c);
for (var c = p.Eo(a), d = 0; d < c.length;) {
var e = [c[d]];
++d;
var f = [window.document.createElement("div")]
, g = e[0];
J.startsWith(e[0], "Key") && (g = D.substr(e[0], 3, null));
f[0].textContent = g;
b.appendChild(f[0]);
g = window.document.createElement("i");
g.className = "icon-cancel";
g.onclick = function (a, b) {
return function () {
p.Jq(b[0]);
n.A.tg.Xa(p);
a[0].remove()
}
}(f, e);
f[0].appendChild(g)
}
c = window.document.createElement("i");
c.className = "icon-plus";
b.appendChild(c);
c.onclick = function () {
q.classList.toggle("show", !0);
q.focus();
q.onkeydown = function (b) {
q.classList.toggle("show", !1);
b.stopPropagation();
b = b.code;
null == p.L(b) && (p.Pa(b, a),
n.A.tg.Xa(p),
r())
}
}
;
return b
}
function c(a, b, c) {
a = l.get(a);
if (null == c)
a.hidden = !0;
else {
a.innerHTML = b + ": <div class='flagico'></div> <span></span>";
b = a.querySelector(".flagico");
a = a.querySelector("span");
try {
b.classList.add("f-" + c.ub)
} catch (vc) { }
a.textContent = c.ub.toUpperCase()
}
}
function d(a, b, c, d) {
var e = l.get(a);
e.selectedIndex = d(b.L());
e.onchange = function () {
var a = c(e.selectedIndex);
b.Xa(a)
}
}
function e(a, b, c) {
function d(a) {
e.classList.toggle("icon-ok", a);
e.classList.toggle("icon-cancel", !a)
}
a = l.get(a);
a.classList.add("toggle");
var e = window.document.createElement("i");
e.classList.add("icon-ok");
a.insertBefore(e, a.firstChild);
a.onclick = function () {
var a = !b.L();
b.Xa(a);
d(a);
null != c && c(a)
}
;
d(b.L())
}
function f(a) {
var b = {
Jm: l.get(a + "btn"),
bh: l.get(a + "sec")
};
t.push(b);
b.Jm.onclick = function () {
g(b)
}
}
function g(a) {
for (var b = 0, c = 0; c < t.length;) {
var d = t[c];
++c;
var e = d == a;
e && (aa.$l = b);
d.bh.classList.toggle("selected", e);
d.Jm.classList.toggle("selected", e);
++b
}
}
null == a && (a = !1);
var k = this;
this.g = v.Ga(aa.N);
var l = v.Ea(this.g);
this.nd = l.get("close");
var t = [];
f("sound");
f("video");
f("misc");
f("input");
g(t[aa.$l]);
e("tsound-main", n.A.pm, function (a) {
n.Na.im(a ? 1 : 0)
});
e("tsound-chat", n.A.Hi);
e("tsound-highlight", n.A.om);
e("tsound-crowd", n.A.nm);
d("viewmode", n.A.Tb, function (a) {
return a - 1
}, function (a) {
return a + 1
});
d("fps", n.A.Fh, function (a) {
return a
}, function (a) {
return a
});
var h = [1, .75, .5, .25];
d("resscale", n.A.Sl, function (a) {
return h[a]
}, function (a) {
for (var b = 0, c = h.length - 1; b < c && !(h[b] <= a);)
++b;
return b
});
e("tvideo-teamcol", n.A.xm);
e("tvideo-showindicators", n.A.Ak);
e("tvideo-showavatars", n.A.lm);
var m = null
, m = function () {
var b = n.A.Ne.L();
c("loc", "Detected location", n.A.Me.L());
c("loc-ovr", "Location override", b);
var d = l.get("loc-ovr-btn");
d.disabled = !a;
null == b ? (d.textContent = "Override location",
d.onclick = function () {
A.i(k.Ep)
}
) : (d.textContent = "Remove override",
d.onclick = function () {
n.A.Ne.Xa(null);
m()
}
)
};
m();
var p = n.A.tg.L(), q = l.get("presskey"), r, u = l.get("inputsec");
r = function () {
v.Cf(u);
var a = b("Up");
u.appendChild(a);
a = b("Down");
u.appendChild(a);
a = b("Left");
u.appendChild(a);
a = b("Right");
u.appendChild(a);
a = b("Kick");
u.appendChild(a)
}
;
r();
this.nd.onclick = function () {
A.i(k.qb)
}
}
function Ya(a) {
this.fk = !1;
this.qm = new za(p.Ia);
this.Lj = new za(p.xa);
this.Hl = new za(p.fa);
var b = this;
this.g = v.Ga(Ya.N);
var c = v.Ea(this.g);
this.jc = c.get("room-name");
this.tm = c.get("start-btn");
this.vm = c.get("stop-btn");
this.gi = c.get("pause-btn");
this.xn = c.get("auto-btn");
this.Nk = c.get("lock-btn");
this.Rl = c.get("reset-all-btn");
this.Fl = c.get("rec-btn");
var d = c.get("link-btn")
, e = c.get("leave-btn")
, f = c.get("rand-btn");
this.wf = c.get("time-limit-sel");
this.qf = c.get("score-limit-sel");
this.rm = c.get("stadium-name");
this.sm = c.get("stadium-pick");
this.sm.onclick = function () {
A.i(b.Xp)
}
;
this.Th(c.get("red-list"), this.Hl, p.fa, a);
this.Th(c.get("blue-list"), this.Lj, p.xa, a);
this.Th(c.get("spec-list"), this.qm, p.Ia, a);
this.Uk(this.wf, this.Tk(15));
this.Uk(this.qf, this.Tk(15));
this.wf.onchange = function () {
y.i(b.aq, b.wf.selectedIndex)
}
;
this.qf.onchange = function () {
y.i(b.Tp, b.qf.selectedIndex)
}
;
this.tm.onclick = function () {
A.i(b.Yp)
}
;
this.vm.onclick = function () {
A.i(b.Zp)
}
;
this.gi.onclick = function () {
A.i(b.Mp)
}
;
this.xn.onclick = function () {
A.i(b.Dp)
}
;
this.Nk.onclick = function () {
y.i(b.$p, !b.Xh)
}
;
this.Rl.onclick = function () {
null != b.ee && (b.ee(p.xa),
b.ee(p.fa))
}
;
this.Fl.onclick = function () {
A.i(b.Qp)
}
;
d.onclick = function () {
A.i(b.Wp)
}
;
e.onclick = function () {
A.i(b.de)
}
;
f.onclick = function () {
A.i(b.Pp)
}
;
this.Bj(!1);
this.Cj(!1)
}
function Za() {
var a = this;
this.g = v.Ga(Za.N);
var b = v.Ea(this.g);
this.Cb = b.get("input");
this.af = b.get("ok");
b.get("cancel").onclick = function () {
null != a.Va && a.Va(null)
}
;
this.Cb.maxLength = 30;
this.Cb.oninput = function () {
a.C()
}
;
this.Cb.onkeydown = function (b) {
13 == b.keyCode && a.Dc() && null != a.Va && a.Va(a.Cb.value)
}
;
this.af.onclick = function () {
a.Dc() && null != a.Va && a.Va(a.Cb.value)
}
;
this.C()
}
function $a(a) {
this.Xk = a.get("notice");
this.$n = a.get("notice-contents");
this.nd = a.get("notice-close");
this.Il()
}
function Aa(a) {
function b(a) {
function b() {
e.className = f.Ta ? "icon-ok" : "icon-cancel"
}
a = d.get(a);
var e = a.querySelector("i")
, f = {
Ta: !0
};
b();
a.onclick = function () {
f.Ta = !f.Ta;
b();
c.bn(c.dj)
}
;
return f
}
this.dj = [];
var c = this;
this.gs = a;
this.Ja = v.Ga(Aa.tj);
var d = v.Ea(this.Ja)
, e = new $a(d);
this.pj = d.get("refresh");
this.Tm = d.get("join");
a = d.get("create");
this.cs = d.get("count");
a.onclick = function () {
A.i(c.ws)
}
;
d.get("changenick").onclick = function () {
A.i(c.vs)
}
;
d.get("settings").onclick = function () {
A.i(c.ys)
}
;
var f = d.get("replayfile");
f.onchange = function () {
var a = f.files;
if (!(1 > a.length)) {
var a = a.item(0)
, b = new FileReader;
b.onload = function () {
y.i(c.xs, b.result)
}
;
b.readAsArrayBuffer(a)
}
}
;
this.fs = b("fil-full");
this.zs = b("fil-pass");
this.ns = d.get("listscroll");
this.Bs = Ba.cg(this.ns);
this.gj = d.get("list");
this.pj.onclick = function () {
e.Il();
c.Om()
}
;
this.Tm.onclick = function () {
null != c.Od && y.i(c.Ym, c.Od.Fs)
}
;
this.Om()
}
function ab(a) {
this.Ja = v.Ga(ab.tj, "tbody");
var b = v.Ea(this.Ja)
, c = b.get("name")
, d = b.get("players")
, e = b.get("distance")
, f = b.get("pass")
, b = b.get("flag");
this.Fs = a;
var g = a.vd;
c.textContent = g.w;
d.textContent = "" + g.I + "/" + g.Xe;
f.textContent = g.Ib ? "Yes" : "No";
e.textContent = "" + (a.Le | 0) + "km";
try {
b.classList.add("f-" + g.ub.toLowerCase())
} catch (k) { }
9 > a.vd.Id && this.Ja.classList.add("old")
}
function bb() {
this.gk = null;
var a = this;
this.g = v.Ga(bb.N);
var b = v.Ea(this.g);
this.Zf = b.get("link");
var c = b.get("copy")
, b = b.get("close");
this.Zf.onfocus = function () {
a.Zf.select()
}
;
c.onclick = function () {
a.Zf.select();
return window.document.execCommand("Copy")
}
;
b.onclick = function () {
A.i(a.qb)
}
}
function ha(a) {
function b() {
var b = g[f];
a.pl = e ? b : 0;
d.get("spd").textContent = b + "x"
}
this.Wf = !1;
var c = this;
this.g = v.Ga(ha.N);
var d = v.Ea(this.g);
this.ti = a;
d.get("reset").onclick = function () {
a.ui();
c.el()
}
;
var e = !0
, f = 2
, g = [.5, .75, 1, 2, 3];
b();
var k = d.get("playicon");
k.classList.add("icon-pause");
d.get("play").onclick = function () {
e = !e;
var a = k.classList;
a.toggle("icon-play", !e);
a.toggle("icon-pause", e);
b()
}
;
d.get("spdup").onclick = function () {
f += 1;
var a = g.length - 1;
f > a && (f = a);
b()
}
;
d.get("spddn").onclick = function () {
--f;
0 > f && (f = 0);
b()
}
;
this.Er = d.get("time");
var l = d.get("timebar");
this.Aq = d.get("progbar");
for (var t = d.get("timetooltip"), h = 0, m = a.Vk; h < m.length;) {
var n = m[h];
++h;
var p = window.document.createElement("div");

You might also like