// ==UserScript==
// @name Bonk Commands
// @namespace https://greatest.deepsurf.us/en/scripts/451341-bonk-commands
// @version 21.6
// @description Adds lots of commands to bonk.io. Type /? or /help in bonk chat to get started.
// @author LEGENDBOSS123 + left paren + mastery3
// @match https://bonk.io/*
// @match https://bonkisback.io/*
// @match https://multiplayer.gg/physics/*
// @run-at document-idle
// @grant none
// @unwrap
// ==/UserScript==
function BonkCommandsScriptInjector(f) {
if (window.location == window.parent.location) {
if (document.readyState == "complete") { f(); }
else { document.addEventListener('readystatechange', function () { setTimeout(f, 1500); }); }
}
}
BonkCommandsScriptInjector(function () {
var scope = window;
scope.scope = scope;
scope.Gwindow = document.getElementById("maingameframe").contentWindow;
scope.Gdocument = document.getElementById("maingameframe").contentDocument;
Gwindow.Gwindow = window;
Gwindow.Gdocument = document;
scope.link2pastebin = "https://pastebin.com/2b8XqqYu";
scope.link2greasyfork = "https://greatest.deepsurf.us/en/scripts/451341-bonk-commands";
if (typeof (scope.injectedBonkCommandsScript) == 'undefined') {
scope.injectedBonkCommandsScript = true;
}
else {
clearInterval(injectedBonkCommandsScript);
}
scope.GENERATE_COPRIME_NUMBER = function (mini = 0, maxi = 0, coprimewith = 0, choices = []) {
if (choices.length == 0) {
for (var i = mini; i < maxi + 1; i++) {
choices.push(i);
}
}
firstTry = choices[Math.floor(Math.random() * choices.length)];
for (var i = 2; i < firstTry + 1; i++) {
if (firstTry % i == 0 && coprimewith % i == 0) {
choices.splice(choices.indexOf(firstTry), 1);
if (choices.length == 0) {
return 0;
}
return GENERATE_COPRIME_NUMBER(mini, maxi, coprimewith, choices);
}
}
return firstTry;
};
scope.GENERATE_PRIME_NUMBER = function (mini = 0, maxi = 0, choices = []) {
if (choices.length == 0) {
for (var i = mini; i < maxi + 1; i++) {
choices.push(i);
}
}
firstTry = choices[Math.floor(Math.random() * choices.length)];
for (var i = 2; i < Math.floor(Math.sqrt(firstTry) + 1); i++) {
if (i != firstTry) {
if (firstTry % i == 0) {
choices.splice(choices.indexOf(firstTry), 1);
if (choices.length == 0) {
return 0;
}
return GENERATE_PRIME_NUMBER(mini, maxi, choices);
}
}
}
return firstTry;
};
scope.SHOW_MESSAGE = function (message) {
const theme = {
backdropBg: 'rgba(0, 0, 0, 0.4)',
modalBg: 'rgba(255, 255, 255, 0.9)',
textColor: '#222',
buttonBg: '#4A90E2',
buttonShadow: '4px 4px 8px rgba(0,0,0,0.1), -4px -4px 8px rgba(255,255,255,0.7)',
buttonHoverBg: '#357ABD',
borderRadius: '10px',
fontFamily: '"Segoe UI", Roboto, Arial, sans-serif',
fontSize: '1.25rem',
zIndex: '2147483647'
};
const backdrop = document.createElement('div');
Object.assign(backdrop.style, {
position: 'fixed',
inset: '0',
backgroundColor: theme.backdropBg,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
zIndex: theme.zIndex,
animation: 'fadeIn 0.3s ease'
});
const modal = document.createElement('div');
Object.assign(modal.style, {
backgroundColor: theme.modalBg,
borderRadius: theme.borderRadius,
boxShadow: '0 12px 24px rgba(0, 0, 0, 0.2)',
maxWidth: '90%',
width: '380px',
padding: '28px',
fontFamily: theme.fontFamily,
textAlign: 'center',
color: theme.textColor,
transform: 'translateY(-20px)',
animation: 'slideIn 0.4s ease forwards'
});
const textEl = document.createElement('p');
textEl.textContent = message;
Object.assign(textEl.style, {
margin: '0 0 24px',
fontSize: theme.fontSize,
lineHeight: '1.5'
});
const btn = document.createElement('button');
btn.textContent = 'OK';
Object.assign(btn.style, {
backgroundColor: theme.buttonBg,
border: 'none',
color: '#fff',
padding: '12px 28px',
fontSize: '1rem',
borderRadius: theme.borderRadius,
cursor: 'pointer',
boxShadow: theme.buttonShadow,
transition: 'background-color 0.2s ease, transform 0.2s ease'
});
btn.addEventListener('mouseenter', () => {
btn.style.backgroundColor = theme.buttonHoverBg;
btn.style.transform = 'scale(1.05)';
});
btn.addEventListener('mouseleave', () => {
btn.style.backgroundColor = theme.buttonBg;
btn.style.transform = 'scale(1)';
});
btn.addEventListener('click', () => {
document.body.removeChild(backdrop);
});
if (!document.getElementById('show-message-keyframes')) {
const styleTag = document.createElement('style');
styleTag.id = 'show-message-keyframes';
styleTag.textContent = `
@keyframes fadeIn {
from { opacity: 0 }
to { opacity: 1 }
}
@keyframes slideIn {
to { transform: translateY(0) }
}
`;
document.head.appendChild(styleTag);
}
modal.appendChild(textEl);
modal.appendChild(btn);
backdrop.appendChild(modal);
document.body.appendChild(backdrop);
};
scope.SHUFFLE_LIST = function (x) {
var nl = x.slice();
for (var i = nl.length - 1; i > 0; i--) {
var r = Math.floor(Math.random() * (i + 1));
var t = nl[i];
nl[i] = nl[r];
nl[r] = t;
}
return nl;
};
scope.str2ab = function (str) {
const buf = new ArrayBuffer(str.length);
const bufView = new Uint8Array(buf);
for (let i = 0, strLen = str.length; i < strLen; i++) {
bufView[i] = str.charCodeAt(i);
}
return buf;
};
scope.ab2str = function (buffer) {
return String.fromCharCode.apply(null, new Uint8Array(buffer));
};
scope.GENERATE_KEYS = async function () {
return crypto.subtle.generateKey({ name: "RSA-OAEP", modulusLength: 2048, publicExponent: new Uint8Array([1, 0, 1]), hash: { name: "SHA-256" } }, true, ["encrypt", "decrypt"]);
};
scope.CRYPT_NUMBER = function (key, data) {
result = 1;
for (var i = 0; i < key[1]; i++) {
result *= data;
result = result % key[0];
}
return result % key[0];
};
scope.ENCRYPT_MESSAGE = async function (key, data) {
try {
var encrypted = await window.crypto.subtle.encrypt(
{
name: "RSA-OAEP"
},
key,
new TextEncoder().encode(data)
);
return btoa(ab2str(encrypted));
}
catch (E) {
return 0;
}
};
scope.DECRYPT_MESSAGE = async function (key, data) {
try {
var decrypted = await window.crypto.subtle.decrypt(
{
name: "RSA-OAEP"
},
key,
str2ab(atob(data))
);
return new TextDecoder().decode(decrypted);
}
catch {
return 0;
}
};
scope.IMPORT_KEY = async function (key) {
return await crypto.subtle.importKey("spki", str2ab(atob(key)), public_key.algorithm, true, ["encrypt"]);
};
scope.EXPORT_KEY = async function (key) {
var result = await crypto.subtle.exportKey("spki", key);
return btoa(ab2str(result));
};
scope.loadMap = function (m, encode = true) {
var mapdata = m;
if (encode) {
var mapdata = encodeToDatabase(m);
}
RECIEVE('42' + JSON.stringify([29, mapdata]));
SEND('42' + JSON.stringify([23, { "m": mapdata }]));
};
if (typeof (scope.textdecoder) == 'undefined') { scope.textdecoder = new Gwindow.TextDecoder; }
if (typeof (scope.textencoder) == 'undefined') { scope.textencoder = new Gwindow.TextEncoder; }
scope.ACTIVATION_FUNCTIONS = class {
static RELU(x) {
return x > 0 ? x : 0;
}
static SIGMOID(x) {
return 1 / (1 + Math.exp(-x));
}
static TANH(x) {
return Math.tanh(x);
}
static LINEAR(x) {
return x;
}
static LEAKY_RELU(x) {
return x > 0 ? x : 0.01 * x;
}
static ELU(x) {
return x > 0 ? x : Math.exp(x) - 1;
}
static SWISH(x) {
return x * sigmoid(x);
}
static SOFTPLUS(x) {
return Math.log(1 + Math.exp(x));
}
};
class NUERON {
constructor(options) {
this.weights = options.weights || new Array(options.number_of_weights).fill(0);
this.bias = options.bias || 0;
this.activation_function = options.activation_function || "RELU";
}
dot(weights) {
var sum = 0;
for (var i = 0; i < this.weights.length; i++) {
sum += weights[i] * this.weights[i];
}
return ACTIVATION_FUNCTIONS[this.activation_function](sum + this.bias);
}
copy() {
return new NUERON({ weights: [...this.weights], bias: this.bias, activation_function: this.activation_function });
}
};
scope.AI = class {
constructor(options) {
this.layers = options.layers || [];
this.activation_functions = options.activation_functions || [];
this.layer_lengths = options.layer_lengths || [];
if (this.layers.length == 0) {
for (var i = 1; i < this.layer_lengths.length; i++) {
var layer = [];
for (var j = 0; j < this.layer_lengths[i]; j++) {
layer.push(new NUERON({ number_of_weights: this.layer_lengths[i - 1], bias: 0, activation_function: this.activation_functions[i - 1] }));
}
this.layers.push(layer);
}
}
else {
for (var i = 0; i < this.layers.length; i++) {
for (var j = 0; j < this.layers[i].length; j++) {
this.layers[i][j] = new NUERON(this.layers[i][j]);
}
}
}
}
feed_forward(layer_index, inputs) {
var output = [];
for (var i = 0; i < this.layers[layer_index].length; i++) {
output.push(this.layers[layer_index][i].dot(inputs));
}
return output;
}
predict(inputs) {
var inp = inputs;
for (var i = 0; i < this.layers.length; i++) {
inp = this.feed_forward(i, inp);
}
return inp;
}
mutate(weight_amount, weight_rate, bias_amount, bias_rate) {
for (var nueron of this.layers.flat()) {
for (var w in nueron.weights) {
if (Math.random() < weight_rate) {
nueron.weights[w] += (Math.random() - 0.5) * weight_amount;
}
}
if (Math.random() < bias_rate) {
nueron.bias += (Math.random() - 0.5) * bias_amount;
}
}
return this;
}
copy() {
var layers = [];
for (var i of this.layers) {
var layer = [];
for (var j of i) {
layer.push(j.copy());
}
layers.push(layer);
}
var copy = new AI({ layers: layers, activation_functions: this.activation_functions, layer_lengths: [...this.layer_lengths] });
return copy;
}
crossOver(other) {
var myflat = this.copy().layers.flat();
var otherflat = other.copy().layers.flat();
var cutIndex = Math.floor(Math.random() * myflat.length);
for (var i = 0; i < myflat.length; i++) {
if (i < cutIndex) {
myflat[i].weights = [...otherflat[i].weights];
myflat[i].bias = otherflat[i].bias;
}
else {
myflat[i].weights = [...myflat[i].weights];
myflat[i].bias = myflat[i].bias;
}
}
return this;
}
crossOver2(other) {
var myflat = this.copy().layers.flat();
var otherflat = other.copy().layers.flat();
for (var i = 0; i < myflat.length; i++) {
for (var j in myflat[i].weights) {
myflat[i].weights[j] = (otherflat[i].weights[j] + myflat[i].weights[j]) / 2;
}
myflat[i].bias = (otherflat[i].bias + myflat[i].bias) / 2;
}
return this;
}
};
scope.vtolai = new AI(JSON.parse('{"layers":[[{"weights":[-0.10263579890910668,-0.2952178389182252,0.18799870257519047,-0.1639676751455108,-0.09334303640552932,0.6268360507447082,-0.01725178807616057],"bias":-0.10210006790537415,"activation_function":"TANH"},{"weights":[0.04435392802403076,0.21599535666717096,-0.44070695343253974,-0.29356168236111563,-0.4489733068270134,-0.11809474718234814,0.21884174429347875],"bias":-0.23428097362944597,"activation_function":"TANH"},{"weights":[-0.06493677241079657,-0.11639917553069797,-0.04726847865769869,-0.407503633123229,0.5278351316264795,0.3136272938727664,0.7365550351350637],"bias":0.4056925001503699,"activation_function":"TANH"},{"weights":[-1.156395284155553,-0.11221146901433489,-0.14892848508672463,-0.3535211134085425,-0.08154190901477965,-0.2623309269080807,-0.9034415207351089],"bias":-0.2375403966923278,"activation_function":"TANH"},{"weights":[-0.2843099591151712,-0.0858569771434206,0.0389251835865197,-1.479898708494397,0.7523462339507919,0.27024719447201756,-0.33680672840767667],"bias":0.17574215169882343,"activation_function":"TANH"},{"weights":[0.28154903191550973,-0.5244710931148197,-0.4792130212183046,0.5173640774337066,0.4870364410546663,-0.350735625155759,0.4523865320259574],"bias":0.21711457873676815,"activation_function":"TANH"},{"weights":[0.18534188562393739,0.3839710751052321,0.34185915944222434,0.1669321534940979,-0.7345032381166988,-0.4541511520581824,0.48607297552369355],"bias":-0.2447588908230826,"activation_function":"TANH"},{"weights":[0.6773504211665503,0.1494715112484698,0.005972462254990648,-0.009261289055404966,-1.165343115876268,-0.04202312749259763,-0.18335965203487006],"bias":0.2876054996210003,"activation_function":"TANH"},{"weights":[-0.33855805128064775,-0.4538154314055001,-0.17973197400624913,0.4567025886584251,0.649443710085702,-0.6982178296006795,-0.2627262187730815],"bias":-0.8324138503283802,"activation_function":"TANH"},{"weights":[-0.3990784698111227,-0.2040194069138127,-0.38563798424091095,0.5415752027330236,-0.3413667675126858,-0.6894473933599696,-0.30356490060229574],"bias":0.4326496664759392,"activation_function":"TANH"},{"weights":[0.7561675121403927,-0.03954438092662314,-0.9355549707007053,0.49409014358094056,-0.11778607563102295,0.1173408631956834,0.3859754926219932],"bias":-0.80576859614539,"activation_function":"TANH"},{"weights":[-0.07481727798507441,-0.11325247683316693,-0.7652214743940842,-0.10239940817847565,0.08197619243348439,-0.05918512873418789,0.46097362635881045],"bias":0.1394171990670543,"activation_function":"TANH"},{"weights":[-0.2831762270275319,0.23206021415663985,0.3061202714151287,-0.023057527150708527,0.3332709895502056,0.37997063063344105,0.025787411588235533],"bias":-0.41867648038207556,"activation_function":"TANH"},{"weights":[-0.6096114922028635,-0.16197181250147974,-0.11030763883076156,0.29645149233297907,-0.0603884348084831,0.8815982985226926,-0.721546795233218],"bias":-0.6767558912289879,"activation_function":"TANH"},{"weights":[-1.1213002039599824,0.12720990994996653,-0.11683544750335227,0.37733256384380937,-0.004521370608526816,-0.6041727159427582,0.7758025516276769],"bias":0.5550481030887293,"activation_function":"TANH"},{"weights":[0.0758056135701714,0.12133356778743372,0.34739955152895496,-0.4825713445719486,0.38912453430057264,0.15030211177631725,-1.36928832292079],"bias":-0.05175544181008657,"activation_function":"TANH"},{"weights":[-0.40442816526926456,0.18477895806255978,0.8624891581722101,-0.11405455491439967,0.03680017671179353,0.2551385315671884,0.39431394381088447],"bias":-0.9831912316506344,"activation_function":"TANH"},{"weights":[-0.2855082363421706,0.38267040657493195,-0.2065775708765648,-0.5774996442665422,0.26068053775411426,0.5535336632682357,-0.4022720868245268],"bias":0.27404117124797334,"activation_function":"TANH"},{"weights":[-0.0022136754381010745,-0.5201906637396313,0.6407951970229301,0.07236814415539494,-0.4550888245082292,1.025295316740158,0.21306156854200922],"bias":-0.12502281803679308,"activation_function":"TANH"},{"weights":[0.8625620492336676,-0.19615604519916133,-0.3748284695751323,0.8263427918080569,0.37822132454327967,0.29851360478469485,0.3528890012345215],"bias":-0.4112901858001672,"activation_function":"TANH"},{"weights":[-0.13709470282030842,-0.12449300317209173,-0.4635980884682164,-0.5032640474724461,0.3822877631872465,-0.5298840757166637,-0.800857698829463],"bias":-0.13253510021793163,"activation_function":"TANH"},{"weights":[-0.19115536378615297,-0.5457907037951598,-0.14296599961308093,0.0004012453545279588,-0.07467801242218602,-0.4796498418310633,0.31895464797914663],"bias":-1.8976982334592705,"activation_function":"TANH"},{"weights":[-0.7376993233666528,-0.2788882661553752,-0.02339900563707609,-0.07221843670851824,0.21691782784657637,0.13997425606500244,0.5564964454811399],"bias":-0.8378782000053469,"activation_function":"TANH"},{"weights":[0.059276304207729134,0.9295472793800778,0.3190003953260826,-0.13547421641166146,1.373704139142272,-0.09464605543222805,-0.06500700678843138],"bias":-0.3053374800621591,"activation_function":"TANH"},{"weights":[-0.31090570626290837,-0.023796663095232467,0.9602193608416687,0.03456224556994127,0.06033395274081488,-0.008245408447705029,-0.6584609636600882],"bias":-0.05401607952171881,"activation_function":"TANH"},{"weights":[-0.24812305797447137,-0.8837050276286977,0.7003352227680587,0.3307987054044926,0.17504736207923535,0.38429804364866776,0.09652474975523104],"bias":-0.10225791939187953,"activation_function":"TANH"},{"weights":[0.1912787597809808,0.03546246838845869,-0.23935599515100364,1.3623299125681267,0.36343918159876665,-0.1392043336512812,-0.8347005544213476],"bias":-0.4832464420994841,"activation_function":"TANH"},{"weights":[0.14559729392826248,0.2664842165868472,-0.28671694508242984,-0.298876592058622,0.7349386965902974,-0.2824085363068033,-0.20516074293009354],"bias":0.2908486836739145,"activation_function":"TANH"},{"weights":[-0.0190456632994613,0.3669564765417195,0.11768915732934274,0.6149349658724911,-0.5770578832530735,0.17427410628405504,0.11737689737430677],"bias":-0.09968981132821972,"activation_function":"TANH"},{"weights":[-0.5677744045402707,-0.32651252554252047,-0.11479745605137814,-0.06890154166226325,0.13128722027492107,-0.7742804133617253,-1.036416926109706],"bias":0.19123583132497363,"activation_function":"TANH"},{"weights":[0.5355389696039183,-0.6513269184525615,-0.6851636754457517,-0.48432450118463016,0.6893393810986861,0.954257180454622,0.2683942810557184],"bias":-0.25003791343839943,"activation_function":"TANH"},{"weights":[0.08783988538908068,-0.12399824552299944,0.42001387072133506,0.19209653971730048,-0.28143766292897054,0.04372580284764889,0.26027704825108583],"bias":-0.40536067740249154,"activation_function":"TANH"},{"weights":[0.19979489190880698,0.19798806730778717,0.371324343966579,-0.42561773337355063,0.16347078722595426,-0.45954451481415254,0.09361695618611823],"bias":0.8634416567179205,"activation_function":"TANH"},{"weights":[0.7767111008428055,0.4027864167505665,1.3713443754237158,-0.22249279055815385,0.21324700314506584,0.378472642879611,0.7320159246487041],"bias":0.6447066642709773,"activation_function":"TANH"},{"weights":[0.2451277749585682,0.7582582935463329,0.16979167015252775,-0.21293710052992051,0.4187290292681488,-0.15040664920426372,0.3560425919140939],"bias":0.3316115496655095,"activation_function":"TANH"},{"weights":[0.6351901142102534,0.09737399224061266,0.28964341924309395,-0.35471896604273956,0.44153742046736677,-0.583220606814218,-0.2812191278207628],"bias":-0.04175809163113008,"activation_function":"TANH"},{"weights":[0.232664853164683,0.4842472409600531,0.03899372075690252,-0.4172244809527447,-0.36947563650085435,-0.6806557046236711,0.11008118083086493],"bias":0.09864490619920042,"activation_function":"TANH"},{"weights":[0.3444493666743389,0.6147519451374067,-0.6141838178331892,0.48894565978777493,0.26356311123603293,-0.1615524847404765,-0.46180047422294596],"bias":0.05266512063207041,"activation_function":"TANH"},{"weights":[0.24286900542332962,-0.26637122933915863,0.5467159461515065,0.2445898149756837,0.4037425815022984,0.3214776327851714,-0.25484020324765233],"bias":-0.02140260909134642,"activation_function":"TANH"},{"weights":[-0.2239641276970132,0.10730798543513777,0.03873801871051251,0.46263763991515333,-0.2194315145439148,0.5847585943594333,-0.3040283624135884],"bias":1.2438676902399843,"activation_function":"TANH"},{"weights":[-0.23762246424928712,-0.6994504156492017,0.446498315807953,0.16475131511564667,0.043215908327872546,-0.6141727060176719,-0.43551853094817794],"bias":-0.19839500025718904,"activation_function":"TANH"},{"weights":[0.7312419336209054,0.5220026325231566,-0.039708544504358054,0.14160227629885427,0.7750289155850127,0.03432555432390495,-0.24566238431626616],"bias":-0.41652596856824325,"activation_function":"TANH"},{"weights":[-0.8015823758346494,-0.22975743802992002,-0.021117708720777874,-0.30324990679937963,-0.4300404694029077,-0.6682378471165737,-0.19328381665513691],"bias":0.5788296774318795,"activation_function":"TANH"},{"weights":[0.4220155471048417,0.9022023265518185,0.03749595850974185,-0.9155317702858271,0.032767364106984026,-0.47510735054613035,0.35408134729879304],"bias":-0.31136246172708715,"activation_function":"TANH"},{"weights":[0.6162154888802442,0.42151301114729806,-0.06758430412621426,-0.36852660957367617,0.4744623648790499,-0.24637530851407538,0.5677482659433892],"bias":-0.987314580487566,"activation_function":"TANH"},{"weights":[-0.6037720702822701,-0.2533022303109795,-0.20534714931666298,0.8473254110850901,0.8594349260235782,0.6509483641190311,-0.5201248057353652],"bias":0.5342120973528767,"activation_function":"TANH"},{"weights":[-0.48575164610422816,0.2151842163574419,-0.30538201543373067,0.129459031885555,0.18719475469429792,-0.25275201484709836,0.5990265852826723],"bias":0.21819990888330132,"activation_function":"TANH"},{"weights":[-0.283016214622551,0.22576744034614873,-0.3589717228712143,0.17791516665295024,0.018377133293878935,-0.2575938668024012,-0.0157828678798808],"bias":-0.044336255097973745,"activation_function":"TANH"},{"weights":[-0.2937078518388092,0.1440567264284334,0.10173158101085067,-0.42924622054275735,-0.2577209434156545,-0.3258853679438158,-0.5559437246004438],"bias":0.03320426580473656,"activation_function":"TANH"},{"weights":[-0.3392212249067372,0.3644703500195288,0.8758909352340676,0.277073958293729,-0.05723804472250935,-0.7449537143604634,0.8352642867872313],"bias":0.49294045343785714,"activation_function":"TANH"},{"weights":[-0.20489220310609912,-0.874617096125379,-0.6433654637385274,-0.44493146876490897,0.4254141477754011,-0.05817768322749683,-0.2240800480124497],"bias":-0.016455289415772824,"activation_function":"TANH"},{"weights":[-0.39763776371756754,-0.018399362788998966,-0.16460979391694866,-0.3279278137044147,-0.3931692274401823,-0.008372383015652862,0.4941329263823945],"bias":0.0900892083258906,"activation_function":"TANH"},{"weights":[-0.28141287748061394,0.31561979418260205,-0.19024120432814273,-0.01076831272054189,-0.513881568237609,-0.43154331329727935,0.6062657994211755],"bias":-0.8013360198139744,"activation_function":"TANH"},{"weights":[0.33835185507484183,-0.1743748985078215,0.2726915937220889,0.11538034628647728,0.2549976606105284,-0.04660483446995092,0.2872136716741551],"bias":0.18048297077351963,"activation_function":"TANH"},{"weights":[-0.45429103847635666,-0.07977751286744064,-0.27630933143520686,-0.24457658124446438,0.30164230662020675,-0.7758015677987362,-0.17399307236630251],"bias":0.06399902335531699,"activation_function":"TANH"},{"weights":[0.3209834861151282,-0.391610825562086,0.2185448183870999,-1.029758103776266,0.18871709858319788,-0.11310446918957456,0.3045271597118205],"bias":1.2831573496599993,"activation_function":"TANH"},{"weights":[0.21329241910892954,0.7701779350560108,0.3830310493139912,-0.04522170113335501,0.6251774786689243,-0.04712288242377513,0.8833456553951259],"bias":-0.1782435157257293,"activation_function":"TANH"},{"weights":[0.052651729250231497,0.6669871247490592,-0.4429496469136125,-0.04785963775254424,0.15984781195597517,-0.6633617323056259,0.5669039917106423],"bias":0.3618008267384784,"activation_function":"TANH"},{"weights":[0.1517023250245862,-0.31450438647871093,-0.3456319623140157,0.14650706832614185,0.04966477142845352,-0.5302524576411289,-0.14232920131362925],"bias":-0.08348921314307381,"activation_function":"TANH"},{"weights":[-0.6355301232386454,-0.15432640048538715,-0.3311839826733533,0.33784456248948896,0.06843931426014452,-0.15141900065711197,-0.0027136164184101176],"bias":0.7604983235377483,"activation_function":"TANH"},{"weights":[0.9549767382879236,0.8130446190628471,1.0070738690824728,0.057706282745391815,0.27915175270243114,0.4351925875048666,-0.21906460225090157],"bias":0.12724168987929524,"activation_function":"TANH"},{"weights":[-0.7455780233474252,-0.0392832956084594,-0.2804719125642887,-0.2020095220039986,0.2825206080990013,-0.2412913988374401,0.9173925542995306],"bias":0.1712287843628591,"activation_function":"TANH"},{"weights":[0.23655744109637228,0.17569008431055505,-0.04897603404939318,0.06273571116770864,1.2492703931906053,-0.4047590065238453,-0.0612732531808868],"bias":0.43697757947869387,"activation_function":"TANH"},{"weights":[-0.2749886626248072,0.9763213878531628,0.12160918982460767,-1.1421450472871473,-0.6687353476886423,0.3351576920996527,0.36725616568911995],"bias":-0.3005302773347111,"activation_function":"TANH"}],[{"weights":[-0.212214064072736,-0.14426319593651904,-0.4397515954485405,0.5488568485588137,-0.5960707420469971,-0.2271044694372602,-0.12534164856734553,-0.20597602067368645,-0.14860336519613218,0.25411798823348813,-0.44322423814923734,0.7430159741404138,0.497717451944885,-0.6026197530332191,0.22682474319103535,-0.17899541173460834,0.6168386892820326,-0.7816136704889848,-0.20987890706366538,-0.044553986207232124,-0.014264958190768376,-0.27986085674049865,-0.36673305540271783,0.5204765996555987,0.5965904844930262,-0.3027799730468572,-0.7233196315193662,-1.018161805131509,-0.04600953572651601,-0.7021803207950239,0.2406790031283181,0.8500640529983284,0.18334382321322637,0.9846012094798868,-0.2346056562124357,0.06722297044172892,-1.1279514222576053,0.12050682106550152,0.7589903678353438,-0.5256811506638204,0.5882010560503271,-0.5403704177494808,-0.19725092263809454,-0.5200967431234792,-0.2868292739132521,0.7094439882818155,0.2766518549116826,0.3152974202571221,0.3935626080043582,0.4698317411667297,-0.9600809043058007,0.06536756444422323,0.7965237190859028,0.07330086021635429,0.22092486409896023,-0.05204273001524318,-1.0965303535872233,-1.014978901992041,-0.4126023950005438,0.32987868900450706,-0.5500340714710505,-1.2707212345170817,-0.6693150405554869,-0.7917306076852623],"bias":0.012195859602815017,"activation_function":"TANH"},{"weights":[0.13341801233236264,0.5752277303445095,0.09111893032313023,-0.20608526301234412,1.1302160266151076,0.8697512587297335,-0.04910003653332673,0.0549982332332774,0.2482065561010477,-0.11262576990135452,-0.3108090462702596,-0.6103864618928144,0.33787993938987093,-0.6165126695057798,0.15558638034182273,0.5472432918042806,-0.17317999187281383,-0.4639265551460366,0.1132793356459319,-0.16994251818588244,0.5956128402494433,0.3892106085822375,-0.8931615149026465,0.5098923717767248,-0.02670601419253896,0.3656835441935692,-0.2187832303332126,0.5958356835175189,-0.29560056126026096,-0.7101404041254615,-0.09915654341653816,0.08289032645606408,0.12554324689185198,-0.4981418364845838,0.041948988901743076,-0.44482517688294604,-0.24698582718883713,0.2314605531424002,-0.017410693486254115,1.0902371092868943,0.0580887926277263,-0.4686914921373381,0.5729128468962406,0.7170027702235305,-1.0099576936848853,0.336279376430394,0.06476146619159623,0.04929007503929869,-0.1210715486278511,0.13883774796490983,0.12883813908412386,0.5513414217467083,-0.09764946800942027,-0.5802516425786834,-0.006016982007561081,-0.9395338302390133,0.1265051803918839,0.8310160332511345,-0.5458837945391556,-0.19599459946044867,0.15241667677170925,-0.36494958007747025,0.5830756419056342,-0.34862244547792837],"bias":0.8551691493828696,"activation_function":"TANH"},{"weights":[-0.020168822342619092,-0.6871223437500916,-0.02209377413532633,0.46082340938872607,-0.44509221722916537,0.035264213936275136,-0.2418663471646957,0.06597566261849402,-0.8859168706222242,0.16145321049819958,-0.1369813778780563,0.35244841320701764,0.14523620655682418,-0.37402696777631084,-0.8046891518964475,-0.5159641560100521,-0.084991913619064,-0.07078519649306605,-0.14773013839061053,-0.478641805532422,-0.7022963741768534,0.05631261626249323,-0.5143937264727041,-0.061862152054912856,-0.059841944045574566,-0.4695586050282853,0.2822162732901525,0.02344713050675,-0.41458989569843807,-0.2996049509264828,-0.7334987650268704,0.6623429276698252,0.22224511199309618,-0.5075620270377047,-0.46021279218596517,0.1124739957822449,-0.6917241704327244,-0.19764297342603562,0.06386816494719821,0.25379766779940444,-0.2790028780578604,0.3652166912434357,0.34371425871838496,-0.4526612953196297,-1.4905596540431019,-0.5951600108332225,0.19217127660131353,-0.08377477088172078,0.34071329148217905,1.2288905889534503,0.7113873112415949,0.05254063517103207,-0.5873998449809354,0.46771733776715535,-0.09154891525112034,0.7405889319561333,0.3357336067074882,-0.4945907330488871,-0.2256068792980692,-0.2298327690807414,0.014108718742252967,0.11220742934143081,-0.2849386336174268,-0.32497835015877335],"bias":-0.7192246152520855,"activation_function":"TANH"},{"weights":[-0.6599359082221465,-0.08299419611775259,0.5623226628064523,0.4763527828885115,-0.007482897870489273,0.951945132359384,0.23100446628113194,0.5551889483688279,0.37695204420813655,0.13964032269119464,-0.2615813733764903,0.10535972074218156,0.39134914236138935,0.16910154201034794,-0.7982928061184278,-0.2991826065071469,0.1944677594042108,-0.2651546008800041,-0.0966264712302434,0.162103694439829,0.2504674431828468,-0.41663286530319454,0.35890273619435087,-0.203380668372372,0.036928579511310254,0.44076217758594377,0.02820272225570039,0.14938156743291484,0.23325273092791798,0.16475362632496152,-0.1416060979533847,-0.5524971956458486,-0.2799342901078286,-0.35466742931847917,1.0378899162434134,-0.1307008598333185,0.5716951198723723,0.5853452715675831,-0.500300844962007,0.05248475426923905,0.07609594953305655,-0.683872493175047,-0.4086586510282847,-0.1156912207365952,-0.34709707308489146,-0.38075410645268104,-0.13913858811442767,0.6869446975644995,-0.9008276834909217,-0.14159989771248474,0.16044271473247695,-0.1934311312827287,-0.3562834016305814,0.20942621904492198,0.24051968441199503,-0.7085584541121426,0.3927615690558328,-0.18461073413219078,0.6288001305242154,-0.0018821696955215877,-0.0009140404546136328,0.10601730853227948,0.2134454129873694,0.17985292799142902],"bias":0.625283614180278,"activation_function":"TANH"},{"weights":[-0.6035035906776236,-0.188263402264859,-0.9281951885294749,-0.5702666666774036,-0.7924893382064735,0.24193544299403608,-0.3319238371336845,0.16458926518241582,-0.016527372802499284,0.09906525855985454,0.26379623505474653,0.14080679937119386,0.3145753701179253,-0.6258654312288535,0.32155828135214914,-0.7595969265385276,0.427639845881542,-0.09724878278412948,-0.35759676515990096,0.2894542232832444,-0.6661084133871016,-0.07491937665156288,0.04982093827900608,0.276404079064484,-0.29638899357176846,0.8358938015628203,0.06363709554310622,-0.11259174714204542,-0.029350811310587158,0.403584641264565,0.12243066162328137,-0.6985808716876541,-0.17065284474503906,0.5595697691835441,-0.09476042647318875,0.3424661004530542,0.22262015271169802,0.17621544160852617,-0.26505235130922433,-0.6787991271058228,0.3927736855974053,-0.05947203334496218,0.3747285731585997,0.5256947288862841,0.42994093970593583,0.4827108195499792,-0.3928802677837927,0.4024794648135322,-0.9205406284733478,0.20741163171082627,0.013399441727562272,-0.016605724502820506,0.3063596022285599,-0.5095770795695351,0.21938284825437404,-1.0927395972893261,-0.047533626169187014,0.5470053999124361,0.3587431406917162,-0.0139400823536549,-0.05520547021898245,-0.37956019047248435,-0.5962666881411975,0.16548028986065913],"bias":0.6584972596666292,"activation_function":"TANH"},{"weights":[0.26782491480987186,-0.0009742110022581754,-0.0843416130034146,0.05717975303049015,-0.0961371437701749,0.3094068853201961,0.027863697741114295,-0.49622116461624205,-0.7577248906246559,0.37537284188036696,-0.043920704783466616,0.004813414026700654,0.3786901221207639,-0.17635715797327137,-0.04625457357219501,-0.26951049313345193,-1.3662307181373752,0.6886986701216351,0.20163609307520888,0.5869308875744642,0.47577262743632476,0.22388611121519453,-0.27573485881428594,-0.7834990220052769,-0.8749004583613217,-0.5197800529575151,-0.31083411916857495,0.026071296497046124,-0.4757976816808185,-0.5179428978785773,-0.17846353369510096,-0.33747018452039984,0.3425982010005724,0.22313400601795946,0.8473026742488031,0.32140288003808537,-0.055360800393520586,0.28204776101743495,-0.3602516017370389,0.6117561281291802,0.06118112476087273,-0.010349020508687051,-0.04498556574250123,0.5112205837908778,0.2924202484419759,-0.04498296930636776,0.3128055477038552,-0.002484023474587198,0.2679911589920053,-0.43722706627973457,-0.4165203734485957,0.5379559525145883,-0.20452315830961582,0.11951935376578954,0.5859316898411393,-1.5144685844350385,0.22999447153347596,-1.0343438354715693,-0.19628976414304622,0.09304013082502546,0.02757522869210269,-0.6789712932606895,0.22524148149757564,-0.5744478052127997],"bias":-0.40461574498137776,"activation_function":"TANH"},{"weights":[0.025030085744981688,0.39525024604325965,0.7113767170484983,-0.36625736831181804,0.7678603510828812,-0.7508398896482914,0.6956821596797235,0.08203426007617287,0.5565176255204349,0.22406477939788355,-1.0191940962510344,0.2101967966526393,-0.01657845700632027,-0.26278588841101425,1.0527575052959721,0.612250841525301,-0.470201748392765,-0.39164740218208766,-0.7533497282412603,0.5907463958002431,-0.07696135916355823,0.9094934529182787,-0.23663203829750096,-0.06945837831986135,0.2066383496430676,0.05721365623096344,0.1741747293762763,-0.12845822763008205,0.2211436178123119,0.734017251723946,-0.12865384099594923,0.7979633323571691,-0.8243645833800489,0.3218363831169103,0.20363662144383654,-0.06453469243352467,-0.12622596763707183,-0.03746818127487253,0.2687092147649661,-0.6836006499981139,-0.29249113079122163,0.8287221088352411,0.369400966729876,0.5274587098774982,-0.11865670489913027,0.9826576634166843,0.4061257924018914,-0.3501082204235348,0.6298497661985373,-0.07337623924794878,-0.4227193130012246,0.07321984415868893,-0.28649993741341206,0.028700777055735857,-0.8029535960043641,-0.40049287787137644,0.14694321021460957,0.15635850797088144,0.02448963202508731,0.2933571555066118,0.3908943193394045,-0.4467429497647131,0.5252516846303339,-0.28879150332486214],"bias":0.6577489545723862,"activation_function":"TANH"},{"weights":[-0.5471922758454706,-0.14711975010887787,0.4454520797899579,-0.8032738513709473,-0.8110706508522979,-0.30058653261256163,-0.5512890183338139,-0.020393282153079617,0.7059373301425497,0.9000254942523497,0.4290029045607357,1.4596479176141892,0.05341881561830885,-0.23966780392960757,0.38683060059775926,-0.18618128032625678,-0.5874076106711318,-0.0503958144391915,0.1572568640248283,1.5139632639250904,-0.48569212123035,-0.1912377502258259,-0.6869898872750684,0.11553281130359447,1.0532380242753812,-0.12478661858954787,-0.3543558785130489,0.5738515081356829,-0.27979129893846716,-0.11666347281288081,0.03995137135571809,-0.22679817394650867,-0.1452836872954564,-0.5917414756673252,-0.4830642560034582,0.37585980789641443,0.08481890887662108,-0.12262696343530702,0.8110610694241451,0.030182036171773962,-0.06259299756519537,0.1453062802461563,0.2959657238884229,0.7798273531961493,-0.5382924900864405,0.1844167067590189,0.03686281916708858,-0.41574882747491293,0.631674089539937,0.395622206149013,-0.6364402941194245,-0.7973783248771027,-0.191796732947899,-0.41185285928712007,-0.05583276425369247,-0.3854600252296825,0.18968306103615967,0.09620917782605748,-0.6852724982830065,0.30901018755481957,1.1965792673087534,-0.35097823253197546,0.09662982550413704,1.2925328274475794],"bias":0.1984000867866497,"activation_function":"TANH"},{"weights":[-0.5567578917524622,-0.1435338297153616,-0.11135532837855103,0.48784396166921157,-0.19439218022834878,0.511987217970762,0.47735022275186556,0.188537521167115,0.8470840607555218,-0.1419529607445444,0.1783175375497882,0.07753002035840537,-0.5870915514066369,0.20320026488814952,0.17403849750801062,-0.37478460456687684,-1.0639975279103688,-0.20754378477787122,0.11692367214863103,0.0701725406192501,-0.28720720067257355,-0.5404914795040145,-0.1458534937434879,0.07285104972601508,-0.1935598181656795,-0.47353375750057203,0.1695985691570252,0.42370634352601017,-0.569838249907552,0.5577891491214714,-0.2638626454351543,0.1471573303371013,-0.7625368536965702,0.014758167675393487,0.160840252955712,-0.2042335127663121,-0.7344457866782305,-0.25497793689330406,-0.6417726230240709,0.05257966158797617,-0.4206735411861816,0.058185152431260295,0.21781813492806817,-0.22878644007388751,-0.7176769386564184,-0.20063362415282085,-0.36143841188534814,-1.018428077578201,0.19037552911400044,-0.1163222442708289,0.0045995398481087,0.36630174355021344,0.14803655655771114,0.17971538260969708,-0.6886151962775867,0.1168504803472353,0.31372911233671813,0.28554887844611165,0.7998425092556875,-1.2827801034280635,0.9586573854222344,1.260069232213375,-0.18545927678234075,0.057338841778091926],"bias":0.5035861183137396,"activation_function":"TANH"},{"weights":[-0.24143825791752208,-0.375558654818356,0.8544194825336753,0.0016695076608705308,-0.8113032772775829,0.32474276148816705,-0.10070960060192011,0.0767801102994411,-0.2542679064317888,-0.6121061746999119,-0.7828867228230932,1.0230566146486346,-0.6235037734139555,-0.6388502910414986,0.30466010221120005,0.9815914828206068,-0.28822642519475755,0.024258379117511376,0.5354274375165906,0.07503760804003273,0.1900843955362551,-0.5621803878128728,-0.6958546144725898,0.5805726909721546,0.0985210667259972,0.031448382371890675,-0.5016009635172287,0.30512536564961595,0.8101158063951246,-0.45426382034730656,0.07101888730411518,-0.28625860453091373,0.07858985860360142,0.3447960283723758,0.2715596587491279,0.05580319141922395,-0.04229702474049527,-0.0632736399481185,0.2290322133693102,-0.17961801136773778,0.7583064135498735,-1.0377297360553082,-0.1587749183691966,0.22250092159958781,0.01051033670636269,0.077948772476682,0.33224367994005094,0.15203118080843636,-0.255461370930375,-0.06569195479789604,-0.33386478338692854,0.1695003079588701,-0.505758835415328,-0.02032094010561389,-0.034013672046589755,-1.4288832969551881,0.2540724251196481,0.6359884776933628,-0.09503780989500492,-0.2515906581920735,-0.32319756870988586,-0.5224630310925787,0.19278751541819208,-0.25934836527601923],"bias":-0.350037760344085,"activation_function":"TANH"},{"weights":[-0.12085686393722116,0.2112725848192809,0.6145844038971042,0.0458108992542422,-0.01725792042791877,-0.8921330735234985,0.021727674089756996,0.3275336085630812,0.2733241587139277,0.2720421768411277,-0.3716404582801289,0.19259867150724655,-0.7313600622808099,-0.687400404267892,-0.2690934220575585,-0.14974555060402822,0.3757529044472951,0.8180015602800106,-0.17490081964613033,-0.1812048539716985,0.23011066274044162,-0.5643278889449688,-0.30931349783355894,0.6682710039772833,-0.35488714582246034,0.4609452950057584,0.9071731420596015,-0.08363813859144527,-0.1556789239622967,-0.3482834074949664,-0.29282298216125324,0.14841999346970813,0.011155145676975411,-0.028051649444974156,-0.27525309336078324,0.21731796083005578,-0.4959314989743672,0.7366345725781465,-0.5086066549975558,0.46742579745644497,0.43568863794981805,-0.4349319667462948,-0.7360556392907394,0.37048870374431164,-0.5593688650291302,0.04479602967193109,-0.6612087451447066,0.133393305257491,0.06896215299002294,0.3483623987501448,-0.8737995858543386,-0.07778050757161403,-0.40387708111146237,-0.7456587597173602,-0.38047284874555315,0.08896643349630261,-0.14636371954995786,-0.13388490140725925,0.6592172953095061,1.5656148568223187,0.8174053182028548,-0.45301209335340925,1.0116583038139664,0.5775445371124545],"bias":-0.16835736143388835,"activation_function":"TANH"},{"weights":[-0.15837608876427872,0.5971688050669408,0.03635592736801711,0.5120467823357658,0.0295635184731369,0.8047880146996631,-0.05779119321943592,0.6793251813014083,0.0041825189433884885,0.24666433215802122,0.7675351186887717,0.1413005259350859,-0.09825819157156056,0.1785003090931164,-0.18811996051871538,-0.23242552608027472,0.5236117415068813,0.5424235821284487,-0.0785170803659009,0.08528215237473419,-0.4422711828676052,-0.5156130719770763,-0.4789522496581255,-0.1655558551289304,0.11901900012686521,0.6137231560345716,-0.829881426401612,-0.14787197106498384,0.5906765206134773,-0.648969641045111,-0.4459707909767866,0.057198374747737285,0.2474996461335047,-0.9992564410098309,0.18241495166119676,-0.21525299646901921,0.07323622156069037,0.07779943678382031,0.02407909306821616,0.3580868444626942,0.28500189658267905,0.3828826007379272,0.09943835545704857,0.21625247120902513,-0.5268453588177916,0.07701642253958647,-0.06561339180943358,0.0748048903332283,0.6033283085004484,-0.1518596161729217,-0.18176291921022247,0.34196072840007175,0.15085300382255556,0.40311789367969675,-0.6650842918499913,0.564496202279767,-0.45964076863501296,-0.2215929101067319,-0.09017680059477776,-0.1392242587005964,-0.6287227212583968,0.27328632043694473,-0.1482272350425171,0.1764907308469643],"bias":0.38278708928441674,"activation_function":"TANH"},{"weights":[0.30210810432180335,-0.5138123213292781,-0.013809158906723237,0.564175447357937,0.07312786544375278,-0.5050514036447149,0.34360814516819566,0.4904128732036084,-0.6332018706685072,0.020923695787744803,0.2692274157841279,-0.6739895964264455,0.12123672787821343,-0.26182022840820957,-0.5623543728838659,-1.141494440441432,0.495561106195628,-1.0671663203129365,-0.23091096678665993,0.31142367877921134,0.4052914051136097,-0.32949462689180326,0.4609223422358311,-0.14974465881028937,1.2317186825491198,-0.039845296364375934,-0.22568909257627692,0.23304559457143734,0.33721317148789265,0.3298631999795761,0.010464140520412404,0.7178104502193073,0.342571770768135,-0.5133482650266118,0.9613201784760804,-0.19757802475494635,0.9472842018781957,0.20472951617098217,-0.20370801690245485,0.370141322599446,0.0620945510496853,0.10754357541428301,0.03071274972070783,-0.4538556736335557,0.8248879128442909,-0.647470622380527,-0.6015016821882884,0.0023435510038603818,0.39369366980108567,-0.4931895309121378,0.9741766736089019,0.8506159635216445,-0.21110913255142624,-0.5925040852914961,0.12395856467566305,0.27762658457169515,-0.052389647788491533,-0.7582935444644014,0.7611531515710721,-0.3263881695112107,0.1914353467369184,-0.5831705516203396,-0.41537703649898317,0.43405369624465123],"bias":-0.06599159511176077,"activation_function":"TANH"},{"weights":[0.31749596806294605,0.021873698551193116,-0.28766465680912,-0.5931289676432298,-0.00038488759881166734,0.7747909772185625,-0.1907295815211289,0.035746722082625824,0.012427946964313347,0.18218761914459344,0.4972792874708647,-0.8781034854904779,0.011066728549043739,-0.06480603659278132,-0.4131476114498077,-0.21815611051275471,0.18505981795557322,-0.14303394921749293,0.25586126902142486,0.812781804205311,-0.41993795576604415,-0.19001829342823107,-0.7544551367914059,0.5547493919859706,0.20175144434518913,-0.1361382156201619,-1.07467754498569,-0.04055797884338772,0.3378530343984086,0.6529206527386107,-0.19054630002845296,-0.43917359296493286,-0.23927884890803136,0.13578991152708508,0.2215507303616665,0.15453627198158218,0.06823673931263831,-0.49972588883678865,0.23642431082196314,-0.08827324751049079,0.12017598370974683,-0.5133756583495975,-0.389198234464484,0.40285268772464267,-0.05417670224001532,0.11798665272399132,0.034295908959633636,0.3807265914189621,0.2073586685901993,0.3854492638959605,0.04764836543429764,-0.008279578461016606,0.26555412984593507,-0.4262717733797612,-0.5101487556240669,0.31197711389118693,-0.34140996442183186,0.2386754218838766,-0.08032130948944814,0.4411674045775698,0.47734646827939786,0.4289207865436776,-0.07987760546366311,0.046853350581939526],"bias":0.7605632144170498,"activation_function":"TANH"},{"weights":[-0.5946305938307863,0.35333514993826565,-0.7357302174000719,-0.753810712402899,0.49465388183428227,0.3618426721111774,0.23415954258862118,-0.0974065189369166,0.3877644352943485,0.44809215123098756,0.274191519257018,1.1079960852021307,-0.11240578406155244,-0.9507353628514631,0.4455799592704612,0.3519860757351992,-0.13394671726956675,-0.9077733357438835,0.3360630991224475,0.14302885105291138,0.5569197656861011,0.0325885826179136,0.4104665998902837,0.3980914411784812,-0.33355614957464474,0.3305366472322342,0.18456381632501628,-0.5981159546057618,-0.14805349170114926,-0.3786775360279765,0.49748829514569415,0.30093190069809916,-0.17512662441756724,0.17908249337306967,0.1311704865638013,-0.3151694586504413,0.18582891230101536,-0.54240641977744,-0.5075831198171935,-0.19641135406165464,-0.21983381127496535,0.34012230209870825,1.4500235789777465,0.19050578586420827,-0.264458283548822,-1.0616692796686844,0.9209177204673026,-0.276926522132908,0.5554997016841567,0.3339382052390411,0.6803677574606893,-0.2830821374864353,0.5544351399684181,0.2757956300545218,0.8072918695976099,0.5947441297766076,0.6074118094972953,0.19673227044351696,-0.4274682198568372,-0.11979675761049842,-0.660558583537962,0.2537896321881335,0.33522232562689624,-0.45370049446418953],"bias":0.08939705880380275,"activation_function":"TANH"},{"weights":[-0.19801989788823482,-1.1888948369688899,0.17646153595674105,0.24540213105014982,0.08880286598116588,0.3434761365604061,0.739895281784923,-0.9617129382400199,-0.014153606863585577,0.3562956714497789,0.3304678326587237,0.6456615770625869,-0.4395705890217098,0.37483378695112635,0.9317270666153238,0.8804716496972588,-0.6358972184037341,-0.46862982533804737,-0.032741015074624,0.08286839476807552,-0.14230135735545263,-0.36495963582876706,-0.5320655459358278,-0.9133279685993637,0.22623200553748754,-0.2889122321704832,-0.7261017784155467,0.40636998631989596,-0.8782321773244878,-0.09324362361822164,0.6537932762454745,-0.3718714733885831,-0.5735251608186666,0.44125325759705036,-0.9927034454373251,0.4021855221256261,0.05304739929707507,0.04864326974968453,0.13969983612219664,-0.17665518200329125,0.1141532542114249,-0.4720422944311468,0.49936477835942417,-0.420716337568507,-0.21853950295126684,0.5419574947328717,-0.3657527993225708,0.2863950161968928,0.1605167165121702,0.4129416398112625,-0.5382631216356574,0.08453611692425991,0.24712418510501583,-0.21548791208255635,-0.0006725695671299103,0.04465638652017906,1.0135049772722067,-0.18444073515514364,-0.5212342423779677,0.06189616435469447,0.2634590414201222,0.7237692014323994,0.03801996619724991,-0.45163996192319056],"bias":-0.5563840446040533,"activation_function":"TANH"},{"weights":[-0.5259206547869902,0.15015565163143735,0.5031295051227358,-0.056888603189066335,0.7676931250100444,-0.7435997115246155,0.19177784635021344,0.18605176959382583,0.8415296144804331,-0.09878311098283457,0.3500905845597839,0.31406956492952054,-0.023754209580023077,-0.6267903115298953,-0.7040527455234129,0.08418053711754507,0.17241389323332101,0.5222883602560112,-0.7293270021713888,-0.3812384346018047,-0.26564481085418684,-0.17195202831525241,-0.04341244847010637,-0.08653022264603982,-0.4959250802528343,0.378929815347616,0.42133904153195106,0.29628057031436356,1.050946364980286,0.4807292685974743,-0.7706555213353691,-0.4645776042502402,-0.23095495726719306,0.2034323551970582,0.541923536964158,0.564125674095194,0.6369001167257095,0.06607984858030293,-0.7792140543893373,0.15299882946467014,0.14063827603483078,-0.22025880662610814,-0.8881409406395391,0.45924957222978485,-0.7162185110030962,-0.43945768482970315,-0.19454282420946634,-0.4381995556996989,-0.46882799747162784,-0.09802712993827706,-0.3249387498921162,0.25270891864652867,0.3539685486626239,-0.067865285090181,-0.019557599701847242,0.2483419084931246,-0.10470764714632472,0.19762519963153036,0.5346991554831474,-0.5865876051424902,0.5344278218838164,0.03916789217113195,0.6176112287985436,-0.20580540273659154],"bias":1.1733486889040832,"activation_function":"TANH"},{"weights":[0.10771825116681984,-0.6807573661134941,0.22631853188902856,-0.4405436849617289,-0.1392377989112631,-0.020642849155815934,-0.150225978148217,-0.6281876398267631,0.30144577748486917,0.0170940265893428,0.10439437250704714,0.2032835319483174,0.17687293141915256,-0.49508934846829106,0.0844257616915392,0.050668023007925465,0.8581538860403825,-0.2492814355399503,-0.7354929474997377,-0.7328574998868274,-0.027002675779295156,0.42269039196194835,0.12816641818600108,0.17533411327777493,0.3648997972016406,-1.5475124090780723,-0.3201231714488349,0.493661409285813,-0.44478722014433153,-0.2744748624586483,-1.0076464070105131,0.7997864013073054,-0.3496766176059802,0.0538977310728084,-0.09551131771109753,-0.08709510303414872,0.1262790012557461,0.20357160253856038,-0.005266804187511614,0.038482148138134484,0.29834916523969246,0.9828819028929695,-0.6088541933269893,0.9438930108121106,-0.5113636454086391,-0.4153528611657151,0.41424289778893325,0.24169420037649464,-0.33381662123733014,0.6865506588814622,-0.48903758122405655,0.38356758936608776,-0.3059440120898847,-0.0654033604306701,-0.5149738636249238,0.5692876430489877,-0.23263603347453082,0.12794546530571946,-0.14506376251215017,0.19294929314184323,-0.9106458257252051,0.19695901093320942,0.17734393244260865,0.29082001566663124],"bias":0.12846417827182496,"activation_function":"TANH"},{"weights":[-0.7118685773388863,-0.37974329829139053,0.6980798332804503,1.0238476845731552,-0.37613411245778144,0.4192009875725557,0.12751037437118984,0.15441048671616564,0.21853617567493022,1.2671922261958268,-0.6450211115940547,-0.6620048007167629,-0.1503433659527166,0.2388886218409521,0.07867344706122617,-0.7954467950481849,-0.17871525234905639,-0.4666119745071445,-0.4587208292661521,-0.8085414868223507,0.22305991071633793,-0.3036226305967837,-0.14656268734436817,-0.11456000669176587,0.7181347631924464,-0.011457050747597463,-0.30925265219029063,0.25434192308466497,-0.3346724879542154,-0.550698338244764,0.48971607061613676,-0.016712075548906146,0.125523860298231,-0.4464157952036467,0.43520286995336,-1.1575021957461868,-0.17249667352218095,-0.9325962003549579,-0.23868267500469403,-0.21697047568881914,-0.1741765135493492,0.715848590918137,0.10329571118688666,0.8005035332856026,0.04931666738154574,-0.5731918752120961,0.0552983466595309,-0.15875174727902777,-0.24799080293608994,0.977742568917639,-0.5880473282647759,-0.39529583374097876,-0.493178041708145,-0.5935987889574219,0.452499576599209,0.5805604799826323,1.0085803232008537,-0.5249084571465349,-0.40845064079738014,-0.092950724829909,0.5047573066392714,-0.3523776206729701,0.19330833811423015,-0.15599685713065695],"bias":-0.46194828514857267,"activation_function":"TANH"},{"weights":[0.24697550736760004,-1.041869190013463,-0.4666548117488882,0.8235121533649765,0.6853817492469483,-0.4677597124088541,-0.44807619923002207,-0.770316068135024,-0.5550712675803056,0.5641902643159137,-1.0977845876571937,-0.03923037119753211,-0.49937190028734973,-0.11240751957435527,-0.06322478930685557,0.04466815583941963,-0.11471096993173975,-0.3163762116757728,0.2850923056082595,0.26986281421519526,-0.27807649469049445,0.4947997183097161,-0.04160631384838324,0.5535586349476672,0.5942074184233767,-0.7693740414451378,0.14835759730340656,0.45303504699145414,-0.6114791781017396,0.7893075113713695,1.0133983220275644,-0.12722694482733052,0.07906075199124397,0.5683488305080033,-0.6410481994514544,-0.4345336885623649,0.15719959581031132,0.35987926026892436,-0.03019216680511196,-0.40172475249605133,0.6560446195409895,0.6465328958746495,0.3749629206528153,0.5731107311778781,-0.7906678880802552,-0.7230059473189712,-0.13426143190432954,0.8219782509978835,0.010820882885500982,1.2092485046086852,-0.12518880600437468,0.345161647952657,-0.4715130697460596,-0.10606801537094337,1.0060766486429125,-0.24122387137556608,0.30467812315251497,-0.4972193867785769,-0.37450547827739666,0.10317928459592803,1.0872726975672775,-0.41011309221557196,-0.29952845921918075,0.10408831901237937],"bias":0.3269485467638164,"activation_function":"TANH"},{"weights":[-0.7681056544425846,0.28758292650356476,-0.458531404399499,1.112220917669024,0.7814187409517276,-0.30278509188712277,0.49315505902215057,0.025391479303027088,0.08105030799289914,0.09032881662478356,-0.4392272980460312,-0.46561569259295166,-0.3518967146221381,-0.15277239584687805,0.0340656208520556,0.1574630881201045,-0.4327249872203457,-0.24250077955005653,0.437533016169058,-0.6538922895173058,0.27705753700184743,0.4952392941947247,0.06478148690606739,-0.025432109081894385,-0.02108600881680142,0.685813746645372,0.23203734203891943,0.1271064613893011,-0.47094139559952913,0.14857329855765683,-0.31583666790872894,0.9609427152040563,-0.21477683411697643,-0.008692364803083202,0.6577208345198632,-0.197511246036585,-0.2048153709340461,0.11579520827113421,0.09238920583109851,-0.7013035224959864,0.21517498892221834,-0.6683829233178549,-0.47163366655514866,0.7969463581874706,-0.5741784803633098,-0.09294359266396637,0.3997173399957956,-0.3859564838976724,0.41228133431438413,-0.5544067847585331,-0.8608544873594073,-0.04698139660400081,-0.3619312141666351,0.16575596063981116,-0.6675299777393953,-0.1661949274069503,-0.5367003157492681,-0.16143606745360856,0.3711214700261279,0.49464984022321035,0.0694894270287585,-0.008789940166100668,-0.7036622783258185,-0.2333652834261181],"bias":0.12391452878944782,"activation_function":"TANH"},{"weights":[-0.5170827455043419,0.1825048741133744,0.6583231588150498,0.8359879502166067,-0.4696086401750125,-0.3711651608989087,-1.1753273645768938,0.30570044520429396,0.3096813094325344,-0.13650748492701387,-0.2986037962017669,-0.031095696847937154,-0.6389524004758279,0.18774830006181148,-0.0787029867431436,0.2635610216416766,-1.1184850345383874,-0.2385889232731068,-0.2128998180645086,0.9409329609679046,0.8914426174883344,0.731722634322155,-0.061638998131262814,0.46422137161041693,0.6613917703653958,-1.168351451780289,-0.014907227059174513,0.46410757038497163,-0.3837203721451574,0.06344205722581038,-0.44029821717474704,-0.01875972191828404,-0.802143770804251,0.6849924000475964,0.2187699128953282,0.007075998459665031,0.426549803574666,-0.3501708866211314,-0.4435506875538593,-0.0004846401298614911,0.44139133040357315,0.38663771374457917,0.6449619131036923,-0.17146957934270013,0.137029328731693,-0.3673786009566495,-0.465710055418984,0.08892048895145599,0.6497628330091361,0.2020411248984137,-0.3211697442325252,-0.4803858660499185,-0.7114868577079472,-0.8116120898438407,0.16245443661125208,-0.28521083860225066,-0.2157353284664921,-0.8290396244586119,0.15684462873197752,0.6844247809373899,-0.09917941771580781,-0.23392890505530584,0.15077456857911128,-0.004618784846306755],"bias":0.5115767087752684,"activation_function":"TANH"},{"weights":[0.5244945689979941,-0.37794074942049866,0.26390624157578224,-0.41915094591023305,-0.23281858378311454,-0.7606811227669499,-0.18313260488286626,0.5182864897002999,0.0257596876569886,-0.13432306105241776,-0.3827219949294341,0.14203892217417832,-0.3264472407763792,-0.0011281097062322831,0.13878463521924972,-0.6266873117832813,-0.8279731202148186,-0.45657032237235057,0.36388244750944454,-0.166158751888599,0.4224171578933936,-0.65613138777468,-0.5588860652525117,0.6447607643204626,-0.3557880321829905,0.4587112793624619,0.06371212729323543,0.25175377828587403,-0.6657711352078524,-0.3226152813915469,-0.6097056612039797,-0.3974283439313795,-0.18213609547283768,0.20400544040835714,0.08662501683061677,0.09587862201571233,0.06124656991116893,0.6777675732224826,0.18232384851665404,0.48858429821074545,0.30495163921253443,-0.38141327201820185,-0.5307429448233598,-0.5338772472883847,0.03288723943986885,-0.1553555476317803,-0.8417549760294554,-0.19101980814270278,0.42548932656280913,0.19418794444468107,0.3025815526714437,0.06908465166999442,0.25471581597241366,0.679051767342431,0.9784234101208003,-0.15490194904028376,-0.309696919358061,0.26089000193147494,0.29624143383110685,-0.32821690053914326,-0.470692941058941,-0.7586276954368519,-0.5037466673172813,-0.3956892415071111],"bias":-0.5642637812862173,"activation_function":"TANH"},{"weights":[-0.0205688666778439,0.5398015812033645,0.7025345942543215,-0.20801007755075357,-0.6676856366053232,-0.5459292349531055,0.7429675802760742,0.10441909202690272,0.23158308587278092,-0.28216940640481813,-0.4469282889804336,-0.10615444017807268,-0.2909481388702847,-0.391078213843924,0.8213027638533384,-0.5492973204394086,0.6078148415955004,-0.04555825044296362,-0.32287058431080484,-0.8144098411619926,-0.28660397512900204,-0.018024949811603165,-0.0797177419273374,0.25635791676009195,0.7327954041189223,-0.3278410080165975,-0.23923393402183388,0.4430393663371211,0.12867895441873362,-0.2708627904632906,0.20005600776716467,0.05239064409284191,-0.7100725407059153,-1.099198348418813,-0.7257121925502287,0.2737056131541438,-0.12328390918200091,0.029610298355247297,-1.083962823441616,0.4749274428580691,-0.5401375327905488,-0.09728577714880036,0.5732755627169006,-0.38038033604468713,0.49243563324235456,-0.6583294375781756,-0.9385819270778615,0.7722950533925115,-0.2984124583377523,0.7661192878951155,-0.40031615609439286,-1.0904710523863368,0.7153477806511854,-0.34948311080271005,-0.5026622113010802,0.22941932632565065,-0.39719973014632404,-0.29180249725456336,-0.8012107184872894,0.49764984904422294,1.1392885824262082,-0.33114224014298044,-0.22257048473089655,-0.8508682781468744],"bias":1.0056248446158922,"activation_function":"TANH"},{"weights":[0.13706209530937613,0.18013343870597104,0.09196363566390517,0.8511531186991034,0.5535669089872245,0.5974121340706817,-0.3877060506784998,-0.10087299708538358,-0.11501263702237319,0.3615408876333942,0.011656693101005214,-0.8833034500229202,0.07829549169392318,-0.4849856505524417,-0.23204810868328124,-0.18718541594599042,0.3653598803495682,0.2554323695027586,-0.10497614171682518,0.18594850143393232,0.08003398062579178,0.34960499185755534,-0.21274241665394206,-0.36664084264936964,-0.3047163023305589,-0.29990518797712906,0.08675105139549558,-0.6504644684947761,0.38174636853256916,0.4872907257410864,0.14249890255182487,-1.2095563307726902,-1.060639457119171,-0.6760436137350707,-0.32388147613780977,-0.2050200801159734,-0.27014529628511597,-0.4331348445362946,-0.0922067281199771,-0.6925676376948723,-0.4239622846738849,-0.8220887874619878,-0.6299816282609461,0.15280212552169042,-0.0354288470261507,-0.04992017826405175,0.2686501799117516,0.3162852652724949,0.3705800322536844,-0.5430004534013106,1.0802463195353587,0.01262664261387761,0.038240968476408205,0.28443407687832484,-0.023048280451792982,0.44711984481266787,-0.29315390504813055,0.02147517692069236,-0.14533244774602266,-0.7614186172266071,0.002829724485583343,-0.25560992572878394,0.9153420358845078,0.364063063890192],"bias":0.41381037726957065,"activation_function":"TANH"},{"weights":[-0.6977083580018089,0.2672488327067259,-0.06504843606721777,-0.38960048346958587,-0.3481800292095474,0.5348649751343058,0.3563584055331669,-0.018655521103177364,-0.3115936225396205,0.004125127179737842,-0.5973019523658308,-0.12750321282127242,0.3115739655113312,0.6539728001248676,0.3419395893396852,-0.5212072104157658,0.3421626899623594,-0.7665707706350429,-1.0508135284613973,0.29224118361321116,0.9454415535247023,0.49345132701866484,-1.2138058375811351,0.16052906440710576,-0.3698028941253214,0.3273356986242648,0.09708283935597678,-1.315087277713423,0.06089000868110998,0.14255769287313316,-0.5050755154667028,-0.4404740185245002,-0.33344144408805565,-0.1761341363767524,-0.019023154546920166,-0.38383138415732226,0.8915582968036797,-1.7990522028975164,-0.6009700909808434,-0.8705669734996615,0.5529286717822093,0.04960697934762715,0.6948274258131921,-0.4171014417698401,0.3747600488338679,0.029945878790981147,0.07555999465682431,0.32779441855390057,0.6075045169362118,-0.6521196548313982,-0.015076199033416476,0.6696253748798365,-0.21332657688150158,0.7219225112023948,-1.314543041637297,-0.5990785667482328,-0.28324142599626506,-0.6375690370727574,-0.5130635744411044,-0.8417079538524914,0.36097245529430444,-0.7923271141193763,-0.0978531514935588,-0.06763515038107017],"bias":-0.08892491225948564,"activation_function":"TANH"},{"weights":[0.22100786752475216,0.21532565501911533,-0.14650334932521963,-0.1880229052412464,0.23185300744191056,-0.10932848991423737,0.3143238640457147,-0.646705453213966,-0.5427243119726701,-0.11769405224401654,0.4079343289022032,0.6051961813622623,0.11441282890853371,0.5318050695663271,0.4306125805690838,-0.5827557806677244,0.4456674233607908,-0.01870188050448089,-0.27914012329845656,0.5191322849565658,0.681846555186587,-0.36788562832215266,0.43018452699316184,0.33069447490370685,-0.4741131718645493,0.1162775969098367,-0.6642977845809871,-0.06905017175337337,0.016323640136494944,0.2651516548698336,-0.392686957802179,-0.09820764842398697,0.5777458530805957,-0.5794058634693597,1.1216186453566548,0.0803736599004656,-0.6006876463390426,0.20862232068023323,-0.6066533750931905,1.248532938866215,-0.22003479551654495,0.22657854553258266,0.7366741839131868,0.27114107119437897,0.28479101342711644,-0.502704384347729,0.02052103900111975,0.21855871789138914,-0.4957563154360936,-0.4188714616074045,-0.10820463360727577,-0.0008433542578125328,-0.8421726806808796,-0.5732844684619799,0.16968943687514412,-0.0691321185342609,0.26557657940487367,-0.32980030780499775,-0.26139913347756005,0.3566909212037293,0.6312074411603402,-0.8656041635657401,-0.6134595895803759,-0.5794808216077999],"bias":0.2341246265686801,"activation_function":"TANH"},{"weights":[-0.5093487991498346,0.7013904959934457,-0.3887984203674467,0.6074941460728243,0.31600705461043577,0.3214858048248944,0.033125333971522716,0.017065428401066635,-0.4823042378570695,-0.14574464468723597,-0.9220505853951627,0.2309173852552239,-0.1715509784085273,0.15817975557047464,-0.5328316726787081,0.3626998504088023,0.4771247170005751,-0.07533230851727762,-0.2261300368506472,0.44790065985867106,-0.15144711166766223,-0.12507957455703403,0.2357056464683475,0.2900232906464617,0.11488769298920522,-0.14337404494154943,0.3789846489081141,-0.2687759820246343,0.5906739128844937,-0.4530061210356368,0.6022376687599807,-0.05799548178092478,-0.3113619151521698,-0.8392130022917361,-0.530059105446756,0.49657452411746333,0.2760036069129152,-0.3257446841704722,-0.1030931713993669,-0.1468160786944289,-0.271348780625267,0.50273306322888,-0.266552845415554,0.13797858965150955,0.5447876400394853,0.5459771813696765,0.05259435721825889,-1.5049082924867536,0.7107551544599826,-0.6846256030873772,-0.3955369320953349,0.6261832423546941,-0.1816977442471396,-0.5020892089950525,-0.2802323278069503,-0.14866375651782043,0.05327666883520976,-0.49760275527151826,-0.10126742580505753,-0.06738210214490373,0.28965171806294027,-0.12849515098801811,0.5436881226925099,-0.5637682881777174],"bias":0.005846399310733115,"activation_function":"TANH"},{"weights":[0.32344396228468186,0.8325222056711814,0.17781818082620612,-0.03720150676508357,-0.18496459970707474,-0.358460370324001,0.28700191916452417,-0.5906665269565644,-0.8337017559997806,0.44411845921602017,-0.14392984674359924,-0.0849326973090795,0.3995726755217228,0.14854104563822487,-0.43994393391118347,-0.23366545443603945,-0.0998013446337703,-0.4130047437594256,0.46836463316785926,0.15191566242499446,-0.8153721807398902,-0.6807000020581262,0.92986838934522,0.17629385355621252,0.45926379334158707,0.0659209936770486,0.4731819098333395,-0.06927050046878536,0.631319980262622,0.053637016703215135,-0.028736759803186095,0.6593485788655822,-0.38379275850548933,0.3419445817889698,-0.7908620428271746,-0.03143687430035344,0.6367648677147147,0.3852105380751293,0.5717169575012321,-0.48053036099902563,-0.3519080729622968,-0.13573400668472246,0.42849509858624524,-0.5078046539458736,-0.28263493709977366,-0.019876328036070968,-0.20583485625734219,-0.5769651410409561,0.9729604107754382,0.24889359505420006,-0.02253826438535052,-0.8388655764658421,0.34357896974118707,0.17255200279929875,-0.11693151790157191,0.5854079579499991,0.3198025828438985,-0.02762126044148687,-0.42296427106002393,-0.7190104843633327,-0.40888241889982774,-0.0016691920908650966,0.059797975310087285,0.3085608425177974],"bias":0.40825585920054086,"activation_function":"TANH"},{"weights":[0.12625030881962865,0.4116241732521345,-0.6526917372788941,0.4326593165445708,0.4712692922443606,0.2425530618481853,-0.35439667400910807,-0.4644542069002342,-0.4485860014813639,0.10541539388486519,0.08043761494395048,-0.05508124386608912,0.11260480145287627,-0.5152435915474985,-0.10942636308834687,-0.14105400601748636,-0.39856780175866696,-0.07908860758960551,0.3572036624902098,0.2274248028469501,-0.7309432289707735,-0.6372340683333215,0.13797307813915985,0.5231785098376242,-0.7729485548600962,-0.43757616330229115,0.012678242811199725,0.4679762785347331,0.36974884532717267,-0.13831033039577856,-0.125715452113216,0.7535849790531964,-0.46636611180967524,0.5361463108498506,0.3862835886758243,-0.23150401679407132,0.22434587457263105,-0.38996808558801394,0.4827165769180132,0.5105719175068737,-0.2912031376245729,0.4775324758840471,0.27854587204053033,0.6140544717068587,-0.20136734843708698,-0.7804277073912295,0.41665952743026347,-0.5298208325537911,-0.737796713161553,-0.2949978307908839,0.8464171427852831,-0.216184205097222,-0.0387618180729023,0.6138651117495353,-0.3747677642872159,-0.2823578183761999,0.4916194905994463,-0.34741615774915274,0.3092817918699621,-0.23060576457348037,-0.44907897821939274,-0.015114546072048436,0.5476824489948824,0.08449518787869335],"bias":0.05558983355969096,"activation_function":"TANH"},{"weights":[-0.22191859419517337,0.23161461110476844,0.383493274995712,-0.38407519691429115,-0.35233786295644476,-0.09732386587168068,-0.6767679444060927,0.27245195965263524,-0.2339518182855608,-0.055700579618578265,-0.12059478503207091,0.23476241328601144,0.028783646388233414,-0.10115803722328322,0.2142958289378593,0.0891780834861123,0.5857351586212594,-0.6954431983747627,-0.07919130327058822,0.13776238733799437,0.47600410427812456,-0.0875724344456425,-0.18162822622562733,-0.35079582174793683,0.07493167551648999,-0.6479695368538663,0.5713068219551375,0.06903169429577419,-0.6421065647599632,0.07341291778075429,-0.32615053861522014,0.12810055825011255,-0.4219223755505179,-0.740327682192211,0.369023365706261,-0.524262065869474,-0.43696097067655876,-0.09816360456289497,-0.0489483507900085,-0.7129713991292281,-0.8567852938390411,-0.8252651459614235,0.35363608120701645,0.36644533923806893,-0.8910452452670962,0.01151589460956913,0.1661943535793443,0.17914423693905304,-0.0070565358956241955,-0.6681199862570321,-0.4976886428524249,0.5505320924933161,-0.1625811460796229,0.4550675530375387,-0.006911875794058997,0.085875767549234,0.16146224053783334,-0.12357382077695377,-0.42184823559080453,0.09397981638748948,-0.20568549534996144,-0.6807077212505367,-0.2626551321697523,0.37409345594098253],"bias":-0.5911238872401593,"activation_function":"TANH"},{"weights":[-0.8144718930408961,-0.2752813628300859,-0.3914592647651104,0.4198935589101733,0.5970127059941595,-0.23178343035775079,0.47501573637778677,0.24390163914400215,-1.044882390222464,0.5355742253687255,-0.8684304045852972,-0.3168697953692541,-0.21034648585648555,0.34248606228788625,-0.5238148128614665,-0.028304490977170475,0.18700326023187305,-0.6740424456446701,0.799779368263985,0.2860767404449589,-0.06453054513662408,0.03322640947711866,-0.1350324997111327,-0.07579654801514142,-0.35862703933025436,-0.166843566248105,-0.7692891971469735,0.08876552637050006,-0.282676036928816,-0.16123258270788582,-0.5315673767384432,-0.1691705840240611,-0.9956545700593609,0.49513274962003573,0.33033662552018195,0.1492730592702112,0.7874944158276398,0.3378988721932562,-0.321724887530597,0.3742246922260718,0.329452535656805,0.5583454551509796,-0.45965594716959723,-0.16279173218904378,-0.22500383086723874,0.4374592279892393,0.10691132668522348,0.04553627259347597,-0.1464513736244332,0.10685524905309804,-0.12904321155613074,0.5487797591280178,0.41687572839869314,0.16610256969279938,-0.32610674551697405,-0.2554152976055099,-0.05327628038625316,0.3896037355736221,-0.34922978429342827,0.6909619193615691,-0.5258648818499617,-0.3074838879572138,-0.8273426288303015,0.659958350142579],"bias":0.38869662332095944,"activation_function":"TANH"},{"weights":[-0.7117691681766796,0.21269942928934993,-0.12365942154503107,0.5737441531397154,-0.09345113973246519,0.5156321848023938,-1.1365826277939992,0.16843399402623274,-0.08934338977787726,-0.5305890703310651,-0.19861766741074585,0.4971846460657129,0.573441822054074,-0.21081164262683905,0.22749513001302077,-1.3418044898221622,0.37216639248312816,0.34202889012593174,0.26280899543915737,-0.17271979339720991,-0.14049035520514672,-0.144233671894325,0.059670047956962805,-0.44462692800078457,0.03357136731171624,-0.7994357963374142,0.35576898635226384,0.1064785449064814,-0.4660439640439271,0.8715069447020906,-0.38043190296506696,-0.003815076049657579,-1.238363894482765,-0.14795722810153775,0.5490327065962384,0.16139759509518892,0.31487877829961003,-0.3909952049296498,-1.1371619082740108,0.19744036466594184,-0.32519191685735427,0.06842043266054207,-0.3237135878452785,-0.6979432902336355,-0.6538385989835719,0.4655690092865644,0.09961598551181425,0.8633662462786362,-0.4048191207351483,-0.8728199663115013,0.9438701223369246,-0.24683654258829074,-0.24310740569525363,0.13683897431485653,0.3462455319169251,-0.1811785881573174,-0.4166771700038717,0.011219435311335985,0.2042732043025068,0.21227573617866677,0.0873576852811843,0.2889566681799082,-0.5183033887092826,0.6489136717741262],"bias":-0.12359001822388206,"activation_function":"TANH"},{"weights":[-0.4179633256456986,0.8521864911808676,-0.14838861927971259,0.1628741644664713,0.6650527752876741,0.42334265752650174,0.5344731509969881,0.42987159810519454,0.049630138066991666,0.24737111085988941,0.10452784839009521,0.4633783603353046,-0.2809597648123032,-0.6534208799680533,0.3347215646582106,0.31757303651511004,1.6350407849059212,-0.37447520565476233,-0.14783213981943313,0.3029345535597372,0.4364076088774157,-0.10936701402194392,0.7995190178778062,0.12561998057215934,-0.7234389692069059,0.021794358372547677,0.7372632360636172,0.7977577809602178,-0.0996036174634245,-0.1336725893076224,0.5924607832166431,-0.5923844722793294,0.6483178611404995,-0.6235603676771184,-0.4333482256375063,-0.20947296499896162,-0.3542281846762227,0.6273606149394927,0.3495377456347071,0.3587353455445607,0.1092560283294267,-0.0652543605890826,0.16999805498151505,-0.3651139917984251,0.2032528835484298,0.7671323863673775,0.04826896218810818,-0.48856107214581934,-0.33297924572135273,-0.35964624669686174,0.4105694575133986,0.17372899524622445,-0.07084337632354241,-0.8824054357068416,0.21441883139857304,0.38410197416780134,-0.18582987273826118,-0.17679943722416097,-0.7046077593632318,-0.6322136048268796,0.3328502149016757,-0.5429378509491521,0.5301013104365392,-0.36442855948186076],"bias":0.22177815376426688,"activation_function":"TANH"},{"weights":[-0.8621663291066267,-0.7911033207888546,0.012159739302555102,-0.1838859323737422,0.21026918362637392,-0.3479659444843419,-0.2966257080854752,0.20813595306111518,0.4736886692198273,-0.038049279789366876,0.3741484353244789,0.21420582969476906,-0.107528559487371,0.295503069087509,-0.3196547812074459,0.5193751257242026,-0.01842069954093116,-0.04413822225544953,-0.002326320408707585,0.2318564093532246,-0.00001442380172887378,0.7231446546529782,0.12060357836251637,-0.29447000851440397,-0.6595674940618799,0.11838234485270635,-0.17517869946750084,-0.15981018170691685,-1.5277622038594787,0.29005145494356444,0.39027581779619996,-0.3536440700210019,-0.2736260460098347,0.02897123664905795,-0.6964005832782484,0.652835406760659,-0.3907015918454701,0.33216055142773554,-1.1288226894583389,-0.5534739356234214,-0.28107280716730104,0.02331725033112353,0.15328452077489418,-0.41901609475747503,-0.10771760983479542,0.062288883238514337,-1.2124179391239178,-0.6267856163077892,-0.023928813767852233,0.7511438047790313,-0.16073890858804388,0.5029518523936446,-0.6060286401931517,-0.43823576351532817,-0.1444788554171545,-0.20735111653262545,-0.6099242349694037,-0.15679688273541753,-0.2165503763362995,0.7338462332061764,0.5758379806316491,0.06968745145328512,-0.1034013081788728,0.2190873158093811],"bias":-0.17918065815574563,"activation_function":"TANH"},{"weights":[0.36048283978513807,0.622317946248206,0.38827757516754224,-0.47261747565758094,-0.07540066251718146,0.5624337040854996,0.37259250137079913,-0.7156244132690572,0.018789358690049253,-0.10566477337771843,-0.5275714537892583,1.161769071077243,0.2426722272987592,0.07188160874299077,0.354144142926929,0.44451870683146416,-0.1413860437051434,-0.015759311781010067,0.7757639509254399,-0.24814594219261557,0.8769275395210354,-0.26210114101937065,0.17939372540734597,-1.0062887172874142,-1.3121936424861789,0.049361397179621784,0.07196263258163704,-0.392883579537343,0.3288239297671862,-0.7284087819131616,0.3147526512950367,0.3715802222592779,0.061868616633684065,0.6633282917890906,0.28451345543374346,-0.3525298841642145,-0.2585586555383651,-0.8628395777043615,0.2808379286325293,-0.31956952521006193,-0.7126268090551058,0.45586943928346724,0.3691545565563882,0.6874324391663524,0.11060627021510099,-0.12034580546860933,0.9799363724391355,-0.39570206770341343,-0.14414889520682195,0.13567026719769354,0.7374910712397689,0.21950788483327208,-0.33669884168588726,0.20739792830540957,0.05173081109217556,-0.13402676965155158,-0.3473059165405835,-0.3853678245951187,-0.19367697641927573,1.5425335077914826,-0.44372274422158137,0.5352219024762621,0.6392389436169542,0.3806473711214543],"bias":0.1231597880543252,"activation_function":"TANH"},{"weights":[-0.80765138707404,0.10360308249330018,-0.41977561508062283,-0.09031870524128494,-0.5744085043423292,-0.5433407912114224,0.6198095762565234,-0.13619443198843406,-0.4920304512721652,-0.37876068904950433,0.23030237692223424,0.6137563606672141,0.7479059539613395,0.1855319029384716,0.27318714032128844,-0.45962732996677236,-0.17948718588714316,-0.33757902407657847,-0.5919401382293205,-0.09348879625602463,-0.453249475867037,0.6117213634971458,0.02266206282411368,0.029016322238033784,0.46398388487727477,-0.43061849019724924,0.7990040336721672,-0.11936834432150813,0.02331986739697984,0.26045893009619303,0.02613197296323155,-0.4196601738074072,-0.26634604105780696,-0.04133154416118982,0.21554299162617424,0.08500355803579591,0.2676110192707755,-0.1482811196646559,0.35000190992710944,-0.05034452764357581,0.09076192842198356,0.25454322376759037,-0.3971309496295932,-0.5466536537602188,-0.0734955508528392,0.31351517385981015,-0.8958549339780305,-0.16687919042464602,-0.2546335855535959,0.7869212879106314,0.31854056946092685,-0.3625262501176875,0.7790461835939301,0.27524687618933963,1.0313238240878606,-0.1102659461633171,0.016412741915594373,-0.25904308824237493,-0.5175713122887999,-0.015294311844169559,-0.14860869813374838,0.3063546587819447,-0.5459583619401227,0.712092393945292],"bias":-0.3259391431281315,"activation_function":"TANH"},{"weights":[-0.14343371679312442,0.6737581983833538,0.03635748914442179,-0.3893579669689495,0.4266640159542575,-0.7736375811479382,0.6335010543700909,1.0624560887623693,0.487081069984157,1.1259433026632626,-0.01803159655058147,1.0078465492417827,-0.4142083937004466,-0.7231119019020655,-0.35544547952453664,0.12168909602315692,-0.3573600178587108,-0.2426292466407727,0.01631971086982439,-0.21134030352218952,0.1566087192896229,-1.2098724577786442,-0.018604447837926114,0.1457380853956744,-0.0445551529226588,0.21462691837399234,-0.43825633036825384,0.24778040460323833,-0.3564497584751449,-0.06847622448517852,-0.3612631346314519,0.959021153869112,-0.03624877922941529,-0.6450654176174163,0.047642213912487553,-0.1190143768568343,-0.5161497238177025,-0.002567525162492229,-0.19156119950473624,-0.46834262383443664,-0.15766473169627823,-0.23276354652388437,0.9546690370953077,-0.19357539127990028,0.05617882283065931,-0.408493039821223,0.6866682563712523,0.23192638032250895,-0.14722896173956643,-0.6195531762111877,-0.20436495476165178,-0.18727812672857636,0.08885654652981448,0.17144605046144776,-0.1773915997343219,-0.8901843065491415,-0.65053820778345,-0.23376435521569325,-0.4583263387530607,-0.3365662139141689,0.22112588797804902,0.07348989746671311,-0.001669504741144216,0.6453313975124098],"bias":-0.10491199280976757,"activation_function":"TANH"},{"weights":[-0.3351732039891512,-0.25703757853909664,0.3186708158323486,0.12402477764031707,-0.16644572697138776,-0.49939082349967195,1.2061904103651102,0.47135918330553683,1.095433209952251,0.9194514643684528,1.243846065514118,0.0355517465113212,-0.44776990214984286,0.4656684871753452,-0.08355240550873497,1.5212171401905108,0.04743530329892779,0.15537161125764848,0.01998000198425207,0.9931100877761567,-0.21308710108503293,0.4622829760628616,-0.8970734425746465,0.513609863266682,0.09527482564849332,-0.3678737561590794,0.9813826723832052,-0.22035141822702478,-0.015476687136035948,-0.22501333197198015,0.8953661777185731,-0.7947288326930025,1.0249329349296843,-0.011529961126005309,-0.2783176858728332,-0.4868267963857827,0.1330915365434459,0.3348187695531521,-0.21845737957088326,-0.029534461954604838,-0.1745542061007742,0.4446918628016756,1.1910779409442378,0.30511058051950246,-0.2089196720991394,0.2853319549628016,0.4305072842038441,-0.05224604270382373,-0.429463125508096,0.8706938840270033,0.6763873933099013,0.34103044117325126,0.2475017393994783,-0.7238316232220524,0.7111674078705764,-0.34532648619141704,0.10990182231466461,-0.23039911665694596,0.13603109496002438,0.09733005549375383,-0.20258393595899113,-0.2882389041102608,-0.2574366014441398,-0.12592727451424734],"bias":0.39766464127703743,"activation_function":"TANH"},{"weights":[-0.22479558290547283,-0.828838344337183,0.31467912286653105,-0.40165679578848595,0.4754864995664887,0.5301696424430348,0.2975168789052248,0.19847699818310383,-0.4138713119827835,-0.10158986467783972,0.5106375134445144,0.1779218053207557,0.4005267174249597,0.06473860061980513,0.17670771397460985,0.42676984773033055,-0.7284636836173608,-0.26908710020178284,-0.45226460302478755,0.24557073537755567,0.39190009534980236,0.6709754226357555,-0.6751299396166949,0.018769790325651584,-0.4278526591241261,-0.006297358480517034,-0.07123216065191793,-0.4291486343478498,-0.4288174089109311,0.3144780997818574,-0.019559749024917382,-0.3813805045803508,0.10167000750284144,-0.5524767109101691,0.09723643385242535,-0.2507592028159516,-0.6826714978747213,-1.1887361037536592,-0.38342897746973215,0.4314438055279877,-0.2814758179848756,0.6151230271870428,0.30356564816203463,-0.5345967734212045,-0.7494913754633142,0.2672799108632657,-0.10752667847529124,-0.9187549642949275,0.23088817604887987,0.6838139797786342,0.7786486264311048,0.011642239658120331,0.6405414282244365,0.0451233005622767,-0.8995296315561008,-0.4341289177355066,0.36643837506457,-0.7148791565809038,0.14470061561226708,0.871120361802445,0.09686083807458505,0.010528419957812857,-0.04389249992867211,-0.7136264656750204],"bias":-0.33206413953167463,"activation_function":"TANH"},{"weights":[-0.21117739215687611,0.29797492503457296,0.04497372429238631,0.6339821730755563,-0.33604007175089645,0.225377676307224,0.08257486713436349,-0.6477185250784243,0.020805302068052124,-0.058048241119925494,0.38173905979053707,0.32842917956419604,0.04986538615950878,-1.2201608042612069,0.04502330254874773,0.20817032961127901,0.10894008375359486,0.10790160974934218,0.4723388422721848,-0.30324253037909826,0.870400968488974,0.46576741602212063,0.9108832364415885,0.6599030154282495,-0.26631160459088754,0.14775613096471676,0.13219119964080828,1.279773398803446,0.20634559861749432,-0.13739038515919033,-0.6688280226971225,0.20582249390528923,-0.12677840187227976,-0.3393955636221229,-0.13002079583216533,-0.0449591132317316,0.3971548569906396,0.19703146986086717,0.5557455909199773,-0.14357222073468306,-0.4497871648381829,0.39137541733733794,0.1894355789345699,0.6595660332698592,-0.4007727912931036,-0.25983212374949083,0.1201730410725638,0.27170511115478924,-0.5207196854712176,0.4833123458150083,0.030314113481295927,0.15961916333666853,-0.6034683695683984,-0.6730460708056809,0.46763059484905567,0.3533652115878484,-0.6538766346409514,-0.5192827382178635,0.11456974234370237,0.27441363916924655,-0.28278313922273735,-1.1805722633250006,-0.27703907668026495,0.28032908996268746],"bias":0.02091561492630259,"activation_function":"TANH"},{"weights":[0.30959798430570423,-0.487811901263444,0.27442737287773333,0.32546865648023393,0.5080886876889537,0.7081394981504986,0.2955775285121456,-0.2076403008628771,-0.4120510557165063,0.5874047871594077,0.9927758306424322,-0.05209071391246104,-0.2837068931995514,-0.014489712776786075,-0.4273698967867003,0.12201204674968927,-0.3722037197404835,0.0643668111224247,0.0446833427985255,0.4246873792098768,-0.4142476841882384,-0.6447595811469684,0.015223673244212532,0.3574850197697944,0.01666996201051204,0.304766515964418,-0.3285886604033879,-0.49214258016983903,-0.5757207691997003,0.557578531913628,0.0916376085471597,0.6457194841532683,-0.9963107137187565,-0.13155708596884658,-0.947445801513377,0.17807228789345417,-0.7718571352423192,-0.07373542025777972,0.6761522420694712,-0.20082569295990368,-0.10675820426443663,-0.14981040726379863,-0.5274486239801432,0.6330842569357941,0.2395516167179117,0.6237000640336583,-0.0885101745733714,-0.2510375795797971,-0.6340251632344506,0.13499016598127772,0.35609969527422913,-0.6583865946627637,1.0763012983164923,0.10758583118532818,-0.021388344834828127,0.28916964275041435,-0.18934763948454592,0.3687961541514687,-0.6069901120064531,-0.3399808233507931,-0.22888128765236124,-0.048922473401351856,0.26686208290253977,0.520655596776995],"bias":0.0612197590897213,"activation_function":"TANH"},{"weights":[-0.4307883682274767,0.04446350252105687,-0.7017708168127191,0.6468343412863935,0.07065162655987386,0.759486324691084,0.05519873801720913,0.04945397805334418,-0.22965280870095214,-0.2708232070887752,-0.3131916135447523,-0.30335742931229936,0.5635700393542388,-0.6219584891238242,-0.8400749781598013,0.5977722767164723,0.42737347302302725,0.7674742354960802,-0.15734108036365516,0.008945663074599054,0.08495344040990926,-0.9392620283224122,-0.09742981366767696,-0.29480529274953465,-0.05113925104436801,-0.13957271147219064,0.7287958357015384,0.26628609658747393,0.15897573277117924,0.22245338029754425,0.5532701713199021,-0.4541608667444368,0.04577637694592749,-0.3188493601101738,0.6742293090814958,0.8975633147158991,-0.5828437993145337,-0.2738928539430541,0.523366115445264,-0.3109597384449306,0.4711591478720649,-0.31722623389024385,0.1688849077374695,0.7605872439686604,-0.1178799563412642,0.05188680807854864,0.1219875594931567,-1.1089426114869143,-0.32269395281968516,-0.16047398821662157,0.3079015828417518,-0.35988797731574107,0.30602793830324543,0.4608537398649899,-0.5968386452092346,-0.1870307529905142,-0.20982713432554415,0.5167460256924684,0.6019799761104314,-0.02859592939291247,-0.5461086049318932,0.8565586047613301,0.01690815260547563,-0.5650399608057376],"bias":0.013532722687192439,"activation_function":"TANH"},{"weights":[0.6121682889017128,0.01564491089983815,0.0012757944834304175,0.8507339432890472,-0.1403572724403903,0.8128843646146281,-0.20819947806315814,0.16342985187198045,0.21021497747923582,0.4805970334927845,0.1275663416105771,0.23722342372867236,0.30403029431059203,-0.7801515909748141,-0.7176007461638073,1.2290198873856977,0.20375181783820717,-0.6281167542603618,0.3314679795596445,-0.40535508628895844,-0.18228379339370007,0.22302650749842606,-0.15838017752099806,-0.5616056831119886,1.0695442013044556,-0.3186511053429394,0.26792553766691696,0.5854483177676278,-0.31328397897143934,0.773051521826229,-0.6774267316628508,-0.4053775024011217,0.23323690997479746,0.20864966113712877,0.02339612190811375,-0.47439728047736884,0.7658561651420498,-1.3180534539078375,0.6319524089500395,0.09421715660768061,-0.3259518332504106,0.034720326096981474,0.01031706236528332,-0.09435920264402584,-0.36687311661844096,0.5915436823813811,0.2752387390192164,0.03276307393676767,0.9223272628167919,-0.7022943720659354,1.0390644048013813,1.0119469598550388,-0.22396423685684486,-0.6266652437810581,0.694588144166491,-0.03597078892434395,-0.3298152874126392,-0.549483348184031,0.39907087901644483,0.13766574472701396,0.20860399594473866,-0.7795766907593449,0.07610790522791835,-0.35925186560832356],"bias":-0.4641962770904116,"activation_function":"TANH"},{"weights":[-0.48280355947863346,1.1469438828014147,-0.09886421552041598,-0.28574326127481015,0.5009294730667079,0.2258626554517751,0.7036472633568109,0.4382649881097519,0.34362935956108226,-0.3634475810254214,-0.5512458147210806,-0.6574642331492313,-0.1928351975256435,0.9024997446974233,0.5572362149222806,0.6775140159018179,0.10843771321522754,0.3451886473178789,-0.11443465907950943,0.1066228318414894,-0.29361139988314794,0.33751039522889675,-0.07650314482755698,-0.6522005029340677,-0.044488908483868765,0.8962353476880307,-0.1224734242231421,-0.2988663072632333,0.2435853341523877,0.04642574051643665,-0.7467224877138039,-0.3859892677426171,0.798498870609862,-0.324400806604437,-0.10086992825602961,0.30618962675250544,0.004133534219628136,-0.26546943531424994,0.622094671858917,0.5135149800145875,-0.274215392929084,-0.06871202163274812,0.3468024613305575,0.31210032226171375,-0.14698361804530885,0.48598339233963855,-0.28923101681773583,0.6497417477713647,-0.22705039576913974,-0.2399422566889256,-0.24253592512509775,-0.09532699772405437,0.17893437294739328,1.3501981636669202,0.2919792771438148,-0.07322170784382945,0.3273656023271684,-0.9001432199425733,-0.04211037254232908,0.10221013064028703,0.07593515771671405,-0.9720436387126021,-0.5725675978910124,-0.685002826665382],"bias":0.19246449582836106,"activation_function":"TANH"},{"weights":[-0.5549586450175205,-0.5253074160242092,-0.7222641177400636,0.11081102572881049,0.7667335875597682,-0.29217801544074673,-0.4302018295587996,-0.10509384788001758,-0.45732566147616605,0.8570472512614509,-0.2249352854825058,-0.5319146050010984,-0.5106753060234518,0.23552024026346124,-0.18481694169522603,-0.5708759201221676,-0.2297886191658248,-0.2645858665914768,-1.1587573625979333,0.3637640405909988,0.24872378161508,-0.9766943140776548,-1.2035613223697381,-0.33650978264084913,0.9903508637131218,-0.01333196457785947,0.21175376849292477,0.5022355437938075,0.048261839023973255,0.04763741781563801,0.0847519427222437,-0.8980254828503141,-0.23264409852362763,-0.3389283715268391,0.3421771144282217,0.25107074473292035,0.20308867596164482,-0.3831696729783426,0.25033950381017733,-0.2653739495817137,0.24016127527411674,0.8281870297293096,-0.49117659624120635,0.16653889712852116,-0.06544672291159931,0.31141226097922714,-0.0433126221463034,0.1310236407434758,-0.2431382670115122,0.48671034474396224,1.2548852690365244,-0.27606055304702026,-0.9585541220058766,-0.8460321210532336,-0.5392830306609137,-0.4041489053403545,0.16794317994060787,-1.2044041373098422,-0.06128076422157691,-0.1042796657791689,0.06811812142076124,-0.15502419771338638,0.5339966226148446,0.45480005830348075],"bias":-0.2089993027159608,"activation_function":"TANH"},{"weights":[-0.08623329109047317,-0.5609322172788765,0.6964270409812331,0.37521828310437944,0.4372632775922862,0.07953147172058261,0.3266801325932133,0.30929604468822225,0.5112043580844882,-0.046029912318690164,-0.12120122537914918,-0.7474977498432731,0.6136061893609422,0.4719127909089129,-0.1687869807683654,0.27524348613153704,-0.2444041958327591,0.6173829255791204,0.19450524290973456,-1.1749130937980365,0.5535282652788743,0.023014625966806607,-0.32157387653355346,-0.00971927297033361,-1.0180591195457305,0.36073154302600874,0.522798457446588,0.766790663083953,-0.25147480787553267,0.4606474412993545,-0.5232986893185515,-0.5792394228140766,-0.1533499350255189,-1.209229120869745,-0.09493160109120151,-0.08902754715765332,0.4146552066306694,-0.09729339699344061,0.30243122977794307,0.10141965334377481,-0.9872762552724134,0.016216598212639967,-0.6184303802615522,0.010723144121656501,-0.2348879925017583,-0.41716832188823444,0.5772767202950929,0.20346315361726602,0.9804090822284937,0.0432680912545203,0.17986068725504717,0.4694074190846844,-0.5459473068362519,0.46908131432858896,0.6622148899243308,-0.5605205201755187,0.2603573159300585,0.13643994729678594,-0.26865961204868855,0.5623050977712495,-0.11398183371311119,-0.683920379931525,0.34035569043905983,0.8169516553488358],"bias":-0.28562713544072493,"activation_function":"TANH"},{"weights":[0.4574589123134701,-0.07031084909478504,0.5326922356255138,-0.13185465147906422,0.23676252815791068,0.5105405428253043,-0.06349274205562726,-0.1492525177994142,-0.24568190308809826,-0.11915175317462887,-0.2944571953541178,-0.16489204221983852,0.1366564304163089,-0.3023893979057987,0.32553570877720317,0.13433261644610506,-0.7159264395358197,0.7176820956486506,1.4180041931894867,0.16600280788361207,0.262431057534659,0.09540658535109567,-0.05961041521556526,-0.2855026411184115,-0.04789408974887689,-0.42710883726509563,-1.0257870163902376,-0.5869692574494996,-0.47735575989652346,-0.15075984247341281,0.24236863084901045,0.0010175240474022372,-0.7078103342963536,-0.08335867212169995,0.47670188465230184,0.6898508454579073,0.14120637786611012,-0.29636964577116254,-0.03696496788604013,0.24833322433038868,-0.4499806314563487,0.4177698473961923,0.008120089004050328,0.49669754805423944,0.193394955064308,-0.9491448444400078,0.457585836059875,-0.337228550956676,0.29833253072787586,0.4314442295794216,0.19506292733878328,-0.18083769398597466,0.1285250059779463,-0.06480909981324473,-0.6819219623889312,-0.08026354819334738,-0.9077004701076089,0.21980930592347525,0.29206998494803615,0.23596242468090328,0.006962582183044179,-0.05572562420299647,0.654492126450193,0.5969037519509632],"bias":-0.47871035551146857,"activation_function":"TANH"},{"weights":[0.2501038644626151,-0.061690515081026256,-0.525305077285083,0.32076002501698164,0.2219339587109174,0.2259486352532652,-0.09201698302280463,0.5083398795705978,-0.6913814418461158,0.6222281458385571,-0.20323547660201904,-0.3231880165161689,-0.27184229993840886,0.31842225730492363,-0.38895543204795185,0.2249221036088112,-0.5679649870814774,-0.84953194420372,0.2650418444833838,0.14520582429996878,-0.13841527283253957,-0.049485617629415043,0.30103806360377766,-0.1047467741111689,-0.1513826156357413,0.005352397637398259,0.28935342915077444,0.4573245519160307,0.5528007979592795,0.35331674206081576,-1.0328763070366138,0.4223488364070286,0.5330458088699694,-0.47433323872481314,-0.32998814223944245,0.41057908739748233,0.19851198279177942,-0.2684481921676876,0.10442910097806436,-0.13828657325935076,-0.21676734143076676,-1.078580831534233,0.3134179550340471,-0.12410725267620037,0.01993745587734732,-0.09011049448259179,-0.5292107805577404,0.014788340764433805,-0.4891453175424661,0.7162513245858738,-0.20038625022507503,0.1224019845214605,0.23371129991534995,0.0524472724551092,-0.003918543500740834,0.5233183125917776,0.23079767189218117,-0.35451458588949114,0.2539459035208351,-0.2848790301011167,-0.05668111517101638,0.7355151405096555,-0.6577712977700344,0.23536452844875366],"bias":0.26199298784476927,"activation_function":"TANH"},{"weights":[0.31159847575019983,-0.09708360263966909,0.27329919556380444,-1.062154037867521,0.11427796759939648,0.17088540103672242,0.5960988675436495,0.518205164909807,0.8522628674906728,0.5822640750581567,-0.20953522975008615,-0.37792989956169076,0.1095100401071182,-0.0697285668023693,-0.22734315964942592,0.5637187262757853,0.3612551232149442,-0.5435026522295447,-0.14935218393467733,0.4833409187521843,0.050888035657676564,-0.6078798713199395,1.1594870738184553,0.35125245739369293,0.2576159095005183,0.06738798747869615,0.34578901533934614,-1.0226776960796178,-0.4860902847390027,0.2506307072650063,-0.799361629067618,-0.3459224247361614,0.08754948003557789,-1.5229056066327775,0.5267087587915827,-0.3429254953058536,0.21081714300446863,0.40427196333653975,-0.48800575678921654,0.6699169198824151,-0.30361783027384187,0.010003702354802513,-0.6459481578104908,-0.4411192138556192,-0.15163160630379036,-0.6399784019448139,-0.328866587027502,-0.09982742815873959,-0.9044947458500286,0.4200744227173168,-0.17741315405273578,-0.033774891919668336,-0.11310409526382786,0.3895944325119377,-0.18425924901805443,-0.8739615215164767,0.3868873741351294,-0.4715254395636499,-0.2750799683126772,-1.261750716408696,-0.33226648491516964,0.3999734152139171,0.2929176107775698,-0.24216196515054528],"bias":0.732297588430364,"activation_function":"TANH"},{"weights":[0.3054855355923494,0.41773515788246063,0.03538775601977707,-0.3602063589708055,-0.9626874923332531,-0.1693655528866347,-0.9737598927220268,-0.024397710286332704,-0.7390895859044543,-0.6868772715863233,0.5961084453807006,-0.2899623621646117,0.020495238839688328,0.2521024586235582,0.3893196476485391,0.053091496976350606,-0.12584414429695728,0.7841338740093469,0.07770442822721163,-0.04113308496292162,-0.6194768935497242,-0.028033778514221584,0.11743475449519997,0.2582848485047431,-0.07900049041045223,0.2742213804428344,0.09486569878707236,-1.4412135122931073,-0.31774908778285854,1.0416053955033138,0.4715106351102675,-0.273749615061558,0.17655228557044778,0.08506604067537155,0.2036067697364564,0.08922770491771109,0.9417656071536666,0.2534448403014168,0.8237474338781693,-0.037023250994765916,-0.678816077089443,-0.11619552212965392,-0.3361302788103021,-0.2502406807547942,-0.5456964815956308,-0.012875204695205936,-0.5645876396925462,0.11533329821122422,0.4608501469803538,1.3208143404489823,0.33279916233996154,0.2849643990714008,0.4589067722372876,0.3458386680526961,0.04494162168947255,0.5474332810884328,-0.07063154401392722,0.08144143211479274,-0.2382485372859994,0.3286609422005488,0.16001410157841975,-0.25837275284092065,-0.03269767499738546,-0.0026986915058063513],"bias":-0.798995585909893,"activation_function":"TANH"},{"weights":[-0.34740726560666535,-0.2901793134098234,-0.2671744397123831,-0.10004337679889887,-0.2739984201815065,-0.022003424933202634,-0.47846471974113725,0.07272461488925275,-0.0227607853301763,0.15116117819686029,0.1164222793341218,-0.058964709718441276,0.12146431344174802,-0.15655035128852676,0.512854745216145,0.31661103029689613,-0.16380786496193228,-0.4430959998061615,-0.21413128386384478,-0.42755088272890623,0.20347259472481338,-0.0924396100609499,-0.5462026742769136,0.08939944962244042,-0.04649909586531957,0.15575750167786684,0.21483351641379006,-0.8463817465207872,0.10428802273349513,-0.08271739799754502,0.4656704913077722,0.18135713103412857,0.2552257603384757,0.31564113051402276,-0.8559043050977321,-0.8538534621878994,0.6045954441506867,-0.008893206920801935,-0.2683739554799215,-1.3363889246731793,0.5163949868221338,0.32711112336124337,-0.08000614126966613,0.10421450299399973,-0.20893166898188945,0.3418054996753525,0.36827263934200277,-0.32660723014970705,-0.10812802368421022,-0.44350148705926323,-0.13880131593287018,-0.2651554851919809,-0.6774480360490075,-1.5154276899382098,0.35681097460640676,0.9685066047944692,-0.1795559603839863,0.23481169590949555,-0.4232030142544077,-0.231559833773568,0.004639464358501825,-0.47459990815824066,-0.6126751767942704,0.26652299244598876],"bias":0.7389252798101293,"activation_function":"TANH"},{"weights":[0.36500383179333146,-0.5633625194446888,-0.11214998270159483,-1.038325233295653,0.15964177427453657,-0.15015003233558452,-1.4053514857068468,-0.1395727094182398,-0.5556578704624932,0.2631441173769185,0.394751335757597,0.2520891180788754,-0.46979454735622794,-1.2524425283591774,0.3446701893281779,0.24243805180636968,0.725824598245151,-1.1710452719601272,-0.03202080636068531,-0.18757529196702796,0.9291646316808189,0.779359075759903,0.36888572200220276,-0.3316189693201972,0.4647175562684537,0.570797401038186,0.7901348735776313,-0.3623414277588968,-0.4781252588697263,-0.185874020581477,0.31007073771668836,0.5474170011181886,-0.38654712627866916,-0.05239221698607571,0.2980071297404649,-0.44853652689093215,-0.7082684170730914,-0.6046013461098754,0.6108254035653471,-0.7856760926454364,0.5789845841667703,0.08774653783333447,-0.4684845200179282,0.06929847143583949,-1.0210215805275449,0.25250113523565537,0.1583442346773615,-0.37583229432659393,-0.412234594444402,-0.7925213597155486,0.5398564625585917,-0.9759303788931671,0.13531141729616497,-0.009383336278175189,-1.0596602772692754,0.24664979952905725,-0.5593871845885016,0.4579043956009625,-0.056927552386750464,0.28481362142616956,0.4954377246365611,0.21837670617377478,-0.0662542468766141,-0.39757887625963567],"bias":-0.5874193365942604,"activation_function":"TANH"},{"weights":[-0.21909559504501797,0.492451677368892,-0.03244293951808724,0.11737151249004585,-0.531496740674177,0.8630999097545469,-0.436792085653592,-0.23809835493888165,-0.5569317710466091,0.2890742542707355,0.300751608450058,-0.08753278574235472,0.013427577613702633,0.14023103526768593,0.3570577937824908,-1.6656810781173368,0.01635339931882919,0.7294681302163641,0.43235466538434225,0.3687219888982109,0.5920930623634496,0.24979809004051606,-0.8789350174147261,-0.11170345323631661,0.10172092204010741,-0.6612023555599454,0.10939971962137646,-1.230931825283127,0.3657219930846551,0.26885973592646956,0.664547526676724,0.13782445867789556,0.4873826026646237,-0.2849873713364484,-0.32300362147766604,-0.2530609858797766,0.5709785331413353,0.38193109677455306,0.4707865407520829,-0.09378437954706483,0.7903143093721505,-0.4784285056412772,-0.05494230834551118,-0.548209979885919,0.14732777429953614,0.17428596835430146,-0.5134738414371431,-0.24149523900295408,-0.2567488845079556,0.020125998641399877,0.6434293857237955,0.4035726187695047,0.43843501562038145,0.1604080282238015,0.9369490434263329,-0.6462293432928821,-0.3412449105115198,-0.4795804018187317,-0.0787665718320531,-0.04309879470741468,0.09573085635960059,-0.01165107385172252,-0.17661413768183387,0.21785963664209257],"bias":0.7680545699437814,"activation_function":"TANH"},{"weights":[0.39951345528339677,0.26853949750348743,0.1784978384006406,-0.392120054147436,0.35585238490559157,-0.5483201580409047,-0.6212505900268561,-0.9525217441862889,0.7063647253478001,-0.020259270693994413,0.618352918643604,0.19767152211154423,0.16292659494548156,-0.1858262702934518,0.06446084853104847,0.28318032811823307,0.2094848264711348,0.15130377297524278,0.6752780952589801,0.1470581846364207,0.503554491493521,-0.5806314864755652,-0.45500386255795666,-0.23103393991929452,-0.5966509495908522,0.46352041845776104,-0.014173853846051337,0.4508197344691097,0.7382258471668476,0.1423374966109549,0.259255670133697,0.30785850948080745,-0.0882102955396929,-1.7523780669676963,-0.09354390259164276,-0.3869475297985629,0.7809467704190036,-0.4758269298500538,0.06783868992141512,-0.2314978385712849,-0.17141691084854682,0.45227735274714675,-0.028181976569581314,1.1577732226409265,-0.29079803955251304,-0.156398257765273,0.017688362972522978,-0.3424482001013867,-0.09297292032636445,0.4747426992546058,-0.019057871561362058,-0.4166250053793905,-0.4295238454223928,-0.39835888638884837,0.6216954606706078,0.1081770582967972,0.4623456675455623,-0.313126371230951,-0.21475414633758175,-0.626793429150278,0.13250911237164442,0.21315888084091902,-0.27571186136110637,0.28422262905336165],"bias":0.7275779816191951,"activation_function":"TANH"},{"weights":[-0.21711694591736022,-0.5121021507971051,-0.5670318579589597,0.06890708571396212,0.30003778051002905,0.3096216694687551,-0.2335915176600843,0.26847382175608736,-0.23338855999982963,0.06205736847748393,-0.34019785389140683,-0.13670956187506839,-0.20612830854823888,-0.28763811796928473,0.1725606698808067,0.0650110654249956,-0.3767780454046846,0.34155627421896584,0.083670617516479,0.08646269434996978,-0.5469130619701592,0.5386191553807429,0.024814430267448388,-0.8216067974521969,-0.03948879318541047,-0.3494835055877511,-0.5585101703115928,-0.6285720410614527,0.0686530765455663,-0.07097669384630101,0.17138554592429348,0.41930935546791,0.10605560125072305,0.7724639025710233,-0.4537988101665045,-0.2114760836494283,0.5264663477626461,-0.11607458503491563,0.1061550103143683,0.39910830175374223,0.07381558061645631,0.5455153020515712,0.3557420287263236,-0.1448941364576623,0.2813896959132062,0.9380613821854796,0.4515325118888412,-0.4054466871287639,0.17790330689160097,-0.26565579475295914,-0.05931131895783956,0.34923841708326164,0.3966031246639558,0.7074031965713625,-0.785771894563352,0.23087247134427097,0.5079940931889584,0.02413000232485649,0.1541656701124498,-0.0010029356503108156,0.08915818468340947,0.27138841398906266,0.5232190340085935,0.18201409036775826],"bias":-0.6261138921540186,"activation_function":"TANH"},{"weights":[0.2001950134527044,-0.2997291419682659,0.4135147131882722,-0.21061809448859806,0.04692352513522011,-0.31540347294771576,0.5621257506333346,-0.3052355491824248,0.3845451642975628,0.5428023547077108,-0.7242388415354495,-0.8912827853768512,0.5555357687322764,-0.3655962466939551,0.7769385754140871,-0.1558897097178085,0.4023926416444324,0.07220035273812166,0.22098265241911974,-0.020571854170978017,0.49515262709988994,0.1337269161842839,-0.6847942740996732,-0.5902547347032611,-0.13458489821081204,-0.8895887094677895,-0.938022469027321,-1.2833588083920118,0.3707918893940213,-0.5834957563875643,-0.3344405978168841,0.25134277341430256,-0.3404149180841971,0.3019081153366997,0.25333628440656775,-0.06930425653204841,0.17264183290574303,0.1632527573466311,-0.10255087556502449,-0.27170808970817606,0.34691947282075486,-0.970304071104165,-0.0635971869354373,0.3956116076136047,-0.3586210317903346,-0.5917992084907197,0.5080213212754234,0.20277919126017677,-0.15557976727336412,0.09056683633539622,-0.21960793797097541,-0.5509953426530183,-0.6313265082981151,0.48144193859831885,0.20507295240424536,-0.16163108102905976,-1.6883226604915773,0.21837620084572362,-0.3389848295630135,0.1251484751930401,-0.8252767309265048,-0.3559752104297515,-1.055377254253567,-0.3529584785140508],"bias":-0.3173938618010695,"activation_function":"TANH"},{"weights":[0.28808261182959577,0.035897373551526654,-0.4806394320894088,0.30044912218439007,-0.17990066989199807,0.25178795408809823,-0.020982897567263473,0.2706653310469156,-0.4480251182004496,-0.7588877391083437,0.4184803003433353,-1.0417635648332617,0.3668500586073064,-1.1993105382835283,-0.9736522086884624,0.6180149964405718,0.5695294445924244,0.2172606048771871,0.39460828763109124,0.16951074678043662,0.6188701252362653,-0.24200558002512987,0.09830299283064575,-0.5316211872464036,0.3314209104501092,-1.242604674193214,-0.19891620707857632,0.5412138435578067,-0.4545760304706618,0.1786374007005413,1.98269943147797,0.9859927807010638,0.18418741590816792,0.1228019706282949,-0.27446212872073744,0.7226082330939972,-1.1677627926991916,0.45910838085856437,0.049235918652862906,-0.29921334939063804,-1.1073713758319939,-0.1923095833437905,0.3573987445070364,0.13767119827297253,-0.4259110724921088,0.1680465404141923,0.5278164827169646,-0.36293545352743983,0.07482021283403253,0.15853401322283106,0.4485874965781636,-0.18457550680857174,0.5857590931026873,-0.7824255364640651,0.7631014361928008,-0.6951577776150513,-0.8978323707007836,0.4303919391653838,0.8256574548943336,0.4410610132732511,-0.1694137461498129,0.38672872089481164,0.3438739944033636,0.41497708493469787],"bias":-0.45227588964856014,"activation_function":"TANH"},{"weights":[-0.6738172082252675,0.712567970400767,-0.4980139665703344,-0.5285724945208694,0.016486126345634913,-0.46160552860901344,-0.6636984139291747,0.33875276504531737,-0.1711979101886869,0.26171741870068493,0.35582560823273884,1.1141974154803216,-0.25426106590799885,-0.17360452375632301,-0.5218592323482644,0.47492918664662287,0.21311526678814735,-0.2376733118984516,0.33113825994804746,0.05791215333843893,0.15898498244708753,0.5942225013739451,-0.18630524309004307,0.19891143296780645,0.3846567539314591,0.1624086308432901,0.06881962488582583,0.2748954265740833,-0.31247187584514147,-0.4650129920563696,-0.5083489505429867,0.13696533994797358,0.19274921804062123,0.627680691314978,0.15195953756988778,0.6489541325368198,-0.8894606919985003,-0.6228434258070299,0.21089384354009863,-0.40889798950454215,-0.2969056402671765,-0.28969483042911626,-0.3554928980640208,-0.5642502422412166,0.8148917462620792,0.5123154535054348,0.17337563731479083,-0.00527486474559169,0.2383795198881833,-0.617288623384875,0.2879263934888032,-0.1420997482776233,0.942830204557395,-0.29894854507328156,-0.2911301148703215,-0.2957240552882507,0.4050942887352675,-0.19661442848825356,-0.1352134147002321,-0.6272505862273121,0.18658556522977202,-0.6893101644626278,-0.5536557965293145,0.4590877311000216],"bias":-0.04501424950502733,"activation_function":"TANH"},{"weights":[0.3814546959900539,-0.08086354874449779,-0.3664095360704584,0.17967805806860895,-0.21278156472398216,-0.544184481217104,0.054910745860200366,-0.216236737588694,-0.468234243996127,-0.6408883692439341,0.15091441501393438,-0.21212741077475508,-0.3052224371505293,-0.3287287639136816,0.6239939031335923,-0.6532516803940531,0.012252406535145765,-0.12200107440583996,0.5762952154736454,-0.7217275429984866,-0.09257674966534422,-0.570267737057451,0.37975761683119863,0.11016388634655203,0.2543487755812933,0.9546530772993819,0.6009704338490445,0.4919596795383938,0.3545204062054596,-0.2918402175608784,-0.009391170084392417,-0.6494960415746704,-1.438868767948254,-0.41283225519436473,-0.08297449189575662,-0.3614721917000063,0.0720094269648795,-0.6763539162108333,0.2538397502996176,-0.3207532209857713,-0.48153399412799425,0.25767335003073366,0.2539778786361726,0.0845101536330995,-0.1800287974306295,0.10424076292857748,0.6795531295275875,1.0290964589217717,-0.37442610446505453,0.5090740962169938,-0.3417623309476409,-0.09603018017492851,0.31719579681346416,-0.15803471159015203,-0.8360600661953256,0.10258959115919589,0.021921919040490553,0.3421309271240711,-0.10578256354997526,0.49142628575730485,-0.1630774397130503,-0.8274265229565774,0.7982346799798029,-0.4169642814952568],"bias":0.11678195097614208,"activation_function":"TANH"},{"weights":[-0.046632025114684596,0.3655465875030313,0.26349598426001597,-0.2624614824589409,0.28512301399397827,-0.1072664549009698,0.51461977787906,0.3188857759038597,0.3115780480789394,0.3292894312228339,-0.831086528148211,-0.18213427035197324,0.2546341106519431,0.09463097174391004,0.01972946024880251,-0.23023264293643209,0.8115783829908517,0.3429314408808106,0.4246332682820779,-0.46495935506267705,-0.3500449900585018,0.1676958732227653,-0.30132272928839043,0.584740845534109,-0.35602979553935676,1.1841402465405115,0.6390314967491648,0.5716162548689188,-0.6202818677501546,0.22585199301356712,0.02202058351767676,0.48750640087831604,-0.20683071061479383,-0.5643716218648133,-0.19645770993728587,0.36349691515605836,0.35510728234132405,-0.4081512521556474,0.003953188949357787,0.3095125763266464,-0.2550420160092511,-0.2959324293516847,-0.7096728099602897,0.5408016137199446,0.25127629905383314,0.5169879151388337,-0.3548911260071654,0.0385995828580572,-0.29958850990816877,-0.31854094252793397,0.11569399584964463,0.3287583739982391,0.2878163551283338,-0.3395589348929037,0.6844102474215744,-0.2813548769309713,0.3717000005959409,0.01956696537980377,-0.05725564143538133,0.42811949924444365,0.03682925429490651,-0.1692967294684617,0.6687001943583338,-0.35559397050741715],"bias":-0.09443513374754905,"activation_function":"TANH"},{"weights":[-0.12763875414861486,-0.3781632266938792,0.026496995164732466,0.15342548800300246,0.25662274607754976,-0.7983741562575288,-0.20510214800630464,0.7064564196601458,0.0032810227492711015,0.3448223009814487,0.22063073847630282,0.8294945910646211,0.09360034524291189,-0.4095320662140848,0.7973729161255869,-0.9387358230809687,0.6405419375543449,-1.1277578805046864,0.5369099971082042,0.4083717670304704,-0.27703712259416957,-0.8112069714122377,-0.35251687364147727,0.030662762414911594,0.8003218138924829,0.08486559078413479,-0.1431361753824999,-0.45724369888379385,-0.07679147987570661,-0.21019922785775666,-0.1242505388020902,-0.6214313310550836,0.42896009613196784,0.0035725350225136836,0.2766166377172165,-0.17006343100281712,-0.4855692346752757,-0.31190287192994914,0.029812016008061965,1.164392823972639,-0.06109222827194939,-0.2896941794249303,-0.3570365101019981,0.0808715607120643,-0.8224342225204712,-0.12265287444678843,-0.035820563491618565,0.30927327665683607,0.9424372908298508,0.6214943473817056,0.12224849391312208,0.2792758667664512,0.21732274823476602,-0.15541985138088787,-0.43454760830658545,-0.31346579951046816,0.38828437171857283,0.5331491066685315,-0.033242267381719856,-0.30735851245907037,0.4749627547967279,-0.08127932192257867,0.06711924979762142,0.1968941508567337],"bias":-0.6074817284108798,"activation_function":"TANH"},{"weights":[-0.6235585916998736,-1.069721867989341,0.6792453462715011,-0.09629161242292883,0.1239859417470314,0.13044975478196036,0.46309732549380084,0.3459110711838345,-0.5143321234292214,-0.3574230368267179,0.07928397839698056,0.29139842264448684,0.8039627606766069,-0.15739882813918132,0.946419813252514,-0.44321636410629506,-0.33850406526043797,-0.7209920434597625,0.36644978101912007,-0.2533502282953525,0.2894594116413718,1.1123825860435304,0.11846270351066607,0.7065889512070489,0.06496793855417066,0.7787666929968831,-0.37719436533308753,0.5266201108815838,-0.5204073402486484,-0.08436481096319634,0.7192416416666704,0.08232601759437633,-0.4374861576784403,-1.1069996340554746,-0.0037828050985494605,0.6215716184549734,-0.6322927429251726,-0.8764973720823822,-0.2670291196708001,-0.11717930534008511,-0.5526370632398038,0.06967817705005362,0.23215025162174843,0.12038873033607003,-0.35775108231698566,0.15382900174164846,0.2712115689303518,0.6348854519942484,-0.11641028514953333,-0.39345700021070357,-0.006562150045948581,-0.5918577317463061,-0.10579485167461518,-0.15298853754415634,0.1290677771983862,-0.07597812442955466,-0.3382759894473711,-0.8404701630634761,0.4087199068108986,0.2949732554808508,0.25525079433452236,-0.13981661021387815,-0.08997692242455002,1.0477185456573992],"bias":0.010388492059723628,"activation_function":"TANH"},{"weights":[-0.9612350680100747,0.3841661866483147,-0.5946273067108775,0.44635647996351957,-0.16041845119563278,0.3112424327297393,0.6944559354809979,-0.3130890788029041,-0.5313627949678895,0.18098830378075287,-0.7106787144111097,0.18054167036926702,-0.49359254046701667,-0.4570693393260882,0.151352447967331,0.11528196975456405,-0.1332483282798012,0.3441598714216081,-0.37236634417028186,-0.3248673667730943,-0.8531252359375568,1.059228992737027,-0.6021943269695484,1.4425122871139013,0.4248190406153084,-0.7216106304225086,0.41715669494672103,0.448092687227052,1.5287738653832723,-0.47565733907180785,-0.012000362659453654,-0.4905221774297261,-0.3273301361203701,0.30926611717287866,0.9538348217838762,0.3499119837192041,-0.2526609277513639,-0.2989672828914524,0.34900086755115184,0.23775309946606568,0.08784002143806657,0.47631355724633545,0.1678608710939671,-0.35713052148474506,0.4435421892498605,1.1169548230288509,0.2841414499265327,-0.22700379842178225,-0.19849660941777908,-0.1683956224186661,-0.7298866095438282,-0.1414682495849687,-0.09595899815040455,0.28084765957363894,-0.26762167531164255,0.7467387492921964,0.8077244817624918,-0.429362333652209,0.6213221901067719,-0.15206656822211695,0.15342591272755904,0.06597510115746504,-0.5107631948039777,-0.6258463859397098],"bias":-0.11603576817793407,"activation_function":"TANH"}],[{"weights":[0.5112378838622696,-0.36170826303325465,0.6512669214824164,-0.3206475543033416,0.8596333340113261,-1.1182578380754225,-0.8126667652183841,-1.063985087528523,-0.07372419431264797,-0.010218622986688033,0.19278244529515418,0.5970147422875207,0.8037082947309473,-0.09862275040963031,0.8006239880633441,-0.13842328572140902,-0.09933176663973228,0.4549209178295569,0.6245335500385567,-0.6296192533449256,0.07441812782633438,0.058463415600249265,-0.025413248289565243,-0.24472232856763665,0.36658567609520687,-0.1544904602291767,0.25916064836815134,0.4296101727458331,-0.3985437891368137,-0.03194531419814693,0.6762429460543249,0.29003482710688344,-0.2821880955989462,-0.7511287635624757,-0.6035371109011741,0.824467775022973,0.6560102491232247,-0.1990855328234961,-0.2874246767664936,-0.6267018276272128,-0.5827855380539149,-1.4200258623464683,-0.5003362920221905,-0.5014389629890339,0.3539878068734733,0.5753263604611715,-0.14010441713185895,-0.3982545767708894,1.0249212097616378,0.14089527397587492,0.3789132275186946,-0.2910752279327017,-0.3347505244989242,-0.2537627063692376,0.09197149769976964,0.378615057443506,0.35074713348778563,0.6555650363321919,0.4316747530911452,0.2028865910324082,-0.231941784266406,-0.0890348411559797,-0.6598370480487129,-0.6520555452414821],"bias":-0.5272671180301874,"activation_function":"TANH"},{"weights":[-0.07526781796099662,0.2515300911566498,0.4314156088615091,0.5093659167049511,0.18003894988961563,0.427971327551858,0.9553779464207844,-0.19361505433222084,0.8587131295889403,-0.30496108232696095,-0.3941647142048205,-0.66214454670408,-0.2571397975399051,0.10085494224176247,0.5714241878304666,-0.42878703882354297,0.13398030920539145,0.7294027695282275,-0.556186281344533,0.4466910250509846,-0.2423084831458582,-0.30066220353643985,-0.522273780270155,-0.7407234216824388,0.574411954376846,-0.628292634671824,0.25362397042778767,0.08800292976561071,0.16612948026380076,-0.5504565283089423,0.07436968495587852,-0.2996384933582156,-0.5315341228799733,0.416120152772926,-0.05021564594852106,-0.43509878960165527,-0.2658889701342254,-0.09922758456990446,0.7166246331847655,0.6311290396369276,0.3392455218269916,0.3969632682044997,0.7634826362226377,0.447552894410245,0.12863004772662337,0.477930490720338,-0.6134119529343434,0.5424101788168374,-0.8235424321420428,-0.07745071962391242,-0.908446835001145,-0.6029442114542986,-0.1591641206787265,0.327635938698991,-0.3344398431538014,-0.22815782513364366,-0.22455045987311328,-0.2739077481791477,0.12115533008756559,0.7331833416454491,0.029404937933265853,0.01634982536726877,-0.9406154080798019,0.500499684578308],"bias":0.05385307726378305,"activation_function":"TANH"},{"weights":[0.5012807631730459,-0.032637351019295234,1.1218181946035368,1.392716221212461,-0.15729467298084637,-0.15874125140168527,0.0065301017821997685,0.08843465878695518,-1.0680348904360883,-0.331847568908836,0.11872051917709947,-0.14721851608510014,0.04189111926792648,-0.41527805085301966,-0.10532128595511721,1.41100172205633,-0.3575186641767592,-0.5883764032081903,0.9828971829605319,-0.8611067777701156,-0.0021245781942432276,0.09913795810662702,0.32687189186287313,0.33569702717603994,0.27969941007235366,0.6280305418260361,0.18756537356908676,0.4150408687031014,0.6068041222883569,-0.8446296880073936,-1.4709971547382283,-0.4787813721120584,0.1857764717921552,0.4079801960627754,0.4245681507701253,-0.09757030523676052,-0.07874619980813974,-0.23283986184883115,-0.5034062436921077,-0.43024866261989175,0.28389808214452034,-0.4920471015270348,0.3633057369105903,0.15784570279261836,0.3380208575226064,-0.41580854952179275,-0.4527247357573817,-0.6877357607640691,-0.3229882277941905,-0.3637635387697953,1.0052741369615124,-0.48089777802843586,-0.14213487666952015,0.648882241267494,-0.07990622680328432,0.02135038116770725,0.27497537052212384,-0.15158044179242505,-0.017996684530991458,0.494914159302686,-0.6044612617090943,0.03459268816249932,0.325468931842637,0.13641069513201862],"bias":0.022966901920926715,"activation_function":"TANH"},{"weights":[-0.20136215941234686,-0.32757454915317574,-0.2095606754838655,0.5723623902068425,0.12274948967180717,-0.6008886375976524,-0.35376571539614327,0.19195174389997088,0.9295100222636484,0.6315780382814965,-0.42382218907011276,0.4609730687645219,-0.5603903177930774,-0.3006771911962801,-0.2538724648883924,-0.100408437547653,0.15651939619556735,0.32882750885940043,0.8117217931091553,0.21384489270278936,0.5411471386006623,-0.8074944931227612,0.18206459708163925,0.3739575610493896,-0.6863535530370335,-0.517244554514023,0.2611762319881999,-0.9296526058981474,0.6423893453979139,0.20633114422241375,-0.2736999225560651,-0.1665101795457499,-0.733515969900453,-0.40873676602329173,0.21043934071334908,0.35377568200563986,0.06767224916578105,-0.5157116640078477,-0.24534252902551354,-0.48788479325877443,0.06749922665654186,0.4599028760145454,-0.09973171997953012,0.37791697413830994,0.5025736434450643,0.06951803177619198,0.47293032030264315,-0.052043690445252644,-0.5198668170288017,-0.2761105299027532,-0.0420222589944147,1.0067911264850449,-0.450913138662305,-0.20756205958810967,0.19358424316009207,-0.509416605548079,0.63028118860322,-0.2898747788323115,0.5242017764276189,-0.8833258760209114,-0.03349681304069771,0.16094289578473683,-0.7792307756218741,0.06437485854363398],"bias":-0.1291134859496848,"activation_function":"TANH"}]],"activation_functions":["TANH","TANH","TANH"],"layer_lengths":[7,64,64,4]}'));
scope.AIgetInput = function (player, target) {
if (!player.playerData?.transform) {
return false;
}
var scalePPM = currentIS.physics.ppm / 7;
scalePPM = 1 / scalePPM;
var angle = player.playerData2.pa;
var va = player.playerData2.avel;
var x = target.x - player.playerData.position.x / scale;
var y = target.y - player.playerData.position.y / scale;
x *= scalePPM;
y *= scalePPM;
var vx = player.playerData2.xvel / scale * 1000;
var vy = player.playerData2.yvel / scale * 1000;
vx *= scalePPM;
vy *= scalePPM;
var out = [x / 100, y / 100, vx / 100, vy / 100, -Math.sin(angle), Math.cos(angle), va * 100];
return out;
};
scope.bytebuffer2 = class {
constructor() {
var g1d = [arguments];
this.index = 0;
this.buffer = new ArrayBuffer(100 * 1024);
this.view = new DataView(this.buffer);
this.implicitClassAliasArray = [];
this.implicitStringArray = [];
this.bodgeCaptureZoneDataIdentifierArray = [];
}
readByte() {
var N0H = [arguments];
N0H[4] = this.view.getUint8(this.index);
this.index += 1;
return N0H[4];
}
writeByte(z0w) {
var v8$ = [arguments];
this.view.setUint8(this.index, v8$[0][0]);
this.index += 1;
}
writeBoolean(z0w) {
var v8$ = [arguments];
this.view.writeByte(this.index, v8$[0][0] ? 1 : 0);
this.index += 1;
}
readInt() {
var A71 = [arguments];
A71[6] = this.view.getInt32(this.index);
this.index += 4;
return A71[6];
}
writeInt(W6i) {
var p5u = [arguments];
this.view.setInt32(this.index, p5u[0][0]);
this.index += 4;
}
readShort() {
var R1R = [arguments];
R1R[9] = this.view.getInt16(this.index);
this.index += 2;
return R1R[9];
}
writeShort(H8B) {
var d_3 = [arguments];
this.view.setInt16(this.index, d_3[0][0]);
this.index += 2;
}
readUint() {
var W2$ = [arguments];
W2$[8] = this.view.getUint32(this.index);
this.index += 4;
return W2$[8];
}
readUShort() {
var W2$ = [arguments];
W2$[8] = this.view.getUint16(this.index);
this.index += 2;
return W2$[8];
}
writeUint(B2X) {
var f8B = [arguments];
this.view.setUint32(this.index, f8B[0][0]);
this.index += 4;
}
readBoolean() {
var h6P = [arguments];
h6P[6] = this.readByte();
return h6P[6] == 1;
}
writeBoolean(Y3I) {
var l79 = [arguments];
if (l79[0][0]) {
this.writeByte(1);
} else {
this.writeByte(0);
}
}
readDouble() {
var V60 = [arguments];
V60[4] = this.view.getFloat64(this.index);
this.index += 8;
return V60[4];
}
writeDouble(z4Z) {
var O41 = [arguments];
this.view.setFloat64(this.index, O41[0][0]);
this.index += 8;
}
readFloat() {
var I0l = [arguments];
I0l[5] = this.view.getFloat32(this.index);
this.index += 4;
return I0l[5];
}
writeFloat(y4B) {
var B0v = [arguments];
this.view.setFloat32(this.index, B0v[0][0]);
this.index += 4;
}
readUTF() {
var d6I = [arguments];
d6I[8] = this.readByte();
d6I[7] = this.readByte();
d6I[9] = d6I[8] * 256 + d6I[7];
d6I[1] = new Uint8Array(d6I[9]);
for (d6I[6] = 0; d6I[6] < d6I[9]; d6I[6]++) {
d6I[1][d6I[6]] = this.readByte();
}
return textdecoder.decode(d6I[1]);
}
writeUTF(L3Z) {
var Z75 = [arguments];
Z75[4] = textencoder.encode(Z75[0][0]);
Z75[3] = Z75[4].length;
Z75[5] = Math.floor(Z75[3] / 256);
Z75[8] = Z75[3] % 256;
this.writeByte(Z75[5]);
this.writeByte(Z75[8]);
Z75[7] = this;
Z75[4].forEach(I_O);
function I_O(s0Q, H4K, j$o) {
var N0o = [arguments];
Z75[7].writeByte(N0o[0][0]);
}
}
toBase64() {
var P4$ = [arguments];
P4$[4] = "";
P4$[9] = new Uint8Array(this.buffer);
P4$[8] = this.index;
for (P4$[7] = 0; P4$[7] < P4$[8]; P4$[7]++) {
P4$[4] += String.fromCharCode(P4$[9][P4$[7]]);
}
return Gwindow.btoa(P4$[4]);
}
fromBase64(W69, A8Q) {
var o0n = [arguments];
o0n[8] = Gwindow.pako;
o0n[6] = Gwindow.atob(o0n[0][0]);
o0n[9] = o0n[6].length;
o0n[4] = new Uint8Array(o0n[9]);
for (o0n[1] = 0; o0n[1] < o0n[9]; o0n[1]++) {
o0n[4][o0n[1]] = o0n[6].charCodeAt(o0n[1]);
}
if (o0n[0][1] === true) {
o0n[5] = o0n[8].inflate(o0n[4]);
o0n[4] = o0n[5];
}
this.buffer = o0n[4].buffer.slice(
o0n[4].byteOffset,
o0n[4].byteLength + o0n[4].byteOffset
);
this.view = new DataView(this.buffer);
this.index = 0;
}
};
if (typeof (scope.originalSend) == 'undefined') { scope.originalSend = Gwindow.WebSocket.prototype.send; }
if (typeof (scope.originalDatenow) == 'undefined') { scope.originalDatenow = Gwindow.Date.now; }
if (typeof (scope.originalXMLOpen) == 'undefined') { scope.originalXMLOpen = Gwindow.XMLHttpRequest.prototype.open; }
if (typeof (scope.originalWebSocket) == 'undefined') { scope.originalWebSocket = Gwindow.WebSocket; }
if (typeof (scope.originalXMLSend) == 'undefined') { scope.originalXMLSend = Gwindow.XMLHttpRequest.prototype.send; }
if (typeof (scope.originalFetch) == 'undefined') { scope.originalFetch = Gwindow.fetch; }
if (typeof (scope.searchrequested) == 'undefined') { scope.searchrequested = 0; }
if (typeof (scope.originalDrawCircle) == 'undefined') { scope.originalDrawCircle = Gwindow.PIXI.Graphics.prototype.drawCircle; }
if (typeof (scope.parentDraw) == 'undefined') { scope.parentDraw = 0; }
if (typeof (scope.pixiCircle) == 'undefined') { scope.pixiCircle = new Gwindow.PIXI.Graphics(); }
if (typeof (scope.container) == 'undefined') { scope.container = new Gwindow.PIXI.Container(); container.addChild(pixiCircle); }
if (typeof (scope.canvasWidth) == 'undefined') { scope.canvasWidth = -1; }
if (typeof (scope.savedrooms) == 'undefined') { scope.savedrooms = []; }
if (typeof (scope.inroom) == 'undefined') { scope.inroom = false; }
if (typeof (scope.currentroomaddress) == 'undefined') { scope.currentroomaddress = -1; }
if (typeof (scope.savedroomsdata) == 'undefined') { scope.savedroomsdata = {}; }
if (typeof (scope.jukeboxplayerURL) == 'undefined') { scope.jukeboxplayerURL = ""; }
if (typeof (scope.jukeboxplayervolume) == 'undefined') { scope.jukeboxplayervolume = 20; }
if (typeof (scope.gameStartTimeStamp) == 'undefined') { scope.gameStartTimeStamp = 0; }
scope.checkInstance = async function (index) {
var doesitwork = false;
await fetch(pipedurllist[index] + "dQw4w9WgXcQ").then(
function (r) {
return r.json();
}
).then(async function (r) {
if (r.audioStreams && !r.error) {
for (var i2 = 0; i2 < r.audioStreams.length; i2++) {
if (r.audioStreams[i2].url) {
try {
var f = await fetch(r.audioStreams[i2].url);
if (f.ok) {
doesitwork = true;
return;
}
}
catch (e) { }
}
}
}
}).catch(function (e) { });
if (!doesitwork) {
return -1;
}
return index;
};
scope.checkJukeboxStream = async function (index, id) {
var doesitwork = false;
var urlreturn = [];
await fetch(pipedurllist[index] + id).then(
function (r) {
return r.json();
}
).then(async function (r) {
if (r.audioStreams && !r.error) {
for (var i2 = 0; i2 < r.audioStreams.length; i2++) {
if (r.audioStreams[i2].url) {
try {
var f = await fetch(r.audioStreams[i2].url);
if (f.ok) {
doesitwork = true;
urlreturn = [r.audioStreams[i2].url, r.title, r.uploader];
return;
}
}
catch (e) { }
}
}
}
}).catch(function (e) { });
if (!doesitwork) {
return -1;
}
return urlreturn;
};
scope.checkInstances = async function () {
pipedindexes = [];
for (var index = 0; index < pipedurllist.length; index++) {
checkInstance(index).then(function (value) {
if (value != -1) {
pipedindexes.push(value);
}
});
}
};
if (typeof (scope.pipedurllist) == 'undefined') {
scope.pipedurllist = [
"https://api.piped.projectsegfau.lt/streams/",
"https://pipedapi.kavin.rocks/streams/",
"https://pipedapi.syncpundit.io/streams/",
"https://api-piped.mha.fi/streams/",
"https://piped-api.garudalinux.org/streams/",
"https://pipedapi.rivo.lol/streams/",
"https://pipedapi.leptons.xyz/streams/",
"https://piped-api.lunar.icu/streams/",
"https://ytapi.dc09.ru/streams/",
"https://piped.tokhmi.xyz/streams/",
"https://pipedapi.aeong.one/streams/"];
scope.pipedindexes = [];
checkInstances();
}
if (typeof (scope.requestAnimationFrameOriginal) == 'undefined') { scope.requestAnimationFrameOriginal = Gwindow.requestAnimationFrame; }
if (typeof (scope.bonkwss) == 'undefined') { scope.bonkwss = 0; }
if (typeof (scope.bonkwssextra) == 'undefined') { scope.bonkwssextra = []; }
if (typeof (scope.chatlog) == 'undefined') { scope.chatlog = ["ROOM START"]; }
if (typeof (scope.wsssendrecievelog) == 'undefined') { scope.wsssendrecievelog = []; }
if (typeof (scope.wsssendlog) == 'undefined') { scope.wsssendlog = []; }
if (typeof (scope.wssrecievelog) == 'undefined') { scope.wssrecievelog = []; }
if (typeof (scope.wsslogpaused) == 'undefined') { scope.wsslogpaused = false; }
if (typeof (scope.debuggeropen) == 'undefined') { scope.debuggeropen = false; }
if (typeof (scope.debuggercount) == 'undefined') { scope.debuggercount = true; }
if (typeof (scope.packetcount) == 'undefined') { scope.packetcount = 0; }
if (typeof (scope.requestedmaps) == 'undefined') { scope.requestedmaps = []; }
if (typeof (scope.maponclick) == 'undefined') { scope.maponclick = 0; }
if (typeof (scope.LZString) == 'undefined') { scope.LZString = Gwindow.LZString; }
if (typeof (scope.PSON) == 'undefined') { scope.PSON = Gwindow.dcodeIO.PSON; }
if (typeof (scope.bytebuffer) == 'undefined') { scope.bytebuffer = Gwindow.dcodeIO.ByteBuffer; }
if (typeof (scope.speech) == 'undefined') { scope.speech = new SpeechSynthesisUtterance(); speech.pitch = 0.75; }
if (typeof (scope.sayer) == 'undefined') { scope.sayer = speechSynthesis; sayer.volume = 0.5; sayer.rate = 1.25; }
if (typeof (scope.pollactive) == 'undefined') { scope.pollactive = [false, 0, 0, []]; }
if (typeof (scope.pollactive2) == 'undefined') { scope.pollactive2 = [false, 0, []]; }
if (typeof (scope.mode) == 'undefined') { scope.mode = ''; }
if (typeof (scope.FFA) == 'undefined') { scope.FFA = true; }
if (typeof (scope.recording) == 'undefined') { scope.recording = false; }
if (typeof (scope.recordingdata) == 'undefined') { scope.recordingdata = []; }
if (typeof (scope.recorddata) == 'undefined') { scope.recorddata = {}; }
if (typeof (scope.recordingid) == 'undefined') { scope.recordingid = -1; }
if (typeof (scope.currentmap) == 'undefined') { scope.currentmap = []; }
if (typeof (scope.wordlist) == 'undefined') {
scope.wordlist = [];
fetch("https://api.github.com/repos/first20hours/google-10000-english/contents/google-10000-english.txt").then(function (data) {
return data.json();
}).then(function (data) {
fetch("https://api.github.com/repos/first20hours/google-10000-english/git/blobs/" + data.sha).then(function (data) {
return data.json();
}).then(function (data) {
scope.wordlist = atob(data.content).split("\n");
});
});
}
scope.embedYouTubeAudio = function (videoId) {
var iframe = document.createElement('iframe');
iframe.style.display = "none";
iframe.src = "https://www.youtube.com/embed/" + videoId + "?enablejsapi=1&origin=" + window.location.origin;
document.body.appendChild(iframe);
return {
play: function () {
iframe.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
},
pause: function () {
iframe.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
},
setCurrentTime: function (seconds) {
iframe.contentWindow.postMessage(`{"event":"command","func":"seekTo","args":[${seconds}, true]}`, '*');
},
getElement: function () {
return iframe;
},
setVolume: function (volume) {
iframe.contentWindow.postMessage(`{"event":"command","func":"setVolume","args":[${volume}]}`, '*');
},
getVolume: function () {
return iframe.contentWindow.postMessage('{"event":"command","func":"getVolume","args":""}', '*');
}
};
};
if (typeof (scope.allstyles) == 'undefined') { scope.allstyles = {}; }
if (typeof (scope.mystyle) == 'undefined') { scope.mystyle = [0, 0, 0]; }
if (typeof (scope.ISpsonpair) == 'undefined') { scope.ISpsonpair = new Gwindow.dcodeIO.PSON.StaticPair(["physics", "shapes", "fixtures", "bodies", "bro", "joints", "ppm", "lights", "spawns", "lasers", "capZones", "type", "w", "h", "c", "a", "v", "l", "s", "sh", "fr", "re", "de", "sn", "fc", "fm", "f", "d", "n", "bg", "lv", "av", "ld", "ad", "fr", "bu", "cf", "rv", "p", "d", "bf", "ba", "bb", "aa", "ab", "axa", "dr", "em", "mmt", "mms", "ms", "ut", "lt", "New body", "Box Shape", "Circle Shape", "Polygon Shape", "EdgeChain Shape", "priority", "Light", "Laser", "Cap Zone", "BG Shape", "Background Layer", "Rotate Joint", "Slider Joint", "Rod Joint", "Gear Joint", 65535, 16777215]); }
if (typeof (scope.sandboxon) == 'undefined') { scope.sandboxon = false; }
if (typeof (scope.sandboxid) == 'undefined') { scope.sandboxid = 200; }
if (typeof (scope.playerids) == 'undefined') { scope.playerids = {}; }
if (typeof (scope.delplayerids) == 'undefined') { scope.delplayerids = {}; }
if (typeof (scope.myid) == 'undefined') { scope.myid = -1; }
if (typeof (scope.hostid) == 'undefined') { scope.hostid = -1; }
if (typeof (scope.sandboxplayerids) == 'undefined') { scope.sandboxplayerids = {}; }
if (typeof (scope.originalMapLoad) == 'undefined') { scope.originalMapLoad = Gdocument.getElementById("maploadwindowmapscontainer").appendChild; }
if (typeof (scope.originalLobbyChat) == 'undefined') { scope.originalLobbyChat = Gdocument.getElementById("newbonklobby_chat_content").appendChild; }
if (typeof (scope.originalIngameChat) == 'undefined') { scope.originalIngameChat = Gdocument.getElementById("ingamechatcontent").appendChild; }
if (typeof (scope.private_chat_keys) == 'undefined') { GENERATE_KEYS().then(function (e) { scope.private_chat_keys = e; scope.private_key = private_chat_keys.privateKey; scope.public_key = private_chat_keys.publicKey; }); }
if (typeof (scope.jukeboxplayer) == 'undefined') {
scope.jukeboxplayer = { src: "", paused: true, src: "", pause: function () { }, play: function () { } };
}
if (Gdocument.getElementById("savedroombutton") == null) {
scope.savedroombutton = Gdocument.createElement("div");
savedroombutton.id = "savedroombutton";
savedroombutton.className = "brownButton brownButton_classic buttonShadow brownButtonDisabled";
savedroombutton.textContent = "Save Room";
savedroombutton.style["left"] = "120px";
savedroombutton.style["position"] = "absolute";
savedroombutton.style["width"] = "90px";
savedroombutton.style["height"] = "30px";
savedroombutton.style["color"] = "#ffffff";
savedroombutton.style["text-align"] = "center";
savedroombutton.style["vertical-align"] = "middle";
savedroombutton.style["line-height"] = "30px";
savedroombutton.style["right"] = "0";
savedroombutton.style["cursor"] = "pointer";
savedroombutton.style["bottom"] = "10px";
savedroombutton.style["margin"] = "auto";
savedroombutton.style["bottom"] = "10px";
savedroombutton.onclick = function () {
if (!savedrooms.includes(currentroomaddress) && currentroomaddress != -1) {
savedrooms.push(currentroomaddress);
savedroomsdata[currentroomaddress] = { "exists": true };
}
Gdocument.getElementById("sm_connectingWindowCancelButton").click();
};
Gdocument.getElementById("sm_connectingWindowCancelButton").style["left"] = "-120px";
Gdocument.getElementById("sm_connectingWindow").appendChild(savedroombutton)
}
if (Gdocument.getElementById("maploadtypedropdowntitlerequested") == null) {
scope.clearmaprequests = Gdocument.createElement("div");
clearmaprequests.id = "clearmaprequests";
clearmaprequests.classList.value = "brownButton brownButton_classic buttonShadow";
clearmaprequests.textContent = "Clear";
clearmaprequests.style["position"] = "absolute";
clearmaprequests.style["display"] = "none";
if (typeof (ishost) != 'undefined') {
if (ishost && (Gdocument.getElementById("maploadtypedropdowntitle").textContent == "MAP REQUESTS" || Gdocument.getElementById("maploadtypedropdowntitle").textContent == "HISTORY")) {
clearmaprequests.style["display"] = "block";
}
}
clearmaprequests.style["right"] = "306px";
clearmaprequests.style["top"] = "57px";
clearmaprequests.style["height"] = "23px";
clearmaprequests.style["width"] = "47px";
clearmaprequests.style["line-height"] = "23px";
clearmaprequests.style["font-size"] = "14px";
clearmaprequests.addEventListener("click", function () {
if (Gdocument.getElementById("maploadtypedropdowntitle").textContent == "MAP REQUESTS") {
requestedmaps = [];
}
else if (Gdocument.getElementById("maploadtypedropdowntitle").textContent == "HISTORY") {
currentmap = [];
}
Gdocument.getElementById("maploadwindowstatustext").style["visibility"] = "inherit";
Gdocument.getElementById("maploadwindowstatustext").textContent = "No Maps";
while (Gdocument.getElementById("maploadwindowmapscontainer").children.length > 0) {
Gdocument.getElementById("maploadwindowmapscontainer").removeChild(Gdocument.getElementById("maploadwindowmapscontainer").firstChild);
}
});
Gdocument.getElementById("maploadwindow").insertBefore(clearmaprequests, Gdocument.getElementById("maploadwindowsearchinput"));
scope.refreshmaprequests = Gdocument.createElement("div");
refreshmaprequests.id = "refreshmaprequests";
refreshmaprequests.classList.value = "brownButton brownButton_classic buttonShadow";
refreshmaprequests.textContent = "Refresh";
refreshmaprequests.style["position"] = "absolute";
refreshmaprequests.style["display"] = "none";
if (typeof (ishost) != 'undefined') {
if (ishost && (Gdocument.getElementById("maploadtypedropdowntitle").textContent == "MAP REQUESTS" || Gdocument.getElementById("maploadtypedropdowntitle").textContent == "HISTORY")) {
refreshmaprequests.style["display"] = "block";
}
}
refreshmaprequests.style["right"] = "357px";
refreshmaprequests.style["top"] = "57px";
refreshmaprequests.style["height"] = "23px";
refreshmaprequests.style["width"] = "47px";
refreshmaprequests.style["line-height"] = "23px";
refreshmaprequests.style["font-size"] = "14px";
refreshmaprequests.addEventListener("click", function () {
var dropdown;
if (Gdocument.getElementById("maploadtypedropdowntitle").textContent == "MAP REQUESTS") {
searchrequested = 1;
dropdown = dropdownrequested;
}
else if (Gdocument.getElementById("maploadtypedropdowntitle").textContent == "HISTORY") {
searchrequested = 2;
dropdown = dropdownrequested;
}
Gdocument.getElementById("maploadtypedropdowntitle").click();
Gdocument.getElementById("maploadtypedropdowntitle").textContent = dropdown.textContent;
dropdown.style["display"] = "none";
clearmaprequests.style["display"] = "block";
refreshmaprequests.style["display"] = "block";
Gdocument.getElementById("maploadwindowhotnessslider").style["visibility"] = "hidden";
Gdocument.getElementById("maploadwindowsearchoptions").style["visibility"] = "hidden";
Gdocument.getElementById("maploadtypedropdownoption10").click();
});
Gdocument.getElementById("maploadwindow").insertBefore(refreshmaprequests, Gdocument.getElementById("maploadwindowsearchinput"));
scope.dropdownrequested = Gdocument.createElement("div");
dropdownrequested.classList = "dropdown-option dropdown_classic";
dropdownrequested.style["display"] = "none";
dropdownrequested.id = "maploadtypedropdowntitlerequested";
if (Gdocument.getElementById("maploadtypedropdownoption10").style["display"] == "block") {
dropdownrequested.style["display"] = "block";
}
dropdownrequested.textContent = "MAP REQUESTS";
dropdownrequested.onclick = function () {
searchrequested = 1;
Gdocument.getElementById("maploadtypedropdowntitle").click();
Gdocument.getElementById("maploadtypedropdowntitle").textContent = dropdownrequested.textContent;
dropdownrequested.style["display"] = "none";
clearmaprequests.style["display"] = "block";
refreshmaprequests.style["display"] = "block";
Gdocument.getElementById("maploadwindowhotnessslider").style["visibility"] = "hidden";
Gdocument.getElementById("maploadwindowsearchoptions").style["visibility"] = "hidden";
Gdocument.getElementById("maploadtypedropdownoption10").click();
};
Gdocument.getElementById("maploadtypedropdown").insertBefore(dropdownrequested, Gdocument.getElementById("maploadtypedropdownoption1"));
Gdocument.getElementById("maploadwindowmapscontainer").__defineGetter__("clientHeight", function () { if (Gdocument.getElementById("maploadtypedropdowntitle").textContent != "MAP REQUESTS") { return Gdocument.getElementById("maploadwindowmapscontainer").getClientRects()[0].height; } else { return 0; } });
scope.dropdownhistory = Gdocument.createElement("div");
dropdownhistory.classList = "dropdown-option dropdown_classic";
dropdownhistory.style["display"] = "none";
dropdownhistory.id = "maploadtypedropdowntitlehistory";
if (Gdocument.getElementById("maploadtypedropdownoption10").style["display"] == "block") {
dropdownhistory.style["display"] = "block";
}
dropdownhistory.textContent = "HISTORY";
dropdownhistory.onclick = function () {
searchrequested = 2;
Gdocument.getElementById("maploadtypedropdowntitle").click();
Gdocument.getElementById("maploadtypedropdowntitle").textContent = dropdownhistory.textContent;
dropdownhistory.style["display"] = "none";
clearmaprequests.style["display"] = "block";
refreshmaprequests.style["display"] = "block";
Gdocument.getElementById("maploadwindowhotnessslider").style["visibility"] = "hidden";
Gdocument.getElementById("maploadwindowsearchoptions").style["visibility"] = "hidden";
Gdocument.getElementById("maploadtypedropdownoption10").click();
};
(new MutationObserver(function () { if (Gdocument.getElementById("maploadtypedropdownoption10").style["display"] == "none") { dropdownhistory.style["display"] = "none"; dropdownrequested.style["display"] = "none"; clearmaprequests.style["display"] = "none"; refreshmaprequests.style["display"] = "none"; } else { dropdownhistory.style["display"] = "block"; dropdownrequested.style["display"] = "block"; } })).observe(Gdocument.getElementById("maploadtypedropdownoption10"), { attributes: true, childList: true });
Gdocument.getElementById("maploadtypedropdown").insertBefore(dropdownhistory, Gdocument.getElementById("maploadtypedropdownoption1"));
Gdocument.getElementById("maploadwindowmapscontainer").__defineGetter__("clientHeight", function () { if (Gdocument.getElementById("maploadtypedropdowntitle").textContent != "HISTORY" && Gdocument.getElementById("maploadtypedropdowntitle").textContent != "MAP REQUESTS") { return Gdocument.getElementById("maploadwindowmapscontainer").getClientRects()[0].height; } else { return 0; } });
};
scope.sandboxonclick = function () {
Gdocument.getElementById("roomlistrefreshbutton").click();
Gdocument.getElementById("roomlistcreatebutton").click();
sandboxon = true;
};
scope.checkboxclearbuttononclick = function () {
var classes = Gdocument.getElementsByClassName("quickplaycheckbox");
var e = true;
for (var i = 0; i < classes.length; i++) {
if (classes[i].checked == true) {
e = false
}
classes[i].checked = false;
}
if (e) {
for (var i = 0; i < classes.length; i++) {
classes[i].checked = true;
}
}
};
Gdocument.getElementById("ingamechatcontent").__defineGetter__("childElementCount", function () { return this.children.length / 50; });
if (Gdocument.getElementById("classic_mid_sandbox") == null) {
Gdocument.getElementById("roomlistrefreshbutton").click();
scope.sandboxbutton = Gdocument.createElement("div");
sandboxbutton.id = "classic_mid_sandbox";
sandboxbutton.classList.value = "brownButton brownButton_classic classic_mid_buttons";
sandboxbutton.textContent = "Sandbox";
sandboxbutton.addEventListener("click", sandboxonclick);
Gdocument.getElementById("classic_mid").insertBefore(sandboxbutton, Gdocument.getElementById("classic_mid_news"));
}
if (Gdocument.getElementById("clearallcheckboxes") == null) {
scope.checkboxclearbutton = Gdocument.createElement("div");
checkboxclearbutton.id = "clearallcheckboxes";
checkboxclearbutton.classList.value = "brownButton brownButton_classic buttonShadow";
checkboxclearbutton.textContent = "On/Off";
checkboxclearbutton.style["position"] = "absolute";
checkboxclearbutton.style["display"] = "none";
if (typeof (ishost) != 'undefined') {
if (ishost && stopquickplay == 0) {
checkboxclearbutton.style["display"] = "block";
}
}
checkboxclearbutton.style["right"] = "255px";
checkboxclearbutton.style["top"] = "57px";
checkboxclearbutton.style["height"] = "23px";
checkboxclearbutton.style["width"] = "47px";
checkboxclearbutton.style["line-height"] = "23px";
checkboxclearbutton.style["font-size"] = "13px";
checkboxclearbutton.addEventListener("click", checkboxclearbuttononclick);
Gdocument.getElementById("maploadwindow").insertBefore(checkboxclearbutton, Gdocument.getElementById("maploadwindowsearchinput"));
}
scope.holdloadbuttonTimeout = [];
scope.holdloadbutton = function () {
var scrollcount = 0;
var mapwindow = Gdocument.getElementById("maploadwindowmapscontainer");
mapwindow.scroll(0, mapwindow.scrollHeight);
};
if (Gdocument.getElementById("mapwindowloadall") == null) {
scope.loadall = Gdocument.createElement("div");
loadall.id = "mapwindowloadall";
loadall.classList.value = "brownButton brownButton_classic buttonShadow";
loadall.textContent = "Load";
loadall.style["position"] = "absolute";
loadall.style["display"] = "block";
loadall.style["left"] = "204px";
loadall.style["top"] = "57px";
loadall.style["height"] = "23px";
loadall.style["width"] = "34px";
loadall.style["line-height"] = "23px";
loadall.style["font-size"] = "12px";
var repeat = function () { holdloadbutton(); holdloadbuttonTimeout.push(setTimeout(repeat, 25)); };
loadall.onmousedown = function () { repeat(); };
loadall.onmouseup = function () { for (var i = 0; i < holdloadbuttonTimeout.length; i++) { clearTimeout(holdloadbuttonTimeout[i]); } };
loadall.onmouseout = function () { for (var i = 0; i < holdloadbuttonTimeout.length; i++) { clearTimeout(holdloadbuttonTimeout[i]); } };
Gdocument.getElementById("maploadwindow").insertBefore(loadall, Gdocument.getElementById("maploadwindowsearchinput"));
}
if (Gdocument.getElementById("BonkCommandsDebuggerContainer") == null) {
Gdocument.getElementById("leaveconfirmwindow").style["z-index"] = 3;
scope.debuggermenu = Gdocument.createElement("div");
debuggermenu.id = "BonkCommandsDebuggerContainer";
debuggermenu.style["position"] = "absolute";
debuggermenu.style["display"] = "none";
if (typeof (debuggeropen) != 'undefined') {
if (debuggeropen) {
debuggermenu.style["display"] = "block";
}
}
debuggermenu.style["width"] = Gdocument.getElementById("bonkiocontainer").style["width"];
debuggermenu.style["height"] = Gdocument.getElementById("bonkiocontainer").style["height"];
debuggermenu.style["background"] = "rgb(26, 39, 51)";
scope.width = parseInt(Gdocument.getElementById("bonkiocontainer").style["width"]) - 20;
scope.height = parseInt(Gdocument.getElementById("bonkiocontainer").style["height"]) - 210;
scope.logmenu = Gdocument.createElement("div");
logmenu.id = "BonkCommandsWebSocketLog";
logmenu.style["position"] = "absolute";
logmenu.style["width"] = width.toString() + "px";
logmenu.style["height"] = height.toString() + "px";
logmenu.style["top"] = "80px";
logmenu.style["left"] = "10px";
logmenu.style["background"] = "rgb(207, 216, 220)";
scope.logmenutopleft = Gdocument.createElement("div");
logmenutopleft.id = "BonkCommandsWebSocketLog";
logmenutopleft.style["position"] = "absolute";
logmenutopleft.textContent = "Sending";
logmenutopleft.classList = "newbonklobby_boxtop newbonklobby_boxtop_classic";
logmenutopleft.style["width"] = (width / 2).toString() + "px";
logmenutopleft.style["height"] = "30px";
logmenutopleft.style["top"] = "-30px";
logmenutopleft.style["background"] = "rgb(0, 150, 136)";
logmenu.appendChild(logmenutopleft);
scope.logmenutopright = Gdocument.createElement("div");
logmenutopright.id = "BonkCommandsWebSocketLog";
logmenutopright.style["position"] = "absolute";
logmenutopright.textContent = "Recieving";
logmenutopright.classList = "newbonklobby_boxtop newbonklobby_boxtop_classic";
logmenutopright.style["width"] = (width / 2).toString() + "px";
logmenutopright.style["height"] = "30px";
logmenutopright.style["left"] = (width / 2).toString() + "px";
logmenutopright.style["top"] = "-30px";
logmenutopright.style["background"] = "rgb(0, 150, 136)";
logmenu.appendChild(logmenutopright);
scope.logmenutable = Gdocument.createElement("table");
logmenutable.id = "BonkCommandsWebSocketTable";
logmenutable.style["position"] = "absolute";
logmenutable.style["border-spacing"] = "0px";
logmenutable.style["font-size"] = "12px";
logmenutable.style["display"] = "table-cell";
logmenutable.style["width"] = "50%";
logmenutable.style["height"] = "100%";
logmenutable.style["table-layout"] = "fixed";
logmenutable.style["overflow-y"] = "scroll";
scope.logmenutable2 = Gdocument.createElement("table");
logmenutable2.id = "BonkCommandsWebSocketTable2";
logmenutable2.style["position"] = "absolute";
logmenutable2.style["width"] = "50%";
logmenutable2.style["left"] = "50%";
logmenutable2.style["font-size"] = "12px";
logmenutable2.style["display"] = "table-cell";
logmenutable2.style["height"] = "100%";
logmenutable2.style["table-layout"] = "fixed";
logmenutable2.style["overflow-y"] = "scroll";
logmenutable2.style["border-spacing"] = "0px";
scope.leftsync = false;
scope.rightsync = false;
logmenutable2.onscroll = function () {
if (!leftsync) {
rightsync = true;
logmenutable.scrollTop = this.scrollTop;
}
else {
leftsync = false;
}
};
logmenutable.onscroll = function () {
if (!rightsync) {
leftsync = true;
logmenutable2.scrollTop = this.scrollTop;
}
else {
rightsync = false
}
};
logmenu.appendChild(logmenutable);
logmenu.appendChild(logmenutable2);
debuggermenu.appendChild(logmenu);
scope.debuggermenuclose = Gdocument.createElement("div");
debuggermenuclose.id = "debuggerclose";
debuggermenuclose.classList = "windowCloseButton brownButton brownButton_classic buttonShadow";
debuggermenuclose.style["position"] = "absolute";
debuggermenuclose.style["top"] = "40px";
debuggermenuclose.style["right"] = "5px";
debuggermenuclose.onclick = function () {
debuggeropen = false; debuggermenu.style["display"] = "none"; Gdocument.getElementById("newbonklobby_chat_input").style["display"] = "";
Gdocument.getElementById("ingamechatinputtext").style["display"] = "";
};
debuggermenu.appendChild(debuggermenuclose);
scope.debuggerform = Gdocument.createElement("form");
debuggerform.autocomplete = "off";
scope.debuggerinput = Gdocument.createElement("input");
debuggerinput.style["position"] = "absolute";
debuggerinput.style["width"] = width.toString() + "px";
debuggerinput.style["left"] = "10px";
debuggerinput.style["top"] = (height + 90).toString() + "px";
debuggerinput.style["font-size"] = "12px";
debuggerinput.style["height"] = "20px";
debuggerform.appendChild(debuggerinput);
scope.debuggersendrecieve = Gdocument.createElement("div");
debuggersendrecieve.style["position"] = "absolute";
debuggersendrecieve.style["width"] = "140px";
debuggersendrecieve.style["left"] = "10px";
debuggersendrecieve.style["top"] = (height + 120).toString() + "px";
debuggersendrecieve.style["font-size"] = "15px";
debuggersendrecieve.style["height"] = "20px";
debuggersendrecieve.classList = "brownButton brownButton_classic buttonShadow";
debuggersendrecieve.textContent = "Send";
debuggersendrecieve.value = 0;
debuggersendrecieve.onclick = function () { if (this.value == 0) { this.textContent = "Recieve"; this.value = 1; } else { this.textContent = "Send"; this.value = 0; } };
debuggermenu.appendChild(debuggersendrecieve);
scope.debuggerpausebutton = Gdocument.createElement("div");
debuggerpausebutton.style["position"] = "absolute";
debuggerpausebutton.style["width"] = "140px";
debuggerpausebutton.style["left"] = "10px";
debuggerpausebutton.style["top"] = (height + 150).toString() + "px";
debuggerpausebutton.style["font-size"] = "15px";
debuggerpausebutton.style["height"] = "20px";
debuggerpausebutton.classList = "brownButton brownButton_classic buttonShadow";
debuggerpausebutton.textContent = "Pause";
debuggerpausebutton.value = 0;
debuggerpausebutton.onclick = function () { if (this.value == 0) { this.textContent = "Play"; this.value = 1; wsslogpaused = true } else { this.textContent = "Pause"; this.value = 0; wsslogpaused = false; } };
debuggermenu.appendChild(debuggerpausebutton);
scope.debuggereval = Gdocument.createElement("input");
debuggereval.style["position"] = "absolute";
debuggereval.style["width"] = (width - 150).toString() + "px";
debuggereval.style["right"] = "10px";
debuggereval.style["top"] = (height + 120).toString() + "px";
debuggereval.style["font-size"] = "12px";
debuggereval.style["height"] = "20px";
debuggereval.addEventListener("keypress", function (e) { if (e.repeat) { return; } if (e.code == "Enter" && this.value.length > 0) { if (debuggersendrecieve.value == 0) { SEND(this.value); } else { RECIEVE(this.value); } } });
debuggerform.appendChild(debuggereval);
debuggermenu.appendChild(debuggerform);
Gdocument.getElementById("newbonkgamecontainer").appendChild(debuggermenu);
}
scope.ISdecode = function (rawdata) {
rawdata_caseflipped = "";
for (i = 0; i < rawdata.length; i++) {
if (i <= 100 && rawdata.charAt(i) === rawdata.charAt(i).toLowerCase()) {
rawdata_caseflipped += rawdata.charAt(i).toUpperCase();
} else if (i <= 100 && rawdata.charAt(i) === rawdata.charAt(i).toUpperCase()) {
rawdata_caseflipped += rawdata.charAt(i).toLowerCase();
} else {
rawdata_caseflipped += rawdata.charAt(i);
}
}
data_deLZd = LZString.decompressFromEncodedURIComponent(rawdata_caseflipped);
databuffer = bytebuffer.fromBase64(data_deLZd);
data = ISpsonpair.decode(databuffer.buffer);
return data;
};
scope.avatarToBase64 = function (buff) {
var uint8 = new Uint8Array(buff.buffer);
var index = buff.index;
var result = "";
for (var i = 0; i < index; i++) {
result += String.fromCharCode(uint8[i]);
}
return btoa(result);
};
scope.avatarToString = function (avatar) {
var buff = new bytebuffer2();
buff.writeByte(0x0A);
buff.writeByte(0x07);
buff.writeByte(0x03);
buff.writeByte(0x61);
buff.writeShort(0x02);
buff.writeByte(0x09);
buff.writeByte(avatar.layers.length * 2 + 1);
buff.writeByte(0x01);
for (var i = 0; i < avatar.layers.length; i++) {
var layer = avatar.layers[i];
buff.writeByte(0x0A);
if (i == 0) {
buff.writeByte(0x07);
buff.writeByte(0x05);
buff.writeByte(0x61);
buff.writeByte(0x6c);
}
else {
buff.writeByte(0x05);
}
buff.writeShort(1);
buff.writeShort(layer.id);
buff.writeFloat(layer.scale);
buff.writeFloat(layer.angle);
buff.writeFloat(layer.x);
buff.writeFloat(layer.y);
buff.writeBoolean(layer.flipX);
buff.writeBoolean(layer.flipY);
buff.writeInt(layer.color);
}
buff.writeInt(avatar.bc);
return encodeURIComponent(avatarToBase64(buff));
};
scope.avatarToBonkLeagueLink = async function (avatar, name, author) {
var skin_str = avatarToString(avatar);
var link = 'https://bonkleagues.io/skins.html#' + name + "|" + author + "|" + skin_str;
var encodedlink = encodeURIComponent(link);
var fetchlink = 'https://bonkleaguebot.herokuapp.com/shorten?url=' + encodedlink;
var url = "";
await fetch(fetchlink).then(function (r) {
return r.json();
}).then(function (r) {
url = r.url;
}).catch(function (err) {
url = -1;
});
return url;
};
scope.ISencode = function (obj) {
data = ISpsonpair.encode(obj);
b64 = data.toBase64();
lzd = LZString.compressToEncodedURIComponent(b64);
caseflipped = "";
for (i = 0; i < lzd.length; i++) {
if (i <= 100 && lzd.charAt(i) === lzd.charAt(i).toLowerCase()) {
caseflipped += lzd.charAt(i).toUpperCase();
} else if (i <= 100 && lzd.charAt(i) === lzd.charAt(i).toUpperCase()) {
caseflipped += lzd.charAt(i).toLowerCase();
} else {
caseflipped += lzd.charAt(i);
}
}
return caseflipped;
};
scope.decodeIS = function (x) {
return ISdecode(x);
};
scope.encodeIS = function (x) {
return ISencode(x);
};
scope.encodeToDatabase = function (W2A) {
var M3n = [arguments];
M3n[1] = new bytebuffer2;
M3n[9] = M3n[0][0].physics;
M3n[0][0].v = 15;
M3n[1].writeShort(M3n[0][0].v);
M3n[1].writeBoolean(M3n[0][0].s.re);
M3n[1].writeBoolean(M3n[0][0].s.nc);
M3n[1].writeShort(M3n[0][0].s.pq);
M3n[1].writeFloat(M3n[0][0].s.gd);
M3n[1].writeBoolean(M3n[0][0].s.fl);
M3n[1].writeUTF(M3n[0][0].m.rxn);
M3n[1].writeUTF(M3n[0][0].m.rxa);
M3n[1].writeUint(M3n[0][0].m.rxid);
M3n[1].writeShort(M3n[0][0].m.rxdb);
M3n[1].writeUTF(M3n[0][0].m.n);
M3n[1].writeUTF(M3n[0][0].m.a);
M3n[1].writeUint(M3n[0][0].m.vu);
M3n[1].writeUint(M3n[0][0].m.vd);
M3n[1].writeShort(M3n[0][0].m.cr.length);
for (
M3n[84] = 0;
M3n[84] < M3n[0][0].m.cr.length;
M3n[84]++
) {
M3n[1].writeUTF(M3n[0][0].m.cr[M3n[84]]);
}
M3n[1].writeUTF(M3n[0][0].m.mo);
M3n[1].writeInt(M3n[0][0].m.dbid);
M3n[1].writeBoolean(M3n[0][0].m.pub);
M3n[1].writeInt(M3n[0][0].m.dbv);
M3n[1].writeShort(M3n[9].ppm);
M3n[1].writeShort(M3n[9].bro.length);
for (M3n[17] = 0; M3n[17] < M3n[9].bro.length; M3n[17]++) {
M3n[1].writeShort(M3n[9].bro[M3n[17]]);
}
M3n[1].writeShort(M3n[9].shapes.length);
for (M3n[80] = 0; M3n[80] < M3n[9].shapes.length; M3n[80]++) {
M3n[2] = M3n[9].shapes[M3n[80]];
if (M3n[2].type == "bx") {
M3n[1].writeShort(1);
M3n[1].writeDouble(M3n[2].w);
M3n[1].writeDouble(M3n[2].h);
M3n[1].writeDouble(M3n[2].c[0]);
M3n[1].writeDouble(M3n[2].c[1]);
M3n[1].writeDouble(M3n[2].a);
M3n[1].writeBoolean(M3n[2].sk);
}
if (M3n[2].type == "ci") {
M3n[1].writeShort(2);
M3n[1].writeDouble(M3n[2].r);
M3n[1].writeDouble(M3n[2].c[0]);
M3n[1].writeDouble(M3n[2].c[1]);
M3n[1].writeBoolean(M3n[2].sk);
}
if (M3n[2].type == "po") {
M3n[1].writeShort(3);
M3n[1].writeDouble(M3n[2].s);
M3n[1].writeDouble(M3n[2].a);
M3n[1].writeDouble(M3n[2].c[0]);
M3n[1].writeDouble(M3n[2].c[1]);
M3n[1].writeShort(M3n[2].v.length);
for (M3n[61] = 0; M3n[61] < M3n[2].v.length; M3n[61]++) {
M3n[1].writeDouble(M3n[2].v[M3n[61]][0]);
M3n[1].writeDouble(M3n[2].v[M3n[61]][1]);
}
}
}
M3n[1].writeShort(M3n[9].fixtures.length);
for (M3n[20] = 0; M3n[20] < M3n[9].fixtures.length; M3n[20]++) {
M3n[7] = M3n[9].fixtures[M3n[20]];
M3n[1].writeShort(M3n[7].sh);
M3n[1].writeUTF(M3n[7].n);
if (M3n[7].fr === null) {
M3n[1].writeDouble(Number.MAX_VALUE);
} else {
M3n[1].writeDouble(M3n[7].fr);
}
if (M3n[7].fp === null) {
M3n[1].writeShort(0);
}
if (M3n[7].fp === false) {
M3n[1].writeShort(1);
}
if (M3n[7].fp === true) {
M3n[1].writeShort(2);
}
if (M3n[7].re === null) {
M3n[1].writeDouble(Number.MAX_VALUE);
} else {
M3n[1].writeDouble(M3n[7].re);
}
if (M3n[7].de === null) {
M3n[1].writeDouble(Number.MAX_VALUE);
} else {
M3n[1].writeDouble(M3n[7].de);
}
M3n[1].writeUint(M3n[7].f);
M3n[1].writeBoolean(M3n[7].d);
M3n[1].writeBoolean(M3n[7].np);
M3n[1].writeBoolean(M3n[7].ng);
M3n[1].writeBoolean(M3n[7].ig);
}
M3n[1].writeShort(M3n[9].bodies.length);
for (M3n[37] = 0; M3n[37] < M3n[9].bodies.length; M3n[37]++) {
M3n[4] = M3n[9].bodies[M3n[37]];
M3n[1].writeUTF(M3n[4].type);
M3n[1].writeUTF(M3n[4].n);
M3n[1].writeDouble(M3n[4].p[0]);
M3n[1].writeDouble(M3n[4].p[1]);
M3n[1].writeDouble(M3n[4].a);
M3n[1].writeDouble(M3n[4].fric);
M3n[1].writeBoolean(M3n[4].fricp);
M3n[1].writeDouble(M3n[4].re);
M3n[1].writeDouble(M3n[4].de);
M3n[1].writeDouble(M3n[4].lv[0]);
M3n[1].writeDouble(M3n[4].lv[1]);
M3n[1].writeDouble(M3n[4].av);
M3n[1].writeDouble(M3n[4].ld);
M3n[1].writeDouble(M3n[4].ad);
M3n[1].writeBoolean(M3n[4].fr);
M3n[1].writeBoolean(M3n[4].bu);
M3n[1].writeDouble(M3n[4].cf.x);
M3n[1].writeDouble(M3n[4].cf.y);
M3n[1].writeDouble(M3n[4].cf.ct);
M3n[1].writeBoolean(M3n[4].cf.w);
M3n[1].writeShort(M3n[4].f_c);
M3n[1].writeBoolean(M3n[4].f_1);
M3n[1].writeBoolean(M3n[4].f_2);
M3n[1].writeBoolean(M3n[4].f_3);
M3n[1].writeBoolean(M3n[4].f_4);
M3n[1].writeBoolean(M3n[4].f_p);
M3n[1].writeBoolean(M3n[4].fz.on);
if (M3n[4].fz.on) {
M3n[1].writeDouble(M3n[4].fz.x);
M3n[1].writeDouble(M3n[4].fz.y);
M3n[1].writeBoolean(M3n[4].fz.d);
M3n[1].writeBoolean(M3n[4].fz.p);
M3n[1].writeBoolean(M3n[4].fz.a);
M3n[1].writeShort(M3n[4].fz.t);
M3n[1].writeDouble(M3n[4].fz.cf);
}
M3n[1].writeShort(M3n[4].fx.length);
for (M3n[28] = 0; M3n[28] < M3n[4].fx.length; M3n[28]++) {
M3n[1].writeShort(M3n[4].fx[M3n[28]]);
}
}
M3n[1].writeShort(M3n[0][0].spawns.length);
for (
M3n[30] = 0;
M3n[30] < M3n[0][0].spawns.length;
M3n[30]++
) {
M3n[6] = M3n[0][0].spawns[M3n[30]];
M3n[1].writeDouble(M3n[6].x);
M3n[1].writeDouble(M3n[6].y);
M3n[1].writeDouble(M3n[6].xv);
M3n[1].writeDouble(M3n[6].yv);
M3n[1].writeShort(M3n[6].priority);
M3n[1].writeBoolean(M3n[6].r);
M3n[1].writeBoolean(M3n[6].f);
M3n[1].writeBoolean(M3n[6].b);
M3n[1].writeBoolean(M3n[6].gr);
M3n[1].writeBoolean(M3n[6].ye);
M3n[1].writeUTF(M3n[6].n);
}
M3n[1].writeShort(M3n[0][0].capZones.length);
for (
M3n[74] = 0;
M3n[74] < M3n[0][0].capZones.length;
M3n[74]++
) {
M3n[3] = M3n[0][0].capZones[M3n[74]];
M3n[1].writeUTF(M3n[3].n);
M3n[1].writeDouble(M3n[3].l);
M3n[1].writeShort(M3n[3].i);
M3n[1].writeShort(M3n[3].ty);
}
M3n[1].writeShort(M3n[9].joints.length);
for (M3n[89] = 0; M3n[89] < M3n[9].joints.length; M3n[89]++) {
M3n[5] = M3n[9].joints[M3n[89]];
if (M3n[5].type == "rv") {
M3n[1].writeShort(1);
M3n[1].writeDouble(M3n[5].d.la);
M3n[1].writeDouble(M3n[5].d.ua);
M3n[1].writeDouble(M3n[5].d.mmt);
M3n[1].writeDouble(M3n[5].d.ms);
M3n[1].writeBoolean(M3n[5].d.el);
M3n[1].writeBoolean(M3n[5].d.em);
M3n[1].writeDouble(M3n[5].aa[0]);
M3n[1].writeDouble(M3n[5].aa[1]);
}
if (M3n[5].type == "d") {
M3n[1].writeShort(2);
M3n[1].writeDouble(M3n[5].d.fh);
M3n[1].writeDouble(M3n[5].d.dr);
M3n[1].writeDouble(M3n[5].aa[0]);
M3n[1].writeDouble(M3n[5].aa[1]);
M3n[1].writeDouble(M3n[5].ab[0]);
M3n[1].writeDouble(M3n[5].ab[1]);
}
if (M3n[5].type == "lpj") {
M3n[1].writeShort(3);
M3n[1].writeDouble(M3n[5].pax);
M3n[1].writeDouble(M3n[5].pay);
M3n[1].writeDouble(M3n[5].pa);
M3n[1].writeDouble(M3n[5].pf);
M3n[1].writeDouble(M3n[5].pl);
M3n[1].writeDouble(M3n[5].pu);
M3n[1].writeDouble(M3n[5].plen);
M3n[1].writeDouble(M3n[5].pms);
}
if (M3n[5].type == "lsj") {
M3n[1].writeShort(4);
M3n[1].writeDouble(M3n[5].sax);
M3n[1].writeDouble(M3n[5].say);
M3n[1].writeDouble(M3n[5].sf);
M3n[1].writeDouble(M3n[5].slen);
}
if (M3n[5].type == "g") {
M3n[1].writeShort(5);
M3n[1].writeUTF(M3n[5].n);
M3n[1].writeShort(M3n[5].ja);
M3n[1].writeShort(M3n[5].jb);
M3n[1].writeDouble(M3n[5].r);
}
if (M3n[5].type != "g") {
M3n[1].writeShort(M3n[5].ba);
M3n[1].writeShort(M3n[5].bb);
M3n[1].writeBoolean(M3n[5].d.cc);
M3n[1].writeDouble(M3n[5].d.bf);
M3n[1].writeBoolean(M3n[5].d.dl);
}
}
M3n[32] = M3n[1].toBase64();
M3n[77] = LZString.compressToEncodedURIComponent(M3n[32]);
return M3n[77];
};
scope.decodeFromDatabase = function (map) {
var F5W = [arguments];
var b64mapdata = LZString.decompressFromEncodedURIComponent(map);
var binaryReader = new bytebuffer2;
binaryReader.fromBase64(b64mapdata, false);
map = { v: 1, s: { re: false, nc: false, pq: 1, gd: 25, fl: false }, physics: { shapes: [], fixtures: [], bodies: [], bro: [], joints: [], ppm: 12, }, spawns: [], capZones: [], m: { a: "noauthor", n: "noname", dbv: 2, dbid: -1, authid: -1, date: "", rxid: 0, rxn: "", rxa: "", rxdb: 1, cr: [], pub: false, mo: "", } };
map.physics = map.physics;
map.v = binaryReader.readShort();
if (map.v > 15) {
throw new Error("Future map version, please refresh page");
}
map.s.re = binaryReader.readBoolean();
map.s.nc = binaryReader.readBoolean();
if (map.v >= 3) {
map.s.pq = binaryReader.readShort();
}
if (map.v >= 4 && map.v <= 12) {
map.s.gd = binaryReader.readShort();
} else if (map.v >= 13) {
map.s.gd = binaryReader.readFloat();
}
if (map.v >= 9) {
map.s.fl = binaryReader.readBoolean();
}
map.m.rxn = binaryReader.readUTF();
map.m.rxa = binaryReader.readUTF();
map.m.rxid = binaryReader.readUint();
map.m.rxdb = binaryReader.readShort();
map.m.n = binaryReader.readUTF();
map.m.a = binaryReader.readUTF();
if (map.v >= 10) {
map.m.vu = binaryReader.readUint();
map.m.vd = binaryReader.readUint();
}
if (map.v >= 4) {
F5W[7] = binaryReader.readShort();
for (F5W[83] = 0; F5W[83] < F5W[7]; F5W[83]++) {
map.m.cr.push(binaryReader.readUTF());
}
}
if (map.v >= 5) {
map.m.mo = binaryReader.readUTF();
map.m.dbid = binaryReader.readInt();
}
if (map.v >= 7) {
map.m.pub = binaryReader.readBoolean();
}
if (map.v >= 8) {
map.m.dbv = binaryReader.readInt();
}
map.physics.ppm = binaryReader.readShort();
F5W[4] = binaryReader.readShort();
for (F5W[15] = 0; F5W[15] < F5W[4]; F5W[15]++) {
map.physics.bro[F5W[15]] = binaryReader.readShort();
}
F5W[6] = binaryReader.readShort();
for (F5W[28] = 0; F5W[28] < F5W[6]; F5W[28]++) {
F5W[5] = binaryReader.readShort();
if (F5W[5] == 1) {
map.physics.shapes[F5W[28]] = { type: "bx", w: 10, h: 40, c: [0, 0], a: 0.0, sk: false };
map.physics.shapes[F5W[28]].w = binaryReader.readDouble();
map.physics.shapes[F5W[28]].h = binaryReader.readDouble();
map.physics.shapes[F5W[28]].c = [
binaryReader.readDouble(),
binaryReader.readDouble(),
];
map.physics.shapes[F5W[28]].a = binaryReader.readDouble();
map.physics.shapes[F5W[28]].sk = binaryReader.readBoolean();
}
if (F5W[5] == 2) {
map.physics.shapes[F5W[28]] = { type: "ci", r: 25, c: [0, 0], sk: false };
map.physics.shapes[F5W[28]].r = binaryReader.readDouble();
map.physics.shapes[F5W[28]].c = [
binaryReader.readDouble(),
binaryReader.readDouble(),
];
map.physics.shapes[F5W[28]].sk = binaryReader.readBoolean();
}
if (F5W[5] == 3) {
map.physics.shapes[F5W[28]] = { type: "po", v: [], s: 1, a: 0, c: [0, 0] };
map.physics.shapes[F5W[28]].s = binaryReader.readDouble();
map.physics.shapes[F5W[28]].a = binaryReader.readDouble();
map.physics.shapes[F5W[28]].c = [
binaryReader.readDouble(),
binaryReader.readDouble(),
];
F5W[74] = binaryReader.readShort();
map.physics.shapes[F5W[28]].v = [];
for (F5W[27] = 0; F5W[27] < F5W[74]; F5W[27]++) {
map.physics.shapes[F5W[28]].v.push([
binaryReader.readDouble(),
binaryReader.readDouble(),
]);
}
}
}
F5W[71] = binaryReader.readShort();
for (F5W[17] = 0; F5W[17] < F5W[71]; F5W[17]++) {
map.physics.fixtures[F5W[17]] = { sh: 0, n: "Def Fix", fr: 0.3, fp: null, re: 0.8, de: 0.3, f: 0x4f7cac, d: false, np: false, ng: false };
map.physics.fixtures[F5W[17]].sh = binaryReader.readShort();
map.physics.fixtures[F5W[17]].n = binaryReader.readUTF();
map.physics.fixtures[F5W[17]].fr = binaryReader.readDouble();
if (map.physics.fixtures[F5W[17]].fr == Number.MAX_VALUE) {
map.physics.fixtures[F5W[17]].fr = null;
}
F5W[12] = binaryReader.readShort();
if (F5W[12] == 0) {
map.physics.fixtures[F5W[17]].fp = null;
}
if (F5W[12] == 1) {
map.physics.fixtures[F5W[17]].fp = false;
}
if (F5W[12] == 2) {
map.physics.fixtures[F5W[17]].fp = true;
}
map.physics.fixtures[F5W[17]].re = binaryReader.readDouble();
if (map.physics.fixtures[F5W[17]].re == Number.MAX_VALUE) {
map.physics.fixtures[F5W[17]].re = null;
}
map.physics.fixtures[F5W[17]].de = binaryReader.readDouble();
if (map.physics.fixtures[F5W[17]].de == Number.MAX_VALUE) {
map.physics.fixtures[F5W[17]].de = null;
}
map.physics.fixtures[F5W[17]].f = binaryReader.readUint();
map.physics.fixtures[F5W[17]].d = binaryReader.readBoolean();
map.physics.fixtures[F5W[17]].np = binaryReader.readBoolean();
if (map.v >= 11) {
map.physics.fixtures[F5W[17]].ng = binaryReader.readBoolean();
}
if (map.v >= 12) {
map.physics.fixtures[F5W[17]].ig = binaryReader.readBoolean();
}
}
F5W[63] = binaryReader.readShort();
for (F5W[52] = 0; F5W[52] < F5W[63]; F5W[52]++) {
map.physics.bodies[F5W[52]] = { type: "s", n: "Unnamed", p: [0, 0], a: 0, fric: 0.3, fricp: false, re: 0.8, de: 0.3, lv: [0, 0], av: 0, ld: 0, ad: 0, fr: false, bu: false, cf: { x: 0, y: 0, w: true, ct: 0 }, fx: [], f_c: 1, f_p: true, f_1: true, f_2: true, f_3: true, f_4: true, fz: { on: false, x: 0, y: 0, d: true, p: true, a: true, t: 0, cf: 0 } };
map.physics.bodies[F5W[52]].type = binaryReader.readUTF();
map.physics.bodies[F5W[52]].n = binaryReader.readUTF();
map.physics.bodies[F5W[52]].p = [binaryReader.readDouble(), binaryReader.readDouble()];
map.physics.bodies[F5W[52]].a = binaryReader.readDouble();
map.physics.bodies[F5W[52]].fric = binaryReader.readDouble();
map.physics.bodies[F5W[52]].fricp = binaryReader.readBoolean();
map.physics.bodies[F5W[52]].re = binaryReader.readDouble();
map.physics.bodies[F5W[52]].de = binaryReader.readDouble();
map.physics.bodies[F5W[52]].lv = [
binaryReader.readDouble(),
binaryReader.readDouble(),
];
map.physics.bodies[F5W[52]].av = binaryReader.readDouble();
map.physics.bodies[F5W[52]].ld = binaryReader.readDouble();
map.physics.bodies[F5W[52]].ad = binaryReader.readDouble();
map.physics.bodies[F5W[52]].fr = binaryReader.readBoolean();
map.physics.bodies[F5W[52]].bu = binaryReader.readBoolean();
map.physics.bodies[F5W[52]].cf.x = binaryReader.readDouble();
map.physics.bodies[F5W[52]].cf.y = binaryReader.readDouble();
map.physics.bodies[F5W[52]].cf.ct = binaryReader.readDouble();
map.physics.bodies[F5W[52]].cf.w = binaryReader.readBoolean();
map.physics.bodies[F5W[52]].f_c = binaryReader.readShort();
map.physics.bodies[F5W[52]].f_1 = binaryReader.readBoolean();
map.physics.bodies[F5W[52]].f_2 = binaryReader.readBoolean();
map.physics.bodies[F5W[52]].f_3 = binaryReader.readBoolean();
map.physics.bodies[F5W[52]].f_4 = binaryReader.readBoolean();
if (map.v >= 2) {
map.physics.bodies[F5W[52]].f_p = binaryReader.readBoolean();
}
if (map.v >= 14) {
map.physics.bodies[F5W[52]].fz.on = binaryReader.readBoolean();
if (map.physics.bodies[F5W[52]].fz.on) {
map.physics.bodies[F5W[52]].fz.x = binaryReader.readDouble();
map.physics.bodies[F5W[52]].fz.y = binaryReader.readDouble();
map.physics.bodies[F5W[52]].fz.d = binaryReader.readBoolean();
map.physics.bodies[F5W[52]].fz.p = binaryReader.readBoolean();
map.physics.bodies[F5W[52]].fz.a = binaryReader.readBoolean();
if (map.v >= 15) {
map.physics.bodies[F5W[52]].fz.t = binaryReader.readShort();
map.physics.bodies[F5W[52]].fz.cf = binaryReader.readDouble();
}
}
}
F5W[88] = binaryReader.readShort();
for (F5W[65] = 0; F5W[65] < F5W[88]; F5W[65]++) {
map.physics.bodies[F5W[52]].fx.push(binaryReader.readShort());
}
}
F5W[97] = binaryReader.readShort();
for (F5W[41] = 0; F5W[41] < F5W[97]; F5W[41]++) {
map.spawns[F5W[41]] = { "x": 400, "y": 300, "xv": 0, "yv": 0, "priority": 5, "r": true, "f": true, "b": true, "gr": false, "ye": false, "n": "Spawn" };
F5W[35] = map.spawns[F5W[41]];
F5W[35].x = binaryReader.readDouble();
F5W[35].y = binaryReader.readDouble();
F5W[35].xv = binaryReader.readDouble();
F5W[35].yv = binaryReader.readDouble();
F5W[35].priority = binaryReader.readShort();
F5W[35].r = binaryReader.readBoolean();
F5W[35].f = binaryReader.readBoolean();
F5W[35].b = binaryReader.readBoolean();
F5W[35].gr = binaryReader.readBoolean();
F5W[35].ye = binaryReader.readBoolean();
F5W[35].n = binaryReader.readUTF();
}
F5W[16] = binaryReader.readShort();
for (F5W[25] = 0; F5W[25] < F5W[16]; F5W[25]++) {
map.capZones[F5W[25]] = { "n": "Cap Zone", "ty": 1, "l": 10, "i": -1 };
map.capZones[F5W[25]].n = binaryReader.readUTF();
map.capZones[F5W[25]].l = binaryReader.readDouble();
map.capZones[F5W[25]].i = binaryReader.readShort();
if (map.v >= 6) {
map.capZones[F5W[25]].ty = binaryReader.readShort();
}
}
F5W[98] = binaryReader.readShort();
for (F5W[19] = 0; F5W[19] < F5W[98]; F5W[19]++) {
F5W[31] = binaryReader.readShort();
if (F5W[31] == 1) {
map.physics.joints[F5W[19]] = { "type": "rv", "d": { "la": 0, "ua": 0, "mmt": 0, "ms": 0, "el": false, "em": false, "cc": false, "bf": 0, "dl": true }, "aa": [0, 0] };
F5W[20] = map.physics.joints[F5W[19]];
F5W[20].d.la = binaryReader.readDouble();
F5W[20].d.ua = binaryReader.readDouble();
F5W[20].d.mmt = binaryReader.readDouble();
F5W[20].d.ms = binaryReader.readDouble();
F5W[20].d.el = binaryReader.readBoolean();
F5W[20].d.em = binaryReader.readBoolean();
F5W[20].aa = [binaryReader.readDouble(), binaryReader.readDouble()];
}
if (F5W[31] == 2) {
map.physics.joints[F5W[19]] = { "type": "d", "d": { "fh": 0, "dr": 0, "cc": false, "bf": 0, "dl": true }, "aa": [0, 0], "ab": [0, 0] };
F5W[87] = map.physics.joints[F5W[19]];
F5W[87].d.fh = binaryReader.readDouble();
F5W[87].d.dr = binaryReader.readDouble();
F5W[87].aa = [binaryReader.readDouble(), binaryReader.readDouble()];
F5W[87].ab = [binaryReader.readDouble(), binaryReader.readDouble()];
}
if (F5W[31] == 3) {
map.physics.joints[F5W[19]] = { "type": "lpj", "d": { "cc": false, "bf": 0, "dl": true }, "pax": 0, "pay": 0, "pa": 0, "pf": 0, "pl": 0, "pu": 0, "plen": 0, "pms": 0 };
F5W[90] = map.physics.joints[F5W[19]];
F5W[90].pax = binaryReader.readDouble();
F5W[90].pay = binaryReader.readDouble();
F5W[90].pa = binaryReader.readDouble();
F5W[90].pf = binaryReader.readDouble();
F5W[90].pl = binaryReader.readDouble();
F5W[90].pu = binaryReader.readDouble();
F5W[90].plen = binaryReader.readDouble();
F5W[90].pms = binaryReader.readDouble();
}
if (F5W[31] == 4) {
map.physics.joints[F5W[19]] = { "type": "lsj", "d": { "cc": false, "bf": 0, "dl": true }, "sax": 0, "say": 0, "sf": 0, "slen": 0 };
F5W[44] = map.physics.joints[F5W[19]];
F5W[44].sax = binaryReader.readDouble();
F5W[44].say = binaryReader.readDouble();
F5W[44].sf = binaryReader.readDouble();
F5W[44].slen = binaryReader.readDouble();
}
if (F5W[31] == 5) {
map.physics.joints[F5W[19]] = { type: "g", n: "", ja: -1, jb: -1, r: 1 };
F5W[91] = map.physics.joints[F5W[19]];
F5W[91].n = binaryReader.readUTF();
F5W[91].ja = binaryReader.readShort();
F5W[91].jb = binaryReader.readShort();
F5W[91].r = binaryReader.readDouble();
}
if (F5W[31] != 5) {
map.physics.joints[F5W[19]].ba = binaryReader.readShort();
map.physics.joints[F5W[19]].bb = binaryReader.readShort();
map.physics.joints[F5W[19]].d.cc = binaryReader.readBoolean();
map.physics.joints[F5W[19]].d.bf = binaryReader.readDouble();
map.physics.joints[F5W[19]].d.dl = binaryReader.readBoolean();
}
}
return map;
};
scope.updateWssLog = function () {
if (!wsslogpaused) {
if (logmenutable.children.length < wsssendrecievelog.length) {
var bottomscroll = logmenutable.clientHeight + logmenutable.scrollTop >= logmenutable.scrollHeight - 1;
while (logmenutable.children.length > 1000) {
logmenutable.removeChild(logmenutable.firstChild);
logmenutable2.removeChild(logmenutable2.firstChild);
}
var loopthro = wsssendrecievelog.slice(packetcount);
for (var i = 0; i < loopthro.length; i++) {
packetcount++;
var row = document.createElement("tr");
var row2 = document.createElement("tr");
var cell1 = document.createElement("td");
cell1.style["overflow-x"] = "scroll";
cell1.style["padding"] = "0px";
cell1.style["width"] = "100000px";
var cell2 = document.createElement("td");
cell2.style["overflow-x"] = "scroll";
cell2.style["padding"] = "0px";
cell2.style["width"] = "100000px";
if (debuggercount) {
cell1.style["background"] = "rgb(178, 185, 189)";
debuggercount = false;
}
else {
cell2.style["background"] = "rgb(178, 185, 189)";
debuggercount = true;
}
cell1.textContent = loopthro[i][1];
cell2.textContent = loopthro[i][1];
if (loopthro[i][0] == 0) {
cell2.style["color"] = "transparent";
cell1.onclick = function () { debuggerinput.value = this.textContent };
}
else {
cell1.style["color"] = "transparent";
cell2.onclick = function () { debuggerinput.value = this.textContent };
}
row.appendChild(cell1);
row2.appendChild(cell2);
logmenutable.appendChild(row);
logmenutable2.appendChild(row2);
}
while (logmenutable.children.length > 1000) {
logmenutable.removeChild(logmenutable.firstChild);
logmenutable2.removeChild(logmenutable2.firstChild);
}
if (bottomscroll) {
logmenutable.scrollTop = logmenutable.scrollHeight;
logmenutable2.scrollTop = logmenutable.scrollHeight;
}
}
}
};
Gdocument.getElementById("maploadwindowmapscontainer").appendChild = function (args) {
var checkbox = Gdocument.createElement("input");
checkbox.type = "checkbox";
checkbox.style["position"] = "absolute";
checkbox.style["margin-top"] = "135px";
checkbox.style["margin-left"] = "140px";
checkbox.style["scale"] = "2";
checkbox.style["display"] = "none";
checkbox.className = "quickplaycheckbox quickplayunchecked";
if (ishost && stopquickplay == 0) {
checkbox.style["display"] = "block";
checkbox.className = "quickplaycheckbox quickplaychecked";
}
checkbox.checked = true;
checkbox.onclick = function (e) { e.stopPropagation(); };
args.appendChild(checkbox);
originalMapLoad.call(this, args);
};
Gdocument.getElementById("newbonklobby_chat_content").appendChild = function (args) {
if (beenKickedTimeStamp + 100 > Date.now() && args.children.length > 0) {
if (args.children[0].textContent.endsWith(" has left the game ") && args.children[0].textContent.startsWith("* ")) {
var kickedorbanned = "banned";
if (onlykicked) {
kickedorbanned = "kicked";
}
args.children[0].textContent = args.children[0].textContent.substring(0, args.children[0].textContent.length - 19) + " has been " + kickedorbanned + " from the game ";
}
}
setTimeout(function () {
if (args.textContent.startsWith("* ") && args.children.length >= 5) {
var newarg = args.cloneNode();
for (var i = 0; i < args.children.length; i++) {
var newarg2 = args.children[i].cloneNode();
newarg2.textContent = args.children[i].textContent;
newarg2.style.color = '#ffffffd6';
newarg2.onclick = args.children[i].onclick;
newarg2.suggestID = args.children[i].suggestID;
newarg.appendChild(newarg2);
}
Gdocument.getElementById("ingamechatcontent").appendChild(newarg);
Gdocument.getElementById("ingamechatcontent").scrollTop = Number.MAX_SAFE_INTEGER;
}
}, 0);
originalLobbyChat.call(this, args);
};
Gdocument.getElementById("ingamechatcontent").appendChild = function (args) {
if (beenKickedTimeStamp + 100 > Date.now() && args.children.length > 0) {
if (args.children[0].textContent.endsWith(" has left the game.") && args.children[0].textContent.startsWith("* ")) {
var kickedorbanned = "banned";
if (onlykicked) {
kickedorbanned = "kicked";
}
args.children[0].textContent = args.children[0].textContent.substring(0, args.children[0].textContent.length - 19) + " has been " + kickedorbanned + " from the game.";
}
}
if (recordedTimeStamp + 100 > Date.now() && args.children.length > 0) {
if (args.children[0].textContent.includes("seconds") && args.children[0].textContent.startsWith("* ")) {
args.children[0].textContent = args.children[0].textContent + " - " + playerids[recordedId].userName;
}
}
originalIngameChat.call(this, args);
};
Gwindow.Date.now = function () {
if (overideDate[0]) {
return overideDate[1];
}
else if (causelag) {
return originalDatenow.call(this, ...arguments) - causelag2;
}
return originalDatenow.call(this, ...arguments);
};
// Gwindow.fetch = async function (url) {
// if(url.includes("1263612863812673162876188227728728728278236812638216861328")){
// var url2 = url.split("1263612863812673162876188227728728728278236812638216861328");
// url2[2] = url2[2].replace(".bonk.io", "");
// url = url2.join("");
// }
// console.log(url);
// return await originalFetch(url);
// };
// Gwindow.WebSocket = function(...url) {
// // if(url.includes("1263612863812673162876188227728728728278236812638216861328")){
// // var url2 = url.split("1263612863812673162876188227728728728278236812638216861328");
// // url2[2] = url2[2].replace(".bonk.io", "");
// // url = url2.join("");
// // }
// console.log(...url);
// return new originalWebSocket(...url);
// }
Gwindow.XMLHttpRequest.prototype.open = function (_, url) {
if (url.includes("scripts/map_get") || url.includes("scripts/map_b1_get") || url.includes("scripts/hotmaps/")) {
if (searchrequested > 0) {
Gdocument.getElementById("maploadtypedropdowntitle").click();
var dropdown;
if (searchrequested == 1) {
dropdown = dropdownrequested;
}
else if (searchrequested == 2) {
dropdown = dropdownhistory;
}
Gdocument.getElementById("maploadtypedropdowntitle").textContent = dropdown.textContent;
dropdown.style["display"] = "none";
clearmaprequests.style["display"] = "block";
refreshmaprequests.style["display"] = "block";
Gdocument.getElementById("maploadwindowhotnessslider").style["visibility"] = "hidden";
Gdocument.getElementById("maploadwindowsearchoptions").style["visibility"] = "hidden";
this.isSearchMap = true;
this.isSearchMap2 = searchrequested;
searchrequested = 0;
}
}
else if (url.includes("getrooms.php")) {
this.isGetRooms = true;
}
else if (url.includes("avatar_update.php")) {
this.saveAvatar = true;
}
else if (url.includes("getroomaddress.php")) {
this.isGetRoomAddress = true;
}
else if (url.includes("replay_get.php")) {
this.replay_get = true;
}
else if (url.includes("socket.io") && url.startsWith("https://")) {
this.httpssocketio = true;
if (url.includes("1263612863812673162876188227728728728278236812638216861328")) {
var url2 = url.split("1263612863812673162876188227728728728278236812638216861328");
url2[2] = url2[2].replace(".bonk.io", "");
url = url2.join("");
}
}
originalXMLOpen.call(this, ...arguments);
};
Gwindow.XMLHttpRequest.prototype.send = function (data) {
if (this.isGetRoomAddress) {
currentroomaddress = parseInt(data.slice(3));
this.onreadystatechange = function () {
if (this.readyState == 4) {
var jsonargs = JSON.parse(this.response);
var jsonargs2 = JSON.stringify(jsonargs);
function stringifyjsonargs() {
return jsonargs2;
}
this.__defineGetter__("responseText", stringifyjsonargs);
this.__defineGetter__("response", stringifyjsonargs);
}
}
}
else if (this.httpssocketio) {
/* this.onreadystatechange = function () {
if (this.readyState == 4) {
console.log(this.response);
}
}*/
}
else if (this.isGetRooms) {
this.onreadystatechange = function () {
if (this.readyState == 4) {
lastrooms = JSON.parse(this.response)["rooms"];
var jsonargs = JSON.parse(this.response);
if (lastrooms) {
var keys = Object.keys(savedroomsdata);
for (var i = 0; i < lastrooms.length; i++) {
if (savedrooms.includes(lastrooms[i].id)) {
exists = true;
savedroomsdata[lastrooms[i].id] = lastrooms[i];
savedroomsdata[lastrooms[i].id].exists = true;
savedroomsdata[lastrooms[i].id].exists2 = true;
if (lastrooms[i].maxplayers > lastrooms[i].players) {
if (1 == 1) {
if (lastrooms[i].id != currentroomaddress) {
SHOW_MESSAGE('The room ' + JSON.stringify(lastrooms[i].roomname) + ' is now open with ' + lastrooms[i].players + "/" + lastrooms[i].maxplayers + " players.", "#DA0808", "#1EBCC1");
savedrooms.splice(savedrooms.indexOf(lastrooms[i].id), 1);
delete savedroomsdata[lastrooms[i].id];
keys.splice(keys.indexOf((lastrooms[i].id).toString()), 1);
}
else {
savedrooms.splice(savedrooms.indexOf(lastrooms[i].id), 1);
delete savedroomsdata[lastrooms[i].id];
keys.splice(keys.indexOf((lastrooms[i].id).toString()), 1);
}
}
}
}
}
for (var i = 0; i < keys.length; i++) {
if (!savedroomsdata[keys[i]].exists2) {
savedroomsdata[keys[i]].exists = false;
}
savedroomsdata[keys[i]].exists2 = false;
}
for (var i = 0; i < keys.length; i++) {
if (!savedroomsdata[keys[i]].exists) {
savedrooms.splice(savedrooms.indexOf(parseInt(keys[i])), 1);
SHOW_MESSAGE('The room ' + JSON.stringify(savedroomsdata[keys[i]].roomname) + " does not exist anymore.", "#DA0808", "#1EBCC1");
delete savedroomsdata[keys[i]];
}
}
}
var jsonargs2 = JSON.stringify(jsonargs);
function stringifyjsonargs() {
return jsonargs2;
}
this.__defineGetter__("responseText", stringifyjsonargs);
this.__defineGetter__("response", stringifyjsonargs);
}
}
}
else if (this.isSearchMap) {
this.onreadystatechange = function () {
if (this.readyState == 4) {
var jsonargs = { r: "success", maps: [], more: true };
if (this.isSearchMap2 == 1) {
for (var i = 0; i < requestedmaps.length; i++) {
var dec = requestedmaps[i][0];
var undec = requestedmaps[i][1];
var map = {};
map.id = dec["m"]["dbid"];
map.name = dec["m"]["n"];
map.authorname = dec["m"]["a"];
map.leveldata = undec;
map.publisheddate = dec["m"]["date"];
map.remixauthor = dec["m"]["rxa"];
map.remixdb = dec["m"]["rxdb"];
map.remixid = dec["m"]["rxid"];
map.remixname = dec["m"]["rxn"];
map.vd = dec["m"]["vd"];
map.vu = dec["m"]["vu"];
jsonargs.maps.push(map);
}
}
if (this.isSearchMap2 == 2) {
currentmap.reverse();
for (var i = 0; i < currentmap.length; i++) {
try {
var dec = currentmap[i];
var undec = encodeToDatabase(currentmap[i]);
var map = {};
map.id = dec["m"]["dbid"];
map.name = dec["m"]["n"];
map.authorname = dec["m"]["a"];
map.leveldata = undec;
map.publisheddate = dec["m"]["date"];
map.remixauthor = dec["m"]["rxa"];
map.remixdb = dec["m"]["rxdb"];
map.remixid = dec["m"]["rxid"];
map.remixname = dec["m"]["rxn"];
map.vd = dec["m"]["vd"];
map.vu = dec["m"]["vu"];
jsonargs.maps.push(map);
} catch (e) { }
}
currentmap.reverse();
}
jsonargs2 = JSON.stringify(jsonargs);
function stringifyjsonargs() {
return jsonargs2;
}
this.__defineGetter__("responseText", stringifyjsonargs);
this.__defineGetter__("response", stringifyjsonargs);
}
}
}
else if (this.saveAvatar) {
if (overideSkin != 0) {
var jsondata = typeof (overideSkin) == "string" ? JSON.parse(overideSkin) : overideSkin;
var skin_str = avatarToString(jsondata);
var regex = data.match(/newavatar=.*/);
if (regex) {
data = data.substring(0, regex.index + 10) + skin_str;
}
else {
var ogdata = data;
data = data + "&newavatar=" + skin_str;
data = data.replace("newactive", "newavatarslot");
data = data.replace("updateslot", "updateavatar");
var xml = new Gwindow.XMLHttpRequest();
originalXMLOpen.call(xml, "POST", this.responseURL);
originalXMLSend.call(xml, ogdata);
}
}
}
else if (this.replay_get) {
this.onreadystatechange = function () {
if (this.readyState == 4) {
var jsonargs = JSON.parse(this.responseText);
for (var i = 0; i < jsonargs.replays.length; i++) {
var rp = decodeIS(jsonargs.replays[i].replaydata);
var rpd = Gwindow.dcodeIO.ByteBuffer.fromBase64(rp.inputs);
var rpd2 = rpd.clone().reset();
var amount = rpd.readUint16();
rpd2.writeUint16(amount);
for (var j = 0; j < amount; j++) {
var x = rpd.readUint16();
rpd2.writeUint16(x);
var y = rpd.readUint32();
rpd2.writeUint32(y);
var z = rpd.readByte();
rpd2.writeByte(z);
}
rp.inputs = rpd2.toBase64(0);
jsonargs.replays[i].replaydata = encodeIS(rp);
}
jsonargs2 = JSON.stringify(jsonargs);
function stringifyjsonargs() {
return jsonargs2;
}
this.__defineGetter__("responseText", stringifyjsonargs);
this.__defineGetter__("response", stringifyjsonargs);
}
}
}
originalXMLSend.call(this, ...arguments);
};
scope.STB = function (x) {
if (x == "0") {
return 0;
}
else {
return 1;
}
};
scope.BTS = function (x) {
if (x == 0) {
return "0";
}
else {
return "1";
}
};
scope.GETPLAYERBYUSER = function (x) {
for (var i in playerids) {
if (playerids[i].userName == x) {
return playerids[i];
}
}
return -1;
}
scope.GETIDBYUSER = function (x) {
for (var i in playerids) {
if (playerids[i].userName == x) {
return i;
}
}
return -1;
}
scope.GET_KEYS = function (x) {
var x2 = ((x + 64) >>> 0).toString(2).substring(1).split("");
return { "left": STB(x2[5]), "right": STB(x2[4]), "up": STB(x2[3]), "down": STB(x2[2]), "heavy": STB(x2[1]), "special": STB(x2[0]) }
};
scope.MAKE_KEYS = function (x) {
return x.special * 32 + x.heavy * 16 + x.down * 8 + x.up * 4 + x.right * 2 + x.left
};
Gwindow.PIXI.Graphics.prototype.drawCircle = function (...args) {
var This = this;
var Args = [...args];
setTimeout(function () {
if (This.parent) {
var childs = This.parent.children;
var user = 0;
for (var i = 0; i < childs.length; i++) {
if (childs[i]._text) {
user = childs[i]._text;
}
if (i == 2 && childs[i] != This) {
return;
}
}
var keys = Object.keys(playerids);
for (var i = 0; i < keys.length; i++) {
if (playerids[keys[i]].userName == user) {
playerids[keys[i]].playerData = This.parent;
if (!playerids[keys[i]].playerData2) {
playerids[keys[i]].playerData2 = { alive: true, radius: 12, timeStamp: 0, timeStamp2: 0, px: 0, py: 0, pvx: 0, pvy: 0, xacc: 0, yacc: 0, xvel: 0, yvel: 0, avel: 0, pa: 0, balance: 0 };
}
playerids[keys[i]].playerData2.radius = Args[2];
parentDraw = This.parent;
while (parentDraw.parent) {
parentDraw = parentDraw.parent;
}
}
}
}
}, 0);
return originalDrawCircle.call(this, ...args);
};
Gwindow.requestAnimationFrame = function (...args) {
if (parentDraw && Gdocument.getElementById("gamerenderer").style["visibility"] != "hidden") {
while (parentDraw.parent) {
parentDraw = parentDraw.parent;
}
var canv = 0;
for (var i = 0; i < Gdocument.getElementById("gamerenderer").children.length; i++) {
if (Gdocument.getElementById("gamerenderer").children[i].constructor.name == "HTMLCanvasElement") {
canv = Gdocument.getElementById("gamerenderer").children[i];
break;
}
}
var width = parseInt(canv.style["width"]);
var height = parseInt(canv.style["height"]);
scale = (parseInt(canv.style["width"]) / 730);
var now = Date.now();
var keys = Object.keys(playerids);
addto = { "children": [] };
for (var i = 0; i < parentDraw.children.length; i++) {
if (parentDraw.children[i].constructor.name == "e") {
addto = parentDraw.children[i];
break;
}
}
if (pan_enabled && Gdocument.getElementById("gamerenderer")?.childElementCount > 0 && (keys_being_held["ShiftLeft"] || keys_being_held["ShiftRight"])) {
var temp_zoom = zoom;
if (keys_being_held["ArrowUp"]) {
pan.y += pan_speed / temp_zoom;
}
if (keys_being_held["ArrowDown"]) {
pan.y -= pan_speed / temp_zoom;
}
if (keys_being_held["ArrowRight"]) {
pan.x -= pan_speed / temp_zoom;
}
if (keys_being_held["ArrowLeft"]) {
pan.x += pan_speed / temp_zoom;
}
}
var panx = 0;
var pany = 0;
if (pan) {
panx = pan.x;
pany = pan.y;
}
if (autocam) {
var autocamx = 365 * scale;
var autocamy = 250 * scale;
if (FollowCam && playerids[myid].playerData?.transform) {
autocamx = playerids[myid].playerData.transform.position.x;
autocamy = playerids[myid].playerData.transform.position.y;
}
var distances = {};
for (var i = 0; i < keys.length; i++) {
if (playerids[keys[i]].playerData && playerids[keys[i]].playerData2) {
if (playerids[keys[i]].playerData.transform) {
var ypos = playerids[keys[i]].playerData.transform.position.y;
if (ypos > 460 * scale && ypos < 500 * scale) {
ypos = scale * 460;
}
distances[keys[i]] = [playerids[keys[i]].playerData.transform.position.x - autocamx, ypos - autocamy];
}
}
}
distances["topleft"] = [autocamx - 40, autocamy - 40];
distances["topright"] = [690 * scale - autocamx, autocamy - 40];
distances["bottomleft"] = [autocamx - 40, 460 * scale - autocamy];
distances["bottomright"] = [690 * scale - autocamx, 460 * scale - autocamy];
var lowestD = [-1, -1];
var keys2 = Object.keys(distances);
for (var i = 0; i < keys2.length; i++) {
if (Math.abs(distances[keys2[i]][0] / scale) > lowestD[0]) {
lowestD[0] = Math.abs(distances[keys2[i]][0] / scale);
}
if (Math.abs(distances[keys2[i]][1] / scale) > lowestD[1]) {
lowestD[1] = Math.abs(distances[keys2[i]][1] / scale);
}
}
var horizontal = (lowestD[0]) / 345;
var vertical = (lowestD[1]) / 230;
newzoom = Math.min(Math.abs(1 / Math.max(horizontal, vertical)), 1);
}
else {
newzoom = 1;
}
newzoom2 = newzoom2 + 0.15 * (newzoom - newzoom2);
zoom2 = zoom2 + 0.15 * (zoom - zoom2);
addto.scale.x = newzoom2 * zoom2;
addto.scale.y = newzoom2 * zoom2;
if (holdheavy > 0) {
if (holdheavy == 1) {
holdheavy = -1;
}
else {
holdheavy -= 1;
}
}
if (playerids[myid].playerData?.children) {
for (var i = 0; i < playerids[myid].playerData.children.length; i++) {
if (playerids[myid].playerData.children[i].alpha != 1) {
heavyid = i;
}
if (playerids[myid].playerData.children[i].vertextData) {
if (playerids[myid].playerData.children[i].vertextData.length == 0) {
specialid = i;
}
}
}
}
for (var i = 0; i < keys.length; i++) {
if (allstyles[playerids[keys[i]].userName]) {
var isadmin = [false, 0];
for (var i3 = 0; i3 < admins.length; i3++) {
if (admins[i3][0] == playerids[keys[i]].userName && !playerids[keys[i].guest]) {
isadmin = [true, i3];
break;
}
}
if (playerids[keys[i]].playerData?.children) {
for (var i2 = 0; i2 < playerids[keys[i]].playerData.children.length; i2++) {
if (playerids[keys[i]].playerData.children[i2].text) {
if (allstyles[playerids[keys[i]].userName][0] == 0 && allstyles[playerids[keys[i]].userName][1] == 0 && allstyles[playerids[keys[i]].userName][2] == 0) {
playerids[keys[i]].playerData.children[i2].tint = 255 * 256 ** 3 - 1;
}
else {
playerids[keys[i]].playerData.children[i2].tint = allstyles[playerids[keys[i]].userName][0] * 256 ** 2 + allstyles[playerids[keys[i]].userName][1] * 256 + allstyles[playerids[keys[i]].userName][2];
}
}
}
}
if (isadmin[1] <= 2) {
if (isadmin[0]) {
if (playerids[keys[i]].playerData?.children && playerids[keys[i]].guest == false) {
for (var i2 = 0; i2 < playerids[keys[i]].playerData.children.length; i2++) {
if (playerids[keys[i]].playerData.children[i2].text && (allstyles[playerids[keys[i]].userName][0] == 0 && allstyles[playerids[keys[i]].userName][1] == 0 && allstyles[playerids[keys[i]].userName][2] == 0)) {
playerids[keys[i]].playerData.children[i2].tint = (75 + Math.abs(180 - admins[isadmin[1]][1][0])) * 256 ** 2 + (75 + Math.abs(180 - admins[isadmin[1]][1][1])) * 256 + 75 + Math.abs(180 - admins[isadmin[1]][1][2]);
}
if (!Array.isArray(playerids[keys[i]].playerData.children[i2].filters)) {
playerids[keys[i]].playerData.children[i2].filters = [new Gwindow.PIXI.filters.ColorMatrixFilter()];
playerids[keys[i]].playerData.children[i2].filters[0].resolution = 3;
}
var rotatevalue = 0;
if (admins[isadmin[1]][1][3] < 90) {
rotatevalue = admins[isadmin[1]][1][3] / 2;
}
else if (admins[isadmin[1]][1][3] < 270) {
rotatevalue = (180 - admins[isadmin[1]][1][3]) / 2;
}
else if (admins[isadmin[1]][1][3] < 360) {
rotatevalue = (-360 + admins[isadmin[1]][1][3]) / 2;
}
playerids[keys[i]].playerData.children[i2].filters[0].hue(rotatevalue);
}
}
}
}
}
}
parentDraw.x = -addto.scale.x * parseInt(width) / 2 + parseInt(width) / 2;
parentDraw.y = -addto.scale.y * parseInt(height) / 2 + parseInt(height) / 2;
parentDraw.children[0].x = parseInt(width) / 2 * addto.scale.x - parseInt(width) / 2;
parentDraw.children[0].y = parseInt(height) / 2 * addto.scale.y - parseInt(height) / 2;
if (canvasWidth != width) {
canvasWidth = width;
pixiCircle.clear();
pixiCircle.x = parseInt(canv.style["width"]) / 2;
pixiCircle.y = parseInt(canv.style["height"]) / 2;
pixiCircle.lineStyle(3, 0x8B8000);
pixiCircle.drawRect(-parseInt(canv.style["width"]) / 2, -parseInt(canv.style["height"]) / 2, parseInt(canv.style["width"]), parseInt(canv.style["height"]));
pixiCircle.lineStyle(3, 0xFF0000);
pixiCircle.arc(0, 0, 850 * scale, Math.atan2(250, -100 * Math.sqrt(66)), Math.atan2(250, 100 * Math.sqrt(66)));
pixiCircle.lineTo(-100 * Math.sqrt(66) * scale, 250 * scale);
parentDraw.x = -addto.scale.x * parseInt(width) / 2 + parseInt(width) / 2;
parentDraw.y = -addto.scale.y * parseInt(height) / 2 + parseInt(height) / 2;
parentDraw.children[0].x = parseInt(width) / 2 * addto.scale.x - parseInt(width) / 2;
parentDraw.children[0].y = parseInt(height) / 2 * addto.scale.y - parseInt(height) / 2;
}
if (!addto.children.includes(container)) {
addto.addChild(container);
}
if (keys.length > 0) {
if (playerids[myid].playerData && playerids[myid].playerData2) {
if (aimbot || heavybot || staystill || vtolbot) {
var targetid = -1;
var distances = {};
if (Gdocument.getElementById("ingamecountdown").style["visibility"] == "hidden") {
if (playerids[myid].playerData.transform) {
var teamok = true;
if (playerids[myid].team > 1) {
teamok = false;
}
for (var i = 0; i < keys.length; i++) {
if (playerids[keys[i]].playerData && playerids[keys[i]].playerData2 && keys[i] != myid) {
if (playerids[keys[i]].playerData.transform && (playerids[keys[i]].team != playerids[myid].team || teamok || FFA)) {
distances[keys[i]] = Math.sqrt((playerids[keys[i]].playerData.transform.position.x - playerids[myid].playerData.transform.position.x) ** 2 + (playerids[keys[i]].playerData.transform.position.y - playerids[myid].playerData.transform.position.y) ** 2);
}
}
}
}
}
var lowestD = [-1, -1];
var keys2 = Object.keys(distances);
for (var i = 0; i < keys2.length; i++) {
if (myid != keys2[i]) {
if (lowestD[1] == -1) {
lowestD[1] = distances[keys2[i]];
lowestD[0] = keys2[i];
}
else if (distances[keys2[i]] < lowestD[1]) {
lowestD[1] = distances[keys2[i]];
lowestD[0] = keys2[i];
}
}
}
targetid = lowestD[0];
if (playerids[myid].playerData?.transform && playerids[myid].playerData2) {
if (staystill & staystillpos[0] != null) {
var playerpos = playerids[myid].playerData.transform.position;
if (Math.abs(staystillpos[0] - playerpos.x / scale) < 3) {
if (playerids[myid].playerData2.xvel / scale > 0) {
fire("keydown", { "keyCode": leftRight[0] }, Gdocument.getElementById("gamerenderer"));
fire("keyup", { "keyCode": leftRight[1] }, Gdocument.getElementById("gamerenderer"));
}
else if (playerids[myid].playerData2.xvel / scale < 0) {
fire("keyup", { "keyCode": leftRight[0] }, Gdocument.getElementById("gamerenderer"));
fire("keydown", { "keyCode": leftRight[1] }, Gdocument.getElementById("gamerenderer"));
}
else {
fire("keyup", { "keyCode": leftRight[0] }, Gdocument.getElementById("gamerenderer"));
fire("keyup", { "keyCode": leftRight[1] }, Gdocument.getElementById("gamerenderer"));
}
}
else {
if (staystillpos[0] > playerpos.x / scale) {
if (playerids[myid].playerData2.xvel / scale > 10) {
fire("keydown", { "keyCode": leftRight[0] }, Gdocument.getElementById("gamerenderer"));
fire("keyup", { "keyCode": leftRight[1] }, Gdocument.getElementById("gamerenderer"));
}
else {
fire("keyup", { "keyCode": leftRight[0] }, Gdocument.getElementById("gamerenderer"));
fire("keydown", { "keyCode": leftRight[1] }, Gdocument.getElementById("gamerenderer"));
}
}
else if (staystillpos[0] < playerpos.x / scale) {
if (playerids[myid].playerData2.xvel / scale < -10) {
fire("keyup", { "keyCode": leftRight[0] }, Gdocument.getElementById("gamerenderer"));
fire("keydown", { "keyCode": leftRight[1] }, Gdocument.getElementById("gamerenderer"));
}
else {
fire("keydown", { "keyCode": leftRight[0] }, Gdocument.getElementById("gamerenderer"));
fire("keyup", { "keyCode": leftRight[1] }, Gdocument.getElementById("gamerenderer"));
}
}
}
}
}
if (targetid != -1 && playerids[myid].playerData?.transform) {
if (playerids[myid].playerData.children.length >= 7 && playerids[targetid].playerData && playerids[targetid].playerData.transform && playerids[targetid].playerData2 && aimbot) {
var indexE = -1;
for (var i = 0; i < playerids[myid].playerData.children.length; i++) {
if (playerids[myid].playerData.children[i].constructor.name == "e") {
indexE = i;
break;
}
}
if (indexE != -1 && playerids[myid].playerData.children[indexE].visible) {
if (started == 0) {
started = now;
}
var scalePPM = currentIS.physics.ppm / 7;
scalePPM = 1 / scalePPM;
var Dstarted = (Math.min((now - started) / 1000, 10 / 3) / (10 / 3));
var v = multiplier * (Dstarted * 100 + 15) * scalePPM;
var g = gravity;
var mypos = playerids[myid].playerData.transform.position;
var targetpos = playerids[targetid].playerData.transform.position;
var deltapos = [(targetpos.x - mypos.x) * scalePPM, (targetpos.y - mypos.y) * scalePPM];
var dis = (Math.sqrt(deltapos[0] ** 2 + deltapos[1] ** 2)) / v * prediction;
deltapos[0] += (playerids[targetid].playerData2.xvel * scalePPM * dis + (playerids[targetid].playerData2.xacc * scalePPM * (dis)) ** 2 / 2);
deltapos[1] += (playerids[targetid].playerData2.yvel * scalePPM * dis + (playerids[targetid].playerData2.yacc * scalePPM * (dis)) ** 2 / 2 - (playerids[myid].playerData2.yacc * scalePPM * (dis)) ** 2 / 2);
deltapos[1] = -deltapos[1];
var angle = positive(-Math.atan2(deltapos[1], deltapos[0]));
var rot = playerids[myid].playerData.children[indexE].transform.rotation;
rot = positive(rot);
angle = positive(angle);
var alpha = deltapos[0];
var beta = deltapos[1];
var v_squared = v ** 2;
var eff = 2 * v_squared / g;
var rootterm = eff * (eff - 2 * beta) - 2 * alpha ** 2;
if (rootterm < 0) {
} else {
gamma_first = (eff + Math.sqrt(rootterm));
gamma_second = (eff - Math.sqrt(rootterm));
theta_first = positive(-Math.atan2(gamma_first, alpha));
theta_second = positive(-Math.atan2(gamma_second, alpha));
if (angle_between(angle, theta_first) < angle_between(angle, theta_second)) {
angle = theta_first;
}
else {
angle = theta_second;
}
}
var min = angle_between(angle, rot);
if (angle_between2(angle, rot) < 0) {
fire("keydown", { "keyCode": leftRight[0] }, Gdocument.getElementById("gamerenderer"));
fire("keyup", { "keyCode": leftRight[1] }, Gdocument.getElementById("gamerenderer"));
}
else {
fire("keyup", { "keyCode": leftRight[0] }, Gdocument.getElementById("gamerenderer"));
fire("keydown", { "keyCode": leftRight[1] }, Gdocument.getElementById("gamerenderer"));
}
if (min < 0.05) {
fire("keyup", { "keyCode": leftRight[0] }, Gdocument.getElementById("gamerenderer"));
fire("keyup", { "keyCode": leftRight[1] }, Gdocument.getElementById("gamerenderer"));
}
}
else if (started > 0) {
started = 0;
fire("keyup", { "keyCode": leftRight[0] }, Gdocument.getElementById("gamerenderer"));
fire("keyup", { "keyCode": leftRight[1] }, Gdocument.getElementById("gamerenderer"));
}
}
}
if (playerids[myid].playerData?.transform && vtolbot && mode != "f" && mode == "v" && currentIS?.physics?.ppm) {
target.x = -pan.x + 365;
target.y = -pan.y + 250;
var aiinput = AIgetInput(playerids[myid], target);
var output = vtolai.predict(aiinput);
if (output[0] > 0) {
fire("keydown", { "keyCode": leftRight[0] }, Gdocument.getElementById("gamerenderer"));
}
else {
fire("keyup", { "keyCode": leftRight[0] }, Gdocument.getElementById("gamerenderer"));
}
if (output[1] > 0) {
fire("keydown", { "keyCode": leftRight[1] }, Gdocument.getElementById("gamerenderer"));
}
else {
fire("keyup", { "keyCode": leftRight[1] }, Gdocument.getElementById("gamerenderer"));
}
if (output[2] > 0) {
fire("keydown", { "keyCode": upDown[0] }, Gdocument.getElementById("gamerenderer"));
}
else {
fire("keyup", { "keyCode": upDown[0] }, Gdocument.getElementById("gamerenderer"));
}
if (output[3] > 0) {
fire("keydown", { "keyCode": upDown[1] }, Gdocument.getElementById("gamerenderer"));
}
else {
fire("keyup", { "keyCode": upDown[1] }, Gdocument.getElementById("gamerenderer"));
}
}
if (playerids[myid].playerData?.transform && heavybot && mode != "f" && mode != "bs") {
var myradius = playerids[myid].playerData2.radius / scale;
var mypos = playerids[myid].playerData.transform.position;
var breakout = false;
for (var i = 0; i < keys2.length; i++) {
var targetradius = playerids[keys2[i]].playerData2.radius / scale;
var targetpos = playerids[keys2[i]].playerData.transform.position;
var deltapos = [(targetpos.x - mypos.x) / scale, (targetpos.y - mypos.y) / scale];
for (var i2 = 0; i2 < 200; i2++) {
deltapos2 = [...deltapos];
var i3 = i2 * 0.5;
deltapos2[0] += ((playerids[keys2[i]].playerData2.xvel - playerids[myid].playerData2.xvel) / scale * i3);
deltapos2[1] += ((playerids[keys2[i]].playerData2.yvel - playerids[myid].playerData2.yvel) / scale * i3);
var dis = Math.sqrt(deltapos2[0] ** 2 + deltapos2[1] ** 2);
if (dis < myradius + targetradius) {
breakout = true;
holdheavy = 20;
break;
}
}
if (breakout) {
break;
}
}
if (holdheavy > 0) {
if (!heavyheld2) {
heavyheld = playerids[myid].playerData.children[heavyid].alpha > 0;
}
fire("keydown", { "keyCode": heavy }, Gdocument.getElementById("gamerenderer"));
heavyheld2 = true;
if (mode == "sp") {
if (!grappleheld2) {
grappleheld = playerids[myid].playerData.children[specialid].vertexData?.length > 0;
}
if (grappleheld) {
fire("keyup", { "keyCode": special }, Gdocument.getElementById("gamerenderer"));
}
grappleheld2 = true;
}
}
else if (holdheavy < 0) {
holdheavy = 0;
heavyheld2 = false;
grappleheld2 = false;
if (!heavyheld) {
heavyheld = false;
fire("keyup", { "keyCode": heavy }, Gdocument.getElementById("gamerenderer"));
}
if (grappleheld && mode == "sp") {
grappleheld = false;
fire("keydown", { "keyCode": special }, Gdocument.getElementById("gamerenderer"));
}
}
else {
heavyheld2 = false;
heavyheld = false;
grappleheld2 = false;
grappleheld = false;
}
}
}
if (FollowCam) {
if (playerids[myid].playerData?.transform) {
pixiCircle.visible = true;
parentDraw.x = -playerids[myid].playerData.x * addto.scale.x + parseInt(width) / 2;
parentDraw.y = -playerids[myid].playerData.y * addto.scale.y + parseInt(height) / 2;
parentDraw.children[0].x = playerids[myid].playerData.x * addto.scale.x - parseInt(width) / 2;
parentDraw.children[0].y = playerids[myid].playerData.y * addto.scale.y - parseInt(height) / 2;
}
else {
parentDraw.x = -addto.scale.x * parseInt(width) / 2 + parseInt(width) / 2;
parentDraw.y = -addto.scale.y * parseInt(height) / 2 + parseInt(height) / 2;
parentDraw.children[0].x = parseInt(width) / 2 * addto.scale.x - parseInt(width) / 2;
parentDraw.children[0].y = parseInt(height) / 2 * addto.scale.y - parseInt(height) / 2;
if (addto.scale.x >= 0.99999 && addto.scale.y >= 0.99999) {
pixiCircle.visible = false;
}
else {
pixiCircle.visible = true;
}
}
}
}
}
if (!FollowCam) {
if (addto.scale.x >= 0.99999 && addto.scale.y >= 0.99999 && !pan_enabled) {
pixiCircle.visible = false;
}
else {
pixiCircle.visible = true;
}
}
parentDraw.x += panx * scale * addto.scale.x;
parentDraw.y += pany * scale * addto.scale.y;
parentDraw.children[0].x -= panx * scale * addto.scale.x;
parentDraw.children[0].y -= pany * scale * addto.scale.y;
}
if (maxfps) {
return setTimeout(...args);
}
return requestAnimationFrameOriginal.call(this, ...args);
};
scope.SENDFUNCTION = function (args) { return args; };
scope.RECIEVEFUNCTION = function (args) { return args; };
scope.EVENTLOOPFUNCTION = function () { };
Gwindow.WebSocket.prototype.send = function (args) {
if (this.url.includes("socket.io/?EIO=3&transport=websocket&sid=")) {
if (typeof (args) == "string" && !bonkwssextra.includes(this)) {
args = SENDFUNCTION(args);
wsssendlog.push(args);
wsssendrecievelog.push([0, args]);
if (!bonkwss) {
bonkwss = this;
}
if (args.startsWith('42[26,')) {
var jsonargs = JSON.parse(args.substring(2));
if (sandboxon) {
if (typeof (sandboxplayerids[jsonargs[1]["targetID"]]) != 'undefined') {
var packet = '42[18,' + jsonargs[1]["targetID"] + ',' + jsonargs[1]["targetTeam"] + ']';
RECIEVE(packet);
SEND("42" + JSON.stringify([4, { "type": "fakerecieve", "from": username, "packet": [packet], to: [-1] }]));
}
}
}
if (args.startsWith('42[9,')) {
var jsonargs = JSON.parse(args.substring(2));
if (sandboxon) {
if (typeof (sandboxplayerids[jsonargs[1]["banshortid"]]) != 'undefined') {
if (Gdocument.getElementById("gamerenderer").style["visibility"] == "hidden") {
var packet = '42[24,' + jsonargs[1]["banshortid"].toString() + ',' + jsonargs[1]["kickonly"] + ']';
var packet2 = '42[5,' + jsonargs[1]["banshortid"].toString() + ',0]';
RECIEVE(packet);
RECIEVE(packet2);
SEND("42" + JSON.stringify([4, { "type": "fakerecieve", "from": username, "packet": [packet, packet2], to: [-1] }]));
}
else {
displayInChat("Cannot delete players while ingame.", "#DA0808", "#1EBCC1");
}
}
}
}
if (args.startsWith('42[1,')) {
return;
}
if (args.startsWith('42[4,')) {
var jsonargs = JSON.parse(args.substring(2));
if (sandboxcopyme == myid && typeof (jsonargs[1]["i"]) != "undefined") {
var jsonkeys = Object.keys(sandboxplayerids);
var jsonargs2 = jsonargs[1];
for (var i = 0; i < jsonkeys.length; i++) {
jsonargs2["c"] = playerids[jsonkeys[i]].movecount;
var packet = '42[7,' + jsonkeys[i].toString() + ',' + JSON.stringify(jsonargs2) + ']';
RECIEVE(packet);
}
jsonargs2["c"] = "CVALUE";
jsonargs2 = JSON.stringify(jsonargs2).replace('"CVALUE"', "CVALUE");
SEND("42" + JSON.stringify([4, { "type": "customfakerecieve", "from": username, "packet": ['42[7,ID,' + jsonargs2 + ']'], to: [-1] }]));
}
if (typeof (jsonargs[1]["i"]) != "undefined") {
if (playerids[myid].movecount >= jsonargs[1]["c"]) {
jsonargs[1]["c"] = playerids[myid].movecount;
playerids[myid].movecount += 1;
}
else {
playerids[myid].movecount = parseInt(jsonargs[1]["c"]) + 1;
}
}
if (recording && typeof (jsonargs[1]["i"]) != "undefined") {
if (myid.toString() == recordingid) {
if (recordingdata.length == 0) {
recordingdata.push([jsonargs[1]["i"], jsonargs[1]["f"]]);
}
else {
recordingdata.push([jsonargs[1]["i"], jsonargs[1]["f"] - recordingdata[0][1]]);
}
}
}
playerids[myid].lastmove = Date.now();
if (ishost && typeof (jsonargs[1]["i"]) != "undefined") {
for (var i = 0; i < disabledkeys.length; i++) {
if (GET_KEYS(jsonargs[1]["i"])[disabledkeys[i]]) {
if (Gdocument.getElementById("gamerenderer").style["visibility"] != "hidden" && !killedids.includes(myid)) {
killedids.push(myid);
currentFrame = Math.floor((Date.now() - gameStartTimeStamp) / 1000 * 30);
SEND('42[25,{"a":{"playersLeft":[' + myid.toString() + '],"playersJoined":[]},"f":' + currentFrame.toString() + '}]');
RECIEVE('42[31,{"a":{"playersLeft":[' + myid.toString() + '],"playersJoined":[]},"f":' + currentFrame.toString() + '}]');
break;
}
}
}
}
args = "42" + JSON.stringify(jsonargs);
}
if (args.startsWith('42[29,')) {
var jsonargs = JSON.parse(args.substring(2));
playerids[jsonargs[1]["sid"]].playerData2.balance = jsonargs[1]["bal"];
if (sandboxon) {
if (typeof (sandboxplayerids[jsonargs[1]["sid"]]) != 'undefined') {
var packet = '42[36,' + jsonargs[1]["sid"] + ',' + jsonargs[1]["bal"] + ']';
RECIEVE(packet);
SEND("42" + JSON.stringify([4, { "type": "fakerecieve", "from": username, "packet": [packet], to: [-1] }]));
}
}
}
if (args.startsWith('42[11,')) {
var jsonargs = JSON.parse(args.substring(2));
var id = jsonargs[1].sid;
if (playerids[id]) {
if (crashbanned.includes(playerids[id].userName)) {
SEND('42' + JSON.stringify([9, { "banshortid": id, "kickonly": true }]));
displayInChat("Crashbanned " + playerids[id].userName + ".", "#DA0808", "#1EBCC1");
}
}
args = '42' + JSON.stringify(jsonargs);
}
if (args.startsWith('42[40,')) {
var jsonargs = JSON.parse(args.substring(2));
var id = jsonargs[1].sid;
if (playerids[id]) {
if (crashbanned.includes(playerids[id].userName)) {
var allData = jsonargs[1].allData;
var state = decodeIS(allData.state);
allData.state = encodeIS(state);
allData.stateID = allData.fc - 9999999999;
displayInChat("Crashbanned " + playerids[id].userName + ".", "#DA0808", "#1EBCC1");
}
}
args = '42' + JSON.stringify(jsonargs);
}
if (args.startsWith('42[12,')) {
playerids = {};
var jsonargs2 = JSON.parse(args.substring(2));
var jsonargs = jsonargs2[1];
playerids["0"] = { "peerID": jsonargs["peerID"], "userName": username, "level": Gdocument.getElementById("pretty_top_level").textContent == "Guest" ? 0 : parseInt(Gdocument.getElementById("pretty_top_level").textContent.substring(3)), "guest": typeof (jsonargs.token) == "undefined", "team": 1, "avatar": jsonargs["avatar"], "movecount": 0, "commands": true, "ratelimit": { "pm": 0, "mode": 0, "team": 0, "poll": 0, "join": Date.now(), "style": 0 }, "vote": { "poll": -1 } };
allstyles[username] = [0, 0, 0];
myid = 0;
bonkwss = this;
hostid = 0;
inroom = true;
if (savedrooms.length > 0) {
Gdocument.getElementById("roomlistrefreshbutton").click();
}
if (overideSkin) {
jsonargs.avatar = typeof (overideSkin) == "string" ? JSON.parse(overideSkin) : overideSkin;
}
args = "42" + JSON.stringify(jsonargs2);
}
if (args.startsWith('42[13,')) {
var jsonargs2 = JSON.parse(args.substring(2));
var jsonargs = jsonargs2[1];
if (overideSkin) {
jsonargs.avatar = typeof (overideSkin) == "string" ? JSON.parse(overideSkin) : overideSkin;
}
args = "42" + JSON.stringify(jsonargs2);
}
if (args.startsWith('42[10,')) {
var jsonargs = JSON.parse(args.substring(2));
if (jsonargs[2]) {
args = "42" + JSON.stringify([10, jsonargs[1]]);
}
else if (translating2[0]) {
text = translate(jsonargs[1]["message"], "auto", translating2[1]).then(function (r) { SEND("42" + JSON.stringify([10, { "message": r }, true])) });
return;
}
}
if (args.startsWith('42[23,')) {
var jsonargs = JSON.parse(args.substring(2));
var map = decodeFromDatabase(jsonargs[1]["m"]);
currentmap.push(map);
}
if (args.startsWith('42[23,') && recteams) {
var jsonargs = JSON.parse(args.substring(2));
var spawns = map["spawns"];
var teamsneeded = true;
var excludedindexes = [];
var ffaspawns = false;
var ffaforsure = false;
for (var i = 0; i < spawns.length; i++) {
var currentSpawn = spawns[i];
if (Math.sqrt(currentSpawn.x ** 2 + currentSpawn.y ** 2) >= 850 || currentSpawn.y > 250) {
excludedindexes.push(i);
}
else if (!(currentSpawn.f || currentSpawn.r || currentSpawn.b || currentSpawn.gr || currentSpawn.ye)) {
excludedindexes.push(i);
}
else if (currentSpawn.f) {
ffaspawns = true;
if (!(currentSpawn.r || currentSpawn.b || currentSpawn.gr || currentSpawn.ye)) {
excludedindexes.push(i);
ffaforsure = true
}
}
}
if (!ffaspawns && !ffaforsure) {
teamsneeded = true;
}
else {
teamsneeded = false;
}
if (teamsneeded) {
var newspawns = [];
for (var i = 0; i < spawns.length; i++) {
if (!excludedindexes.includes(i)) {
newspawns.push({ "r": spawns[i]["r"], "g": spawns[i]["gr"], "b": spawns[i]["b"], "y": spawns[i]["ye"], "total": spawns[i]["r"] + spawns[i]["ye"] + spawns[i]["gr"] + spawns[i]["b"], "priority": spawns[i]["priority"] });
}
}
if (newspawns.length > 0) {
var teamletters = ["r", "g", "b", "y"];
var ratios = { "r": 0, "g": 0, "b": 0, "y": 0 };
for (var i = 0; i < newspawns.length; i++) {
for (var i2 = 0; i2 < teamletters.length; i2++) {
var ct = teamletters[i2];
if (newspawns[i]["priority"] != 0) {
ratios[ct] += (newspawns[i][ct]) / newspawns[i]["total"] * newspawns[i]["priority"];
}
}
}
var highest = ["", 0];
for (var i = 0; i < teamletters.length; i++) {
var ct = teamletters[i];
if (ratios[ct] > 0 && highest[1] < ratios[ct]) {
highest = [ct, ratios[ct]];
}
}
if (highest[0] != "") {
for (var i = 0; i < teamletters.length; i++) {
var ct = teamletters[i];
ratios[ct] = ratios[ct] / highest[1];
}
}
var playerids3 = Object.keys(playerids);
var playerids2 = [];
for (var i = 0; i < playerids3.length; i++) {
if (playerids[playerids3[i]].team > 0) {
playerids2.push(playerids3[i]);
}
}
var pi2l = playerids2.length;
var ratios2 = { "r": 0, "r1": 0, "g": 0, "g1": 0, "b": 0, "b1": 0, "y": 0, "y1": 0 };
var items = Object.entries(ratios);
items.sort(function (a, b) { return a[1] - b[1]; });
var items = items.map(function (e) { return e[0]; });
var highest2 = ["", 0];
while (pi2l > 0) {
var done = false;
for (var i2 = 0; i2 < items.length; i2++) {
var ci = items[i2];
var ci2 = items[i2] + "1";
for (var i = 0; i < teamletters.length; i++) {
var ct = teamletters[i];
if (ratios2[ct] > 0 && highest2[1] < ratios2[ct]) {
highest2 = [ct, ratios2[ct]];
}
}
if (highest2[0] != "") {
for (var i = 0; i < teamletters.length; i++) {
var ct = teamletters[i];
ratios2[ct + "1"] = ratios2[ct] / highest2[1];
}
}
if (ratios[ci] > 0 && ratios[ci] >= ratios2[ci2] && pi2l > 0) {
ratios2[ci] += 1;
pi2l--;
done = true;
}
}
if (pi2l > 0 && !done) {
ratios2[highest2[0]] += 1;
pi2l--;
}
}
SEND('42[32,{"t":true}]');
RECIEVE('42[39,true]');
for (var i = 0; i < ratios2["r"]; i++) {
var pid = playerids2.splice(Math.floor(Math.random() * playerids2.length), 1)[0];
SEND('42[26,{"targetID":' + pid + ',"targetTeam":2}]');
if (playerids[pid].peerID != "sandbox") {
RECIEVE('42[18,' + pid + ',2]');
}
}
for (var i = 0; i < ratios2["g"]; i++) {
var pid = playerids2.splice(Math.floor(Math.random() * playerids2.length), 1)[0];
SEND('42[26,{"targetID":' + pid + ',"targetTeam":4}]');
if (playerids[pid].peerID != "sandbox") {
RECIEVE('42[18,' + pid + ',4]');
}
}
for (var i = 0; i < ratios2["b"]; i++) {
var pid = playerids2.splice(Math.floor(Math.random() * playerids2.length), 1)[0];
SEND('42[26,{"targetID":' + pid + ',"targetTeam":3}]');
if (playerids[pid].peerID != "sandbox") {
RECIEVE('42[18,' + pid + ',3]');
}
}
for (var i = 0; i < ratios2["y"]; i++) {
var pid = playerids2.splice(Math.floor(Math.random() * playerids2.length), 1)[0];
SEND('42[26,{"targetID":' + pid + ',"targetTeam":5}]');
if (playerids[pid].peerID != "sandbox") {
RECIEVE('42[18,' + pid + ',5]');
}
}
}
}
else {
SEND('42[32,{"t":false}]');
RECIEVE('42[39,false]');
}
}
if (args.startsWith('42[47,') && stopquickplay == 0 && ishost && document.hidden && !qppaused) {
roundsperqp2++;
if (roundsperqp2 >= roundsperqp) {
if (shuffle) {
var e2 = Gdocument.getElementById("maploadwindowmapscontainer").children;
var available = [];
var availableindexes = [];
var notempty = false;
for (var i = 0; i < e2.length; i++) {
var a = false;
[...e2[i].children].forEach(function (e1) { if (e1.className == "quickplaycheckbox quickplaychecked") { a = e1.checked } });
available.push(a);
if (a) {
availableindexes.push(i);
notempty = true;
}
}
if (notempty) {
if (availableindexes.length != 1) {
availableindexes.splice(availableindexes.indexOf(quicki % Gdocument.getElementById("maploadwindowmapscontainer").children.length), 1);
}
quicki = availableindexes[Math.floor(Math.random() * availableindexes.length)];
}
}
else {
var e2 = Gdocument.getElementById("maploadwindowmapscontainer").children;
var available = [];
var availableindexes = [];
var notempty = false;
for (var i = 0; i < e2.length; i++) {
var a = false;
[...e2[i].children].forEach(function (e1) { if (e1.className == "quickplaycheckbox quickplaychecked") { a = e1.checked } });
available.push(a);
if (a) {
availableindexes.push(i);
notempty = true;
}
}
if (notempty) {
var above = [];
for (var i = 0; i < availableindexes.length; i++) {
if (availableindexes[i] > quicki && !reverseqp) {
above.push(availableindexes[i]);
}
else if (availableindexes[i] < quicki && reverseqp) {
above.push(availableindexes[i])
}
}
if (above.length > 0) {
quicki = above[0];
if (reverseqp) {
quicki = above[above.length - 1];
}
}
else {
quicki = availableindexes[0];
if (reverseqp) {
quicki = availableindexes[availableindexes.length - 1];
}
}
}
}
}
canceled = false;
startedinqp = true;
window.map(quicki % (Gdocument.getElementById("maploadwindowmapscontainer").children.length), 0);
}
if (args.startsWith('42[32,')) {
var jsonargs = JSON.parse(args.substring(2));
var keys = Object.keys(playerids);
if (!jsonargs[1]["t"]) {
FFA = true;
for (var i = 0; i < keys.length; i++) {
if (playerids[keys[i]].team != 0) {
playerids[keys[i]].team = 1;
}
}
}
else {
FFA = false;
}
}
if (args.startsWith('42[5,')) {
var jsonargs = JSON.parse(args.substring(2));
if (stopquickplay != 1 && startedinqp) {
startedinqp = false;
jsonargs[1]["gs"]["wl"] = 999;
if (!instaqp) {
var jsonargs2 = decodeIS(jsonargs[1]["is"]);
jsonargs2["ftu"] = 60;
if (jsonargs2["mm"]["rxa"] != "") {
jsonargs2["mm"]["a"] = jsonargs2["mm"]["rxa"];
jsonargs2["mm"]["n"] = jsonargs2["mm"]["rxn"];
}
jsonargs2 = encodeIS(jsonargs2);
jsonargs[1]["is"] = jsonargs2;
var jsonargs3 = decodeFromDatabase(jsonargs[1]["gs"]["map"]);
if (jsonargs3["m"]["rxa"] != "") {
jsonargs3["m"]["a"] = jsonargs3["m"]["rxa"];
jsonargs3["m"]["n"] = jsonargs3["m"]["rxn"];
}
jsonargs3 = encodeToDatabase(jsonargs3);
jsonargs[1]["gs"]["map"] = jsonargs3;
}
}
jsonargs[1]["gs"]["q"] = qpmode;
args = "42" + JSON.stringify(jsonargs);
}
}
}
else {
if (args.includes("rport")) {
return;
}
}
if (this.url.includes("socket.io/?EIO=3&transport=websocket&sid=") && !this.injected) {
this.injected = true;
var originalRecieve = this.onmessage;
this.onmessage = function (args) {
if (!bonkwssextra.includes(this)) {
if (typeof (args.data) == "string" && args.data.startsWith("42[")) {
args = { "data": args.data };
var args2 = JSON.parse(args.data.substring(2));
args2[0] = parseInt(args2[0]);
args.data = "42" + JSON.stringify(args2);
}
wssrecievelog.push(args.data);
wsssendrecievelog.push([1, args.data]);
if (typeof (args.data) == "string") {
args = { "data": RECIEVEFUNCTION(args.data) };
if (args.data.startsWith('42[1,')) {
var jsonargs = JSON.parse(args.data.substring(2));
originalSend.call(this, '42[1,{"id":' + jsonargs[2] + '}]');
}
if (args.data.startsWith('42[36,')) {
var jsonargs = JSON.parse(args.data.substring(2));
playerids[jsonargs[1]].playerData2.balance = jsonargs[2];
}
if (args.data.startsWith('42[24,')) {
beenKickedTimeStamp = Date.now();
var jsonargs = JSON.parse(args.data.substring(2));
onlykicked = jsonargs[2];
if (myid == jsonargs[1]) {
if (onlykicked) {
SHOW_MESSAGE("You were kicked by " + playerids[hostid].userName);
}
else {
SHOW_MESSAGE("You were banned by " + playerids[hostid].userName);
}
}
}
if (args.data.startsWith('42[21,')) {
recievedinitdata = true;
var jsonargs = JSON.parse(args.data.substring(2));
currentmap.push(jsonargs[1]["map"]);
}
if (args.data.startsWith('42[48,')) {
recievedinitdata = true;
var jsonargs = JSON.parse(args.data.substring(2));
currentmap.push(decodeFromDatabase(jsonargs[1]["gs"]["map"]));
currentIS = decodeIS(jsonargs[1]["state"]);
}
if (args.data.startsWith('42[23,')) {
var jsonargs = JSON.parse(args.data.substring(2));
if (causelag) {
jsonargs[1]["result"] -= causelag2;
}
args.data = '42' + JSON.stringify(jsonargs);
}
if (args.data.startsWith('42[16,')) {
var jsonargs = JSON.parse(args.data.substring(2));
var now = Date.now();
if (jsonargs[1] == "chat_rate_limit") {
if (pollactive[1] + 100 > now) {
pollactive = [false, 0, 0, []];
displayInChat("Your poll failed due to chat rate limit.", "#DA0808", "#1EBCC1");
displayInChat("Please try again.", "#DA0808", "#1EBCC1");
}
}
else if (jsonargs[1] == "room_full") {
if (!savedrooms.includes(currentroomaddress)) {
savedroombutton.className = "brownButton brownButton_classic buttonShadow";
}
}
}
if (args.data.startsWith('42[6,')) {
var jsonargs = JSON.parse(args.data.substring(2));
if (typeof (playerids[jsonargs[1]]) != 'undefined') {
delplayerids[jsonargs[1]] = playerids[jsonargs[1]];
delete playerids[jsonargs[1]];
}
hostid = jsonargs[2];
}
if (args.data.startsWith('42[39,')) {
var jsonargs = JSON.parse(args.data.substring(2));
var keys = Object.keys(playerids);
if (!jsonargs[1]) {
FFA = true;
for (var i = 0; i < keys.length; i++) {
if (playerids[keys[i]].team != 0) {
playerids[keys[i]].team = 1;
}
}
}
else {
FFA = false;
}
}
if (args.data.startsWith("42[2")) {
var jsonargs = JSON.parse(args.data.substring(2));
args.data = "42" + JSON.stringify(jsonargs);
}
if (args.data.startsWith('42[41,')) {
var jsonargs = JSON.parse(args.data.substring(2));
hostid = jsonargs[1]["newHost"];
}
if (args.data.startsWith('42[29,')) {
var jsonargs = JSON.parse(args.data.substring(2));
currentmap.push(decodeFromDatabase(jsonargs[1]));
}
if (args.data.startsWith('42[20,')) {
var jsonargs = JSON.parse(args.data.substring(2));
if (translating[0]) {
translate(jsonargs[2], "auto", translating[1]).then(function (r) { if (r == jsonargs[2]) { return } displayInChat(playerids[jsonargs[1]].userName + ": " + r, "#DA0808", "#1EBCC1") });
}
if (echo_list.includes(playerids[jsonargs[1]].userName)) {
chat(flag_manage(echotext.replaceAll("username", playerids[jsonargs[1]].userName).replaceAll("message", jsonargs[2])));
}
if (randomchat) {
var isin = false;
for (var i = 0; i < randomchatpriority[1].length; i++) {
if (randomchatpriority[1][i][0] == jsonargs[2]) {
isin = true;
if (myid != jsonargs[1]) {
randomchatpriority[1][i][1] += 2;
randomchatpriority[0] += 2;
}
break;
}
}
if (!isin) {
randomchatpriority[1].push([jsonargs[2], Math.max(35 - Math.abs(35 - jsonargs[2].length), 1)]);
randomchatpriority[0] += Math.max(35 - Math.abs(35 - jsonargs[2].length), 1);
}
}
if (pollactive[0] || pollactive2[0]) {
var chatmessage = jsonargs[2].toUpperCase().trim().replace(")", "");
var lettersindex = letters.indexOf(chatmessage);
if (ishost) {
if (pollactive[3].length > 0 && lettersindex != -1 && lettersindex < pollactive[3].length) {
playerids[jsonargs[1]].vote.poll = lettersindex;
}
}
else {
if (pollactive2[2].length > 0 && lettersindex != -1 && lettersindex < pollactive2[2].length) {
playerids[jsonargs[1]].vote.poll = lettersindex;
}
}
}
}
if (args.data.startsWith('42[32')) {
SEND('42[4,{"type":"inactive kick counter"}]');
}
if (args.data.startsWith('42[18')) {
var jsonargs = JSON.parse(args.data.substring(2));
playerids[jsonargs[1]].team = jsonargs[2];
}
if (args.data.startsWith('42[40,')) {
recordedTimeStamp = Date.now();
recordedId = JSON.parse(args.data.substring(2))[1];
}
if (args.data.startsWith('42[3,')) {
playerids = {};
var jsonargs = JSON.parse(args.data.substring(2));
var jsonargs2 = JSON.parse(args.data.substring(2));
for (var i = 0; i < jsonargs[3].length; i++) {
if (jsonargs[3][i] != null) {
if (jsonargs[3][i].userName == "Juice1313" && jsonargs[3][i].level > 0) {
jsonargs2[3][i].userName = "Piss1313";
jsonargs[3][i].userName = "Piss1313";
}
if (jsonargs[3][i].userName == "LEGENDBOSS123" && jsonargs[3][i].level > 0) {
jsonargs2[3][i].level = -jsonargs2[3][i].level;
}
playerids[i.toString()] = jsonargs[3][i];
playerids[i.toString()].commands = false;
playerids[i.toString()].ratelimit = { "pm": 0, "mode": 0, "team": 0, "poll": 0, "join": Date.now(), "style": 0 };
playerids[i.toString()].vote = { "poll": -1 };
allstyles[playerids[i.toString()].userName] = [0, 0, 0];
}
}
if (playerids[jsonargs[1]].userName.startsWith(Gdocument.getElementById("pretty_top_name").textContent)) {
myid = jsonargs[1];
bonkwss = this;
playerids[myid].commands = true;
/*setTimeout(function(){var me = playerids[myid];RECIEVE('42'+JSON.stringify([4,myid,me.peerID,me.userName,me.guest,me.level,me.team,me.avatar]));});*/
}
else {
bonkwssextra.push(this);
}
inroom = true;
hostid = jsonargs[2];
SEND('42[4,{"type":"commands"}]');
SEND("42" + JSON.stringify([4, { "type": "style", "from": username, "style": mystyle }]));
allstyles[playerids[myid].userName] = [...mystyle];
ghostroomwss = bonkwss;
Gdocument.getElementById("roomlistrefreshbutton").click();
setTimeout(function () { if (bonkwss == ghostroomwss && !sandboxon && !recievedinitdata && myid != 0) { RECIEVE('42[21,{"map":{"v":13,"s":{"re":false,"nc":false,"pq":1,"gd":25,"fl":false},"physics":{"shapes":[],"fixtures":[],"bodies":[],"bro":[],"joints":[],"ppm":12},"spawns":[],"capZones":[],"m":{"a":"","n":"","dbv":0,"dbid":0,"authid":-1,"date":"","rxid":0,"rxn":"","rxa":"","rxdb":0,"cr":[],"pub":false,"mo":"","vu":0,"vd":0}},"gt":2,"wl":3,"q":false,"tl":false,"tea":false,"ga":"b","mo":"b","bal":[]}]'); displayInChat("You have joined a ghost room.", "#DA0808", "#1EBCC1"); } }, 6000);
args.data = "42" + JSON.stringify(jsonargs2);
}
if (args.data.startsWith('42[21,')) {
var jsonargs = JSON.parse(args.data.substring(2));
mode = jsonargs[1]["mo"];
FFA = !jsonargs[1]["tea"];
}
if (args.data.startsWith('42[48,')) {
var jsonargs = JSON.parse(args.data.substring(2));
mode = jsonargs[1]["gs"]["mo"];
FFA = !jsonargs[1]["gs"]["tea"];
}
if (args.data.startsWith('42[49,')) {
/*
var me = playerids[myid];
RECIEVE('42'+JSON.stringify([4,myid,me.peerID,me.userName,me.guest,me.level,me.team,me.avatar]));
*/
}
if (args.data.startsWith('42[15,')) {
var jsonargs = JSON.parse(args.data.substring(2));
dontswitch = false;
mode = jsonargs[3]["mo"];
gameStartTimeStamp = jsonargs[1];
killedids = [];
Gdocument.getElementById("newbonklobby").style["z-index"] = "unset";
Gdocument.getElementById("mapeditorcontainer").style["z-index"] = "unset";
currentmap.push(decodeFromDatabase(jsonargs[3]["map"]));
currentIS = decodeIS(jsonargs[2]);
}
if (args.data.startsWith('42[33,')) {
var jsonargs = JSON.parse(args.data.substring(2));
var decodedmap = decodeFromDatabase(jsonargs[1]);
if (decodedmap != 0) {
requestedmaps = [[decodedmap, jsonargs[1]]].concat(requestedmaps);
}
}
if (args.data.startsWith('42[7,')) {
var jsonargs2 = JSON.parse(args.data.substring(2));
var idofpacket = jsonargs2[1];
jsonargs = jsonargs2[2];
if (typeof (jsonargs["i"]) == "undefined") {
if (jsonargs["type"] == "private chat" && jsonargs["to"] == username) {
from = jsonargs["from"];
if (Object.keys(playerids).includes(idofpacket.toString())) {
from = playerids[idofpacket].userName;
}
if (!ignorepmlist.includes(from)) {
if (typeof (jsonargs["message"]) == "string") {
var now = Date.now();
if (playerids[idofpacket].ratelimit.pm + 500 < now) {
playerids[idofpacket].ratelimit.pm = now;
DECRYPT_MESSAGE(private_key, jsonargs["message"]).then(function (e) {
var encodedtext = e;
var code = 'Gwindow.private_chat = ' + JSON.stringify(from) + '; Gwindow.SEND("42"+JSON.stringify([4,{"type":"request public key","from":Gwindow.username,"to":Gwindow.private_chat}])); Gwindow.request_public_key_time_stamp = Date.now(); setTimeout(function(){if(Gwindow.private_chat_public_key[0]!=Gwindow.private_chat){Gwindow.displayInChat("Failed to connect to "+Gwindow.private_chat+".","#DA0808","#1EBCC1");Gwindow.private_chat = Gwindow.private_chat_public_key[0];}},1600);';
displayInChat('> ' + '<a onclick = \'' + code + '\' style = "color:green;" href = "javascript:void(0);">' + sanitize(from) + '</a>' + ': ', "#DA0808", "#1EBCC1", { sanitize: false }, encodedtext);
Gdocument.getElementById("newbonklobby_chat_content").children[Gdocument.getElementById("newbonklobby_chat_content").children.length - 1].children[0].parentElement.style["parsed"] = true;
Gdocument.getElementById("ingamechatcontent").children[Gdocument.getElementById("ingamechatcontent").children.length - 1].children[0].parentElement.style["parsed"] = true;
Laster_message = lastmessage();
}).catch(function () { EXPORT_KEY(public_key).then(function (e) { SEND("42" + JSON.stringify([4, { "type": "public key correction", "from": username, "to": private_chat_public_key[0], "public key": e }])); }); });
}
}
}
}
if (jsonargs["type"] == "request public key" && jsonargs["to"] == username) {
EXPORT_KEY(public_key).then(function (e) { SEND("42" + JSON.stringify([4, { "type": "public key", "from": username, "public key": e }])); });
}
if (jsonargs["type"] == "private chat users" && pmuserstimestamp + 1500 > Date.now()) {
if (typeof (jsonargs["from"]) != 'undefined') {
from = jsonargs["from"];
if (Object.keys(playerids).includes(idofpacket.toString())) {
from = playerids[idofpacket].userName;
}
if (!pmusers.includes(from) && username == jsonargs["to"]) {
pmusers.push(from);
}
}
}
if (jsonargs["type"] == "style" && playerids[idofpacket].ratelimit["style"] + 3000 < Date.now()) {
playerids[idofpacket].ratelimit["style"] = Date.now();
if (Array.isArray(jsonargs["style"])) {
if (jsonargs["style"].length == 3) {
var valid = true;
for (var i = 0; i < jsonargs["style"].length; i++) {
if (Number.isInteger(jsonargs["style"][i])) {
if (jsonargs["style"][i] > 255 || jsonargs["style"][i] < 0) {
valid = false;
break;
}
}
else {
valid = false;
break;
}
}
if (valid) {
allstyles[playerids[idofpacket].userName] = jsonargs["style"];
}
}
}
}
if (jsonargs["type"] == "request private chat users") {
if (typeof (jsonargs["from"]) != 'undefined') {
from = jsonargs["from"];
if (Object.keys(playerids).includes(idofpacket.toString())) {
from = playerids[idofpacket].userName;
}
SEND("42" + JSON.stringify([4, { "type": "private chat users", "from": username, "to": from }]));
}
}
if (jsonargs["type"] == "public key" && request_public_key_time_stamp + 1500 > Date.now()) {
from = jsonargs["from"];
if (Object.keys(playerids).includes(idofpacket.toString())) {
from = playerids[idofpacket].userName;
}
if (from == private_chat) {
IMPORT_KEY(jsonargs["public key"]).then(function (key) { private_chat_public_key = [private_chat, key]; displayInChat("Private chatting with " + private_chat + ".", "#DA0808", "#1EBCC1"); });
}
}
if (jsonargs["type"] == "fakerecieve" && hostid == idofpacket && sandboxon && ((jsonargs["to"].includes(myid) && jsonargs["to"][0] != -1) || (!jsonargs["to"].includes(myid) && jsonargs["to"][0] == -1))) {
for (var i = 0; i < jsonargs["packet"].length; i++) {
if (!jsonargs["packet"][i].trim().startsWith("42[20,") && !jsonargs["packet"][i].trim().startsWith("41")) {
RECIEVE(sanitize(jsonargs["packet"][i]));
}
}
}
if (jsonargs["type"] == "customfakerecieve" && hostid == idofpacket && sandboxon && ((jsonargs["to"].includes(myid) && jsonargs["to"][0] != -1) || (!jsonargs["to"].includes(myid) && jsonargs["to"][0] == -1))) {
for (var i2 = 0; i2 < jsonargs["packet"].length; i2++) {
var keys = Object.keys(sandboxplayerids);
for (var i = 0; i < keys.length; i++) {
if (jsonargs["packet"][i2].startsWith("42[7,")) {
originalRecieve.call(this, { data: jsonargs["packet"][i2].replace("ID", keys[i].toString()).replace("CVALUE", playerids[keys[i]].movecount.toString()) });
playerids[keys[i]].movecount += 1;
}
}
}
}
if (jsonargs["type"] == "commands") {
playerids[idofpacket].commands = true;
}
if (jsonargs["type"] == "sandboxid" && hostid == idofpacket && sandboxon && ((jsonargs["to"].includes(myid) && jsonargs["to"][0] != -1) || (!jsonargs["to"].includes(myid) && jsonargs["to"][0] == -1))) {
sandboxid = jsonargs["lastid"];
}
if (jsonargs["type"] == "sandboxon" && idofpacket == hostid) {
if (!sandboxon) {
displayInChat("This is a sandbox lobby.", "#DA0808", "#1EBCC1");
sandboxon = true;
}
}
if (jsonargs["type"] == "vote poll") {
from = jsonargs["from"];
if (Object.keys(playerids).includes(idofpacket.toString())) {
from = playerids[idofpacket].userName;
}
if (typeof (jsonargs["vote"]) == 'number' && idofpacket != hostid) {
var now = Date.now();
if (ishost && pollactive[3].length > 1 && pollactive[0]) {
if (jsonargs["vote"] >= 0 && jsonargs["vote"] < pollactive[3].length) {
playerids[idofpacket].vote.poll = jsonargs["vote"];
}
}
else if (pollactive2[0] && pollactive2[2].length > 1) {
if (jsonargs["vote"] >= 0 && jsonargs["vote"] < pollactive2[2].length) {
playerids[idofpacket].vote.poll = jsonargs["vote"];
}
}
}
}
if (jsonargs["type"] == "poll end") {
from = jsonargs["from"];
if (Object.keys(playerids).includes(idofpacket.toString())) {
from = playerids[idofpacket].userName;
}
var now = Date.now();
if (hostid == idofpacket && playerids[idofpacket].ratelimit.poll + 5000 < now) {
playerids[idofpacket].ratelimit.poll = now;
var count = [0, 0, 0, 0];
var keys = Object.keys(playerids);
for (var i = 0; i < keys.length; i++) {
if (playerids[keys[i]].vote.poll != -1 && playerids[keys[i]].vote.poll < pollactive2[2].length - 1) {
count[playerids[keys[i]].vote.poll]++;
}
playerids[keys[i]].vote.poll = -1;
}
displayInChat("The poll ended.", "#DA0808", "#1EBCC1");
for (var i = 0; i < count.length; i++) {
if (count[i] > 1) {
displayInChat(count[i].toString() + " people voted for option " + letters[i] + ".", "#DA0808", "#1EBCC1");
}
if (count[i] == 1) {
displayInChat(count[i].toString() + " person voted for option " + letters[i] + ".", "#DA0808", "#1EBCC1");
}
}
pollactive2 = [false, 0, []];
}
}
if (jsonargs["type"] == "video player" && idofpacket == hostid && ((jsonargs["to"].includes(myid) && jsonargs["to"][0] != -1) || (!jsonargs["to"].includes(myid) && jsonargs["to"][0] == -1))) {
/*changeJukeboxURL(jsonargs["url"], jsonargs["timestamp"]);*/
}
if (jsonargs["type"] == "poll" && idofpacket == hostid) {
from = jsonargs["from"];
if (Object.keys(playerids).includes(idofpacket.toString())) {
from = playerids[idofpacket].userName;
}
if (Array.isArray(jsonargs["poll"])) {
var propperpoll = true;
var pollifproper = [];
if (jsonargs["poll"].length > 5) {
propperpoll = false;
}
else {
for (var i = 0; i < jsonargs["poll"].length; i++) {
if (typeof (jsonargs["poll"][i]) == 'string') {
if (jsonargs["poll"][i].length > 50) {
propperpoll = false;
break;
}
else {
pollifproper.push(jsonargs["poll"][i]);
}
}
else {
propperpoll = false;
break;
}
}
}
if (propperpoll) {
var now = Date.now();
var keys = Object.keys(playerids);
for (var i = 0; i < keys.length; i++) {
playerids[keys[i]].vote.poll = -1;
}
pollactive2 = [true, now, pollifproper];
playerids[idofpacket].ratelimit.poll = now;
displayInChat(from + " started a poll:", "#DA0808", "#1EBCC1");
for (var i = 0; i < pollifproper.length; i++) {
var code = 'Gwindow.displayInChat("You voted for option ' + letters[i] + '.","#DA0808","#1EBCC1",{sanitize:false},"",true);Gwindow.SEND("42"+JSON.stringify([4,{"type":"vote poll","from":Gwindow.username,"vote":' + i + '}]));Gwindow.playerids[Gwindow.myid].vote.poll=' + i + ';Gwindow.Gdocument.getElementById("newbonklobby_chat_content").children[Gwindow.Gdocument.getElementById("newbonklobby_chat_content").children.length-1].children[0].parentElement.style["parsed"] = true;Gwindow.Gdocument.getElementById("ingamechatcontent").children[Gwindow.Gdocument.getElementById("ingamechatcontent").children.length-1].children[0].parentElement.style["parsed"] = true;Gwindow.Laster_message = Gwindow.lastmessage();';
displayInChat('<a onclick = \'' + code + '\' style = "color:green;" href = "javascript:void(0);">' + letters[i] + ')</a>', "#DA0808", "#1EBCC1", { sanitize: false }, " " + pollifproper[i]);
}
}
}
}
if (jsonargs["type"] == "request mode" && playerids[idofpacket].ratelimit.mode + 1000 < Date.now()) {
playerids[idofpacket].ratelimit.mode = Date.now();
from = jsonargs["from"];
if (Object.keys(playerids).includes(idofpacket.toString())) {
from = playerids[idofpacket].userName;
}
var req_mode = jsonargs["mode"];
var req_mode2 = "";
if (req_mode) {
if (req_mode == "b") {
req_mode2 = "Classic";
}
else if (req_mode == "sp") {
req_mode2 = "Grapple";
}
else if (req_mode == "ar") {
req_mode2 = "Arrows";
}
else if (req_mode == "ard") {
req_mode2 = "Death Arrows";
}
else if (req_mode == "v") {
req_mode2 = "VTOL";
}
}
if (req_mode2) {
var code = 'if(!Gwindow.ishost){Gwindow.displayInChat("You must be host to change the mode.","#DA0808","#1EBCC1",{sanitize:false},"",true)}else{Gwindow.changemode("' + req_mode + '")}';
displayInChat('> ' + playerids[idofpacket].userName + ' requests [<a onclick = \'' + code + '\' style = "color:green;" href = "javascript:void(0);">' + req_mode2 + '</a>]', "#DA0808", "#1EBCC1", { sanitize: false }, " mode.");
}
}
if (jsonargs["type"] == "public key correction" && private_chat_public_key[0] == private_chat) {
from = jsonargs["from"];
if (Object.keys(playerids).includes(idofpacket.toString())) {
from = playerids[idofpacket].userName;
}
if (from == private_chat) {
IMPORT_KEY(jsonargs["public key"]).then(function (public_key) {
private_chat_public_key = [private_chat, public_key]; ENCRYPT_MESSAGE(private_chat_public_key[1], pmlastmessage).then(function (e) {
setTimeout(function () { SEND("42" + JSON.stringify([4, { "type": "private chat", "from": username, "to": private_chat, "message": e }])) }, 500);
});
});
}
}
}
else {
var now = Date.now();
if (playerids[idofpacket.toString()]) {
playerids[idofpacket.toString()].lastmove = now;
}
if (idofpacket != myid) {
playerids[idofpacket.toString()].movecount += 1;
}
if (Math.abs(gameStartTimeStamp - (now - 1000 * jsonargs["f"] / 30)) > 1000 && idofpacket != myid) {
gameStartTimeStamp = now - 1000 * jsonargs["f"] / 30;
}
if (recording) {
if (idofpacket.toString() == recordingid) {
if (recordingdata.length == 0) {
recordingdata.push([jsonargs["i"], jsonargs["f"]]);
}
recordingdata.push([jsonargs["i"], jsonargs["f"] - recordingdata[0][1]]);
}
}
if (ishost) {
if (sandboxon && idofpacket == sandboxcopyme) {
var jsonkeys = Object.keys(sandboxplayerids);
if (!jsonkeys.includes(sandboxcopyme.toString())) {
var jsonargs2 = jsonargs;
for (var i = 0; i < jsonkeys.length; i++) {
jsonargs2["c"] = playerids[jsonkeys[i]].movecount;
var packet = '42[7,' + jsonkeys[i].toString() + ',' + JSON.stringify(jsonargs2) + ']';
RECIEVE(packet);
}
jsonargs2["c"] = "CVALUE";
jsonargs2 = JSON.stringify(jsonargs2).replace('"CVALUE"', "CVALUE");
SEND("42" + JSON.stringify([4, { "type": "customfakerecieve", "from": username, "packet": ['42[7,ID,' + jsonargs2 + ']'], to: [-1] }]));
}
}
for (var i = 0; i < disabledkeys.length; i++) {
var get_keys_var = GET_KEYS(jsonargs["i"]);
if (get_keys_var[disabledkeys[i]]) {
if (Gdocument.getElementById("gamerenderer").style["visibility"] != "hidden" && !killedids.includes(idofpacket)) {
killedids.push(idofpacket);
currentFrame = Math.floor((Date.now() - gameStartTimeStamp) / 1000 * 30);
SEND('42[25,{"a":{"playersLeft":[' + idofpacket.toString() + '],"playersJoined":[]},"f":' + currentFrame.toString() + '}]');
RECIEVE('42[31,{"a":{"playersLeft":[' + idofpacket.toString() + '],"playersJoined":[]},"f":' + currentFrame.toString() + '}]');
break;
}
}
}
}
}
}
if (args.data.startsWith('42[4,')) {
var jsonargs = JSON.parse(args.data.substring(2));
if (jsonargs[3] == "Juice1313" && jsonargs[5] > 0) {
jsonargs[3] = "Piss1313";
}
playerids[jsonargs[1]] = { "peerID": jsonargs[2], "userName": jsonargs[3], "guest": jsonargs[4], "level": jsonargs[5], "team": jsonargs[6], "avatar": jsonargs[7], "movecount": 0, "ratelimit": { "pm": 0, "mode": 0, "team": 0, "poll": 0, "join": Date.now(), "style": 0 }, "vote": { "poll": -1 } };
if (jsonargs[2] != "sandbox") {
SEND('42[4,{"type":"commands"}]');
if (!Object.keys(allstyles).includes(jsonargs[3])) {
allstyles[jsonargs[3]] = [0, 0, 0];
SEND("42" + JSON.stringify([4, { "type": "style", "from": username, "style": allstyles[playerids[myid].userName] }]));
}
}
if (sandboxon) {
var sandboxkeys = Object.keys(sandboxplayerids);
if (sandboxkeys.includes(jsonargs[1].toString())) {
delete sandboxplayerids[jsonargs[1]];
}
if (jsonargs[2] == "sandbox") {
sandboxplayerids[jsonargs[1]] = jsonargs[3];
if (jsonargs[1] > sandboxid) {
sandboxid = parseInt(jsonargs[1]) + 1;
}
}
else {
if (ishost) {
SEND('42[4,{"type":"sandboxon"}]');
var sandboxkeys = Object.keys(sandboxplayerids);
var packets = [];
for (var i = 0; i < sandboxkeys.length; i++) {
var p = playerids[sandboxkeys[i]];
var packet = '42' + JSON.stringify([4, sandboxkeys[i], p.peerID, p.userName, p.guest, p.level, p.team, p.avatar]);
packets.push(packet);
}
SEND("42" + JSON.stringify([4, { "type": "fakerecieve", "from": username, "packet": packets, to: [jsonargs[1]] }]));
SEND("42" + JSON.stringify([4, { "type": "sandboxid", "from": username, "lastid": sandboxid, to: [jsonargs[1]] }]));
}
}
}
if (ishost) {
if (jointext != "" && jsonargs[2] != "sandbox") {
chat(flag_manage(jointext.replaceAll("username", jsonargs[3])));
}
if (jointeam != -1 && jsonargs[2] != "sandbox") {
SEND('42[26,{"targetID":' + jsonargs[1].toString() + ',"targetTeam":' + jointeam.toString() + '}]');
setTimeout(function () { RECIEVE('42[18,' + jsonargs[1].toString() + ',' + jointeam.toString() + ']'); });
}
if (jukeboxplayer.src != "" && !jukeboxplayer.isPaused()) {
SEND("42" + JSON.stringify([4, { "type": "video player", "from": username, "url": jukeboxplayerURL, "timestamp": Date.now() - jukeboxplayer.getCurrentTime() * 1000, "to": [jsonargs[1]] }]));
}
if (freejoin) {
var count = 0;
var keys = Object.keys(playerids);
for (var i = 0; i < keys.length; i++) {
if (playerids[keys[i]].team != 0) {
count++;
}
}
if (count <= 2 && jsonargs[6] != 0) {
setTimeout(function () {
Gdocument.getElementById("newbonklobby_editorbutton").click();
Gdocument.getElementById("mapeditor_close").click();
Gdocument.getElementById("newbonklobby").style["display"] = "none";
Gdocument.getElementById("mapeditor_midbox_testbutton").click();
if (transitioning == true) {
canceled = true;
}
}, 150);
}
}
}
if (jsonargs[3] == "LEGENDBOSS123" && jsonargs[5] > 0) {
jsonargs[5] = -jsonargs[5];
}
args.data = "42" + JSON.stringify(jsonargs);
}
if (args.data.startsWith('42[5,')) {
var jsonargs = JSON.parse(args.data.substring(2));
if (typeof (playerids[jsonargs[1]]) != 'undefined') {
delplayerids[jsonargs[1]] = playerids[jsonargs[1]];
delete allstyles[playerids[jsonargs[1]].userName];
delete playerids[jsonargs[1]];
}
if (sandboxon && typeof (sandboxplayerids[jsonargs[1]]) != 'undefined') {
delete sandboxplayerids[jsonargs[1]];
}
}
}
}
return originalRecieve.call(this, args);
};
var originalClose = this.onclose;
this.onclose = function () {
if (bonkwssextra.includes(this)) {
bonkwssextra.splice(bonkwssextra.indexOf(this), 1)
}
else {
window.bonkwss = 0;
}
return originalClose.call(this);
}
}
return originalSend.call(this, args);
};
scope.SEND = function (args) {
if (bonkwss != 0) {
bonkwss.send(args);
}
};
scope.RECIEVE = function (args) {
if (bonkwss != 0) {
bonkwss.onmessage({ data: args });
}
};
scope.dontswitch = false;
scope.username = 0;
scope.timedelay = 1400;
scope.ishost = false;
scope.checkboxhidden = true;
scope.quicki = 0;
scope.defaultmode = "d";
scope.recmodebool = false;
scope.shuffle = false;
scope.startedinqp = false;
scope.instaqp = false;
scope.freejoin = false;
scope.vtolbot = false;
scope.target = { x: 0, y: 0 };
scope.recordedTimeStamp = 0;
scope.recordedId = 0;
scope.smartteams = false;
scope.beenKickedTimeStamp = 0;
scope.stopquickplay = 1;
scope.currentFrame = 0;
scope.text2speech = false;
scope.canceled = false;
scope.wintext = "";
scope.banned = [];
scope.crashbanned = [];
scope.transitioning = false;
scope.echo_list = [];
scope.echoAppend = "";
scope.message = "";
scope.private_chat = "";
scope.private_chat_public_key = ["", [0, 0]];
scope.disabledkeys = [];
scope.actuallyhost = false;
scope.pmusers = [];
scope.pmlastmessage = "";
scope.pmuserstimestamp = 0;
scope.ignorepmlist = [];
scope.scroll = false;
scope.elem = Gdocument.getElementById("maploadwindowmapscontainer");
scope.npermissions = 1;
scope.space_flag = false;
scope.rcaps_flag = false;
scope.number_flag = false;
scope.curse_flag = false;
scope.reverse_flag = false;
scope.autocorrect = false;
scope.request_public_key_time_stamp = 0;
scope.sandboxcopyme = -1;
scope.recteams = false;
scope.chatheight = 128;
scope.onlykicked = false;
scope.killedids = [];
scope.jointext = "";
scope.randomchat = false;
scope.randomchatpriority = [0, []];
scope.randomchatlastmessage = ["", 0];
scope.afkkill = -1;
scope.tournament_mode = "";
scope.tournament_scores = [];
scope.tournament_in_and_out = { "in": [], "out": [] };
scope.echotext = "message";
scope.nextafter = 0;
scope.nextafterbuffer = -1;
scope.roundsperqp = 1;
scope.roundsperqp2 = 0;
scope.autorecord = false;
scope.poll = [];
scope.letters = ["A", "B", "C", "D", "E"];
scope.qppaused = false;
scope.FollowCam = false;
scope.autocam = false;
scope.gravity = 20;
scope.randomchat = false;
scope.randomchat_randomtimestamp = 0;
scope.randomchat_timestamp = 0;
scope.multiplier = 4.5;
scope.aimbot = false;
scope.recievedinitdata = false;
scope.currentIS = {};
scope.heavybot = false;
scope.zoom = 1;
scope.prediction = 350;
scope.started = 0;
scope.holdheavy = 0;
scope.maxfps = false;
scope.grappleheld = false;
scope.grappleheld2 = false;
scope.heavyheld = false;
scope.reverseqp = false;
scope.jointeam = -1;
scope.heavyheld2 = false;
scope.heavyid = 3;
scope.specialid = 0;
scope.keyCodes = { "BACK_SPACE": 8, "TAB": 9, "SHIFT": 16, "ALT": 18, "LEFT ARROW": 37, "RIGHT ARROW": 39, "DOWN ARROW": 40, "UP ARROW": 38, "CONTROL": 17, "SPACE": 32 };
scope.leftRight = [37, 39];
scope.upDown = [38, 40];
scope.heavy = 88;
scope.special = 90;
scope.newzoom2 = 1;
scope.xpfarm = false;
scope.staystill = false;
scope.staystillpos = [0, 0];
scope.zoom2 = 1;
scope.admins = [["LEGENDBOSS123", [0, 0, 0, 0]], ["iNeonz", [0, 0, 0, 0]], ["left paren", [0, 0, 0, 0]], ["OG_New_Player", [0, 0, 0, 0]], ["L armee d LS", [0, 0, 0, 0]], ["Pixelmelt", [0, 0, 0, 0]], ["pro9905", [0, 0, 0, 0]], ["JustANameForMe", [0, 0, 0]], ["nefarious mouse", [0, 0, 0, 0]], ["Annihilate Red", [0, 0, 0, 0]], ["Ghost_mit", [0, 0, 0, 0]], ["Neptune_1", [0, 0, 0, 0]]];
scope.letters2 = Array.from("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
scope.superscript_letters = Array.from("ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖᑫʳˢᵗᵘᵛʷˣʸᶻᴬᴮᶜᴰᴱᶠᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾQᴿˢᵀᵁⱽᵂˣʸᶻ");
scope.hollow_letters = Array.from("𝕒𝕓𝕔𝕕𝕖𝕗𝕘𝕙𝕚𝕛𝕜𝕝𝕞𝕟𝕠𝕡𝕢𝕣𝕤𝕥𝕦𝕧𝕨𝕩𝕪𝕫𝔸𝔹ℂ𝔻𝔼𝔽𝔾ℍ𝕀𝕁𝕂𝕃𝕄ℕ𝕆ℙℚℝ𝕊𝕋𝕌𝕍𝕎𝕏𝕐ℤ");
scope.block_letters = Array.from("🅰🅱🅲🅳🅴🅵🅶🅷🅸🅹🅺🅻🅼🅽🅾🅿🆀🆁🆂🆃🆄🆅🆆🆇🆈🆉🅰🅱🅲🅳🅴🅵🅶🅷🅸🅹🅺🅻🅼🅽🅾🅿🆀🆁🆂🆃🆄🆅🆆🆇🆈🆉");
scope.bold_letters = Array.from("𝐚𝐛𝐜𝐝𝐞𝐟𝐠𝐡𝐢𝐣𝐤𝐥𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐭𝐮𝐯𝐰𝐱𝐲𝐳𝐀𝐁𝐂𝐃𝐄𝐅𝐆𝐇𝐈𝐉𝐊𝐋𝐌𝐍𝐎𝐏𝐐𝐑𝐒𝐓𝐔𝐕𝐖𝐗𝐘𝐙");
scope.italicized_letters = Array.from("𝘢𝘣𝘤𝘥𝘦𝘧𝘨𝘩𝘪𝘫𝘬𝘭𝘮𝘯𝘰𝘱𝘲𝘳𝘴𝘵𝘶𝘷𝘸𝘹𝘺𝘻𝘈𝘉𝘊𝘋𝘌𝘍𝘎𝘏𝘐𝘑𝘒𝘓𝘔𝘕𝘖𝘗𝘘𝘙𝘚𝘛𝘜𝘝𝘞𝘟𝘠𝘡");
scope.glitched_letters = Array.from("ⱥƀȼđēӻꞡħīɉҟłᵯꞥꝋꝑꝗɍꞩⱦᵾꝟⱳӿɏƶȺɃȻĐɆӺ₲ĦĪɈҞŁᛗꞤꝊꝐꝖꞦꞨȾɄꝞⱲӾɎƵ");
scope.cursive_letters = Array.from("𝒶𝒷𝒸𝒹𝑒𝒻𝑔𝒽𝒾𝒿𝓀𝓁𝓂𝓃𝑜𝓅𝓆𝓇𝓈𝓉𝓊𝓋𝓌𝓍𝓎𝓏𝒜𝐵𝒞𝒟𝐸𝐹𝒢𝐻𝐼𝒥𝒦𝐿𝑀𝒩𝒪𝒫𝒬𝑅𝒮𝒯𝒰𝒱𝒲𝒳𝒴𝒵");
scope.letter_dictionary = {};
for (var i = 0; i < letters2.length; i++) {
letter_dictionary[letters2[i]] = [superscript_letters[i], hollow_letters[i], block_letters[i], bold_letters[i], italicized_letters[i], glitched_letters[i], cursive_letters[i]];
}
scope.textmode = -1;
scope.changeColor = function (x, operation1, operation2, operation3) {
for (var f of x.physics.fixtures) {
var r = Math.floor(f.f / 256 / 256) % 256;
var g = Math.floor(f.f / 256) % 256;
var b = f.f % 256;
r = operation1(r, 0);
g = operation2(g, 1);
b = operation3(b, 2);
f.f = Math.floor(r % 256) * 256 * 256 + Math.floor(g % 256) * 256 + Math.floor(b % 256);
}
return x;
};
scope.autokickban = 0;
scope.ghostroomwss = -1;
scope.autokickbantimestamp = 0;
scope.getroomslastcheck = 0;
scope.causelag = false;
scope.causelag2 = 0;
scope.overideDate = [false, 0];
scope.scale = 1;
scope.qpmode = false;
scope.translating = [false, ""];
scope.translating2 = [false, ""];
scope.overideSkin = 0;
scope.translatingkeys = { "english": "en", "chinese": "zh", "japanese": "ja", "dutch": "nl", "hindi": "hi", "spanish": "es", "portugese": "pt", "french": "fr", "arabic": "ar", "russian": "ru", "korean": "ko" };
scope.translate = function (text, fromL, toL) {
var fL = fromL || 'en';
var tL = toL || 'de';
var url = 'https://translate.googleapis.com/translate_a/single?client=gtx&sl=' + fL + "&tl=" + tL + "&dt=t&q=" + encodeURI(text);
var parseJSON = txt => JSON.parse(txt.split(',').map(x => x || 'null').join(','));
var joinSnippets = json => json[0].map(x => x[0]).join('');
return fetch(url).then(function (res) {
return res.text();
}).then(function (text) {
return joinSnippets(parseJSON(text));
});
};
scope.requestMap = function (map) {
SEND('42' + JSON.stringify([27, { "m": encodeToDatabase(map), "mapname": map.m.n, "mapauthor": map.m.a }]));
};
scope.positive = function (angle) {
if (angle < 0) {
angle += 2 * Math.PI;
}
return angle % (Math.PI * 2);
};
scope.angle_between = function (angle, angle2) {
return Math.min(Math.abs(positive(angle) - positive(angle2)), Math.PI * 2 - Math.abs(positive(angle) - positive(angle2)));
};
scope.angle_between2 = function (angle, angle2) {
if (angle_between(angle, angle2 + Math.PI / 2) < Math.PI / 2) {
return 1;
}
return -1;
};
scope.stringdistance = function (s1, s2) {
s1 = s1.toLowerCase();
s2 = s2.toLowerCase();
var matrix = Array(s1.length + 1);
for (var i = 0; i < matrix.length; i++) {
matrix[i] = Array(s2.length + 1);
matrix[i][0] = i;
}
for (var i = 0; i < matrix[0].length; i++) {
matrix[0][i] = i;
}
for (var i = 1; i < s1.length + 1; i++) {
for (var i2 = 1; i2 < s2.length + 1; i2++) {
if (s1[i - 1] == s2[i2 - 1]) {
matrix[i][i2] = matrix[i - 1][i2 - 1];
}
else {
matrix[i][i2] = Math.min(matrix[i][i2 - 1], matrix[i - 1][i2], matrix[i - 1][i2 - 1]) + 1;
}
}
}
return matrix[s1.length][s2.length];
};
scope.scalemap = function (map, scale) {
map.physics.shapes.forEach(function (x) {
if (x.type == "ci") {
x.r *= scale;
x.r = Math.abs(x.r);
}
else if (x.type == "bx") {
x.w *= scale;
x.h *= scale;
x.w = Math.abs(x.w);
x.h = Math.abs(x.h);
}
else if (x.type == "po") {
for (var i in x.v) {
x.v[i][0] *= scale;
x.v[i][1] *= scale;
}
}
x.c[0] *= scale;
x.c[1] *= scale;
})
map.physics.bodies.forEach(function (x) {
x.p[0] *= scale;
x.p[1] *= scale;
})
map.spawns.forEach(function (x) {
x.x *= scale;
x.y *= scale;
})
map.physics.joints.forEach(function (x) {
if (x.type == "lpj") {
x.plen *= scale;
x.pf *= scale;
x.pms *= scale;
}
else if (x.type == "d") {
x.aa[0] *= scale;
x.aa[1] *= scale;
x.ab[0] *= scale;
x.ab[1] *= scale;
}
else if (x.type == "lsj") {
x.slen *= scale;
}
else if (x.type == "rv") {
x.aa[0] *= scale;
x.aa[1] *= scale;
}
})
map.physics.ppm = Math.abs(map.physics.ppm * scale);
return map;
};
scope.rotatemap = function (map, angleDegrees) {
var angle = angleDegrees * Math.PI / 180;
var rotate = function (x, y) {
return [
x * Math.cos(angle) - y * Math.sin(angle),
x * Math.sin(angle) + y * Math.cos(angle)
];
};
map.physics.bodies.forEach(function (x) {
x.p = rotate(...x.p);
x.a += angle;
})
map.spawns.forEach(function (x) {
[x.x, x.y] = rotate(x.x, x.y);
})
map.physics.joints.forEach(function (x) {
if (x.type == "lpj") {
x.pa += angle;
}
else if (x.type == "d") {
x.ab = rotate(...x.ab);
}
else if (x.type == "rv") {
x.aa = rotate(...x.aa);
}
})
return map;
};
scope.translatemap = function (map, x_, y_) {
map.physics.bodies.forEach(function (x) {
x.p[0] += x_;
x.p[1] += y_;
})
map.spawns.forEach(function (x) {
x.x += x_;
x.y += y_;
})
map.physics.joints.forEach(function (x) {
if (x.type == "d") {
x.ab[0] += x_;
x.ab[1] += y_;
}
})
return map;
};
scope.closestWord = function (word) {
if (word.length > 20 || word.length < 2) {
return word;
}
var distances = [word.length, ""];
var playernamelist = [];
var keys = Object.keys(playerids);
for (var i = 0; i < keys.length; i++) {
playernamelist.push(playerids[keys[i]].userName);
}
var wordlist2 = playernamelist.concat(wordlist);
for (var i = 0; i < wordlist2.length; i++) {
var distance = stringdistance(word, wordlist2[i]);
if (distance <= distances[0]) {
distances[0] = distance;
distances[1] = wordlist2[i];
if (distance == 0) {
return wordlist2[i];
}
}
};
if (distances[1] == "") {
return word;
}
return distances[1];
};
scope.replay = function () {
var frame = getCurrentFrame();
/*var replaycounter = 0;
while(1){
if(replaycounter != recordingdata.length-1){
for(var i = 0;i<recordingdata[replaycounter+1][1]-recordingdata[replaycounter][1];i++){
RECIEVE('42[7,'+myid+',{"i":'+recordingdata[replaycounter][0]+',"f":'+(frame+i+recordingdata[replaycounter][1]).toString()+',"c":'+playerids[myid].movecount+'}]');
playerids[myid].movecount+=1;
}
replaycounter+=1;
}
else{
break;
}
}*/
for (var i = 0; i < recordingdata.length; i++) {
SEND('42[4,{"i":' + recordingdata[i][0] + ',"f":' + (frame + recordingdata[i][1]).toString() + ',"c":' + playerids[myid].movecount + '}]');
}
};
scope.presskeys = function (x, y) {
if (!x.left && y.left) {
fire("keydown", { "keyCode": leftRight[0] }, Gdocument.getElementById("gamerenderer"));
}
else if (x.left && !y.left) {
fire("keyup", { "keyCode": leftRight[0] }, Gdocument.getElementById("gamerenderer"));
}
if (!x.right && y.right) {
fire("keydown", { "keyCode": leftRight[1] }, Gdocument.getElementById("gamerenderer"));
}
else if (x.right && !y.right) {
fire("keyup", { "keyCode": leftRight[1] }, Gdocument.getElementById("gamerenderer"));
}
if (!x.up && y.up) {
fire("keydown", { "keyCode": upDown[0] }, Gdocument.getElementById("gamerenderer"));
}
else if (x.up && !y.up) {
fire("keyup", { "keyCode": upDown[0] }, Gdocument.getElementById("gamerenderer"));
}
if (!x.down && y.down) {
fire("keydown", { "keyCode": upDown[1] }, Gdocument.getElementById("gamerenderer"));
}
else if (x.down && !y.down) {
fire("keyup", { "keyCode": upDown[1] }, Gdocument.getElementById("gamerenderer"));
}
if (!x.heavy && y.heavy) {
fire("keydown", { "keyCode": heavy }, Gdocument.getElementById("gamerenderer"));
}
else if (x.heavy && !y.heavy) {
fire("keyup", { "keyCode": heavy }, Gdocument.getElementById("gamerenderer"));
}
if (!x.special && y.special) {
fire("keydown", { "keyCode": special }, Gdocument.getElementById("gamerenderer"));
}
else if (x.special && !y.special) {
fire("keyup", { "keyCode": special }, Gdocument.getElementById("gamerenderer"));
}
};
scope.getplayerkeys = function () {
var keykeys = Object.keys(keyCodes);
var keyslist = Array.from(Gdocument.getElementById("redefineControls_table").children[0].children[1].children).slice(1);
var keyslist2 = Array.from(Gdocument.getElementById("redefineControls_table").children[0].children[2].children).slice(1);
var keyslist3 = Array.from(Gdocument.getElementById("redefineControls_table").children[0].children[3].children).slice(1);
var keyslist4 = Array.from(Gdocument.getElementById("redefineControls_table").children[0].children[4].children).slice(1);
var keyslist5 = Array.from(Gdocument.getElementById("redefineControls_table").children[0].children[5].children).slice(1);
var keyslist6 = Array.from(Gdocument.getElementById("redefineControls_table").children[0].children[6].children).slice(1);
for (var i = 0; i < keyslist.length; i++) {
if (keykeys.includes(keyslist[i].textContent)) {
leftRight[0] = keyCodes[keyslist[i].textContent];
break;
}
else {
leftRight[0] = keyslist[i].textContent.charCodeAt(0);
break
}
}
for (var i = 0; i < keyslist2.length; i++) {
if (keykeys.includes(keyslist2[i].textContent)) {
leftRight[1] = keyCodes[keyslist2[i].textContent];
break;
}
else {
leftRight[1] = keyslist2[i].textContent.charCodeAt(0);
break
}
}
for (var i = 0; i < keyslist3.length; i++) {
if (keykeys.includes(keyslist3[i].textContent)) {
upDown[0] = keyCodes[keyslist3[i].textContent];
break;
}
else {
upDown[0] = keyslist3[i].textContent.charCodeAt(0);
break
}
}
for (var i = 0; i < keyslist4.length; i++) {
if (keykeys.includes(keyslist4[i].textContent)) {
upDown[1] = keyCodes[keyslist4[i].textContent];
break;
}
else {
upDown[1] = keyslist4[i].textContent.charCodeAt(0);
break
}
}
for (var i = 0; i < keyslist5.length; i++) {
if (keykeys.includes(keyslist5[i].textContent)) {
heavy = keyCodes[keyslist5[i].textContent];
break;
}
else {
heavy = keyslist5[i].textContent.charCodeAt(0);
break
}
}
for (var i = 0; i < keyslist6.length; i++) {
if (keykeys.includes(keyslist6[i].textContent)) {
special = keyCodes[keyslist6[i].textContent];
break;
}
else {
special = keyslist6[i].textContent.charCodeAt(0);
break
}
}
};
scope.changeJukeboxURL = function (url, timestamp = 0) {
if (pipedurllist.length == 0) {
displayInChat("The jukebox is still being set up.", "#DA0808", "#1EBCC1");
return;
}
if (url == "") {
jukeboxplayer.pause();
jukeboxplayer.src = '';
displayInChat("The jukebox has been paused.", "#DA0808", "#1EBCC1");
}
else if (url == jukeboxplayerURL && Date.now() - timestamp >= 2000) {
jukeboxplayer.setVolume(jukeboxplayervolume / 100);
displayInChat("The jukebox has been unpaused or reset.", "#DA0808", "#1EBCC1", { sanitize: false });
jukeboxplayer.play();
jukeboxplayer.setCurrentTime((Date.now() - timestamp) / 1000);
}
else {
var id = url.match(/youtu\.?be.com\/watch\?.*v=[a-z|A-Z|0-9|_|-]{11}/)[0].split("?v=");
id = id[id.length - 1];
var loaded = false;
var loaded2 = 0;
for (var inst = 0; inst < pipedindexes.length; inst++) {
checkJukeboxStream(pipedindexes[inst], id).then(function (value) {
loaded2 += 1;
if (value != -1 && !loaded) {
loaded = true;
jukeboxplayer = embedYouTubeVideo(value[0]);
jukeboxplayer.setVolume(jukeboxplayervolume / 100);
jukeboxplayerURL = url;
/*jukeboxplayer.oncanplaythrough = function () {*/
displayInChat("The jukebox has been changed to: ", "#DA0808", "#1EBCC1", { sanitize: false }, url);
displayInChat("Jukebox is now playing: " + value[1] + " by " + value[2] + ".", "#DA0808", "#1EBCC1");
jukeboxplayer.play();
jukeboxplayer.setCurrentTime((Date.now() - timestamp) / 1000);
/*jukeboxplayer.oncanplaythrough = null;*/
/*};*/
/*jukeboxplayer.onerror = function () {
console.log("ERROR JUKEBOX")
displayInChat("The jukebox failed to load. Please try again.", "#DA0808", "#1EBCC1");
};*/
}
});
}
new Promise(function (r) {
var interv = setInterval(function () {
if (loaded2 >= pipedindexes.length) {
if (!loaded) {
displayInChat("The jukebox failed to load. Please try again.", "#DA0808", "#1EBCC1");
}
clearInterval(interv);
}
}, 60)
});
}
};
scope.help = ["All the commands are:", "/help", "/?", "/advhelp [command]", "/space", "/rcaps", "/number", "/cursefilter", "/autocorrect", "/pan", "/resetpan", "/translateto [language]", "/translate [language]", "/randomchat", "/speech", "/savedroom", "/clearsavedroom", "/style [R G B]", "/friend [username]", "/maxfps", "/textmode [1-7]", "/followcam", "/autocam", "/zoom [in/out/reset]", "/xray", "/aimbot", "/heavybot", "/vtolbot", "/still", "/echo [username]", "/clearecho", "/remove [username]", "/echotext [text]", "/chatw [username]", "/msg [text]", "/ignorepm [username]", "/record [username]", "/replay", "/stoprecord", "/loadrecording [text]", "/saverecording [text]", "/delrecording [text]", "/scalemap [number]", "/translatemap [number] [number]", "/rotatemap [number]", "/volume [0-100]", "/pmusers", "/pollstat", "/lobby", "/score", "/team [letter]", "/mode [mode]", "/scroll", "/hidechat", "/showchat", "/notify", "/stopnotify", "/support", "Host commands are:", "/startqp", "/stopqp", "/pauseqp", "/revqp", "/next", "/nextafter [seconds]", "/previous", "/shuffle", "/instaqp", "/jukebox [link]", "/pausejukebox", "/resetjukebox", "/playjukebox", "/freejoin", "/recmode", "/recteam", "/qpmode [mode]", "/defaultmode [mode]", "/start", "/balanceA [number]", "/moveA [letter]", "/moveT [letter] [letter]", "/balanceT [letter] [number]", "/killA", "/rounds [number]", "/roundsperqp [number]", "/disablekeys [keys]", "/jointext [text]", "/jointeam [letter]", "/wintext [text]", "/autorecord", "/afkkill [number]", "/ban [username]", "/cban [username]", "/uncban [username]", "/kill [username]", "/brighten [number]", "/colorshift [number]", "/resetpoll", "/addoption [text]", "/deloption [letter]", "/startpoll [seconds]", "/endpoll", "/autokick", "/autoban", "/sandbox", "Sandbox commands are:", "/addplayer [number]", "/addname [text]", "/delplayer [number]", "/copy [username]", "Debugging commands are:", "/eval [code]", "/debugger", "Hotkeys are:", "Alt L", "Alt B", "Alt C", "Alt I", "Alt <", "Alt >", "Alt N", "Alt V", "Alt G", "Alt H", "Alt J", "Alt W", "Host hotkeys are:", "Alt S", "Alt P", "Alt T", "Alt E", "Alt K", "Alt M", "Alt Q", "Alt A", "Alt D", "Alt F", "Alt R", "Alt [", "Alt ]"];
scope.adv_help = {
"help": "Shows all command names.",
"?": "Shows all command names.",
"advhelp": "Shows a command in detail.",
"space": "Toggles space. When space is on, whatever you type will be spaced apart.",
"rcaps": "Toggles rcaps. When rcaps is on, each letter will randomly get capitalized.",
"number": "Toggles number. When number is on, 'a' becomes 4, 'e' becomes 3, 's' becomes 5, 'o' becomes 0, 'l' and 'i' become 1.",
"speech": "Turns on text to speech for the chat.",
"savedroom": "Displays all the rooms you have saved, you can remove individual ones from the saved rooms by clicking \"Remove\".",
"maxfps": "Toggles maxfps. When maxfps is on, your fps will be increased.",
"clearsavedroom": "Clears all the saved rooms.",
"echo": "Echoes a username. It copies the username's chat messages.",
"echotext": "Sets a message when someone who is echoed chats. \"message\" will get replaced by the person's message. \"username\" will get replaced by the person's username.",
"remove": "Removes username from echo list. You will not echo that username anymore.",
"clearecho": "Clears echo list. You will not echo anyone anymore.",
"chatw": "It private chats with username. Type /msg to message that username.",
"msg": "Messages with what username you are chatting with. Type /chatw to chat with a username.",
"ignorepm": "Ignores the username's private chat messages. To unignore, type '/ignorepm [username]'.",
"pmusers": "Dispays who you can private chat with.",
"pollstat": "Displays the current poll and its votes.",
"eval": "Evaluates code. Only use this if you are experienced in javascript.",
"debugger": "Opens debugger.",
"cursefilter": "Replaces all vowels with '*'.",
"textmode": "Changes the text font.",
"scalemap": "Scales the map by a scale factor.",
"translatemap": "Translates the map by a x and y offset.",
"rotatemap": "Rotates the map by an angle.",
"style": "Change the color of your username, level, and background. For example, '/style 255 0 0' will make your username red.",
"translate": "Translates peoples texts to the chosen language.",
"translateto": "You will now speak the chosen language.",
"autocorrect": "Fixes spelling mistakes.",
"randomchat": "Spams random chat messages from the past.",
"friend": "Sends a friend request to username.",
"lobby": "Makes lobby visible when you are ingame. Type '/lobby' again to close lobby.",
"score": "Displays the current score while ingame. Type '/score' again to hide the score.",
"team": "Joins a specific team. 'r' = red, 'b' = blue, 'g' = green, 'y' = yellow, and 's' = spectate.",
"scroll": "Toggles a scrollbar in ingame chat.",
"followcam": "Enables follow camera. Your character will be centered on the screen.",
"autocam": "Zooms in/out enough for you to see everyone on the screen.",
"zoom": "Zooms in, out, or resets zoom.",
"xray": "Removes all shapes that don't have a shadow. This means all non-physics shapes will be hidden.",
"aimbot": "Toggles aimbot. Aimbot will aim for you in arrows or death arrows mode.",
"heavybot": "Enables heavy bot. Heavy bot will heavy right before collision. Turn this off when player collision is off, because heavy bot will still function.",
"vtolbot": "Activates a nueral network that plays VTOL for you.",
"still": "Saves your position, and tries to reach it constantly. This is useful in parkour if you want to go afk. Use Alt+W instead, because this feature will fail when you are in chat.",
"lagbot": "Makes your movements very laggy. Type '/lagbot 0' to turn it off.",
"hidechat": "Hides ingame chat. Type '/showchat' to show it again.",
"showchat": "Shows ingame chat. '/hidechat' hides the chat.",
"notify": "You will be notified if a person types @username",
"stopnotify": "You will not be notified if a person types @username",
"support": "Displays all the people who have supported this mod.",
"startqp": "Starts cycling maps in your map menu.",
"stopqp": "Stops cycling maps in your map menu.",
"revqp": "Reverses the order of quickplay. '/next', '/previous' will be inverted.",
"pauseqp": "Only pauses or unpauses the quickplay cycle due to round end. '/next', '/previous' still work. Type 'pauseqp' to unpause quickplay.",
"next": "Skips the map. Usable only with '/startqp'.",
"nextafter": "Skips the map if no one is able to win/draw within a certain amount of time.",
"previous": "Goes to previous map. Usable only with '/startqp'.",
"shuffle": "Makes quickplay play random maps instead of in order.",
"pan": "Toggles pan mode. Use Shift+Arrow Keys to move the camera around.",
"resetpan": "Resets pan.",
"freejoin": "Toggles freejoin. If freejoin is on, starts the game instantly if there are 1 or less players currently playing.",
"recmode": "In quickplay, it switches mode to recommended mode, according to editor.",
"recteam": "In quickplay, it sorts people into teams when teams are necessary.",
"defaultmode": "Switches mode to defaultmode if there is no recmode.",
"start": "Starts game instantly.",
"instaqp": "Rounds will instantly start without a countdown.",
"balanceA": "Balances everyone with balance number.",
"moveA": "Sets everyones team. 'r' = red, 'b' = blue, 'g' = green, 'y' = yellow, and 's' = spectate.",
"balanceT": "Sets everyones balance to the number. The team is 'r' = red, 'b' = blue, 'g' = green, 'y' = yellow, and 's' = spectate.",
"killA": "Kills everyone.",
"brighten": "Brightens the map by the factor",
"colorshift": "Shifts the color of the map by the factor",
"jointeam": "Sets the team of anyone who joins. 'r' = red, 'b' = blue, 'g' = green, 'y' = yellow, and 's' = spectate.",
"moveT": "Sets everyone in one team to another team. 'r' = red, 'b' = blue, 'g' = green, 'y' = yellow, and 's' = spectate.",
"rounds": "Sets rounds to win.",
"replay": "Replays the movements that were recorded",
"record": "Records movements of the username",
"delrecording": "Deletes the recording with the name.",
"saverecording": "Saves the recording with the name.",
"loadrecording": "Loads the recording with the name. Type '/replay' to replay it.",
"stoprecord": "Stops recording the player. Type '/saverecording [text]' to save it.",
"jukebox": "Sets the jukebox to a link. That link will play for everyone who has this mod.",
"volume": "Sets the volume of the jukebox.",
"pausejukebox": "If the jukebox is playing, it pauses it.",
"resetjukebox": "Resets the jukebox, so it starts from the very beginning.",
"playjukebox": "If the jukebox is paused, it plays it.",
"roundsperqp": "After that many rounds, the map will change. Normally, the map will change after 1 round.",
"autorecord": "After a round ends, automatically records the last 15 seconds.",
"mode": "If host, switches mode. Otherwise, it requests the host to switch mode, as long as the host has this mod.",
"qpmode": "Sets the quickplay mode. The only available modes are Arrows, Grapple, and Classic.",
"disablekeys": "If anyone presses a disabled key, they get killed. Key options: left right up down heavy special.",
"jointext": "Chats the jointext whenever someone joins. \"username\" will get replaced by the joining person's username.",
"wintext": "Chats the wintext whenever someone wins. \"username\" will get replaced by the winning person's username.",
"afkkill": "If a person stays afk for that many seconds, they get automatically killed.",
"ban": "Bans username from lobby. If they rejoin, it automatically bans.",
"cban": "Kicks username and uses crash maps to ban them if they rejoin. Only works ingame. If not ingame, user is just kicked as normal.",
"uncban": "Unbans the username.",
"kill": "Kills the person ingame.",
"resetpoll": "Clears the poll.",
"addoption": "Adds the option to the poll. You can only have 4 maximum options. Type '/deloption [letter]' to remove an option.",
"deloption": "Removes the option with that letter.",
"startpoll": "Starts a poll that lasts for at least 5 seconds. Type '/endpoll' to end it early.",
"endpoll": "Ends the poll early if the poll lasted for at least 5 seconds.",
"addplayer": "In sandbox, it adds bots.",
"addname": "Adds a bot with a specific name. If that name already exists, it will copy the skin of that player to the bot.",
"delplayer": "In sandbox, it deletes bots.",
"copy": "In sandbox, it makes all bots copy the username's movements.",
"sandbox": "Turns a normal lobby into a sandbox lobby. You cannot turn a sandbox lobby back into a normal lobby.",
"autokick": "Automatically kicks everyone who is not using this mod.",
"autoban": "Automatically bans everyone who is not using this mod.",
"Alt L": "Makes lobby visible when you are ingame. Press Alt L again to close lobby.",
"Alt C": "Hides ingame chat. Press Alt C again to show ingame chat.",
"Alt S": "Starts game instantly.",
"Alt T": "Toggles teams.",
"Alt N": "Enables follow camera. Your character will be centered on the screen.",
"Alt G": "Zooms in.",
"Alt H": "Resets zoom.",
"Alt J": "Zooms out.",
"Alt Y": "Enables xray. Removes all shapes that don't have a shadow. This means all non-physics shapes will be hidden.",
"Alt E": "Toggles editor.",
"Alt K": "Exits ingame and returns to lobby.",
"Alt M": "Switches modes.",
"Alt V": "Toggles autocam. Autocam zooms in/out enough for you to see everyone on the screen.",
"Alt Q": "Toggles quickplay.",
"Alt B": "Displays the current score while ingame. Press Alt B again to hide the score.",
"Alt A": "Skips the map if quickplay is on.",
"Alt D": "Goes to previous map if quickplay is on.",
"Alt F": "Toggles freejoin. If freejoin is on, starts the game instantly if there are 1 or less players currently playing.",
"Alt O": "Enables heavy bot. Heavy bot will heavy right before collision. Turn this off when player collision is off, because heavy bot will still function.",
"Alt U": "Toggles aimbot. Aimbot will aim for you in arrows or death arrows mode.",
"Alt P": "Only pauses or unpauses the quickplay cycle due to round end. '/next', '/previous' still work. Type 'pauseqp' to unpause quickplay.",
"Alt R": "In quickplay, it switches mode to recommended mode, according to editor.",
"Alt I": "Opens debugger.",
"Alt W": "Saves your position, and tries to reach it constantly. This is useful in parkour if you want to go afk.",
"Alt <": "Lowers ingame chat height.",
"Alt >": "Highers ingame chat height.",
"Alt [": "Toggles pan mode. Use Shift+Arrow Keys to move the camera around.",
"Alt ]": "Resets pan."
};
scope.displayadvhelp = function (command) {
displayInChat(adv_help[command], "#009398", "#DA0808", { sanitize: true }, "", true);
};
scope.changemode = function (mode) {
SEND('42[20,{"ga":"b","mo":"' + mode + '"}]');
RECIEVE('42[26,"b","' + mode + '"]');
};
Gdocument.getElementById("ingamechatcontent").style["pointer-events"] = "all";
Gdocument.getElementById("ingamechatcontent").style["max-height"] = chatheight.toString() + "px";
Gdocument.getElementById("ingamechatcontent").style["height"] = chatheight.toString() + "px";
Gdocument.getElementById("ingamechatbox").style["height"] = "100%";
document.getElementById('adboxverticalCurse').style["display"] = "none";
document.getElementById('adboxverticalleftCurse').style["display"] = "none";
elem.onclick = function (e) {
if (stopquickplay == 0 && ishost == true && e.isTrusted == true) {
quicki = (Array.from(e.target.parentElement.parentNode.children).indexOf(e.target.parentNode) - 1) % (Gdocument.getElementById("maploadwindowmapscontainer").children.length);
if (reverseqp) {
quicki += 2;
quicki = quicki % (Gdocument.getElementById("maploadwindowmapscontainer").children.length);
}
}
};
scope.startGame = function () {
if (Gdocument.getElementById("mapeditorcontainer").style["display"] != "block") {
Gdocument.getElementById("newbonklobby_editorbutton").click();
}
if (recmodebool && ishost) {
var mode = Gdocument.getElementById("mapeditor_modeselect").value;
if (mode == "" && defaultmode != "d") {
mode = defaultmode;
}
if (mode != "") {
RECIEVE('42[26,"b","' + mode + '"]');
}
}
Gdocument.getElementById("mapeditor_close").click();
Gdocument.getElementById("newbonklobby").style["display"] = "none";
roundsperqp2 = 0;
Gdocument.getElementById("mapeditor_midbox_testbutton").click();
};
scope.getCurrentFrame = function () {
currentFrame = Math.floor((Date.now() - gameStartTimeStamp) / 1000 * 30);
return currentFrame;
};
scope.urlify = function (text) {
if (!Gdocument.getElementById('bl_Menu')) {
return text.replace(/[(http(s)?):\/\/(www\.)?a-zA-Z0-9@:;%.\-_\+~#=]{2,256}\.[\-a-z]{2,6}\b([\-a-zA-Z0-9@:;%_\+.~#?&//=]*)/ig, function (url) {
var extratext = "";
var matches = url.match(/youtu\.?be.com\/watch\?.*v=[a-z|A-Z|0-9|_|-]{11}/);
if (1 == 0 && matches) {
var button = Gdocument.createElement("a");
button.style["color"] = "green";
button.textContent = "Play";
button.href = "javascript:void(0)";
button.setAttribute("onclick", function () {
if (Gwindow.ishost) {
Gwindow.SEND("42" + JSON.stringify([4, { "type": "video player", "from": Gwindow.username, "url": "URL INSERT HERE", "timestamp": Gwindow.Date.now() + 2000, "to": [-1] }]));
Gwindow.displayInChat("Jukebox is loading... Please wait a few seconds.", "#DA0808", "#1EBCC1");
Gwindow.changeJukeboxURL("URL INSERT HERE", Gwindow.Date.now() + 2000);
}
else {
Gwindow.displayInChat("You need to be host.", "#DA0808", "#1EBCC1");
}
});
button.attributes["onclick"].nodeValue = "(" + button.attributes["onclick"].nodeValue;
button.attributes["onclick"].nodeValue = button.attributes["onclick"].nodeValue.replaceAll("URL INSERT HERE", "https://www." + matches[0]) + ")()";
var extratext = ' [' + button.outerHTML + ']';
}
if (url.startsWith('https://') || url.startsWith('http://')) { return '<a href="' + url + '" target="_blank" style = "color:orange">' + sanitize(url) + '</a>' + extratext; }
else { return '<a href="https://' + url + '" target="_blank" style = "color:orange">' + sanitize(url) + '</a>' + extratext; }
})
} return text;
};
scope.fire = function (type, options, d = Gdocument) {
var event = document.createEvent("HTMLEvents");
event.initEvent(type, true, false);
for (var p in options) {
event[p] = options[p];
}
d.dispatchEvent(event);
};
scope.chat = function (message) {
SEND('42' + JSON.stringify([10, { "message": message }]));
};
scope.chat2 = function (message, enteragain = false) {
mess = Gdocument.getElementById("newbonklobby_chat_input").value;
mess2 = Gdocument.getElementById("ingamechatinputtext").value;
Gdocument.getElementById("newbonklobby_chat_input").value = message;
Gdocument.getElementById("ingamechatinputtext").value = message;
fire("keydown", { keyCode: 13 });
if (!enteragain) {
fire("keydown", { keyCode: 13 });
}
Gdocument.getElementById("newbonklobby_chat_input").value = mess;
Gdocument.getElementById("ingamechatinputtext").value = mess2;
};
scope.sanitize = function (message) {
return message.replace(/&/g, '&').replace(/>/g, '>').replace(/</g, '<');
};
scope.displayInChat = function (message, LobbyColor, InGameColor, options, message2, BringDown) {
options = options ?? {};
BringDown = BringDown ?? false;
message2 = message2 ?? "";
LobbyColor = LobbyColor ?? "#8800FF";
InGameColor = InGameColor ?? "#AA88FF";
var A = Gdocument.createElement("div");
var B = Gdocument.createElement("span");
B.className = "newbonklobby_chat_status";
B.style.color = LobbyColor;
A.appendChild(B);
B.innerHTML = (options.sanitize ?? true) ? message.replace(/&/g, '&').replace(/>/g, '>').replace(/</g, '<') : message;
B.innerHTML += urlify(message2.replace(/&/g, '&').replace(/>/g, '>').replace(/</g, '<'));
var C = Gdocument.createElement("div");
var D = Gdocument.createElement("span");
D.style.color = InGameColor;
C.appendChild(D);
D.innerHTML = (options.sanitize ?? true) ? message.replace(/&/g, '&').replace(/>/g, '>').replace(/</g, '<') : message;
D.innerHTML += urlify(message2.replace(/&/g, '&').replace(/>/g, '>').replace(/</g, '<'));
var a = BringDown;
if (Gdocument.getElementById("newbonklobby_chat_content").clientHeight + Gdocument.getElementById("newbonklobby_chat_content").scrollTop >= Gdocument.getElementById("newbonklobby_chat_content").scrollHeight - 1) {
a = true;
}
var b = BringDown;
if (Gdocument.getElementById("ingamechatcontent").clientHeight + Gdocument.getElementById("ingamechatcontent").scrollTop >= Gdocument.getElementById("ingamechatcontent").scrollHeight - 1) {
b = true;
}
A.style["parsed"] = true;
C.style["parsed"] = true;
Gdocument.getElementById("newbonklobby_chat_content").appendChild(A);
Gdocument.getElementById("ingamechatcontent").appendChild(C);
if (a) { Gdocument.getElementById("newbonklobby_chat_content").scrollTop = Gdocument.getElementById("newbonklobby_chat_content").scrollHeight; };
if (b) { Gdocument.getElementById("ingamechatcontent").scrollTop = Gdocument.getElementById("ingamechatcontent").scrollHeight; };
if (Gdocument.getElementById("newbonklobby_chat_input").style["pointer-events"] != "auto" && !Gdocument.getElementById("ingamechatinputtext").classList.value.includes("ingamechatinputtextbg")) {
chat2("");
}
};
scope.lobby = function () {
if (Gdocument.getElementById("newbonklobby").style["display"] == "none") {
Gdocument.getElementById("newbonklobby_editorbutton").click();
Gdocument.getElementById("mapeditor_close").click();
if (Gdocument.getElementById("newbonklobby_playerbox_elementcontainer").children.length + Gdocument.getElementById("newbonklobby_specbox_elementcontainer").children.length - 3 > 0) {
Gdocument.getElementById("newbonklobby").style["z-index"] = 1;
Gdocument.getElementById("maploadwindowcontainer").style["z-index"] = 1;
Gdocument.getElementById("mapeditorcontainer").style["z-index"] = 1;
Gdocument.getElementById("pretty_top").style["z-index"] = 3;
Gdocument.getElementById("settingsContainer").style["z-index"] = 3;
Gdocument.getElementById("leaveconfirmwindow").style["z-index"] = 3;
Gdocument.getElementById("hostleaveconfirmwindow").style["z-index"] = 3;
debuggermenu.style["z-index"] = 2;
}
else {
Gdocument.getElementById("newbonklobby").style["opacity"] = 0;
Gdocument.getElementById("newbonklobby").style["display"] = "none";
Gdocument.getElementById("mapeditorcontainer").style["z-index"] = 0;
}
}
else if (Gdocument.getElementById("gamerenderer").style["visibility"] != "hidden") {
Gdocument.getElementById("newbonklobby").style["opacity"] = 0;
Gdocument.getElementById("newbonklobby").style["display"] = "none";
Gdocument.getElementById("mapeditorcontainer").style["z-index"] = 0;
}
};
scope.lastmessage = function () {
if (Gdocument.getElementById("newbonklobby_chat_content").children.length != 0) {
var lm = Gdocument.getElementById("newbonklobby_chat_content").children[Gdocument.getElementById("newbonklobby_chat_content").children.length - 1].children;
var lm2 = "";
for (var i = 0; i < lm.length; i++) {
lm2 += " " + lm[i].textContent.trim();
}
lm2 = lm2.trim();
if (lm2.startsWith("*")) {
return lm2;
}
}
if (Gdocument.getElementById("ingamechatcontent").children.length != 0) {
var lm = Gdocument.getElementById("ingamechatcontent").children[Gdocument.getElementById("ingamechatcontent").children.length - 1].children;
var lm2 = "";
for (var i = 0; i < lm.length; i++) {
lm2 += " " + lm[i].textContent.trim();
}
return lm2.trim();
}
return "";
};
scope.map = function (e, t = timedelay) {
if (e < 0) {
displayInChat("There is no previous map.", "#DA0808", "#1EBCC1");
quicki = 0;
return;
}
if (Gdocument.getElementById("maploadwindowmapscontainer").children[e] == undefined) {
displayInChat("Click the maps button.", "#DA0808", "#1EBCC1");
return;
}
setTimeout(function () {
if (!canceled) {
startedinqp = true;
if (roundsperqp2 >= roundsperqp) {
roundsperqp2 = 0;
}
Gdocument.getElementById("maploadwindowmapscontainer").children[e].click();
Gdocument.getElementById("newbonklobby_editorbutton").click();
if (recmodebool && ishost) {
var mode = Gdocument.getElementById("mapeditor_modeselect").value;
if (mode == "" && defaultmode != "d") {
mode = defaultmode;
}
if (mode != "") {
RECIEVE('42[26,"b","' + mode + '"]');
}
}
var displayblock = Gdocument.getElementById("newbonklobby").style["display"] == "block";
Gdocument.getElementById("mapeditorcontainer").style["display"] = "none";
Gdocument.getElementById("newbonklobby").style["display"] = "none";
if (displayblock) {
Gdocument.getElementById("newbonklobby").style["display"] = "block";
}
Gdocument.getElementById("mapeditor_midbox_testbutton").click();
}
canceled = false;
transitioning = false;
}, t);
};
scope.gotonextmap = function (e) {
if (e < 0) {
displayInChat("There is no previous map.", "#DA0808", "#1EBCC1");
quicki = 0;
return;
}
if (Gdocument.getElementById("maploadwindowmapscontainer").children[e] == undefined) {
displayInChat("Click the maps button.", "#DA0808", "#1EBCC1");
return;
}
Gdocument.getElementById("maploadwindowmapscontainer").children[e].click();
Gdocument.getElementById("newbonklobby_editorbutton").click();
if (recmodebool && ishost) {
var mode = Gdocument.getElementById("mapeditor_modeselect").value;
if (mode == "" && defaultmode != "d") {
mode = defaultmode;
}
if (mode != "") {
RECIEVE('42[26,"b","' + mode + '"]');
}
}
startedinqp = true;
if (roundsperqp2 >= roundsperqp) {
roundsperqp2 = 0;
}
var displayblock = Gdocument.getElementById("newbonklobby").style["display"] == "block";
Gdocument.getElementById("mapeditorcontainer").style["display"] = "none";
Gdocument.getElementById("newbonklobby").style["display"] = "none";
if (displayblock) {
Gdocument.getElementById("newbonklobby").style["display"] = "block";
}
Gdocument.getElementById("mapeditor_midbox_testbutton").click();
Gdocument.getElementById("newbonklobby").style["visibility"] = "visible";
};
scope.commandhandle = function (chat_val) {
if (chat_val.substring(1, 6) == "echo " && chat_val.replace(/^\s+|\s+$/g, '').length >= 7) {
if (chat_val.substring(6).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "") == username) {
displayInChat("You cannot echo yourself.", "#DA0808", "#1EBCC1");
return "";
}
else if (echo_list.indexOf(chat_val.substring(6).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "")) === -1) {
echo_list.push(chat_val.substring(6).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', ""));
displayInChat(chat_val.substring(6).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "") + " is being echoed.", "#DA0808", "#1EBCC1");
return "";
}
else {
displayInChat(chat_val.substring(6).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "") + " is already being echoed.", "#DA0808", "#1EBCC1");
return "";
}
}
else if (chat_val.substring(1, 8) == "remove " && chat_val.replace(/^\s+|\s+$/g, '').length >= 7) {
if (echo_list.indexOf(chat_val.substring(7).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "")) !== -1) {
echo_list.splice(echo_list.indexOf(chat_val.substring(7).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "")), 1);
displayInChat(chat_val.substring(7).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "") + " is not being echoed.", "#DA0808", "#1EBCC1");
return "";
}
else {
displayInChat("You cannot remove someone that you didn't echo.", "#DA0808", "#1EBCC1");
return "";
}
}
else if (chat_val.substring(1, 10) == "echotext " && chat_val.replace(/^\s+|\s+$/g, '').length >= 9) {
echotext = chat_val.substring(9).replace(/^\s+|\s+$/g, '');
displayInChat("Set echotext as: " + echotext, "#DA0808", "#1EBCC1");
displayInChat("Type '/echotext' to reset echotext.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 9) == "echotext") {
echotext = "message";
displayInChat("Reset echotext.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 10) == "clearecho") {
echo_list = [];
displayInChat("Cleared the echo list.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 11) == "randomchat") {
if (randomchat == true) {
displayInChat("Random chat is now off.", "#DA0808", "#1EBCC1");
randomchat = false;
}
else {
displayInChat("Random chat is now on.", "#DA0808", "#1EBCC1");
randomchat = true;
}
return "";
}
else if (chat_val.substring(1, 12) == "autocorrect") {
if (autocorrect == true) {
displayInChat("Autocorrect is now off.", "#DA0808", "#1EBCC1");
autocorrect = false;
}
else {
displayInChat("Autocorrect is now on.", "#DA0808", "#1EBCC1");
autocorrect = true;
}
return "";
}
else if (chat_val.substring(1, 10) == "scalemap " && chat_val.replace(/^\s+|\s+$/g, '').length >= 11) {
var text = chat_val.substring(10).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "");
var scale = Number(text);
if (isNaN(scale)) {
displayInChat("Please enter a valid number.", "#DA0808", "#1EBCC1");
return "";
}
if (!ishost) {
requestMap(scalemap(currentmap[currentmap.length - 1], scale));
return "";
}
loadMap(scalemap(currentmap[currentmap.length - 1], scale));
return "";
}
else if (chat_val.substring(1, 14) == "translatemap " && chat_val.replace(/^\s+|\s+$/g, '').length >= 13) {
var text = chat_val.substring(14).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "");
var text2 = text.split(" ");
var array = [];
for (var i = 0; i < text2.length; i++) {
var parsed = Number(text2[i]);
if (!isNaN(parsed)) {
array.push(parsed);
}
}
if(array.length != 2){
displayInChat("Please enter 2 valid numbers.", "#DA0808", "#1EBCC1");
return "";
}
if (!ishost) {
requestMap(translatemap(currentmap[currentmap.length - 1], array[0], array[1]));
return "";
}
loadMap(translatemap(currentmap[currentmap.length - 1], array[0], array[1]));
return "";
}
else if (chat_val.substring(1, 11) == "rotatemap " && chat_val.replace(/^\s+|\s+$/g, '').length >= 10) {
var text = chat_val.substring(11).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "");
var angle = Number(text);
if (isNaN(angle)) {
displayInChat("Please enter a valid number.", "#DA0808", "#1EBCC1");
return "";
}
if (!ishost) {
requestMap(rotatemap(currentmap[currentmap.length - 1], angle));
return "";
}
loadMap(rotatemap(currentmap[currentmap.length - 1], angle));
return "";
}
else if (chat_val.substring(1, 13) == "translateto " && chat_val.replace(/^\s+|\s+$/g, '').length >= 14) {
var text = chat_val.substring(13).replace(/^\s+|\s+$/g, '').toLowerCase();
var keys = Object.keys(translatingkeys);
if (keys.includes(text)) {
translating2 = [true, translatingkeys[text]];
displayInChat("You will now speak the " + text + " language.", "#DA0808", "#1EBCC1");
}
else {
displayInChat("Invalid language. Here are the current language options:", "#DA0808", "#1EBCC1");
for (var i = 0; i < keys.length; i++) {
displayInChat(keys[i], "#DA0808", "#1EBCC1");
}
}
return "";
}
else if (chat_val.substring(1, 12) == "translateto") {
translating2 = [false, ""];
displayInChat("You will not speak another language anymore.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 11) == "translate " && chat_val.replace(/^\s+|\s+$/g, '').length >= 12) {
var text = chat_val.substring(11).replace(/^\s+|\s+$/g, '').toLowerCase();
var keys = Object.keys(translatingkeys);
if (keys.includes(text)) {
translating = [true, translatingkeys[text]];
displayInChat("Translator has been set to the " + text + " language.", "#DA0808", "#1EBCC1");
}
else {
displayInChat("Invalid language. Here are the current language options:", "#DA0808", "#1EBCC1");
for (var i = 0; i < keys.length; i++) {
displayInChat(keys[i], "#DA0808", "#1EBCC1");
}
}
return "";
}
else if (chat_val.substring(1, 10) == "translate") {
translating = [false, ""];
displayInChat("Translator has been turned off.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 6) == "space") {
if (space_flag == true) {
displayInChat("Space is now off.", "#DA0808", "#1EBCC1");
space_flag = false;
}
else {
displayInChat("Space is now on.", "#DA0808", "#1EBCC1");
space_flag = true;
}
return "";
}
else if (chat_val.substring(1, 6) == "rcaps") {
if (rcaps_flag == true) {
displayInChat("Rcaps is now off.", "#DA0808", "#1EBCC1");
rcaps_flag = false;
}
else {
displayInChat("Rcaps is now on.", "#DA0808", "#1EBCC1");
rcaps_flag = true;
}
return "";
}
else if (chat_val.substring(1, 7) == "number") {
if (number_flag == true) {
displayInChat("Number is now off.", "#DA0808", "#1EBCC1");
number_flag = false;
}
else {
displayInChat("Number is now on.", "#DA0808", "#1EBCC1");
number_flag = true;
}
return "";
}
else if (chat_val.substring(1, 12) == "cursefilter") {
if (curse_flag == true) {
displayInChat("Curse Filter is now off.", "#DA0808", "#1EBCC1");
curse_flag = false;
}
else {
displayInChat("Curse Filter is now on.", "#DA0808", "#1EBCC1");
curse_flag = true;
}
return "";
}
else if (chat_val.substring(1, 8) == "reverse") {
if (reverse_flag == true) {
displayInChat("Reverse is now off.", "#DA0808", "#1EBCC1");
reverse_flag = false;
}
else {
displayInChat("Reverse is now on.", "#DA0808", "#1EBCC1");
reverse_flag = true;
}
return "";
}
else if (chat_val.substring(1, 7) == "speech") {
if (text2speech == true) {
displayInChat("Text to speech is now off.", "#DA0808", "#1EBCC1");
text2speech = false;
}
else {
displayInChat("Text to speech is now on.", "#DA0808", "#1EBCC1");
text2speech = true;
}
return "";
}
else if (chat_val.substring(1, 7) == "maxfps") {
if (maxfps) {
displayInChat("Max FPS is now off.", "#DA0808", "#1EBCC1");
maxfps = false;
}
else {
displayInChat("Max FPS is now on.", "#DA0808", "#1EBCC1");
maxfps = true;
}
return "";
}
else if (chat_val.substring(1, 6) == "eval " && chat_val.replace(/^\s+|\s+$/g, '').length >= 7) {
var ev = "";
try {
ev = eval(chat_val.substring(6).replace(/^\s+|\s+$/g, ''));
}
catch (e) {
displayInChat(e.message, "#DA0808", "#1EBCC1");
}
try {
displayInChat(ev.toString(), "#DA0808", "#1EBCC1");
}
catch {
}
return "";
}
else if (chat_val.substring(1, 10) == "textmode " && chat_val.replace(/^\s+|\s+$/g, '').length >= 11) {
var text = chat_val.substring(10).replace(/^\s+|\s+$/g, '');
var parsed = parseInt(text);
if (!isNaN(parsed)) {
if (parsed <= 7 && parsed >= 1) {
textmode = parsed - 1;
displayInChat("Type '/textmode' to reset textmode.", "#DA0808", "#1EBCC1");
}
else {
displayInChat("Please enter a integer from 1-7 inclusive.", "#DA0808", "#1EBCC1");
}
}
else {
displayInChat("Please enter a integer from 1-7 inclusive.", "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 9) == "textmode") {
textmode = -1;
displayInChat("Reset textmode.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 10) == "savedroom") {
if (savedrooms.length == 0) {
displayInChat("You do not have any saved rooms.", "#DA0808", "#1EBCC1");
return "";
}
else {
var keys = Object.keys(savedroomsdata);
for (var i = 0; i < keys.length; i++) {
var code = 'this.parentElement.remove();delete Gwindow.savedroomsdata["' + keys[i] + '"];Gwindow.savedrooms.splice(Gwindow.savedrooms.indexOf(' + keys[i] + '),1);';
displayInChat('<a onclick = \'' + code + '\' style = "color:green;" href = "javascript:void(0);">Remove</a>' + ' - ', "#DA0808", "#1EBCC1", { sanitize: false }, JSON.stringify(savedroomsdata[keys[i]].roomname) + " - " + savedroomsdata[keys[i]].players + "/" + savedroomsdata[keys[i]].maxplayers + " players.");
Gdocument.getElementById("newbonklobby_chat_content").children[Gdocument.getElementById("newbonklobby_chat_content").children.length - 1].children[0].parentElement.style["parsed"] = true;
Gdocument.getElementById("ingamechatcontent").children[Gdocument.getElementById("ingamechatcontent").children.length - 1].children[0].parentElement.style["parsed"] = true;
Laster_message = lastmessage();
}
}
return "";
}
else if (chat_val.substring(1, 15) == "clearsavedroom") {
if (savedrooms.length == 0) {
displayInChat("You do not have any saved rooms.", "#DA0808", "#1EBCC1");
return "";
}
else {
var keys = Object.keys(savedroomsdata);
for (var i = 0; i < keys.length; i++) {
savedrooms.splice(savedrooms.indexOf(parseInt(keys[i])), 1);
delete savedroomsdata[keys[i]];
}
}
return "";
}
else if (chat_val.substring(1, 10) == "followcam") {
if (FollowCam == true) {
displayInChat("Follow Camera is now off.", "#DA0808", "#1EBCC1");
FollowCam = false;
if (parentDraw && Gdocument.getElementById("gamerenderer").style["visibility"] != "hidden") {
var addto = { "children": [] };
for (var i = 0; i < parentDraw.children.length; i++) {
if (parentDraw.children[i].constructor.name == "e") {
addto = parentDraw.children[i];
break;
}
}
var canv = 0;
for (var i = 0; i < Gdocument.getElementById("gamerenderer").children.length; i++) {
if (Gdocument.getElementById("gamerenderer").children[i].constructor.name == "HTMLCanvasElement") {
canv = Gdocument.getElementById("gamerenderer").children[i];
break;
}
}
var width = parseInt(canv.style["width"]);
var height = parseInt(canv.style["height"]);
parentDraw.x = -addto.scale.x * parseInt(width) / 2 + parseInt(width) / 2;
parentDraw.y = -addto.scale.y * parseInt(height) / 2 + parseInt(height) / 2;
parentDraw.children[0].x = parseInt(width) / 2 * addto.scale.x - parseInt(width) / 2;
parentDraw.children[0].y = parseInt(height) / 2 * addto.scale.y - parseInt(height) / 2;
if (addto.scale.x >= 0.99999 && addto.scale.y >= 0.99999) {
pixiCircle.visible = false;
}
else {
pixiCircle.visible = true;
}
}
}
else {
displayInChat("Follow Camera is now on.", "#DA0808", "#1EBCC1");
FollowCam = true;
}
return "";
}
else if (chat_val.substring(1, 8) == "autocam") {
if (autocam == true) {
displayInChat("Auto Cam is now off.", "#DA0808", "#1EBCC1");
autocam = false
}
else {
displayInChat("Auto Cam is now on.", "#DA0808", "#1EBCC1");
autocam = true;
}
return "";
}
else if (chat_val.substring(1, 4) == "pan") {
if (pan_enabled == true) {
displayInChat("Pan is now off.", "#DA0808", "#1EBCC1");
pan_enabled = false;
pan = { "x": 0, "y": 0 };
}
else {
displayInChat("Pan is now on. Shift + Arrow Keys to pan.", "#DA0808", "#1EBCC1");
pan_enabled = true;
}
return "";
}
else if (chat_val.substring(1, 9) == "resetpan") {
pan = { "x": 0, "y": 0 };
displayInChat("Reset pan.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 7) == "aimbot") {
if (aimbot == true) {
displayInChat("Aimbot is now off.", "#DA0808", "#1EBCC1");
aimbot = false;
}
else {
displayInChat("Aimbot is now on.", "#DA0808", "#1EBCC1");
aimbot = true;
getplayerkeys();
}
return "";
}
else if (chat_val.substring(1, 8) == "volume " && chat_val.replace(/^\s+|\s+$/g, '').length >= 9) {
var text = chat_val.substring(8).replace(/^\s+|\s+$/g, '');
if (!isNaN(parseInt(text))) {
int_text = parseInt(text);
if (int_text >= 0 && int_text <= 100) {
jukeboxplayer.setVolume(int_text / 100);
jukeboxplayervolume = int_text;
displayInChat("Jukebox volume set to: " + int_text.toString() + " percent.", "#DA0808", "#1EBCC1");
}
else {
displayInChat("Volume must be between 0 and 100 percent.", "#DA0808", "#1EBCC1");
}
}
return "";
}
else if (chat_val.substring(1, 6) == "still") {
if (staystill == true) {
displayInChat("Still is now off.", "#DA0808", "#1EBCC1");
staystill = false;
staystillpos = [0, 0];
fire("keyup", { "keyCode": leftRight[0] }, Gdocument.getElementById("gamerenderer"));
fire("keyup", { "keyCode": leftRight[1] }, Gdocument.getElementById("gamerenderer"));
}
else {
if (playerids[myid].playerData?.transform) {
displayInChat("Still is now on.", "#DA0808", "#1EBCC1");
staystill = true;
staystillpos = [playerids[myid].playerData.transform.position.x / scale, playerids[myid].playerData.transform.position.y / scale];
getplayerkeys();
fire("keyup", { "keyCode": leftRight[0] }, Gdocument.getElementById("gamerenderer"));
fire("keyup", { "keyCode": leftRight[1] }, Gdocument.getElementById("gamerenderer"));
}
else {
displayInChat("You have to be alive to use this command.", "#DA0808", "#1EBCC1");
}
}
return "";
}
else if (chat_val.substring(1, 9) == "heavybot") {
if (heavybot == true) {
displayInChat("Heavy bot is now off.", "#DA0808", "#1EBCC1");
heavybot = false;
}
else {
displayInChat("Heavy bot is now on.", "#DA0808", "#1EBCC1");
heavybot = true;
getplayerkeys();
}
return "";
}
else if (chat_val.substring(1, 8) == "vtolbot") {
if (vtolbot == true) {
displayInChat("VTOL bot is now off.", "#DA0808", "#1EBCC1");
vtolbot = false;
}
else {
displayInChat("VTOL bot is now on.", "#DA0808", "#1EBCC1");
vtolbot = true;
getplayerkeys();
}
return "";
}
else if (chat_val.substring(1, 5) == "xray") {
Gdocument.getElementById("pretty_top_settings").click();
Gdocument.getElementById("settings_close").click();
if (Gdocument.getElementById("settings_graphicsquality").value == 1) {
displayInChat("You must have medium or high quality enabled to use this feature.", "#DA0808", "#1EBCC1");
return "";
}
if (parentDraw && Gdocument.getElementById("gamerenderer").style["visibility"] != "hidden") {
var addto = { "children": [] };
for (var i = 0; i < parentDraw.children.length; i++) {
if (parentDraw.children[i].constructor.name == "e") {
addto = parentDraw.children[i];
break;
}
}
var addto2 = { "children": [] };
for (var i = 0; i < addto.children.length; i++) {
if (addto.children[i].constructor.name == "e") {
addto2 = addto.children[i];
break;
}
}
var checkxray = addto2.children[0];
var addto3 = addto2.children[0].children;
if (addto3.length == 1) {
checkxray = checkxray.children[0];
addto3 = addto3[0].children;
}
var xrayon = false;
if (checkxray.xrayon) {
checkxray.xrayon = false;
xrayon = false;
}
else {
checkxray.xrayon = true;
xrayon = true;
}
if (xrayon) {
displayInChat("Xray is now on.", "#DA0808", "#1EBCC1");
for (var i = 0; i < addto3.length; i++) {
if (addto3[i].children.length > 0) {
var ids = [];
var ids2 = [];
for (var i3 = 0; i3 < addto3[i].children.length; i3++) {
addto3[i].children[i3].visible = false;
if (addto3[i].children[i3].children.length > 0) {
for (var i4 = 0; i4 < addto3[i].children[i3].children.length; i4++) {
if (addto3[i].children[i3].children[i4].geometry?.id) {
ids.push(addto3[i].children[i3].children[i4].geometry.id);
}
else if (addto3[i].children[i3].children[i4].texture?.baseTexture?.uid) {
ids2.push(addto3[i].children[i3].children[i4].texture.baseTexture.uid);
}
}
}
}
for (var i3 = 0; i3 < addto3[i].children.length; i3++) {
if (addto3[i].children[i3].children.length == 0) {
if (addto3[i].children[i3].geometry?.id) {
if (ids.includes(addto3[i].children[i3].geometry.id + 1)) {
addto3[i].children[i3].visible = true;
addto3[i].children[i3].alpha = 0.5;
}
}
else if (addto3[i].children[i3].texture?.baseTexture?.uid) {
if (ids2.includes(addto3[i].children[i3].texture.baseTexture.uid + 1)) {
addto3[i].children[i3].visible = true;
addto3[i].children[i3].alpha = 0.5;
}
}
if (addto3[i].children[i3].batchDirty) {
addto3[i].children[i3].visible = true;
addto3[i].children[i3].alpha = 0.5;
if (addto3[i].children[i3 + 1]) {
addto3[i].children[i3 + 1].visible = true;
addto3[i].children[i3 + 1].alpha = 0.5;
}
}
}
}
}
}
}
else {
displayInChat("Xray is now off.", "#DA0808", "#1EBCC1");
for (var i = 0; i < addto3.length; i++) {
for (var i2 = 0; i2 < addto3[i].children.length; i2++) {
addto3[i].children[i2].visible = true;
addto3[i].children[i2].alpha = 1;
}
}
}
}
return "";
}
else if (chat_val.substring(1, 6) == "zoom ") {
var text = chat_val.substring(6).replace(/^\s+|\s+$/g, '');
if (parentDraw && Gdocument.getElementById("gamerenderer").style["visibility"] != "hidden") {
var addto = 0;
for (var i = 0; i < parentDraw.children.length; i++) {
if (parentDraw.children[i].constructor.name == "e") {
addto = parentDraw.children[i];
break;
}
}
var canv = 0;
for (var i = 0; i < Gdocument.getElementById("gamerenderer").children.length; i++) {
if (Gdocument.getElementById("gamerenderer").children[i].constructor.name == "HTMLCanvasElement") {
canv = Gdocument.getElementById("gamerenderer").children[i];
break;
}
}
var width = parseInt(canv.style["width"]);
var height = parseInt(canv.style["height"]);
if (addto) {
if (text == "in") {
zoom *= 1.1;
}
else if (text == "out") {
zoom /= 1.1;
}
else if (text == "reset") {
zoom = 1;
}
else {
displayInChat("Options for zooming:", "#DA0808", "#1EBCC1");
displayInChat("in", "#DA0808", "#1EBCC1");
displayInChat("out", "#DA0808", "#1EBCC1");
displayInChat("reset", "#DA0808", "#1EBCC1");
return "";
}
addto.scale.x = zoom;
addto.scale.y = zoom;
parentDraw.x = -addto.scale.x * parseInt(width) / 2 + parseInt(width) / 2;
parentDraw.y = -addto.scale.y * parseInt(height) / 2 + parseInt(height) / 2;
parentDraw.children[0].x = parseInt(width) / 2 * addto.scale.x - parseInt(width) / 2;
parentDraw.children[0].y = parseInt(height) / 2 * addto.scale.y - parseInt(height) / 2;
if (addto.scale.x >= 0.99999 && addto.scale.y >= 0.99999 && !FollowCam) {
pixiCircle.visible = false;
}
else {
pixiCircle.visible = true;
}
}
}
return "";
}
else if (chat_val.substring(1, 9) == "hidechat") {
Gdocument.getElementById("ingamechatcontent").style["max-height"] = "0px";
return "";
}
else if (chat_val.substring(1, 9) == "showchat") {
Gdocument.getElementById("ingamechatcontent").style["max-height"] = chatheight.toString() + "px";
return "";
}
else if (chat_val.substring(1, 6) == "score") {
var element = Gdocument.getElementById("ingamewinner_scores");
if (element.style["opacity"] < 1) {
element.style["opacity"] = 1;
element.style["visibility"] = "visible";
}
else {
element.style["opacity"] = 0;
element.style["visibility"] = "unset";
}
return "";
}
else if (chat_val.substring(1, 7) == "scroll") {
if (scroll == false) {
scroll = true;
Gdocument.getElementById("ingamechatcontent").style["overflow-y"] = "scroll";
Gdocument.getElementById("ingamechatcontent").style["overflow-x"] = "hidden";
}
else if (scroll == true) {
scroll = false;
Gdocument.getElementById("ingamechatcontent").style["overflow-y"] = "hidden";
Gdocument.getElementById("ingamechatcontent").style["overflow-x"] = "hidden";
}
return "";
}
else if (chat_val.substring(1, 7) == "chatw ") {
var text = chat_val.substring(7).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "");
if (username == text) {
displayInChat("You cannot private chat with yourself.", "#DA0808", "#1EBCC1");
return "";
}
private_chat = text;
SEND("42" + JSON.stringify([4, { "type": "request public key", "from": username, "to": private_chat }]));
request_public_key_time_stamp = Date.now();
setTimeout(function () { if (private_chat_public_key[0] != private_chat) { displayInChat("Failed to connect to " + private_chat + ".", "#DA0808", "#1EBCC1"); private_chat = private_chat_public_key[0]; } }, 1600);
return "";
}
else if (chat_val.substring(1, 8) == "lagbot " && chat_val.replace(/^\s+|\s+$/g, '').length >= 9) {
var text = chat_val.substring(8).replace(/^\s+|\s+$/g, '');
if (!isNaN(parseInt(text))) {
int_text = parseInt(text);
if (int_text == 0) {
causelag = false;
causelag2 = 0;
displayInChat("Lagbot is now off.", "#DA0808", "#1EBCC1");
displayInChat("To enable lagbot, type '/lagbot [number]' with a number between 1 and 10.", "#DA0808", "#1EBCC1");
}
else if (int_text > 0 && int_text <= 10) {
causelag = true;
causelag2 = 45 * int_text;
displayInChat("Lagbot is now on with a lag setting of " + int_text.toString() + " (~" + (45 * int_text).toString() + "MS).", "#DA0808", "#1EBCC1");
displayInChat("Type '/lagbot 0' to turn off lagbot.", "#DA0808", "#1EBCC1");
}
else {
displayInChat("To enable lagbot, type '/lagbot [number]' with a number between 1 and 10.", "#DA0808", "#1EBCC1");
displayInChat("Type '/lagbot 0' to turn off lagbot.", "#DA0808", "#1EBCC1");
}
return "";
}
}
else if (chat_val.substring(1, 8) == "record " && chat_val.replace(/^\s+|\s+$/g, '').length >= 9) {
var text = chat_val.substring(8).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "");
var keys = Object.keys(playerids);
var recordingid2 = -1;
for (var i = 0; i < keys.length; i++) {
if (playerids[keys[i]].userName == text) {
recordingid2 = keys[i];
}
}
if (recordingid2 == -1) {
displayInChat("Player not found. Please type a valid username.", "#DA0808", "#1EBCC1");
return "";
}
else {
recording = true;
recordingid = recordingid2;
displayInChat(playerids[recordingid].userName + " is now being recorded.", "#DA0808", "#1EBCC1");
if (recordingdata.length > 0) {
displayInChat("Any unsaved recording data is now cleared.", "#DA0808", "#1EBCC1");
}
recordingdata = [];
}
return "";
}
else if (chat_val.substring(1, 11) == "stoprecord") {
if (recording) {
displayInChat(playerids[recordingid].userName + " is not being recorded anymore.", "#DA0808", "#1EBCC1");
displayInChat("Type '/saverecording [text]' to save this recording.", "#DA0808", "#1EBCC1");
recording = false;
recordingid = -1;
recordingdata[0][1] = 0;
}
else {
displayInChat("No one is being recorded.", "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 15) == "saverecording " && chat_val.replace(/^\s+|\s+$/g, '').length >= 16) {
var text = chat_val.substring(15).replace(/^\s+|\s+$/g, '');
if (Object.keys(recorddata).includes(text)) {
displayInChat("This recording already exists. Please use a different name or type '/delrecording " + text + "'.", "#DA0808", "#1EBCC1");
}
else if (recordingdata.length > 0) {
recorddata[text] = JSON.parse(JSON.stringify(recordingdata));
displayInChat("Recording saved as: " + text, "#DA0808", "#1EBCC1");
}
else {
displayInChat("There is no recording data to save. Please record data using '/record [username]'", "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 14) == "delrecording " && chat_val.replace(/^\s+|\s+$/g, '').length >= 15) {
var text = chat_val.substring(14).replace(/^\s+|\s+$/g, '');
if (Object.keys(recorddata).includes(text)) {
displayInChat("Recording deleted.", "#DA0808", "#1EBCC1");
delete recorddata[text];
}
else {
displayInChat("This recording does not exist.", "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 15) == "loadrecording " && chat_val.replace(/^\s+|\s+$/g, '').length >= 16) {
var text = chat_val.substring(15).replace(/^\s+|\s+$/g, '');
if (!Object.keys(recorddata).includes(text)) {
displayInChat("This recording does not exist.", "#DA0808", "#1EBCC1");
}
else {
if (recordingdata.length > 0) {
displayInChat("Any unsaved recording data is now cleared.", "#DA0808", "#1EBCC1");
}
recordingdata = JSON.parse(JSON.stringify(recorddata[text]));
displayInChat("Recording data is now loaded.", "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 7) == "replay") {
if (recording) {
displayInChat(playerids[recordingid].userName + " is not being recorded anymore.", "#DA0808", "#1EBCC1");
displayInChat("Type '/saverecording [text]' to save this recording.", "#DA0808", "#1EBCC1");
recordingid = -1;
recording = false;
recordingdata[0][1] = 0;
}
replay();
return "";
}
else if (chat_val.substring(1, 5) == "msg " && chat_val.replace(/^\s+|\s+$/g, '').length >= 6) {
if (private_chat_public_key[1][0] != 0 && private_chat_public_key[1][1] != 0 && private_chat_public_key[0] == private_chat) {
var text = chat_val.substring(5).replace(/^\s+|\s+$/g, '');
pmlastmessage = text.slice(0, 400);
ENCRYPT_MESSAGE(private_chat_public_key[1], text).then(function (e) {
SEND("42" + JSON.stringify([4, { "type": "private chat", "from": username, "to": private_chat, "message": e }]));
});
displayInChat("> " + username + ": ", "#DA0808", "#1EBCC1", { sanitize: false }, text, false);
Gdocument.getElementById("newbonklobby_chat_content").children[Gdocument.getElementById("newbonklobby_chat_content").children.length - 1].children[0].parentElement.style["parsed"] = true;
Gdocument.getElementById("ingamechatcontent").children[Gdocument.getElementById("ingamechatcontent").children.length - 1].children[0].parentElement.style["parsed"] = true;
Laster_message = lastmessage();
}
return "";
}
else if (chat_val.substring(1, 10) == "ignorepm " && chat_val.replace(/^\s+|\s+$/g, '').length >= 11) {
var text = chat_val.substring(10).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "");
if (ignorepmlist.includes(text)) {
var index = ignorepmlist.indexOf(text);
ignorepmlist.splice(index, 1);
displayInChat("You are not ignoring private messages from " + text + ".", "#DA0808", "#1EBCC1");
}
else {
ignorepmlist.push(text);
displayInChat("You are now ignoring private messages from " + text + ".", "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 8) == "pmusers") {
pmusers = [];
SEND("42" + JSON.stringify([4, { "type": "request private chat users", "from": username }]));
pmuserstimestamp = Date.now();
setTimeout(function () {
if (pmusers.length == 0) {
displayInChat("You cannot private chat with anyone.", "#DA0808", "#1EBCC1");
} else { displayInChat("You can private chat with:", "#DA0808", "#1EBCC1"); for (var i = 0; i < pmusers.length; i++) { var code = 'Gwindow.private_chat = ' + JSON.stringify(pmusers[i]) + '; Gwindow.SEND("42"+JSON.stringify([4,{"type":"request public key","from":Gwindow.username,"to":Gwindow.private_chat}])); Gwindow.request_public_key_time_stamp = Date.now(); setTimeout(function(){if(Gwindow.private_chat_public_key[0]!=Gwindow.private_chat){Gwindow.displayInChat("Failed to connect to "+Gwindow.private_chat+".","#DA0808","#1EBCC1");Gwindow.private_chat = Gwindow.private_chat_public_key[0];}},1600);'; displayInChat('<a onclick = \'' + code + '\' href = "javascript:void(0);" style = "color:green">' + sanitize(pmusers[i]) + '</a>', "#DA0808", "#1EBCC1", { sanitize: false }); Gdocument.getElementById("newbonklobby_chat_content").children[Gdocument.getElementById("newbonklobby_chat_content").children.length - 1].children[0].parentElement.style["parsed"] = true; Gdocument.getElementById("ingamechatcontent").children[Gdocument.getElementById("ingamechatcontent").children.length - 1].children[0].parentElement.style["parsed"] = true; Laster_message = lastmessage(); } }
}, 1600);
return "";
}
else if (chat_val.substring(1, 7) == "style " && chat_val.replace(/^\s+|\s+$/g, '').length >= 11) {
var text = chat_val.substring(7).replace(/^\s+|\s+$/g, '');
var text2 = text.split(" ");
var array = [];
for (var i = 0; i < text2.length; i++) {
var parsed = parseInt(text2[i]);
if (!isNaN(parsed)) {
array.push(parsed);
}
}
if (array[0] + array[1] + array[2] == 0) {
array = [1, 1, 1];
}
if (array.length == 3) {
SEND("42" + JSON.stringify([4, { "type": "style", "from": username, "style": array }]));
allstyles[username] = array;
mystyle = [...array];
displayInChat("Set style to (" + array.toString() + "). Type '/style' to reset style.", "#DA0808", "#1EBCC1");
}
else {
displayInChat("Please enter a valid RGB color code seperated by space. For example, white = '/style 255 255 255'. Type '/style' to reset style.", "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 6) == "style") {
SEND("42" + JSON.stringify([4, { "type": "style", "from": username, "style": [0, 0, 0] }]));
allstyles[username] = [0, 0, 0];
mystyle = [0, 0, 0];
displayInChat("Reset style.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 8) == "friend " && chat_val.replace(/^\s+|\s+$/g, '').length >= 12) {
var text = chat_val.substring(8).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "");
var keys = Object.keys(playerids);
for (var i = 0; i < keys.length; i++) {
if (playerids[keys[i]].userName == text) {
SEND('42[35,{"id":' + keys[i] + '}]');
}
}
return "";
}
else if (chat_val.substring(1, 6) == "lobby") {
lobby();
return "";
}
else if (chat_val.substring(1, 9) == "debugger") {
if (Gdocument.getElementById("BonkCommandsDebuggerContainer").style["display"] == "none") {
debuggeropen = true;
Gdocument.getElementById("BonkCommandsDebuggerContainer").style["display"] = "block";
Gdocument.getElementById("newbonklobby_chat_input").style["display"] = "none";
Gdocument.getElementById("ingamechatinputtext").style["display"] = "none";
}
else {
debuggeropen = false;
Gdocument.getElementById("BonkCommandsDebuggerContainer").style["display"] = "none";
Gdocument.getElementById("newbonklobby_chat_input").style["display"] = "";
Gdocument.getElementById("ingamechatinputtext").style["display"] = "";
}
return "";
}
else if (chat_val.substring(1, 6) == "team " && chat_val.replace(/^\s+|\s+$/g, '').length >= 7) {
var text = chat_val.substring(6).replace(/^\s+|\s+$/g, '');
if (text == "r") { Gdocument.getElementById("newbonklobby_redbutton").click(); }
else if (text == "g") { Gdocument.getElementById("newbonklobby_greenbutton").click(); }
else if (text == "y") { Gdocument.getElementById("newbonklobby_yellowbutton").click(); }
else if (text == "b") { Gdocument.getElementById("newbonklobby_bluebutton").click(); }
else if (text == "s") { Gdocument.getElementById("newbonklobby_specbutton").click(); }
else if (text == "f") { Gdocument.getElementById("newbonklobby_ffabutton").click(); }
return "";
}
else if (chat_val.substring(1, 7) == "notify") {
npermissions = 1;
return "";
}
else if (chat_val.substring(1, 11) == "stopnotify") {
npermissions = 0;
return "";
}
else if (chat_val.substring(1, 8) == "support") {
displayInChat("Thanks everyone for helping me make this mod - LEGENDBOSS123", "#0000FF", "#FFFFFF");
displayInChat("mastery3", "#0000FF", "#FFFFFF");
displayInChat("UnmatchedBracket aka Left Paren", "#0000FF", "#FFFFFF");
displayInChat("iNeonz", "#0000FF", "#FFFFFF");
return "";
}
else if (chat_val.substring(1, 9) == "pollstat") {
if (pollactive[0] || pollactive2[0]) {
var count = [0, 0, 0, 0];
var keys = Object.keys(playerids);
for (var i = 0; i < keys.length; i++) {
if (ishost) {
if (playerids[keys[i]].vote.poll != -1 && playerids[keys[i]].vote.poll < pollactive[3].length - 1) {
count[playerids[keys[i]].vote.poll]++;
}
}
else {
if (playerids[keys[i]].vote.poll != -1 && playerids[keys[i]].vote.poll < pollactive2[2].length - 1) {
count[playerids[keys[i]].vote.poll]++;
}
}
}
for (var i = 0; i < count.length; i++) {
if (count[i] > 1) {
displayInChat(count[i].toString() + " people voted for option " + letters[i] + ".", "#DA0808", "#1EBCC1");
}
if (count[i] == 1) {
displayInChat(count[i].toString() + " person voted for option " + letters[i] + ".", "#DA0808", "#1EBCC1");
}
}
if (ishost) {
displayInChat("The poll will end in: " + ((pollactive[2] - Date.now()) / 1000).toString() + " seconds.", "#DA0808", "#1EBCC1");
}
displayInChat("The poll is:", "#DA0808", "#1EBCC1");
if (ishost) {
for (var i = 0; i < pollactive[3].length; i++) {
displayInChat(letters[i] + ") " + pollactive[3][i], "#DA0808", "#1EBCC1");
}
}
else {
for (var i = 0; i < pollactive2[2].length; i++) {
displayInChat(letters[i] + ") " + pollactive2[2][i], "#DA0808", "#1EBCC1");
}
}
}
else {
displayInChat("No poll has been started.", "#DA0808", "#1EBCC1");
if (ishost) {
displayInChat("Type '/startpoll [seconds]' to start a poll.", "#DA0808", "#1EBCC1");
if (poll.length > 0) {
displayInChat("The poll is:", "#DA0808", "#1EBCC1");
for (var i = 0; i < poll.length; i++) {
displayInChat(letters[i] + ") " + poll[i], "#DA0808", "#1EBCC1");
}
}
}
}
return "";
}
else if (chat_val.substring(1, 5) == "help" || chat_val.substring(1, 2) == "?") {
for (var i = 0; i < help.length; i++) {
if (help[i].startsWith("/")) {
var splitted = help[i].substring(1).split(" ");
var command = splitted[0];
var rest = "";
if (splitted.length > 1) {
rest = " " + splitted.slice(1).join(" ");
}
displayInChat("/" + '<a onclick = \'Gwindow.displayadvhelp("' + command + '");\' style = "color:green;" href = "javascript:void(0);">' + command + '</a>' + rest, "#DA0808", "#1EBCC1", { sanitize: false }, "", false);
}
else if (help[i].startsWith("Alt ")) {
displayInChat('<a onclick = \'Gwindow.displayadvhelp("' + help[i] + '");\' style = "color:green;" href = "javascript:void(0);">' + help[i] + '</a>', "#DA0808", "#1EBCC1", { sanitize: false }, "", false);
}
else {
displayInChat(help[i], "#DA0808", "#1EBCC1");
}
}
return "";
}
else if (chat_val.substring(1, 9) == "advhelp " && chat_val.replace(/^\s+|\s+$/g, '').length >= 10) {
var text = chat_val.substring(9).replace(/^\s+|\s+$/g, '');
if (typeof (adv_help[text]) != 'undefined') {
displayInChat(adv_help[text], "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 6) == "mode " && chat_val.replace(/^\s+|\s+$/g, '').length >= 7) {
var text = chat_val.substring(6).replace(/^\s+|\s+$/g, '');
var mode = "";
var text2 = text;
if (text == "arrows") {
text2 = "Arrows";
mode = "ar";
}
else if (text == "death arrows") {
mode = "ard";
text2 = "Death Arrows";
}
else if (text == "grapple") {
mode = "sp";
text2 = "Grapple";
}
else if (text == "classic") {
mode = "b";
text2 = "Classic";
}
else if (text == "vtol") {
mode = "v";
text2 = "VTOL";
}
else {
displayInChat("Mode options:", "#DA0808", "#1EBCC1");
displayInChat("classic", "#DA0808", "#1EBCC1");
displayInChat("arrows", "#DA0808", "#1EBCC1");
displayInChat("death arrows", "#DA0808", "#1EBCC1");
displayInChat("grapple", "#DA0808", "#1EBCC1");
displayInChat("vtol", "#DA0808", "#1EBCC1");
}
if (mode != "") {
if (ishost) {
SEND('42[20,{"ga":"b","mo":"' + mode + '"}]');
RECIEVE('42[26,"b","' + mode + '"]');
displayInChat("Changed mode to " + text + ".", "#DA0808", "#1EBCC1");
}
else {
if (playerids[myid].ratelimit.mode + 1000 < Date.now()) {
playerids[myid].ratelimit.mode = Date.now();
SEND("42" + JSON.stringify([4, { "type": "request mode", "from": username, "mode": mode }]));
var code = 'if(!Gwindow.ishost){Gwindow.displayInChat("You must be host to change the mode.","#DA0808","#1EBCC1",{sanitize:false},"",true)}else{Gwindow.changemode("' + mode + '")}';
displayInChat('> ' + username + ' requests [<a onclick = \'' + code + '\' style = "color:green;" href = "javascript:void(0);">' + text2 + '</a>]', "#DA0808", "#1EBCC1", { sanitize: false }, " mode.");
}
else {
displayInChat("You are requesting modes too quickly.", "#DA0808", "#1EBCC1");
}
}
}
return "";
}
else if (ishost) {
if (chat_val.substring(1, 11) == "nextafter " && chat_val.replace(/^\s+|\s+$/g, '').length >= 12) {
var text = Number(chat_val.substring(11).replace(/^\s+|\s+$/g, ''));
if (isNaN(text)) {
displayInChat("Type a positive number.", "#DA0808", "#1EBCC1");
return "";
}
else if (text <= 0) {
displayInChat("Type a positive number.", "#DA0808", "#1EBCC1");
return "";
}
nextafter = text;
displayInChat("Set next after to: " + text.toString() + " seconds.", "#DA0808", "#1EBCC1");
displayInChat("Type '/nextafter' to reset next after.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 10) == "nextafter") {
nextafter = 0;
displayInChat("Reset next after.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 5) == "next" && stopquickplay == 0) {
roundsperqp2 = 0;
if (shuffle) {
var e = Gdocument.getElementById("maploadwindowmapscontainer").children;
var available = [];
var availableindexes = [];
var notempty = false;
for (var i = 0; i < e.length; i++) {
var a = false;
[...e[i].children].forEach(function (e1) { if (e1.className == "quickplaycheckbox quickplaychecked") { a = e1.checked } });
available.push(a);
if (a) {
availableindexes.push(i);
notempty = true;
}
}
if (notempty) {
if (availableindexes.length != 1) {
availableindexes.splice(availableindexes.indexOf(quicki % Gdocument.getElementById("maploadwindowmapscontainer").children.length), 1);
}
quicki = availableindexes[Math.floor(Math.random() * availableindexes.length)];
}
}
else {
var e = Gdocument.getElementById("maploadwindowmapscontainer").children;
var available = [];
var availableindexes = [];
var notempty = false;
for (var i = 0; i < e.length; i++) {
var a = false;
[...e[i].children].forEach(function (e1) { if (e1.className == "quickplaycheckbox quickplaychecked") { a = e1.checked } });
available.push(a);
if (a) {
availableindexes.push(i);
notempty = true;
}
}
if (notempty) {
var above = [];
for (var i = 0; i < availableindexes.length; i++) {
if (availableindexes[i] > quicki && !reverseqp) {
above.push(availableindexes[i]);
}
else if (availableindexes[i] < quicki && reverseqp) {
above.push(availableindexes[i])
}
}
if (above.length > 0) {
quicki = above[0];
if (reverseqp) {
quicki = above[above.length - 1];
}
}
else {
quicki = availableindexes[0];
if (reverseqp) {
quicki = availableindexes[availableindexes.length - 1];
}
}
}
}
gotonextmap(quicki % (Gdocument.getElementById("maploadwindowmapscontainer").children.length));
displayInChat("Switched to next map.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 9) == "freejoin") {
if (freejoin == false) {
freejoin = true;
displayInChat("Freejoin is now on.", "#DA0808", "#1EBCC1");
}
else {
freejoin = false;
displayInChat("Freejoin is now off.", "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 8) == "instaqp") {
if (instaqp == false) {
instaqp = true;
displayInChat("Instaqp is now on.", "#DA0808", "#1EBCC1");
}
else {
instaqp = false;
displayInChat("Instaqp is now off.", "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 9) == "previous" && stopquickplay == 0) {
roundsperqp2 = 0;
if (shuffle) {
var e = Gdocument.getElementById("maploadwindowmapscontainer").children;
var available = [];
var availableindexes = [];
var notempty = false;
for (var i = 0; i < e.length; i++) {
var a = false;
[...e[i].children].forEach(function (e1) { if (e1.className == "quickplaycheckbox quickplaychecked") { a = e1.checked } });
available.push(a);
if (a) {
availableindexes.push(i);
notempty = true;
}
}
if (notempty) {
if (availableindexes.length != 1) {
availableindexes.splice(availableindexes.indexOf(quicki % Gdocument.getElementById("maploadwindowmapscontainer").children.length), 1);
}
quicki = availableindexes[Math.floor(Math.random() * availableindexes.length)];
}
}
else {
var e = Gdocument.getElementById("maploadwindowmapscontainer").children;
var available = [];
var availableindexes = [];
var notempty = false;
for (var i = 0; i < e.length; i++) {
var a = false;
[...e[i].children].forEach(function (e1) { if (e1.className == "quickplaycheckbox quickplaychecked") { a = e1.checked } });
available.push(a);
if (a) {
availableindexes.push(i);
notempty = true;
}
}
if (notempty) {
var above = [];
for (var i = 0; i < availableindexes.length; i++) {
if (availableindexes[i] < quicki && !reverseqp) {
above.push(availableindexes[i]);
}
else if (availableindexes[i] > quicki && reverseqp) {
above.push(availableindexes[i])
}
}
if (above.length > 0) {
quicki = above[above.length - 1];
if (reverseqp) {
quicki = above[0];
}
}
else {
quicki = availableindexes[availableindexes.length - 1];
if (reverseqp) {
quicki = availableindexes[0];
}
}
}
}
gotonextmap(quicki % (Gdocument.getElementById("maploadwindowmapscontainer").children.length));
displayInChat("Switched to previous map.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 6) == "start" && chat_val.length == 6) {
if (Gdocument.getElementById("mapeditorcontainer").style["display"] != "block") {
Gdocument.getElementById("newbonklobby_editorbutton").click();
}
if (recmodebool && ishost) {
var mode = Gdocument.getElementById("mapeditor_modeselect").value;
if (mode == "" && defaultmode != "d") {
mode = defaultmode;
}
if (mode != "") {
RECIEVE('42[26,"b","' + mode + '"]');
}
}
Gdocument.getElementById("mapeditor_close").click();
Gdocument.getElementById("newbonklobby").style["display"] = "none";
roundsperqp2 = 0;
Gdocument.getElementById("mapeditor_midbox_testbutton").click();
return "";
}
else if (chat_val.substring(1, 8) == "startqp" && stopquickplay == 1) {
stopquickplay = 0;
quicki = 0;
qppaused = false;
displayInChat("Enabled quickplay.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 7) == "stopqp" && stopquickplay == 0) {
stopquickplay = 1;
quicki = 0;
qppaused = false;
displayInChat("Disabled quickplay.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 8) == "pauseqp" && stopquickplay == 0) {
if (qppaused == false) {
qppaused = true;
displayInChat("Paused quickplay.", "#DA0808", "#1EBCC1");
}
else {
qppaused = false;
displayInChat("Unpaused quickplay.", "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 6) == "revqp" && stopquickplay == 0) {
if (reverseqp == false) {
reverseqp = true;
displayInChat("Reverseqp is now on..", "#DA0808", "#1EBCC1");
}
else {
reverseqp = false;
displayInChat("Reverseqp is now off.", "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 8) == "qpmode " && chat_val.replace(/^\s+|\s+$/g, '').length >= 9) {
var text = chat_val.substring(8).replace(/^\s+|\s+$/g, '');
if (text == "arrows") {
qpmode = "arrowsquick";
displayInChat("Set qp mode to arrows.", "#DA0808", "#1EBCC1");
}
else if (text == "classic") {
qpmode = "bonkquick";
displayInChat("Set qp mode to classic.", "#DA0808", "#1EBCC1");
}
else if (text == "grapple") {
qpmode = "grapplequick";
displayInChat("Set qp mode to grapple.", "#DA0808", "#1EBCC1");
}
else {
displayInChat("Mode options:", "#DA0808", "#1EBCC1");
displayInChat("classic", "#DA0808", "#1EBCC1");
displayInChat("arrows", "#DA0808", "#1EBCC1");
displayInChat("grapple", "#DA0808", "#1EBCC1");
return "";
}
displayInChat("Type '/qpmode' to reset qp mode.", "#DA0808", "#1EBCC1");
if (Gdocument.getElementById("mapeditorcontainer").style["display"] != "block") {
Gdocument.getElementById("newbonklobby_editorbutton").click();
}
if (recmodebool && ishost) {
var mode = Gdocument.getElementById("mapeditor_modeselect").value;
if (mode == "" && defaultmode != "d") {
mode = defaultmode;
}
if (mode != "") {
RECIEVE('42[26,"b","' + mode + '"]');
}
}
Gdocument.getElementById("mapeditor_close").click();
Gdocument.getElementById("newbonklobby").style["display"] = "none";
roundsperqp2 = 0;
Gdocument.getElementById("mapeditor_midbox_testbutton").click();
return "";
}
else if (chat_val.substring(1, 7) == "qpmode") {
qpmode = false;
displayInChat("Reset qp mode.", "#DA0808", "#1EBCC1");
if (Gdocument.getElementById("mapeditorcontainer").style["display"] != "block") {
Gdocument.getElementById("newbonklobby_editorbutton").click();
}
if (recmodebool && ishost) {
var mode = Gdocument.getElementById("mapeditor_modeselect").value;
if (mode == "" && defaultmode != "d") {
mode = defaultmode;
}
if (mode != "") {
RECIEVE('42[26,"b","' + mode + '"]');
}
}
Gdocument.getElementById("mapeditor_close").click();
Gdocument.getElementById("newbonklobby").style["display"] = "none";
roundsperqp2 = 0;
Gdocument.getElementById("mapeditor_midbox_testbutton").click();
return "";
}
else if (1 == 0 && chat_val.substring(1, 9) == "jukebox " && chat_val.replace(/^\s+|\s+$/g, '').length >= 10) {
var text = chat_val.substring(9).replace(/^\s+|\s+$/g, '');
SEND("42" + JSON.stringify([4, { "type": "video player", "from": username, "url": text, "timestamp": Date.now() + 2000, "to": [-1] }]));
displayInChat("Jukebox is loading... Please wait a few seconds.", "#DA0808", "#1EBCC1");
changeJukeboxURL(text, Date.now() + 2000);
return "";
}
else if (1 == 0 && chat_val.substring(1, 13) == "pausejukebox") {
if (jukeboxplayer.src != "" && !jukeboxplayer.isPaused()) {
displayInChat("Jukebox is now paused.", "#DA0808", "#1EBCC1");
jukeboxplayer.pause();
SEND("42" + JSON.stringify([4, { "type": "video player", "from": username, "url": "", "timestamp": Date.now(), "to": [-1] }]));
}
return "";
}
else if (1 == 0 && chat_val.substring(1, 13) == "resetjukebox") {
if (jukeboxplayer.src != "") {
jukeboxplayer.setCurrentTime(0);
displayInChat("Jukebox has reset.", "#DA0808", "#1EBCC1");
changeJukeboxURL(jukeboxplayerURL, Date.now() + 2000);
SEND("42" + JSON.stringify([4, { "type": "video player", "from": username, "url": jukeboxplayerURL, "timestamp": Date.now() + 2000, "to": [-1] }]));
}
return "";
}
else if (1 == 0 && chat_val.substring(1, 12) == "playjukebox") {
if (jukeboxplayer.src != "" && jukeboxplayer.isPaused()) {
changeJukeboxURL(jukeboxplayerURL, Date.now() - jukeboxplayer.getCurrentTime() * 1000);
SEND("42" + JSON.stringify([4, { "type": "video player", "from": username, "url": jukeboxplayerURL, "timestamp": Date.now() - jukeboxplayer.getCurrentTime() * 1000, "to": [-1] }]));
}
return "";
}
else if (chat_val.substring(1, 5) == "ban " && chat_val.replace(/^\s+|\s+$/g, '').length >= 6) {
banned.push(chat_val.substring(5).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', ""));
displayInChat("Banned " + chat_val.substring(5).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "") + ".", "#DA0808", "#1EBCC1");
return "/kick '" + chat_val.substring(5).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "") + "'";
}
else if (chat_val.substring(1, 6) == "kill " && chat_val.replace(/^\s+|\s+$/g, '').length >= 7) {
var text = chat_val.substring(6).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "");
var keys = Object.keys(playerids);
var killid = undefined;
for (var i = 0; i < keys.length; i++) {
if (playerids[keys[i]].userName == text) {
killid = keys[i];
}
}
if (typeof (killid) != "undefined" && Gdocument.getElementById("gamerenderer").style["visibility"] != "hidden" && !killedids.includes(killid)) {
currentFrame = Math.floor((Date.now() - gameStartTimeStamp) / 1000 * 30);
killedids.push(killid);
SEND('42[25,{"a":{"playersLeft":[' + killid.toString() + '],"playersJoined":[]},"f":' + currentFrame.toString() + '}]');
RECIEVE('42[31,{"a":{"playersLeft":[' + killid.toString() + '],"playersJoined":[]},"f":' + currentFrame.toString() + '}]');
}
return "";
}
else if (chat_val.substring(1, 6) == "killA") {
var keys = Object.keys(playerids);
if (Gdocument.getElementById("gamerenderer").style["visibility"] != "hidden") {
currentFrame = Math.floor((Date.now() - gameStartTimeStamp) / 1000 * 30);
SEND('42[25,{"a":{"playersLeft":[' + keys.toString() + '],"playersJoined":[]},"f":' + currentFrame.toString() + '}]');
RECIEVE('42[31,{"a":{"playersLeft":[' + keys.toString() + '],"playersJoined":[]},"f":' + currentFrame.toString() + '}]');
}
return "";
}
else if (chat_val.substring(1, 10) == "balanceA " && chat_val.replace(/^\s+|\s+$/g, '').length >= 11) {
var text = chat_val.substring(10).replace(/^\s+|\s+$/g, '');
if (!isNaN(parseInt(text))) {
if (parseInt(text) >= -100 && parseInt(text) <= 100) {
var keys = Object.keys(playerids);
for (var i = 0; i < keys.length; i++) {
SEND('42[29,{"sid":' + keys[i] + ',"bal":' + text + '}]');
RECIEVE('42[36,' + keys[i] + ',' + text + ']');
}
}
}
return "";
}
else if (chat_val.substring(1, 10) == "brighten " && chat_val.replace(/^\s+|\s+$/g, '').length >= 11) {
var text = chat_val.substring(10).replace(/^\s+|\s+$/g, '');
if (!isNaN(Number(text))) {
var intText = Number(text);
var f = function (x) {
return x * intText;
};
loadMap(changeColor(currentmap[currentmap.length - 1], f, f, f));
}
return "";
}
else if (chat_val.substring(1, 12) == "colorshift " && chat_val.replace(/^\s+|\s+$/g, '').length >= 13) {
var text = chat_val.substring(12).replace(/^\s+|\s+$/g, '');
if (!isNaN(Number(text))) {
var intText = Number(text);
var seed = [Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5];
var f = function (x, ind) {
return x * 1 + seed[ind] * intText;
};
loadMap(changeColor(currentmap[currentmap.length - 1], f, f, f));
}
return "";
}
else if (chat_val.substring(1, 6) == "cban " && chat_val.replace(/^\s+|\s+$/g, '').length >= 7) {
var text = chat_val.substring(6).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "");;
var user = GETIDBYUSER(text);
if (user != -1) {
SEND('42' + JSON.stringify([9, { "banshortid": user, "kickonly": true }]));
}
if (crashbanned.includes(text)) {
displayInChat("Already crashbanned " + text + ".", "#DA0808", "#1EBCC1");
return "";
}
crashbanned.push(text);
displayInChat("Crashbanned " + text + ".", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 8) == "uncban " && chat_val.replace(/^\s+|\s+$/g, '').length >= 9) {
var text = chat_val.substring(8).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "");;
if (crashbanned.includes(text)) {
crashbanned.splice(crashbanned.indexOf(text), 1);
displayInChat("Un crashbanned " + text + ".", "#DA0808", "#1EBCC1");
return "";
}
displayInChat(text + " was never crashbanned.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 10) == "balanceT " && chat_val.replace(/^\s+|\s+$/g, '').length >= 11) {
var text = chat_val.substring(10).replace(/^\s+|\s+$/g, '');
var text2 = text.split(" ").filter(function (e) { if (e != "") { return true; } return false; });
if (text2.length != 2 || isNaN(parseInt(text2[1])) || !["s", "r", "b", "y", "g", "f"].includes(text2[0])) {
displayInChat("Please enter a team letter and a number to balance.", "#DA0808", "#1EBCC1");
return "";
}
var teamdict = { "s": 0, "f": 1, "r": 2, "b": 3, "g": 4, "y": 5 };
if (parseInt(text2[1]) >= -100 && parseInt(text2[1]) <= 100) {
var keys = Object.keys(playerids);
for (var i = 0; i < keys.length; i++) {
if (playerids[keys[i]].team == teamdict[text2[0]]) {
SEND('42[29,{"sid":' + keys[i] + ',"bal":' + text2[1] + '}]');
RECIEVE('42[36,' + keys[i] + ',' + text2[1] + ']');
}
}
}
return "";
}
else if (chat_val.substring(1, 10) == "resetpoll") {
poll = [];
displayInChat("The poll has been reset.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 11) == "addoption " && chat_val.replace(/^\s+|\s+$/g, '').length >= 12) {
var text = chat_val.substring(11).replace(/^\s+|\s+$/g, '');
if (text.length > 50) {
displayInChat("Your option is greater than 50 characters.", "#DA0808", "#1EBCC1");
return "";
}
if (poll.includes(text)) {
displayInChat("This option already exists.", "#DA0808", "#1EBCC1");
}
else if (poll.length >= 4) {
displayInChat("Your poll already has the max 4 amounts of options.", "#DA0808", "#1EBCC1");
displayInChat("Type '/deloption [letter]' to remove a option.", "#DA0808", "#1EBCC1");
displayInChat("The poll is:", "#DA0808", "#1EBCC1");
for (var i = 0; i < poll.length; i++) {
displayInChat(letters[i] + ") " + poll[i], "#DA0808", "#1EBCC1");
}
}
else {
poll.push(text);
displayInChat("The poll is now:", "#DA0808", "#1EBCC1");
for (var i = 0; i < poll.length; i++) {
displayInChat(letters[i] + ") " + poll[i], "#DA0808", "#1EBCC1");
}
}
return "";
}
else if (chat_val.substring(1, 11) == "deloption " && chat_val.replace(/^\s+|\s+$/g, '').length >= 12) {
var text = letters.indexOf(chat_val.substring(11).replace(/^\s+|\s+$/g, ''));
if (text == -1 || text >= poll.length) {
if (poll.length > 0) {
displayInChat("Available options are:", "#DA0808", "#1EBCC1");
for (var i = 0; i < poll.length; i++) {
displayInChat(letters[i], "#DA0808", "#1EBCC1");
}
}
else {
displayInChat("Your poll is empty.", "#DA0808", "#1EBCC1");
displayInChat("Type '/addoption [text]' to add an option.", "#DA0808", "#1EBCC1");
}
}
else {
poll.splice(text, 1);
displayInChat("The poll is now:", "#DA0808", "#1EBCC1");
for (var i = 0; i < poll.length; i++) {
displayInChat(letters[i] + ") " + poll[i], "#DA0808", "#1EBCC1");
}
}
return "";
}
else if (chat_val.substring(1, 11) == "startpoll " && chat_val.replace(/^\s+|\s+$/g, '').length >= 12) {
var text = Number(chat_val.substring(11).replace(/^\s+|\s+$/g, ''));
if (isNaN(text)) {
displayInChat("Type a positive number.", "#DA0808", "#1EBCC1");
return "";
}
else if (text <= 0) {
displayInChat("Type a positive number.", "#DA0808", "#1EBCC1");
return "";
}
else if (text < 10) {
displayInChat("Your poll has to last for at least 5 seconds.", "#DA0808", "#1EBCC1");
return "";
}
if (pollactive[0]) {
displayInChat("There is already an ongoing poll.", "#DA0808", "#1EBCC1");
displayInChat("Type '/endpoll' to end the poll.", "#DA0808", "#1EBCC1");
return "";
}
if (poll.length < 2) {
displayInChat("Your poll needs at least 2 options.", "#DA0808", "#1EBCC1");
displayInChat("Type '/addoption' to add to the poll.", "#DA0808", "#1EBCC1");
return "";
}
var now = Date.now();
pollactive = [true, now, now + text * 1000, [...poll]];
playerids[myid].ratelimit.poll = now;
var chatpoll = [...poll];
chatpoll.push("Cancel vote.");
pollactive[3].push("Cancel vote.");
for (var i = 0; i < chatpoll.length; i++) {
chatpoll[i] = letters[i] + ") " + chatpoll[i];
}
chat(chatpoll.join(" "));
setTimeout(function () {
if (pollactive[0]) {
SEND("42" + JSON.stringify([4, { "type": "poll", "from": username, "poll": pollactive[3] }]));
var keys = Object.keys(playerids);
for (var i = 0; i < keys.length; i++) {
playerids[keys[i]].vote.poll = -1;
}
displayInChat("The poll will end in: " + text.toString() + " seconds.", "#DA0808", "#1EBCC1");
displayInChat("Type '/endpoll' to end the poll early.", "#DA0808", "#1EBCC1");
}
}, 200);
return "";
}
else if (chat_val.substring(1, 8) == "endpoll") {
if (pollactive[0]) {
if (playerids[myid].ratelimit.poll + 5000 > Date.now()) {
displayInChat("Your poll has to be at least 5 seconds.", "#DA0808", "#1EBCC1");
displayInChat("There are " + ((playerids[myid].ratelimit.poll + 5000 - Date.now()) / 1000).toString() + " seconds left until you can end the poll early.", "#DA0808", "#1EBCC1");
return "";
}
playerids[myid].ratelimit.poll = Date.now();
SEND("42" + JSON.stringify([4, { "type": "poll end", "from": username }]));
displayInChat("The poll ended.", "#DA0808", "#1EBCC1");
var count = [0, 0, 0, 0];
var keys = Object.keys(playerids);
for (var i = 0; i < keys.length; i++) {
if (playerids[keys[i]].vote.poll != -1 && playerids[keys[i]].vote.poll < pollactive[3].length - 1) {
count[playerids[keys[i]].vote.poll]++;
}
playerids[keys[i]].vote.poll = -1;
}
for (var i = 0; i < count.length; i++) {
if (count[i] > 1) {
displayInChat(count[i].toString() + " people voted for option " + letters[i] + ".", "#DA0808", "#1EBCC1");
}
if (count[i] == 1) {
displayInChat(count[i].toString() + " person voted for option " + letters[i] + ".", "#DA0808", "#1EBCC1");
}
}
displayInChat("The poll was:", "#DA0808", "#1EBCC1");
for (var i = 0; i < pollactive[3].length; i++) {
displayInChat(letters[i] + ") " + pollactive[3][i], "#DA0808", "#1EBCC1");
}
pollactive = [false, 0, 0, []];
}
else {
displayInChat("No poll has been started", "#DA0808", "#1EBCC1");
displayInChat("Type '/startpoll [seconds]' to start a poll.", "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 7) == "moveA " && chat_val.replace(/^\s+|\s+$/g, '').length >= 8) {
var text = chat_val.substring(7).replace(/^\s+|\s+$/g, '');
var keys = Object.keys(playerids);
var t = -1;
if (text == "f") {
t = 1;
}
else if (text == "b") {
t = 3;
}
else if (text == "g") {
t = 4;
}
else if (text == "r") {
t = 2;
}
else if (text == "y") {
t = 5;
}
else if (text == "s") {
t = 0;
}
if (t == -1) {
displayInChat("The format for this command is:", "#DA0808", "#1EBCC1");
displayInChat("/moveA [letter]", "#DA0808", "#1EBCC1");
displayInChat("For example: '/moveA r' would move everyone to red team.", "#DA0808", "#1EBCC1");
return "";
}
for (var i = 0; i < keys.length; i++) {
SEND('42[26,{"targetID":' + keys[i].toString() + ',"targetTeam":' + t.toString() + '}]');
if (playerids[keys[i]].peerID != "sandbox") {
RECIEVE('42[18,' + keys[i].toString() + ',' + t.toString() + ']');
}
}
return "";
}
else if (chat_val.substring(1, 7) == "moveT " && chat_val.replace(/^\s+|\s+$/g, '').length >= 8) {
var text = chat_val.substring(7).replace(/^\s+|\s+$/g, '').split(" ").filter(function (i) { if (i == "") { return false } else { return true } });
if (text.length == 2) {
var firstteam = -1;
var secondteam = -1;
for (var i = 0; i < 2; i++) {
var t = -1;
if (text[i] == "f") {
t = 1;
}
else if (text[i] == "b") {
t = 3;
}
else if (text[i] == "g") {
t = 4;
}
else if (text[i] == "r") {
t = 2;
}
else if (text[i] == "y") {
t = 5;
}
else if (text[i] == "s") {
t = 0;
}
if (t == -1) {
displayInChat("The format for this command is:", "#DA0808", "#1EBCC1");
displayInChat("/moveT [letter] [letter]", "#DA0808", "#1EBCC1");
displayInChat("For example: '/moveT s r' would move everyone in spectate to red team.", "#DA0808", "#1EBCC1");
return "";
}
else {
if (i == 0) {
firstteam = t;
}
else {
secondteam = t;
}
}
}
var keys = Object.keys(playerids);
for (var i = 0; i < keys.length; i++) {
if (playerids[keys[i]].team == firstteam) {
SEND('42[26,{"targetID":' + keys[i].toString() + ',"targetTeam":' + secondteam.toString() + '}]');
if (playerids[keys[i]].peerID != "sandbox") {
RECIEVE('42[18,' + keys[i].toString() + ',' + secondteam.toString() + ']');
}
}
}
}
else {
displayInChat("The format for this command is:", "#DA0808", "#1EBCC1");
displayInChat("/moveT [team] [team]", "#DA0808", "#1EBCC1");
displayInChat("For example: '/moveT s r' would move everyone in spectate to red team.", "#DA0808", "#1EBCC1");
return "";
}
return "";
}
if (chat_val.substring(1, 13) == "roundsperqp " && chat_val.replace(/^\s+|\s+$/g, '').length >= 14) {
var text = parseInt(chat_val.substring(13).replace(/^\s+|\s+$/g, ''));
if (isNaN(text)) {
displayInChat("Type a positive number.", "#DA0808", "#1EBCC1");
return "";
}
else if (text <= 0) {
displayInChat("Type a positive number.", "#DA0808", "#1EBCC1");
return "";
}
roundsperqp = text;
roundsperqp2 = 0;
displayInChat("Set rounds per quickplay to: " + text.toString(), "#DA0808", "#1EBCC1");
displayInChat("Type '/roundsperqp' to reset rounds per quickplay.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 12) == "roundsperqp") {
roundsperqp = 1;
roundsperqp2 = 0;
displayInChat("Reset rounds per quickplay.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 8) == "rounds " && chat_val.replace(/^\s+|\s+$/g, '').length >= 9) {
var text = chat_val.substring(8).replace(/^\s+|\s+$/g, '');
if (!isNaN(parseInt(text))) {
text = parseInt(text).toString();
SEND('42[21,{"w":' + text + '}]');
RECIEVE('42[27,' + text + ']');
}
return "";
}
else if (chat_val.substring(1, 13) == "disablekeys " && chat_val.replace(/^\s+|\s+$/g, '').length >= 14) {
var text = chat_val.substring(13).replace(/^\s+|\s+$/g, '');
var keys = text.split(" ");
var disabledkeys2 = [];
var possiblekeys = ["left", "right", "up", "down", "heavy", "special"];
for (var i = 0; i < keys.length; i++) {
if (keys[i] != "" && !disabledkeys2.includes(keys[i])) {
if (possiblekeys.includes(keys[i])) {
disabledkeys2.push(keys[i]);
}
else {
displayInChat("Key options: " + possiblekeys.join(" ") + ".", "#DA0808", "#1EBCC1");
return "";
}
}
}
disabledkeys = disabledkeys2;
displayInChat("Set disabled keys to: " + disabledkeys.join(" ") + ".", "#DA0808", "#1EBCC1");
displayInChat("Type '/disablekeys' to reset disabled keys.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 12) == "disablekeys") {
displayInChat("Reset disabled keys.", "#DA0808", "#1EBCC1");
disabledkeys = [];
return "";
}
else if (chat_val.substring(1, 10) == "jointext " && chat_val.replace(/^\s+|\s+$/g, '').length >= 11) {
jointext = chat_val.substring(10).replace(/^\s+|\s+$/g, '');
displayInChat("Set jointext to: " + jointext, "#DA0808", "#1EBCC1");
displayInChat("Type '/jointext' to reset jointext.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 9) == "jointext") {
jointext = "";
displayInChat("Reset jointext.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 10) == "jointeam " && chat_val.replace(/^\s+|\s+$/g, '').length >= 11) {
var text = chat_val.substring(10).replace(/^\s+|\s+$/g, '');
var keys = Object.keys(playerids);
var t = -1;
if (text == "f") {
t = 1;
displayInChat("Set jointeam to FFA.", "#DA0808", "#1EBCC1");
}
else if (text == "b") {
t = 3;
displayInChat("Set jointeam to blue team.", "#DA0808", "#1EBCC1");
}
else if (text == "g") {
t = 4;
displayInChat("Set jointeam to green team.", "#DA0808", "#1EBCC1");
}
else if (text == "r") {
t = 2;
displayInChat("Set jointeam to red team.", "#DA0808", "#1EBCC1");
}
else if (text == "y") {
t = 5;
displayInChat("Set jointeam to yellow team.", "#DA0808", "#1EBCC1");
}
else if (text == "s") {
t = 0;
displayInChat("Set jointeam to spectate.", "#DA0808", "#1EBCC1");
}
if (t == -1) {
displayInChat("The format for this command is:", "#DA0808", "#1EBCC1");
displayInChat("/jointeam [letter]", "#DA0808", "#1EBCC1");
displayInChat("For example: '/jointeam r' would move every joined person to red team.", "#DA0808", "#1EBCC1");
return "";
}
displayInChat("Type '/jointeam' to reset jointeam.", "#DA0808", "#1EBCC1");
jointeam = t;
return "";
}
else if (chat_val.substring(1, 9) == "jointeam") {
jointeam = -1;
displayInChat("Reset jointeam.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 9) == "wintext " && chat_val.replace(/^\s+|\s+$/g, '').length >= 10) {
wintext = chat_val.substring(9).replace(/^\s+|\s+$/g, '');
displayInChat("Set wintext to: " + wintext, "#DA0808", "#1EBCC1");
displayInChat("Type '/wintext' to reset wintext.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 8) == "wintext") {
wintext = "";
displayInChat("Reset wintext.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 11) == "autorecord") {
if (autorecord) {
autorecord = false;
displayInChat("Autorecord is now off.", "#DA0808", "#1EBCC1");
}
else {
autorecord = true;
displayInChat("Autorecord is now on.", "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 9) == "afkkill " && chat_val.replace(/^\s+|\s+$/g, '').length >= 10) {
var text = Number(chat_val.substring(9).replace(/^\s+|\s+$/g, ''));
if (!isNaN(text)) {
if (text > 0) {
displayInChat("Set afk kill to: " + text.toString() + " seconds.", "#DA0808", "#1EBCC1");
displayInChat("Type '/afkkill' to reset afk kill.", "#DA0808", "#1EBCC1");
var keys = Object.keys(playerids);
var now = Date.now();
for (var i = 0; i < keys.length; i++) {
playerids[keys[i]].lastmove = now;
}
afkkill = text;
}
else {
displayInChat("Type a positive number.", "#DA0808", "#1EBCC1");
}
}
else {
displayInChat("Type a positive number.", "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 9) == "afkkill") {
afkkill = -1;
displayInChat("Reset afk kill.", "#DA0808", "#1EBCC1");
return "";
}
else if (chat_val.substring(1, 13) == "defaultmode " && chat_val.replace(/^\s+|\s+$/g, '').length >= 14) {
var text = chat_val.substring(13).replace(/^\s+|\s+$/g, '');
if (text == "default") {
defaultmode = "";
displayInChat("Changed default mode to default.", "#DA0808", "#1EBCC1");
}
else if (text == "arrows") {
defaultmode = "ar";
displayInChat("Changed default mode to arrows.", "#DA0808", "#1EBCC1");
}
else if (text == "death arrows") {
defaultmode = "ard";
displayInChat("Changed default mode to death arrows.", "#DA0808", "#1EBCC1");
}
else if (text == "grapple") {
defaultmode = "sp";
displayInChat("Changed default mode to grapple.", "#DA0808", "#1EBCC1");
}
else if (text == "vtol") {
defaultmode = "v";
displayInChat("Changed default mode to vtol.", "#DA0808", "#1EBCC1");
}
else if (text == "classic") {
defaultmode = "b";
displayInChat("Changed default mode to classic.", "#DA0808", "#1EBCC1");
}
else {
displayInChat("Default mode options:", "#DA0808", "#1EBCC1");
displayInChat("default", "#DA0808", "#1EBCC1");
displayInChat("classic", "#DA0808", "#1EBCC1");
displayInChat("arrows", "#DA0808", "#1EBCC1");
displayInChat("death arrows", "#DA0808", "#1EBCC1");
displayInChat("grapple", "#DA0808", "#1EBCC1");
displayInChat("vtol", "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 8) == "recmode") {
if (recmodebool == true) {
recmodebool = false;
displayInChat("Recmode is now off.", "#DA0808", "#1EBCC1");
}
else {
recmodebool = true;
displayInChat("Recmode is now on.", "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 8) == "recteam") {
if (recteams == true) {
recteams = false;
displayInChat("Recteam is now off.", "#DA0808", "#1EBCC1");
}
else {
recteams = true;
displayInChat("Recteam is now on.", "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 8) == "shuffle") {
if (shuffle == true) {
shuffle = false;
displayInChat("Shuffle is now off.", "#DA0808", "#1EBCC1");
}
else {
shuffle = true;
displayInChat("Shuffle is now on.", "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 9) == "autokick") {
if (autokickban == 0) {
displayInChat("Autokick is now on.", "#DA0808", "#1EBCC1");
autokickban = 1;
}
else if (autokickban == 1) {
autokickban = 0;
displayInChat("Autokick is now off.", "#DA0808", "#1EBCC1");
}
else {
autokickban = 1;
displayInChat("Autokick is now on, and Autoban is now off.", "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 8) == "autoban") {
if (autokickban == 0) {
displayInChat("Autoban is now on.", "#DA0808", "#1EBCC1");
autokickban = 2;
}
else if (autokickban == 2) {
autokickban = 0;
displayInChat("Autoban is now off.", "#DA0808", "#1EBCC1");
}
else {
autokickban = 2;
displayInChat("Autoban is now on, and Autokick is now off.", "#DA0808", "#1EBCC1");
}
return "";
}
else if (chat_val.substring(1, 8) == "sandbox") {
if (sandboxon == false) {
displayInChat("This room is now a sandbox room.", "#DA0808", "#1EBCC1");
sandboxon = true;
SEND('42[4,{"type":"sandboxon"}]');
var sandboxkeys = Object.keys(sandboxplayerids);
var packets = [];
for (var i = 0; i < sandboxkeys.length; i++) {
var p = playerids[sandboxkeys[i]];
var packet = '42' + JSON.stringify([4, sandboxkeys[i], p.peerID, p.userName, p.guest, p.level, p.team, p.avatar]);
packets.push(packet);
}
SEND("42" + JSON.stringify([4, { "type": "fakerecieve", "from": username, "packet": packets, to: [-1] }]));
SEND("42" + JSON.stringify([4, { "type": "sandboxid", "from": username, "lastid": sandboxid, to: [-1] }]));
}
else {
displayInChat("You cannot turn a sandbox room back into a normal room.", "#DA0808", "#1EBCC1");
}
return "";
}
else if (sandboxon) {
if (chat_val.substring(1, 11) == "addplayer " && chat_val.replace(/^\s+|\s+$/g, '').length >= 12) {
var text = chat_val.substring(11).replace(/^\s+|\s+$/g, '');
if (!isNaN(parseInt(text))) {
var text2 = parseInt(text);
if (text2 > 0) {
for (var i = 0; i < text2; i++) {
while (playerids[sandboxid]) {
sandboxid += 1;
}
var color = Math.floor(Math.random() * 16777215).toString();
var packet = '42' + JSON.stringify([4, sandboxid, "sandbox", sandboxid.toString(), true, 0, 0, { "layers": [], "bc": color }]);
RECIEVE(packet);
SEND("42" + JSON.stringify([4, { "type": "fakerecieve", "from": username, "packet": [packet], to: [-1] }]));
sandboxplayerids[sandboxid] = sandboxid.toString();
sandboxid += 1;
}
}
}
return "";
}
if (chat_val.substring(1, 9) == "addname " && chat_val.replace(/^\s+|\s+$/g, '').length >= 10) {
var text = chat_val.substring(9).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "");
while (playerids[sandboxid]) {
sandboxid += 1;
}
var keys = Object.keys(playerids);
var addon = "";
var escape = false;
var keysi = -1;
while (!escape) {
escape = true;
for (var i = 0; i < keys.length; i++) {
if (playerids[keys[i]].userName == text + addon) {
addon += "";
var escape = false;
}
if (playerids[keys[i]].userName == text) {
keysi = keys[i];
}
}
}
if (keysi != -1) {
var packet = '42' + JSON.stringify([4, sandboxid, "sandbox", text + addon, playerids[keysi].guest, playerids[keysi].level, 0, playerids[keysi].avatar]);
RECIEVE(packet);
SEND("42" + JSON.stringify([4, { "type": "fakerecieve", "from": username, "packet": [packet], to: [-1] }]));
}
else {
var color = Math.floor(Math.random() * 16777215).toString();
var packet = '42' + JSON.stringify([4, sandboxid, "sandbox", text + addon, true, 0, 0, { "layers": [], "bc": color }]);
RECIEVE(packet);
SEND("42" + JSON.stringify([4, { "type": "fakerecieve", "from": username, "packet": [packet], to: [-1] }]));
}
sandboxplayerids[sandboxid] = sandboxid.toString();
sandboxid += 1;
return "";
}
else if (chat_val.substring(1, 11) == "delplayer " && chat_val.replace(/^\s+|\s+$/g, '').length >= 12) {
var text = chat_val.substring(11).replace(/^\s+|\s+$/g, '');
if (!isNaN(parseInt(text))) {
var text2 = parseInt(text);
if (text2 > 0) {
if (Gdocument.getElementById("gamerenderer").style["visibility"] == "hidden") {
var jsonkeys = Object.keys(sandboxplayerids).reverse();
var packets = [];
for (var i = 0; i < text2 && i < jsonkeys.length; i++) {
var packet = '42[5,' + jsonkeys[i] + ',0]';
RECIEVE(packet);
packets.push(packet);
delete sandboxplayerids[jsonkeys[i]];
}
SEND("42" + JSON.stringify([4, { "type": "fakerecieve", "from": username, "packet": packets, to: [-1] }]));
}
else {
displayInChat("Cannot delete players while ingame.", "#DA0808", "#1EBCC1");
}
}
}
return "";
}
else if (chat_val.substring(1, 6) == "copy " && chat_val.replace(/^\s+|\s+$/g, '').length >= 7) {
var text = chat_val.substring(6).replace(/^\s+|\s+$/g, '').replaceAll("'", "").replaceAll('"', "");
var keys = Object.keys(playerids);
var keys2 = Object.keys(sandboxplayerids);
var copiedperson = -1;
for (var i = 0; i < keys.length; i++) {
if (playerids[keys[i]].userName == text) {
copiedperson = keys[i];
}
}
if (copiedperson == -1) {
displayInChat(playerids[copiedperson].userName + " was not found in this room.", "#DA0808", "#1EBCC1");
return "";
}
if (keys2.includes(copiedperson.toString())) {
displayInChat("Bots cannot copy a bot.", "#DA0808", "#1EBCC1");
return "";
}
displayInChat("All bots will now copy " + playerids[copiedperson].userName + ".", "#DA0808", "#1EBCC1");
displayInChat("To reset copy, type '/copy'.", "#DA0808", "#1EBCC1");
sandboxcopyme = copiedperson;
return "";
}
else if (chat_val.substring(1, 5) == "copy") {
sandboxcopyme = -1;
displayInChat("Copy is now off.", "#DA0808", "#1EBCC1");
return "";
}
}
}
return chat_val;
};
scope.flag_manage = function (t) {
var text = t;
if (autocorrect == true) {
var text2 = text.split(" ");
for (var i = 0; i < text2.length; i++) {
text2[i] = closestWord(text2[i]);
}
text = text2.join(" ");
}
if (reverse_flag == true) {
text = text.split("").reverse().join("")
}
if (rcaps_flag == true) {
text = text.split('');
for (var i = 0; i < text.length; i++) {
if (Math.floor(Math.random() * 2)) {
text[i] = text[i].toUpperCase();
}
else {
text[i] = text[i].toLowerCase();
}
}
text = text.join('');
}
if (space_flag == true) {
text = text.split('').join(' ')
}
if (textmode != -1) {
newtext = "";
for (var i = 0; i < text.length; i++) {
if (letter_dictionary[text[i]]) {
newtext += letter_dictionary[text[i]][textmode];
}
else {
newtext += text[i];
}
}
text = newtext;
}
if (curse_flag == true) {
text = text.replace(/[a|A]/g, "*");
text = text.replace(/[e|E]/g, "*");
text = text.replace(/[i|I]/g, "*");
text = text.replace(/[o|O]/g, "*");
text = text.replace(/[u|U]/g, "*");
text = text.replace(/[y|Y]/g, "*");
}
if (number_flag == true) {
text = text.replace(/[t|T][Oo]+/g, "2");
text = text.replace(/[f|F][o|O][r|R]/g, "4");
text = text.replace(/[a|A][t|T][e|E]/g, "8");
text = text.replace(/[e|E]/g, "3");
text = text.replace(/[a|A]/g, "4");
text = text.replace(/[o|O]/g, "0");
text = text.replace(/[s|S]/g, "5");
text = text.replace(/[i|I|l|L]/g, "1");
}
return text;
};
Gdocument.getElementById("newbonklobby_chat_input").onkeydown = function (e) {
if (e.keyCode == 13) {
var chat_val = Gdocument.getElementById("newbonklobby_chat_input").value;
if (chat_val != "" && chat_val[0] == "/") {
Gdocument.getElementById("newbonklobby_chat_input").value = "";
chat2(commandhandle(chat_val));
}
else {
Gdocument.getElementById("newbonklobby_chat_input").value = "";
chat2(flag_manage(chat_val));
}
}
};
Gdocument.getElementById("ingamechatinputtext").onkeydown = function (e) {
if (e.keyCode == 13) {
var chat_val = Gdocument.getElementById("ingamechatinputtext").value;
if (chat_val != "" && chat_val[0] == "/") {
Gdocument.getElementById("ingamechatinputtext").value = "";
chat2(commandhandle(chat_val));
}
else {
Gdocument.getElementById("ingamechatinputtext").value = "";
chat2(flag_manage(chat_val));
}
}
};
scope.Last_message = "";
scope.Laster_message = "";
scope.new_message = false;
scope.changed_chat = false;
scope.injectedBonkCommandsScript = setInterval(timeout123, 60);
scope.pan_enabled = false;
scope.lastXPtimestamp = Date.now();
scope.pan = { "x": 0, "y": 0 };
scope.pan_speed = 5;
scope.keys_being_held = {};
scope.hotkeys_keyup = function (e) {
if (keys_being_held[e.code]) {
keys_being_held[e.code] = false;
}
};
Gdocument.onkeyup = hotkeys_keyup;
scope.hotkeys = function (e) {
var keycode = e.code;
if (!keys_being_held[keycode]) {
keys_being_held[keycode] = true;
}
if (!e.altKey && e.shiftKey && !e.ctrlKey && !e.metaKey) {
if (pan_enabled && Gdocument.getElementById("gamerenderer")?.childElementCount > 0) {
if (keycode == "ArrowUp") {
e.stopPropagation();
e.preventDefault();
}
else if (keycode == "ArrowDown") {
e.stopPropagation();
e.preventDefault();
}
else if (keycode == "ArrowLeft") {
e.stopPropagation();
e.preventDefault();
}
else if (keycode == "ArrowRight") {
e.stopPropagation();
e.preventDefault();
}
}
}
if (e.altKey && !e.shiftKey && !e.ctrlKey && !e.metaKey) {
if (keycode == "Period") {
if (Gdocument.getElementById("ingamechatcontent").style["max-height"] != "0px") {
chatheight += 5;
if (chatheight > 600) { chatheight = 600; }
Gdocument.getElementById("ingamechatcontent").style["max-height"] = chatheight.toString() + "px";
Gdocument.getElementById("ingamechatcontent").style["height"] = chatheight.toString() + "px";
Gdocument.getElementById("ingamechatbox").style["height"] = "100%";
}
e.preventDefault();
}
if (parentDraw && Gdocument.getElementById("gamerenderer").style["visibility"] != "hidden") {
if (keycode == "KeyG") {
var addto = 0;
for (var i = 0; i < parentDraw.children.length; i++) {
if (parentDraw.children[i].constructor.name == "e") {
addto = parentDraw.children[i];
break;
}
}
var canv = 0;
for (var i = 0; i < Gdocument.getElementById("gamerenderer").children.length; i++) {
if (Gdocument.getElementById("gamerenderer").children[i].constructor.name == "HTMLCanvasElement") {
canv = Gdocument.getElementById("gamerenderer").children[i];
break;
}
}
var width = parseInt(canv.style["width"]);
var height = parseInt(canv.style["height"]);
if (addto) {
zoom *= 1.1;
}
addto.scale.x = zoom;
addto.scale.y = zoom;
parentDraw.x = -addto.scale.x * parseInt(width) / 2 + parseInt(width) / 2;
parentDraw.y = -addto.scale.y * parseInt(height) / 2 + parseInt(height) / 2;
parentDraw.children[0].x = parseInt(width) / 2 * addto.scale.x - parseInt(width) / 2;
parentDraw.children[0].y = parseInt(height) / 2 * addto.scale.y - parseInt(height) / 2;
if (addto.scale.x >= 0.99999 && addto.scale.y >= 0.99999 && !FollowCam) {
pixiCircle.visible = false;
}
else {
pixiCircle.visible = true;
}
e.preventDefault();
}
if (keycode == "KeyH") {
var addto = 0;
for (var i = 0; i < parentDraw.children.length; i++) {
if (parentDraw.children[i].constructor.name == "e") {
addto = parentDraw.children[i];
break;
}
}
var canv = 0;
for (var i = 0; i < Gdocument.getElementById("gamerenderer").children.length; i++) {
if (Gdocument.getElementById("gamerenderer").children[i].constructor.name == "HTMLCanvasElement") {
canv = Gdocument.getElementById("gamerenderer").children[i];
break;
}
}
var width = parseInt(canv.style["width"]);
var height = parseInt(canv.style["height"]);
if (addto) {
zoom = 1;
}
addto.scale.x = zoom;
addto.scale.y = zoom;
parentDraw.x = -addto.scale.x * parseInt(width) / 2 + parseInt(width) / 2;
parentDraw.y = -addto.scale.y * parseInt(height) / 2 + parseInt(height) / 2;
parentDraw.children[0].x = parseInt(width) / 2 * addto.scale.x - parseInt(width) / 2;
parentDraw.children[0].y = parseInt(height) / 2 * addto.scale.y - parseInt(height) / 2;
if (addto.scale.x >= 0.99999 && addto.scale.y >= 0.99999 && !FollowCam) {
pixiCircle.visible = false;
}
else {
pixiCircle.visible = true;
}
e.preventDefault();
}
if (keycode == "KeyJ") {
var addto = 0;
for (var i = 0; i < parentDraw.children.length; i++) {
if (parentDraw.children[i].constructor.name == "e") {
addto = parentDraw.children[i];
break;
}
}
var canv = 0;
for (var i = 0; i < Gdocument.getElementById("gamerenderer").children.length; i++) {
if (Gdocument.getElementById("gamerenderer").children[i].constructor.name == "HTMLCanvasElement") {
canv = Gdocument.getElementById("gamerenderer").children[i];
break;
}
}
var width = parseInt(canv.style["width"]);
var height = parseInt(canv.style["height"]);
if (addto) {
zoom /= 1.1;
}
addto.scale.x = zoom;
addto.scale.y = zoom;
parentDraw.x = -addto.scale.x * parseInt(width) / 2 + parseInt(width) / 2;
parentDraw.y = -addto.scale.y * parseInt(height) / 2 + parseInt(height) / 2;
parentDraw.children[0].x = parseInt(width) / 2 * addto.scale.x - parseInt(width) / 2;
parentDraw.children[0].y = parseInt(height) / 2 * addto.scale.y - parseInt(height) / 2;
if (addto.scale.x >= 0.99999 && addto.scale.y >= 0.99999 && !FollowCam) {
pixiCircle.visible = false;
}
else {
pixiCircle.visible = true;
}
e.preventDefault();
}
}
if (keycode == "Comma") {
if (Gdocument.getElementById("ingamechatcontent").style["max-height"] != "0px") {
chatheight -= 5;
if (chatheight < 100) { chatheight = 100; }
Gdocument.getElementById("ingamechatcontent").style["max-height"] = chatheight.toString() + "px";
Gdocument.getElementById("ingamechatcontent").style["height"] = chatheight.toString() + "px";
Gdocument.getElementById("ingamechatbox").style["height"] = "100%";
}
e.preventDefault();
}
}
if (e.repeat) { return; }
if (e.altKey && !e.shiftKey && !e.ctrlKey && !e.metaKey) {
if (ishost) {
if (keycode == "KeyE") {
if (Gdocument.getElementById("newbonklobby").style["display"] == "block") {
Gdocument.getElementById("newbonklobby_editorbutton").click();
}
else if (Gdocument.getElementById("mapeditorcontainer").style["display"] == "block") {
Gdocument.getElementById("mapeditor_close").click();
}
e.preventDefault();
}
else if (keycode == "KeyT") {
Gdocument.getElementById("newbonklobby_teamsbutton").click();
e.preventDefault();
}
else if (keycode == "KeyM") {
Gdocument.getElementById("newbonklobby_modebutton").click();
e.preventDefault();
}
else if (keycode == "KeyK") {
if (Gdocument.getElementById("gamerenderer").style["visibility"] != "hidden") {
Gdocument.getElementById("pretty_top_exit").click();
}
e.preventDefault();
}
else if (keycode == "KeyS") {
if (Gdocument.getElementById("mapeditorcontainer").style["display"] != "block") {
Gdocument.getElementById("newbonklobby_editorbutton").click();
}
if (recmodebool && ishost) {
var mode = Gdocument.getElementById("mapeditor_modeselect").value;
if (mode == "" && defaultmode != "d") {
mode = defaultmode;
}
if (mode != "") {
RECIEVE('42[26,"b","' + mode + '"]');
}
}
Gdocument.getElementById("mapeditor_close").click();
Gdocument.getElementById("newbonklobby").style["display"] = "none";
roundsperqp2 = 0;
Gdocument.getElementById("mapeditor_midbox_testbutton").click();
e.preventDefault();
}
else if (keycode == "KeyD") {
roundsperqp2 = 0;
if (stopquickplay == 0) {
if (shuffle) {
var e2 = Gdocument.getElementById("maploadwindowmapscontainer").children;
var available = [];
var availableindexes = [];
var notempty = false;
for (var i = 0; i < e2.length; i++) {
var a = false;
[...e2[i].children].forEach(function (e1) { if (e1.className == "quickplaycheckbox quickplaychecked") { a = e1.checked } });
available.push(a);
if (a) {
availableindexes.push(i);
notempty = true;
}
}
if (notempty) {
if (availableindexes.length != 1) {
availableindexes.splice(availableindexes.indexOf(quicki % Gdocument.getElementById("maploadwindowmapscontainer").children.length), 1);
}
quicki = availableindexes[Math.floor(Math.random() * availableindexes.length)];
}
}
else {
var e2 = Gdocument.getElementById("maploadwindowmapscontainer").children;
var available = [];
var availableindexes = [];
var notempty = false;
for (var i = 0; i < e2.length; i++) {
var a = false;
[...e2[i].children].forEach(function (e1) { if (e1.className == "quickplaycheckbox quickplaychecked") { a = e1.checked } });
available.push(a);
if (a) {
availableindexes.push(i);
notempty = true;
}
}
if (notempty) {
var above = [];
for (var i = 0; i < availableindexes.length; i++) {
if (availableindexes[i] > quicki && !reverseqp) {
above.push(availableindexes[i]);
}
else if (availableindexes[i] < quicki && reverseqp) {
above.push(availableindexes[i])
}
}
if (above.length > 0) {
quicki = above[0];
if (reverseqp) {
quicki = above[above.length - 1];
}
}
else {
quicki = availableindexes[0];
if (reverseqp) {
quicki = availableindexes[availableindexes.length - 1];
}
}
}
}
gotonextmap(quicki % (Gdocument.getElementById("maploadwindowmapscontainer").children.length));
}
e.preventDefault();
}
else if (keycode == "KeyA") {
if (stopquickplay == 0) {
roundsperqp2 = 0;
if (shuffle) {
var e2 = Gdocument.getElementById("maploadwindowmapscontainer").children;
var available = [];
var availableindexes = [];
var notempty = false;
for (var i = 0; i < e2.length; i++) {
var a = false;
[...e2[i].children].forEach(function (e1) { if (e1.className == "quickplaycheckbox quickplaychecked") { a = e1.checked } });
available.push(a);
if (a) {
availableindexes.push(i);
notempty = true;
}
}
if (notempty) {
if (availableindexes.length != 1) {
availableindexes.splice(availableindexes.indexOf(quicki % Gdocument.getElementById("maploadwindowmapscontainer").children.length), 1);
}
quicki = availableindexes[Math.floor(Math.random() * availableindexes.length)];
}
}
else {
var e2 = Gdocument.getElementById("maploadwindowmapscontainer").children;
var available = [];
var availableindexes = [];
var notempty = false;
for (var i = 0; i < e2.length; i++) {
var a = false;
[...e2[i].children].forEach(function (e1) { if (e1.className == "quickplaycheckbox quickplaychecked") { a = e1.checked } });
available.push(a);
if (a) {
availableindexes.push(i);
notempty = true;
}
}
if (notempty) {
var above = [];
for (var i = 0; i < availableindexes.length; i++) {
if (availableindexes[i] < quicki && !reverseqp) {
above.push(availableindexes[i]);
}
else if (availableindexes[i] > quicki && reverseqp) {
above.push(availableindexes[i])
}
}
if (above.length > 0) {
quicki = above[above.length - 1];
if (reverseqp) {
quicki = above[0];
}
}
else {
quicki = availableindexes[availableindexes.length - 1];
if (reverseqp) {
quicki = availableindexes[0];
}
}
}
}
gotonextmap(quicki % (Gdocument.getElementById("maploadwindowmapscontainer").children.length));
}
e.preventDefault();
}
else if (keycode == "KeyQ") {
if (stopquickplay == 1) {
stopquickplay = 0;
quicki = 0;
qppaused = false;
displayInChat("Enabled quickplay.", "#DA0808", "#1EBCC1");
}
else {
stopquickplay = 1;
quicki = 0;
qppaused = false;
displayInChat("Disabled quickplay.", "#DA0808", "#1EBCC1");
}
e.preventDefault();
}
else if (keycode == "KeyP" && stopquickplay == 0) {
if (qppaused == true) {
qppaused = false;
displayInChat("Unpaused quickplay.", "#DA0808", "#1EBCC1");
}
else {
qppaused = true;
displayInChat("Paused quickplay.", "#DA0808", "#1EBCC1");
}
e.preventDefault();
}
else if (keycode == "KeyR") {
if (recmodebool == true) {
recmodebool = false;
displayInChat("Recmode is now off.", "#DA0808", "#1EBCC1");
}
else {
recmodebool = true;
displayInChat("Recmode is now on.", "#DA0808", "#1EBCC1");
}
}
else if (keycode == "KeyF") {
if (freejoin == false) {
freejoin = true;
displayInChat("Freejoin is now on.", "#DA0808", "#1EBCC1");
}
else {
freejoin = false;
displayInChat("Freejoin is now off.", "#DA0808", "#1EBCC1");
}
e.preventDefault();
}
}
else {
if (keycode == "KeyE") {
e.preventDefault();
}
else if (keycode == "KeyT") {
e.preventDefault();
}
else if (keycode == "KeyM") {
e.preventDefault();
}
else if (keycode == "KeyK") {
e.preventDefault();
}
else if (keycode == "KeyS") {
e.preventDefault();
}
else if (keycode == "KeyD") {
e.preventDefault();
}
else if (keycode == "KeyA") {
e.preventDefault();
}
else if (keycode == "KeyQ") {
e.preventDefault();
}
else if (keycode == "KeyP") {
e.preventDefault();
}
else if (keycode == "KeyF") {
e.preventDefault();
}
else if (keycode == "KeyR") {
e.preventDefault();
}
}
if (keycode == "KeyL") {
lobby();
e.preventDefault();
}
if (keycode == "KeyC") {
if (Gdocument.getElementById("gamerenderer").style["visibility"] != "hidden") {
if (Gdocument.getElementById("ingamechatcontent").style["max-height"] == "0px") {
Gdocument.getElementById("ingamechatcontent").style["max-height"] = chatheight.toString() + "px";
}
else {
Gdocument.getElementById("ingamechatcontent").style["max-height"] = "0px";
}
}
e.preventDefault();
}
if (keycode == "KeyI") {
if (Gdocument.getElementById("BonkCommandsDebuggerContainer").style["display"] == "none") {
debuggeropen = true;
Gdocument.getElementById("BonkCommandsDebuggerContainer").style["display"] = "block";
Gdocument.getElementById("newbonklobby_chat_input").style["display"] = "none";
Gdocument.getElementById("ingamechatinputtext").style["display"] = "none";
}
else {
debuggeropen = false;
Gdocument.getElementById("BonkCommandsDebuggerContainer").style["display"] = "none";
Gdocument.getElementById("newbonklobby_chat_input").style["display"] = "";
Gdocument.getElementById("ingamechatinputtext").style["display"] = "";
}
e.preventDefault();
}
if (keycode == "KeyB") {
var element = Gdocument.getElementById("ingamewinner_scores");
if (element.style["opacity"] < 1) {
element.style["opacity"] = 1;
element.style["visibility"] = "visible";
}
else {
element.style["opacity"] = 0;
element.style["visibility"] = "unset";
}
e.preventDefault();
}
if (keycode == "KeyY") {
Gdocument.getElementById("pretty_top_settings").click();
Gdocument.getElementById("settings_close").click();
if (Gdocument.getElementById("settings_graphicsquality").value == 1) {
displayInChat("You must have medium or high quality enabled to use this feature.", "#DA0808", "#1EBCC1");
return "";
}
if (parentDraw && Gdocument.getElementById("gamerenderer").style["visibility"] != "hidden") {
var addto = { "children": [] };
for (var i = 0; i < parentDraw.children.length; i++) {
if (parentDraw.children[i].constructor.name == "e") {
addto = parentDraw.children[i];
break;
}
}
var addto2 = { "children": [] };
for (var i = 0; i < addto.children.length; i++) {
if (addto.children[i].constructor.name == "e") {
addto2 = addto.children[i];
break;
}
}
var checkxray = addto2.children[0];
var addto3 = addto2.children[0].children;
if (addto3.length == 1) {
checkxray = checkxray.children[0];
addto3 = addto3[0].children;
}
var xrayon = false;
if (checkxray.xrayon) {
checkxray.xrayon = false;
xrayon = false;
}
else {
checkxray.xrayon = true;
xrayon = true;
}
if (xrayon) {
displayInChat("Xray is now on.", "#DA0808", "#1EBCC1");
for (var i = 0; i < addto3.length; i++) {
if (addto3[i].children.length > 0) {
var ids = [];
var ids2 = [];
for (var i3 = 0; i3 < addto3[i].children.length; i3++) {
addto3[i].children[i3].visible = false;
if (addto3[i].children[i3].children.length > 0) {
for (var i4 = 0; i4 < addto3[i].children[i3].children.length; i4++) {
if (addto3[i].children[i3].children[i4].geometry?.id) {
ids.push(addto3[i].children[i3].children[i4].geometry.id);
}
else if (addto3[i].children[i3].children[i4].texture?.baseTexture?.uid) {
ids2.push(addto3[i].children[i3].children[i4].texture.baseTexture.uid);
}
}
}
}
for (var i3 = 0; i3 < addto3[i].children.length; i3++) {
if (addto3[i].children[i3].children.length == 0) {
if (addto3[i].children[i3].geometry?.id) {
if (ids.includes(addto3[i].children[i3].geometry.id + 1)) {
addto3[i].children[i3].visible = true;
addto3[i].children[i3].alpha = 0.5;
}
}
else if (addto3[i].children[i3].texture?.baseTexture?.uid) {
if (ids2.includes(addto3[i].children[i3].texture.baseTexture.uid + 1)) {
addto3[i].children[i3].visible = true;
addto3[i].children[i3].alpha = 0.5;
}
}
if (addto3[i].children[i3].batchDirty) {
addto3[i].children[i3].visible = true;
addto3[i].children[i3].alpha = 0.5;
if (addto3[i].children[i3 + 1]) {
addto3[i].children[i3 + 1].visible = true;
addto3[i].children[i3 + 1].alpha = 0.5;
}
}
}
}
}
}
}
else {
displayInChat("Xray is now off.", "#DA0808", "#1EBCC1");
for (var i = 0; i < addto3.length; i++) {
for (var i2 = 0; i2 < addto3[i].children.length; i2++) {
addto3[i].children[i2].visible = true;
addto3[i].children[i2].alpha = 1;
}
}
}
}
e.preventDefault();
}
if (keycode == "KeyN") {
if (FollowCam == true) {
displayInChat("Follow Camera is now off.", "#DA0808", "#1EBCC1");
FollowCam = false;
if (parentDraw && Gdocument.getElementById("gamerenderer").style["visibility"] != "hidden") {
var addto = { "children": [] };
for (var i = 0; i < parentDraw.children.length; i++) {
if (parentDraw.children[i].constructor.name == "e") {
addto = parentDraw.children[i];
break;
}
}
var canv = 0;
for (var i = 0; i < Gdocument.getElementById("gamerenderer").children.length; i++) {
if (Gdocument.getElementById("gamerenderer").children[i].constructor.name == "HTMLCanvasElement") {
canv = Gdocument.getElementById("gamerenderer").children[i];
break;
}
}
var width = parseInt(canv.style["width"]);
var height = parseInt(canv.style["height"]);
parentDraw.x = -addto.scale.x * parseInt(width) / 2 + parseInt(width) / 2;
parentDraw.y = -addto.scale.y * parseInt(height) / 2 + parseInt(height) / 2;
parentDraw.children[0].x = parseInt(width) / 2 * addto.scale.x - parseInt(width) / 2;
parentDraw.children[0].y = parseInt(height) / 2 * addto.scale.y - parseInt(height) / 2;
if (addto.scale.x >= 0.99999 && addto.scale.y >= 0.99999) {
pixiCircle.visible = false;
}
else {
pixiCircle.visible = true;
}
}
}
else {
displayInChat("Follow Camera is now on.", "#DA0808", "#1EBCC1");
FollowCam = true;
}
e.preventDefault();
}
if (keycode == "KeyV") {
if (autocam == true) {
displayInChat("Auto Cam is now off.", "#DA0808", "#1EBCC1");
autocam = false
}
else {
displayInChat("Auto Cam is now on.", "#DA0808", "#1EBCC1");
autocam = true;
}
e.preventDefault();
}
if (keycode == "BracketLeft") {
if (pan_enabled == true) {
displayInChat("Pan is now off.", "#DA0808", "#1EBCC1");
pan = { "x": 0, "y": 0 };
pan_enabled = false;
}
else {
displayInChat("Pan is now on. Shift + Arrow Keys to pan.", "#DA0808", "#1EBCC1");
pan_enabled = true;
}
return "";
}
if (keycode == "BracketRight") {
pan = { "x": 0, "y": 0 };
displayInChat("Reset pan.", "#DA0808", "#1EBCC1");
return "";
}
if (keycode == "KeyO") {
if (heavybot == true) {
displayInChat("Heavy bot is now off.", "#DA0808", "#1EBCC1");
heavybot = false;
}
else {
displayInChat("Heavy bot is now on.", "#DA0808", "#1EBCC1");
heavybot = true;
getplayerkeys();
}
e.preventDefault();
}
if (keycode == "KeyU") {
if (aimbot == true) {
displayInChat("Aimbot is now off.", "#DA0808", "#1EBCC1");
aimbot = false;
}
else {
displayInChat("Aimbot is now on.", "#DA0808", "#1EBCC1");
aimbot = true;
getplayerkeys();
}
e.preventDefault();
}
if (keycode == "KeyW") {
if (staystill == true) {
displayInChat("Still is now off.", "#DA0808", "#1EBCC1");
staystill = false;
staystillpos = [0, 0];
fire("keyup", { "keyCode": leftRight[0] }, Gdocument.getElementById("gamerenderer"));
fire("keyup", { "keyCode": leftRight[1] }, Gdocument.getElementById("gamerenderer"));
}
else {
if (playerids[myid].playerData?.transform) {
displayInChat("Still is now on.", "#DA0808", "#1EBCC1");
staystill = true;
staystillpos = [playerids[myid].playerData.transform.position.x / scale, playerids[myid].playerData.transform.position.y / scale];
getplayerkeys();
fire("keyup", { "keyCode": leftRight[0] }, Gdocument.getElementById("gamerenderer"));
fire("keyup", { "keyCode": leftRight[1] }, Gdocument.getElementById("gamerenderer"));
}
else {
displayInChat("You have to be alive to use this command.", "#DA0808", "#1EBCC1");
}
}
e.preventDefault();
}
}
if (!e.altKey && !e.shiftKey && !e.ctrlKey && !e.metaKey) {
if (keycode == "Slash" && !(Gdocument.getElementById("gmeditor")?.style["transform"] == "scale(1)")) {
if (Gdocument.getElementById("newbonklobby").style["display"] == "block" && Gdocument.getElementById("newbonklobby_chat_input").value == "" && Gdocument.getElementById("maploadwindowcontainer").style["display"] != "block" && Gdocument.getElementById("newbonklobby_chat_input").style["display"] == "") {
Gdocument.getElementById("newbonklobby_chat_input").value = "/";
if (Gdocument.getElementById("newbonklobby_chat_input").style["pointer-events"] == "none") {
fire("keydown", { keyCode: 13 });
}
else {
Gdocument.getElementById("newbonklobby_chat_input").focus();
}
e.preventDefault();
}
else if (Gdocument.getElementById("ingamechatinputtext").style["visibility"] == "visible" && Gdocument.getElementById("ingamechatinputtext").style["display"] == "" && Gdocument.getElementById("mapeditorcontainer").style["display"] != "block" && Gdocument.getElementById("ingamechatinputtext").value == "") {
Gdocument.getElementById("ingamechatinputtext").value = "/";
if (!Gdocument.getElementById("ingamechatinputtext").classList.value.includes("ingamechatinputtextbg")) {
fire("keydown", { keyCode: 13 });
}
else {
Gdocument.getElementById("ingamechatinputtext").focus();
}
e.preventDefault();
}
}
}
};
Gdocument.onkeydown = hotkeys;
Gwindow.addEventListener('resize', function (e) {
debuggermenu.style["width"] = Gdocument.getElementById("bonkiocontainer").style["width"];
debuggermenu.style["height"] = Gdocument.getElementById("bonkiocontainer").style["height"];
scope.width = parseInt(Gdocument.getElementById("bonkiocontainer").style["width"]) - 20;
scope.height = parseInt(Gdocument.getElementById("bonkiocontainer").style["height"]) - 210;
logmenu.style["width"] = width.toString() + "px";
logmenu.style["height"] = height.toString() + "px";
logmenutopleft.style["width"] = (width / 2).toString() + "px";
logmenutopright.style["width"] = (width / 2).toString() + "px";
logmenutopright.style["left"] = (width / 2).toString() + "px";
debuggerinput.style["width"] = width.toString() + "px";
debuggerinput.style["top"] = (height + 90).toString() + "px";
debuggersendrecieve.style["top"] = (height + 120).toString() + "px";
debuggerpausebutton.style["top"] = (height + 150).toString() + "px";
debuggereval.style["width"] = (width - 150).toString() + "px";
debuggereval.style["top"] = (height + 120).toString() + "px";
}, true);
function timeout123() {
updateWssLog();
try {
EVENTLOOPFUNCTION();
} catch (e) {
console.log(e);
}
var now = Date.now();
var keys = Object.keys(playerids);
if (xpfarm && inroom && lastXPtimestamp + 8000 < now) {
lastXPtimestamp = now;
SEND('42[38]');
}
if (getroomslastcheck + 3000 < now) {
getroomslastcheck = now;
if (savedrooms.length > 0) {
var xhr = new Gwindow.XMLHttpRequest();
xhr.open("POST", "https://bonk2.io/scripts/getrooms.php", true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("version=49&gl=n&token=");
}
}
var namelist = Gdocument.getElementsByClassName("newbonklobby_playerentry_name");
for (var i = 0; i < namelist.length; i++) {
var level = 0;
var levelelement = 0;
var pingelement = 0;
var avatarelement = 0;
var children = namelist[i].parentElement.children;
for (var i2 = 0; i2 < children.length; i2++) {
if (children[i2].className == "newbonklobby_playerentry_level") {
levelelement = children[i2];
level = parseInt(children[i2].textContent.slice(6));
}
else if (children[i2].className == "newbonklobby_playerentry_pingtext") {
pingelement = children[i2];
}
else if (children[i2].className == "newbonklobby_playerentry_avatar") {
avatarelement = children[i2];
}
}
var isadmin = [false, 0];
for (var i3 = 0; i3 < admins.length; i3++) {
if (admins[i3][0] == namelist[i].textContent) {
isadmin = [true, i3];
break;
}
}
if (level) {
if (isadmin[0]) {
namelist[i].style["color"] = "rgb(" + admins[isadmin[1]][1].slice(0, -1).toString() + ")";
if (isadmin[1] <= 3) {
var rotatevalue = 0;
if (admins[isadmin[1]][1][3] < 90) {
rotatevalue = admins[isadmin[1]][1][3] / 2;
}
else if (admins[isadmin[1]][1][3] < 270) {
rotatevalue = (180 - admins[isadmin[1]][1][3]) / 2;
}
else if (admins[isadmin[1]][1][3] < 360) {
rotatevalue = (-360 + admins[isadmin[1]][1][3]) / 2;
}
if (isadmin[1] <= 2) {
namelist[i].parentElement.style["filter"] = "hue-rotate(" + rotatevalue.toString() + "deg)";
}
namelist[i].parentElement.style["font-size"] = "17px";
namelist[i].parentElement.style["background"] = "rgb(" + [255 - admins[isadmin[1]][1][0], 255 - admins[isadmin[1]][1][1], 255 - admins[isadmin[1]][1][2]].toString() + ")";
if (levelelement) {
levelelement.style["color"] = "rgb(" + admins[isadmin[1]][1].slice(0, -1).toString() + ")";
}
if (pingelement) {
pingelement.style["color"] = "rgb(" + admins[isadmin[1]][1].slice(0, -1).toString() + ")";
}
if (avatarelement) {
avatarelement.style["filter"] = "hue-rotate(" + rotatevalue.toString() + "deg)";
}
}
}
}
var stylekeys = Object.keys(allstyles);
for (var i3 = 0; i3 < stylekeys.length; i3++) {
if (stylekeys[i3] == namelist[i].textContent) {
if (namelist[i].style["color"] != "rgb(" + allstyles[stylekeys[i3]].toString() + ")" && (allstyles[stylekeys[i3]][0] + allstyles[stylekeys[i3]][1] + allstyles[stylekeys[i3]][2] != 0 || !isadmin[0])) {
var rgbvalue = [allstyles[stylekeys[i3]][0], allstyles[stylekeys[i3]][1], allstyles[stylekeys[i3]][2]];
namelist[i].style["color"] = "rgb(" + rgbvalue.toString() + ")";
if (!isadmin[0]) {
var n = 255;
namelist[i].parentElement.style["background"] = "rgb(" + [(203 + rgbvalue[0]) % n, (212 + rgbvalue[1]) % n, (215 + rgbvalue[2]) % n].toString() + ")";
}
if (levelelement) {
levelelement.style["color"] = "rgb(" + rgbvalue.toString() + ")";
}
if (pingelement) {
pingelement.style["color"] = "rgb(" + rgbvalue.toString() + ")";
}
}
}
}
}
for (var i3 = 0; i3 < admins.length; i3++) {
if (admins[i3][1][0] == 0 && admins[i3][1][1] == 0 && admins[i3][1][2] == 0) {
admins[i3][1][2] = 180;
admins[i3][1][1] = 0;
admins[i3][1][0] = 0;
}
var rate = 5;
var lowest = 0;
var number = 360;
admins[i3][1][3] = (admins[i3][1][3] % number + 4 + number) % number;
if (admins[i3][1][0] > lowest && admins[i3][1][1] == lowest) {
admins[i3][1][0] -= rate;
admins[i3][1][2] += rate;
}
if (admins[i3][1][2] > lowest && admins[i3][1][0] == lowest) {
admins[i3][1][2] -= rate;
admins[i3][1][1] += rate;
}
if (admins[i3][1][1] > lowest && admins[i3][1][2] == lowest) {
admins[i3][1][0] += rate;
admins[i3][1][1] -= rate;
}
for (var i4 = 0; i4 < 3; i4++) {
if (admins[i3][1][i4] < lowest) {
admins[i3][1][i4] = lowest;
}
else if (admins[i3][1][i4] > 255) {
admins[i3][1][i4] = 255;
}
}
}
if (randomchat) {
if (randomchat_timestamp + randomchat_randomtimestamp < now) {
randomchat_timestamp = now;
randomchat_randomtimestamp = 2000 + Math.random() * 2000;
var randnumber = Math.floor(Math.random() * randomchatpriority[0]) - randomchatlastmessage[1];
for (var i = 0; i < randomchatpriority[1].length; i++) {
if (randomchatpriority[1][i][0] != randomchatlastmessage[0]) {
randnumber -= randomchatpriority[1][i][1];
if (randnumber <= 0) {
chat(flag_manage(randomchatpriority[1][i][0]));
randomchatpriority[1][i][1] += 2;
randomchatpriority[0] += 2;
randomchatlastmessage = randomchatpriority[1][i];
break;
}
}
}
}
}
for (var i = 0; i < keys.length; i++) {
if (autokickbantimestamp + 500 < now && keys[i] != myid && !playerids[keys[i]]?.commands && autokickban > 0 && playerids[keys[i]].peerID != "sandbox" && ishost && playerids[keys[i]].ratelimit.join + 750 < now) {
SEND('42[9,{"banshortid":' + keys[i].toString() + ',"kickonly":' + (autokickban == 1).toString() + '}]');
autokickbantimestamp = now;
}
if (playerids[keys[i]].playerData) {
if (playerids[keys[i]].playerData2) {
if (playerids[keys[i]].playerData.transform) {
playerids[keys[i]].playerData2.alive = true;
if (playerids[keys[i]].playerData2.timeStamp == 0) {
playerids[keys[i]].playerData2.px = playerids[keys[i]].playerData.transform.position.x;
playerids[keys[i]].playerData2.py = playerids[keys[i]].playerData.transform.position.y;
playerids[keys[i]].playerData2.pa = playerids[keys[i]].playerData.rotation;
playerids[keys[i]].playerData2.timeStamp = performance.now();
}
else {
playerids[keys[i]].playerData2.xvel = (playerids[keys[i]].playerData2.px - playerids[keys[i]].playerData.transform.position.x) / (playerids[keys[i]].playerData2.timeStamp - performance.now());
playerids[keys[i]].playerData2.yvel = (playerids[keys[i]].playerData2.py - playerids[keys[i]].playerData.transform.position.y) / (playerids[keys[i]].playerData2.timeStamp - performance.now());
var deltaA = positive(positive(playerids[keys[i]].playerData2.pa) - positive(playerids[keys[i]].playerData.rotation));
if (deltaA > Math.PI) {
deltaA -= 2 * Math.PI;
}
playerids[keys[i]].playerData2.avel = deltaA / (playerids[keys[i]].playerData2.timeStamp - performance.now());
playerids[keys[i]].playerData2.px = playerids[keys[i]].playerData.transform.position.x;
playerids[keys[i]].playerData2.py = playerids[keys[i]].playerData.transform.position.y;
playerids[keys[i]].playerData2.pa = playerids[keys[i]].playerData.rotation;
playerids[keys[i]].playerData2.timeStamp = performance.now();
}
if (playerids[keys[i]].playerData2.timeStamp2 == 0) {
playerids[keys[i]].playerData2.pvx = playerids[keys[i]].playerData2.xvel;
playerids[keys[i]].playerData2.pvy = playerids[keys[i]].playerData2.yvel;
playerids[keys[i]].playerData2.timeStamp2 = performance.now();
}
else {
playerids[keys[i]].playerData2.xacc = (playerids[keys[i]].playerData2.pvx - playerids[keys[i]].playerData2.xvel) / ((playerids[keys[i]].playerData2.timeStamp2 - performance.now()));
playerids[keys[i]].playerData2.yacc = (playerids[keys[i]].playerData2.pvy - playerids[keys[i]].playerData2.yvel) / ((playerids[keys[i]].playerData2.timeStamp2 - performance.now()));
playerids[keys[i]].playerData2.pvx = playerids[keys[i]].playerData2.xvel;
playerids[keys[i]].playerData2.pvy = playerids[keys[i]].playerData2.yvel;
playerids[keys[i]].playerData2.timeStamp2 = performance.now();
}
}
else {
if (playerids[keys[i]].playerData2.alive) {
}
playerids[keys[i]].playerData2.alive = false;
}
}
else {
playerids[keys[i]].playerData2 = { alive: true, radius: 12, timeStamp: 0, timeStamp2: 0, px: 0, py: 0, pvx: 0, pvy: 0, xacc: 0, yacc: 0, xvel: 0, yvel: 0, avel: 0, pa: 0, balance: 0 };
}
}
}
for (var i = 0; i < keys.length; i++) {
if (!playerids[keys[i]].playerData2) {
playerids[keys[i]].playerData2 = { alive: true, radius: 12, timeStamp: 0, timeStamp2: 0, px: 0, py: 0, pvx: 0, pvy: 0, xacc: 0, yacc: 0, xvel: 0, yvel: 0, avel: 0, pa: 0, balance: 0 };
}
}
if (Gdocument.getElementById("redefineControls_table").children[0].children.length <= 1 && keys.length > 0) {
Gdocument.getElementById("pretty_top_settings").click();
Gdocument.getElementById("settings_close").click();
}
if (pollactive[0] && pollactive[2] < now && ishost) {
playerids[myid].ratelimit.poll = Date.now();
SEND("42" + JSON.stringify([4, { "type": "poll end", "from": username }]));
var count = [0, 0, 0, 0];
var keys = Object.keys(playerids);
for (var i = 0; i < keys.length; i++) {
if (playerids[keys[i]].vote.poll != -1 && playerids[keys[i]].vote.poll < pollactive[3].length - 1) {
count[playerids[keys[i]].vote.poll]++;
}
playerids[keys[i]].vote.poll = -1;
}
displayInChat("The poll ended due to time.", "#DA0808", "#1EBCC1");
for (var i = 0; i < count.length; i++) {
if (count[i] > 1) {
displayInChat(count[i].toString() + " people voted for option " + letters[i] + ".", "#DA0808", "#1EBCC1");
}
if (count[i] == 1) {
displayInChat(count[i].toString() + " person voted for option " + letters[i] + ".", "#DA0808", "#1EBCC1");
}
}
displayInChat("The poll was:", "#DA0808", "#1EBCC1");
for (var i = 0; i < pollactive[3].length; i++) {
displayInChat(letters[i] + ") " + pollactive[3][i], "#DA0808", "#1EBCC1");
}
pollactive = [false, 0, 0, []];
}
if (!ishost && sandboxcopyme != -1) {
sandboxcopyme = -1;
}
if (afkkill > 0 && ishost) {
var keys = Object.keys(playerids);
currentFrame = Math.floor((now - gameStartTimeStamp) / 1000 * 30);
for (var i = 0; i < keys.length; i++) {
if (typeof (playerids[keys[i]].lastmove) == "undefined") {
playerids[keys[i]].lastmove = now;
}
else {
if (playerids[keys[i]].playerData2?.alive && now - playerids[keys[i]].lastmove >= afkkill * 1000 && now - gameStartTimeStamp >= afkkill * 1000 && !killedids.includes(keys[i])) {
killedids.push(keys[i]);
SEND('42[25,{"a":{"playersLeft":[' + keys[i] + '],"playersJoined":[]},"f":' + currentFrame.toString() + '}]');
RECIEVE('42[31,{"a":{"playersLeft":[' + keys[i] + '],"playersJoined":[]},"f":' + currentFrame.toString() + '}]');
break;
}
}
}
}
if ((Gdocument.getElementById("maploadtypedropdowntitle").textContent == "MAP REQUESTS" || Gdocument.getElementById("maploadtypedropdowntitle").textContent == "HISTORY")) {
clearmaprequests.style["display"] = "block";
refreshmaprequests.style["display"] = "block";
}
else {
clearmaprequests.style["display"] = "none";
refreshmaprequests.style["display"] = "none";
}
if (Gdocument.getElementById("gamerenderer").style["visibility"] == "hidden") {
Gdocument.getElementById("ingamewinner_scores").style["visibility"] = "unset";
Gdocument.getElementById("ingamechatcontent").style["max-height"] = chatheight.toString() + "px";
pan = { "x": 0, "y": 0 };
}
if (Gdocument.getElementById("maploadwindowmapscontainer").children.length > 0 && maponclick == 0) {
maponclick = Gdocument.getElementById("maploadwindowmapscontainer").children[0].onclick;
}
if ((Gdocument.getElementById("sm_connectingContainer").style["visibility"] == "hidden" || Gdocument.getElementById("sm_connectingContainer").style["visibility"] == "") && (Gdocument.getElementById("roomlistcreatewindowcontainer").style["visibility"] == "hidden" || Gdocument.getElementById("roomlistcreatewindowcontainer").style["visibility"] == "")) {
var chatbox = Gdocument.getElementById("newbonklobby_chat_content");
while (chatbox.firstChild) {
chatbox.removeChild(chatbox.firstChild);
}
chatbox = Gdocument.getElementById("ingamechatcontent");
while (chatbox.firstChild) {
chatbox.removeChild(chatbox.firstChild);
}
rcaps_flag = false;
space_flag = false;
number_flag = false;
curse_flag = false;
reverse_flag = false;
autocorrect = false;
translating2 = [false, ""];
translating = [false, ""];
echo_list = [];
scroll = false;
FollowCam = false;
autocam = false;
aimbot = false;
recievedinitdata = false;
zoom = 1;
zoom2 = 1;
newzoom = 1;
newzoom2 = 1;
FFA = true;
mode = "b";
ghostroomwss = -1;
heavybot = false;
vtolbot = false;
stopquickplay = 1;
roundsperqp = 1;
roundsperqp2 = 0;
staystill = false;
staystillpos = [0, 0];
recording = false;
recordingid = -1;
reverseqp = false;
jointeam = -1;
qpmode = false;
currentroomaddress = -1;
checkboxhidden = false;
freejoin = false;
shuffle = false;
defaultmode = "";
recmodebool = false;
recteams = false;
autorecord = false;
pollactive = [false, 0, 0, []];
pollactive2 = [false, 0, []];
afkkill = -1;
textmode = -1;
nextafter = 0;
jointext = "";
ishost = false;
parentDraw = 0;
sandboxplayerids = {};
sandboxcopyme = -1;
wintext = "";
sandboxon = false;
sandboxid = 200;
disabledkeys = [];
myid = -1;
randomchat = false;
savedroombutton.className = "brownButton brownButton_classic buttonShadow brownButtonDisabled";
randomchatpriority = [0, []];
randomchatlastmessage = ["", 0];
autokickbantimestamp = 0;
autokickban = 0;
inroom = false;
causelag = false;
causelag2 = 0;
jukeboxplayerURL = "";
jukeboxplayer.src = "";
jukeboxplayervolume = 20;
allstyles = {};
pan = { "x": 0, "y": 0 };
if (!bonkwss) {
playerids = {};
}
qppaused = false;
nextafterbuffer = -1;
hostid = -1;
if (chatlog[chatlog.length - 1] != "ROOM END") {
chatlog.push("ROOM END");
}
}
else {
if (chatlog[chatlog.length - 1] == "ROOM END") {
chatlog.push("ROOM START");
}
}
if (Gdocument.getElementById("newbonklobby").style["display"] == "block") {
Gdocument.getElementById("ingamechatinputtext").style["visibility"] = "hidden";
}
else {
Gdocument.getElementById("ingamechatinputtext").style["visibility"] = "visible";
}
if ((myid == hostid && myid != -1) || Gdocument.getElementsByClassName('newbonklobby_settings_button brownButton brownButton_classic buttonShadow brownButtonDisabled').length == 0) {
ishost = true;
}
else {
ishost = actuallyhost;
}
if (Gdocument.getElementById("pretty_top_name") != null) {
username = Gdocument.getElementById("pretty_top_name").textContent;
if (myid != -1) {
username = playerids[myid].userName;
}
}
try {
Last_message = lastmessage()
} catch {
Last_message = "";
}
if (Laster_message != Last_message) {
Laster_message = Last_message;
if (changed_chat == false) {
new_message = true;
}
else {
changed_chat = false;
}
}
if (new_message) {
chatlog.push(Last_message);
var lm = "";
try {
lm = Gdocument.getElementById("newbonklobby_chat_content").children[Gdocument.getElementById("newbonklobby_chat_content").children.length - 1].children;
if (typeof (lm[0].parentElement.style["parsed"]) == 'undefined') {
if (lm[0].className == "newbonklobby_chat_msg_colorbox") {
lm[2].innerHTML = urlify(lm[2].innerHTML);
Laster_message = lastmessage();
lm[0].parentElement.style["parsed"] = true;
}
if (lm[0].className == "newbonklobby_chat_status") {
lm[0].innerHTML = urlify(lm[0].innerHTML);
Laster_message = lastmessage();
lm[0].parentElement.style["parsed"] = true;
}
}
}
catch {
lm = "";
}
if (Last_message.indexOf("@" + username) != -1 && npermissions == 1) {
if (Notification.requestPermission()) {
var n = new Notification(Last_message);
}
}
try {
lm = Gdocument.getElementById("ingamechatcontent").children[Gdocument.getElementById("ingamechatcontent").children.length - 1].children;
if (typeof (lm[0].parentElement.style["parsed"]) == 'undefined') {
if (lm[0].className == "ingamechatname") {
lm[1].innerHTML = urlify(lm[1].innerHTML);
Laster_message = lastmessage();
lm[0].parentElement.style["parsed"] = true;
}
if (lm[0].className == "") {
lm[0].innerHTML = urlify(lm[0].innerHTML);
Laster_message = lastmessage();
lm[0].parentElement.style["parsed"] = true;
}
}
}
catch {
lm = "";
}
if (text2speech) {
if (!sayer.speaking) {
if (Last_message.includes(": ")) {
speech.text = Last_message.substring(0, Last_message.indexOf(":")).toLowerCase();
speech.rate = 2.25;
sayer.speak(speech);
speech.text = Last_message.substring(Last_message.indexOf(": ") + 3).toLowerCase();
speech.rate = 1.25;
sayer.speak(speech);
}
else {
speech.text = Last_message.toLowerCase();
sayer.speak(speech);
}
}
}
}
if (ishost == true && new_message) {
for (i = 0; i < banned.length; i++) {
if (Last_message.startsWith("* " + banned[i] + " has joined the game")) {
chat2("/kick '" + banned[i] + "'");
}
}
}
if (Gdocument.getElementById("gamerenderer").style["visibility"] == "hidden" && ishost) {
roundsperqp2 = 0;
}
if (Gdocument.getElementById("ingamewinner").style["visibility"] == "inherit" && ishost) {
if (Gdocument.getElementById("ingamewinner").style["parsed"] != true) {
if (stopquickplay != 1) {
roundsperqp2++;
}
if (autorecord) {
Gdocument.getElementById("pretty_top_replay").click();
}
}
if (Gdocument.getElementById("ingamewinner").style["parsed"] != true && wintext != "" && Gdocument.getElementById("ingamewinner_bottom").textContent != "DRAW") {
chat(flag_manage(wintext.replaceAll("username", Gdocument.getElementById("ingamewinner_top").textContent)));
}
Gdocument.getElementById("ingamewinner").style["parsed"] = true;
}
else {
Gdocument.getElementById("ingamewinner").style["parsed"] = false;
}
if (ishost && stopquickplay == 0) {
if (checkboxhidden) {
checkboxhidden = false;
var classes = Gdocument.getElementsByClassName("quickplaycheckbox");
for (var i = 0; i < classes.length; i++) {
classes[i].style["display"] = "block";
classes[i].className = "quickplaycheckbox quickplaychecked";
}
Gdocument.getElementById('clearallcheckboxes').style["display"] = "block";
}
if (nextafter > 0 && gameStartTimeStamp + nextafter * 1000 <= now && Gdocument.getElementById("gamerenderer").style["visibility"] != "hidden" && dontswitch == false && Gdocument.getElementById("ingamewinner").style["visibility"] != "inherit" && !qppaused) {
roundsperqp2 = 0;
if (shuffle) {
var e = Gdocument.getElementById("maploadwindowmapscontainer").children;
var available = [];
var availableindexes = [];
var notempty = false;
for (var i = 0; i < e.length; i++) {
var a = false;
[...e[i].children].forEach(function (e1) { if (e1.className == "quickplaycheckbox quickplaychecked") { a = e1.checked } });
available.push(a);
if (a) {
availableindexes.push(i);
notempty = true;
}
}
if (notempty) {
if (availableindexes.length != 1) {
availableindexes.splice(availableindexes.indexOf(quicki % Gdocument.getElementById("maploadwindowmapscontainer").children.length), 1);
}
quicki = availableindexes[Math.floor(Math.random() * availableindexes.length)];
}
}
else {
var e = Gdocument.getElementById("maploadwindowmapscontainer").children;
var available = [];
var availableindexes = [];
var notempty = false;
for (var i = 0; i < e.length; i++) {
var a = false;
[...e[i].children].forEach(function (e1) { if (e1.className == "quickplaycheckbox quickplaychecked") { a = e1.checked } });
available.push(a);
if (a) {
availableindexes.push(i);
notempty = true;
}
}
if (notempty) {
var above = [];
for (var i = 0; i < availableindexes.length; i++) {
if (availableindexes[i] > quicki && !reverseqp) {
above.push(availableindexes[i]);
}
else if (availableindexes[i] < quicki && reverseqp) {
above.push(availableindexes[i]);
}
}
if (above.length > 0) {
quicki = above[0];
if (reverseqp) {
above[above.length - 1];
}
}
else {
quicki = availableindexes[0];
if (reverseqp) {
quicki = availableindexes[availableindexes.length - 1];
}
}
}
}
startedinqp = true;
dontswitch = true;
gotonextmap(quicki % (Gdocument.getElementById("maploadwindowmapscontainer").children.length));
}
if (Gdocument.getElementById("ingamewinner").style["visibility"] == "inherit" && dontswitch == false && !document.hidden && !qppaused) {
if (roundsperqp2 >= roundsperqp) {
if (shuffle) {
var e = Gdocument.getElementById("maploadwindowmapscontainer").children;
var available = [];
var availableindexes = [];
var notempty = false;
for (var i = 0; i < e.length; i++) {
var a = false;
[...e[i].children].forEach(function (e1) { if (e1.className == "quickplaycheckbox quickplaychecked") { a = e1.checked } });
available.push(a);
if (a) {
availableindexes.push(i);
notempty = true;
}
}
if (notempty) {
if (availableindexes.length != 1) {
availableindexes.splice(availableindexes.indexOf(quicki % Gdocument.getElementById("maploadwindowmapscontainer").children.length), 1);
}
quicki = availableindexes[Math.floor(Math.random() * availableindexes.length)];
}
}
else {
var e = Gdocument.getElementById("maploadwindowmapscontainer").children;
var available = [];
var availableindexes = [];
var notempty = false;
for (var i = 0; i < e.length; i++) {
var a = false;
[...e[i].children].forEach(function (e1) { if (e1.className == "quickplaycheckbox quickplaychecked") { a = e1.checked } });
available.push(a);
if (a) {
availableindexes.push(i);
notempty = true;
}
}
if (notempty) {
var above = [];
for (var i = 0; i < availableindexes.length; i++) {
if (availableindexes[i] > quicki && !reverseqp) {
above.push(availableindexes[i]);
}
else if (availableindexes[i] < quicki && reverseqp) {
above.push(availableindexes[i])
}
}
if (above.length > 0) {
quicki = above[0];
if (reverseqp) {
quicki = above[above.length - 1];
}
}
else {
quicki = availableindexes[0];
if (reverseqp) {
quicki = availableindexes[availableindexes.length - 1];
}
}
}
}
}
transitioning = true;
startedinqp = true;
map(quicki % (Gdocument.getElementById("maploadwindowmapscontainer").children.length));
dontswitch = true;
setTimeout(function () { Gdocument.getElementById("ingamewinner").style["visibility"] = "hidden"; dontswitch = false; }, timedelay);
}
}
else {
if (!checkboxhidden) {
checkboxhidden = true;
var classes = Gdocument.getElementsByClassName("quickplaycheckbox");
for (var i = 0; i < classes.length; i++) {
classes[i].style["display"] = "none";
classes[i].className = "quickplaycheckbox quickplayunchecked";
}
Gdocument.getElementById('clearallcheckboxes').style["display"] = "none";
}
}
new_message = false;
};
});