Facebook
From Silly Butterfly, 8 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 390
  1. /*The MIT License (MIT)
  2. Copyright (c) 2015 Apostolique
  3. Permission is hereby granted, free of charge, to any person obtaining a copy
  4. of this software and associated documentation files (the "Software"), to deal
  5. in the Software without restriction, including without limitation the rights
  6. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. copies of the Software, and to permit persons to whom the Software is
  8. furnished to do so, subject to the following conditions:
  9. The above copyright notice and this permission notice shall be included in all
  10. copies or substantial portions of the Software.
  11. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  17. SOFTWARE.*/
  18.  
  19. // ==UserScript==
  20. // @name        AposLauncher
  21. // @namespace   AposLauncher
  22. // @include     http://agar.io/*
  23. // @version     4.123
  24. // @grant       none
  25. // @author      http://www.twitch.tv/apostolique
  26. // ==/UserScript==
  27.  
  28. var aposLauncherVersion = 4.123;
  29.  
  30. Number.prototype.mod = function(n) {
  31.     return ((this % n) + n) % n;
  32. };
  33.  
  34. Array.prototype.peek = function() {
  35.     return this[this.length - 1];
  36. };
  37.  
  38. var sha = "efde0488cc2cc176db48dd23b28a20b90314352b";
  39. function getLatestCommit() {
  40.     window.jQuery.ajax({
  41.             url: "https://api.github.com/repos/apostolique/Agar.io-bot/git/refs/heads/master",
  42.             cache: false,
  43.             dataType: "jsonp"
  44.         }).done(function(data) {
  45.             console.dir(data.data);
  46.             console.log("hmm: " + data.data.object.sha);
  47.             sha = data.data.object.sha;
  48.  
  49.             function update(prefix, name, url) {
  50.                 window.jQuery(document.body).prepend("<div id='" + prefix + "Dialog' style='position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px; z-index: 100; display: none;'>");
  51.                 window.jQuery('#' + prefix + 'Dialog').append("<div id='" + prefix + "Message' style='width: 350px; background-color: #FFFFFF; margin: 100px auto; border-radius: 15px; padding: 5px 15px 5px 15px;'>");
  52.                 window.jQuery('#' + prefix + 'Message').append("<h2>UPDATE TIME!!!</h2>");
  53.                 window.jQuery('#' + prefix + 'Message').append("<p>Grab the update for: <a id='" + prefix + "Link' href='" + url + "' target=\"_blank\">" + name + "</a></p>");
  54.                 window.jQuery('#' + prefix + 'Link').on('click', function() {
  55.                     window.jQuery("#" + prefix + "Dialog").hide();
  56.                     window.jQuery("#" + prefix + "Dialog").remove();
  57.                 });
  58.                 window.jQuery("#" + prefix + "Dialog").show();
  59.             }
  60.  
  61.             window.jQuery.get('https://raw.githubusercontent.com/Apostolique/Agar.io-bot/master/launcher.user.js?' + Math.floor((Math.random() * 1000000) + 1), function(data) {
  62.                 var latestVersion = data.replace(/(\r\n|\n|\r)/gm, "");
  63.                 latestVersion = latestVersion.substring(latestVersion.indexOf("// @version") + 11, latestVersion.indexOf("// @grant"));
  64.  
  65.                 latestVersion = parseFloat(latestVersion + 0.0000);
  66.                 var myVersion = parseFloat(aposLauncherVersion + 0.0000);
  67.  
  68.                 if (latestVersion > myVersion) {
  69.                     update("aposLauncher", "launcher.user.js", "https://github.com/Apostolique/Agar.io-bot/blob/" + sha + "/launcher.user.js/");
  70.                 }
  71.                 console.log('Current launcher.user.js Version: ' + myVersion + " on Github: " + latestVersion);
  72.             });
  73.  
  74.         }).fail(function() {});
  75. }
  76. getLatestCommit();
  77.  
  78. console.log("Running Bot Launcher!");
  79. (function(d, e) {
  80.  
  81.     //UPDATE
  82.     function keyAction(e) {
  83.         if (84 == e.keyCode) {
  84.             console.log("Toggle");
  85.             toggle = !toggle;
  86.         }
  87.         if (82 == e.keyCode) {
  88.             console.log("ToggleDraw");
  89.             toggleDraw = !toggleDraw;
  90.         }
  91.         if (68 == e.keyCode) {
  92.             window.setDarkTheme(!getDarkBool());
  93.         }
  94.         if (70 == e.keyCode) {
  95.             window.setShowMass(!getMassBool());
  96.         }
  97.         if (69 == e.keyCode) {
  98.             if (message.length > 0) {
  99.                 window.setMessage([]);
  100.                 window.onmouseup = function() {};
  101.                 window.ignoreStream = true;
  102.             } else {
  103.                 window.ignoreStream = false;
  104.                 window.refreshTwitch();
  105.             }
  106.         }
  107.         window.botList[botIndex].keyAction(e);
  108.     }
  109.  
  110.     function humanPlayer() {
  111.         //Don't need to do anything.
  112.         return [getPointX(), getPointY()];
  113.     }
  114.  
  115.  
  116.  
  117.     function pb() {
  118.  
  119.         //UPDATE
  120.  
  121.         window.botList = window.botList || [];
  122.  
  123.         window.jQuery('#nick').val(originalName);
  124.  
  125.         function HumanPlayerObject() {
  126.             this.name = "Human";
  127.             this.keyAction = function(key) {};
  128.             this.displayText = function() {return [];};
  129.             this.mainLoop = humanPlayer;
  130.         }
  131.  
  132.         var hpo = new HumanPlayerObject();
  133.  
  134.         window.botList.push(hpo);
  135.  
  136.         window.updateBotList();
  137.  
  138.         ya = !0;
  139.         Pa();
  140.         setInterval(Pa, 18E4);
  141.  
  142.         var father = window.jQuery("#canvas").parent();
  143.         window.jQuery("#canvas").remove();
  144.         father.prepend("<canvas id='canvas'>");
  145.  
  146.         G = za = document.getElementById("canvas");
  147.         f = G.getContext("2d");
  148.         G.onmousedown = function(a) {
  149.             if (Qa) {
  150.                 var b = a.clientX - (5 + m / 5 / 2),
  151.                     c = a.clientY - (5 + m / 5 / 2);
  152.                 if (Math.sqrt(b * b + c * c) <= m / 5 / 2) {
  153.                     V();
  154.                     H(17);
  155.                     return
  156.                 }
  157.             }
  158.             fa = a.clientX;
  159.             ga = a.clientY;
  160.             Aa();
  161.             V();
  162.         };
  163.         G.onmousemove = function(a) {
  164.             fa = a.clientX;
  165.             ga = a.clientY;
  166.             Aa();
  167.         };
  168.         G.onmouseup = function() {};
  169.         /firefox/i.test(navigator.userAgent) ? document.addEventListener("DOMMouseScroll", Ra, !1) : document.body.onmousewheel = Ra;
  170.         var a = !1,
  171.             b = !1,
  172.             c = !1;
  173.         d.onkeydown = function(l) {
  174.             //UPDATE
  175.             if (!window.jQuery('#nick').is(":focus")) {
  176.                 32 != l.keyCode || a || (V(), H(17), a = !0);
  177.                 81 != l.keyCode || b || (H(18), b = !0);
  178.                 87 != l.keyCode || c || (V(), H(21), c = !0);
  179.                 27 == l.keyCode && Sa(!0);
  180.  
  181.                 //UPDATE
  182.                 keyAction(l);
  183.             }
  184.         };
  185.         d.onkeyup = function(l) {
  186.             32 == l.keyCode && (a = !1);
  187.             87 == l.keyCode && (c = !1);
  188.             81 == l.keyCode && b && (H(19), b = !1);
  189.         };
  190.         d.onblur = function() {
  191.             H(19);
  192.             c = b = a = !1
  193.         };
  194.         d.onresize = Ta;
  195.         d.requestAnimationFrame(Ua);
  196.         setInterval(V, 40);
  197.         y && e("#region").val(y);
  198.         Va();
  199.         ha(e("#region").val());
  200.         0 == Ba && y && I();
  201.         W = !0;
  202.         e("#overlays").show();
  203.         Ta();
  204.         d.location.hash && 6 <= d.location.hash.length && Wa(d.location.hash)
  205.     }
  206.  
  207.     function Ra(a) {
  208.         J *= Math.pow(.9, a.wheelDelta / -120 || a.detail || 0);
  209.         //UPDATE
  210.         0.07 > J && (J = 0.07);
  211.         J > 4 / h && (J = 4 / h)
  212.     }
  213.  
  214.     function qb() {
  215.         if (.4 > h) X = null;
  216.         else {
  217.             for (var a = Number.POSITIVE_INFINITY, b = Number.POSITIVE_INFINITY, c = Number.NEGATIVE_INFINITY, l = Number.NEGATIVE_INFINITY, d = 0, p = 0; p < v.length; p++) {
  218.                 var g = v[p];
  219.                 !g.N() || g.R || 20 >= g.size * h || (d = Math.max(g.size, d), a = Math.min(g.x, a), b = Math.min(g.y, b), c = Math.max(g.x, c), l = Math.max(g.y, l))
  220.             }
  221.             X = rb.ka({
  222.                 ca: a - 10,
  223.                 da: b - 10,
  224.                 oa: c + 10,
  225.                 pa: l + 10,
  226.                 ma: 2,
  227.                 na: 4
  228.             });
  229.             for (p = 0; p < v.length; p++)
  230.                 if (g = v[p],
  231.                     g.N() && !(20 >= g.size * h))
  232.                     for (a = 0; a < g.a.length; ++a) b = g.a[a].x, c = g.a[a].y, b < s - m / 2 / h || c < t - r / 2 / h || b > s + m / 2 / h || c > t + r / 2 / h || X.m(g.a[a])
  233.         }
  234.     }
  235.  
  236.     function Aa() {
  237.         //UPDATE
  238.         if (toggle || window.botList[botIndex].name == "Human") {
  239.             setPoint(((fa - m / 2) / h + s), ((ga - r / 2) / h + t));
  240.         }
  241.     }
  242.  
  243.     function Pa() {
  244.         null == ka && (ka = {}, e("#region").children().each(function() {
  245.             var a = e(this),
  246.                 b = a.val();
  247.             b && (ka[b] = a.text())
  248.         }));
  249.         e.get("https://m.agar.io/info", function(a) {
  250.                 var b = {},
  251.                     c;
  252.                 for (c in a.regions) {
  253.                     var l = c.split(":")[0];
  254.                     b[l] = b[l] || 0;
  255.                     b[l] += a.regions[c].numPlayers
  256.                 }
  257.                 for (c in b) e('#region option[value="' + c + '"]').text(ka[c] + " (" + b[c] + " players)")
  258.             },
  259.             "json")
  260.     }
  261.  
  262.     function Xa() {
  263.         e("#adsBottom").hide();
  264.         e("#overlays").hide();
  265.         W = !1;
  266.         Va();
  267.         d.googletag && d.googletag.pubads && d.googletag.pubads().clear(d.aa)
  268.     }
  269.  
  270.     function ha(a) {
  271.         a && a != y && (e("#region").val() != a && e("#region").val(a), y = d.localStorage.location = a, e(".region-message").hide(), e(".region-message." + a).show(), e(".btn-needs-server").prop("disabled", !1), ya && I())
  272.     }
  273.  
  274.     function Sa(a) {
  275.         W || (K = null, sb(), a && (x = 1), W = !0, e("#overlays").fadeIn(a ? 200 : 3E3))
  276.     }
  277.  
  278.     function Y(a) {
  279.         e("#helloContainer").attr("data-gamemode", a);
  280.         P = a;
  281.         e("#gamemode").val(a)
  282.     }
  283.  
  284.     function Va() {
  285.         e("#region").val() ? d.localStorage.location = e("#region").val() : d.localStorage.location && e("#region").val(d.localStorage.location);
  286.         e("#region").val() ? e("#locationKnown").append(e("#region")) : e("#locationUnknown").append(e("#region"))
  287.     }
  288.  
  289.     function sb() {
  290.         la && (la = !1, setTimeout(function() {
  291.             la = !0
  292.         //UPDATE
  293.         }, 6E4 * Ya))
  294.     }
  295.  
  296.     function Z(a) {
  297.         return d.i18n[a] || d.i18n_dict.en[a] || a
  298.     }
  299.  
  300.     function Za() {
  301.         var a = ++Ba;
  302.         console.log("Find " + y + P);
  303.         e.ajax("https://m.agar.io/findServer", {
  304.             error: function() {
  305.                 setTimeout(Za, 1E3)
  306.             },
  307.             success: function(b) {
  308.                 a == Ba && (b.alert && alert(b.alert), Ca("ws://" + b.ip, b.token))
  309.             },
  310.             dataType: "json",
  311.             method: "POST",
  312.             cache: !1,
  313.             crossDomain: !0,
  314.             data: (y + P || "?") + "\n154669603"
  315.         })
  316.     }
  317.  
  318.     function I() {
  319.         ya && y && (e("#connecting").show(), Za())
  320.     }
  321.  
  322.     function Ca(a, b) {
  323.         if (q) {
  324.             q.onopen = null;
  325.             q.onmessage = null;
  326.             q.onclose = null;
  327.             try {
  328.                 q.close()
  329.             } catch (c) {}
  330.             q = null
  331.         }
  332.         Da.la && (a = "ws://" + Da.la);
  333.         if (null != L) {
  334.             var l = L;
  335.             L = function() {
  336.                 l(b)
  337.             }
  338.         }
  339.         if (tb) {
  340.             var d = a.split(":");
  341.             a = d[0] + "s://ip-" + d[1].replace(/\./g, "-").replace(/\//g, "") + ".tech.agar.io:" + (+d[2] + 2E3)
  342.         }
  343.         M = [];
  344.         k = [];
  345.         E = {};
  346.         v = [];
  347.         Q = [];
  348.         F = [];
  349.         z = A = null;
  350.         R = 0;
  351.         $ = !1;
  352.         console.log("Connecting to " + a);
  353.         //UPDATE
  354.         serverIP = a;
  355.         q = new WebSocket(a);
  356.         q.binaryType = "arraybuffer";
  357.         q.onopen = function() {
  358.             var a;
  359.             console.log("socket open");
  360.             a = N(5);
  361.             a.setUint8(0, 254);
  362.             a.setUint32(1, 5, !0);
  363.             O(a);
  364.             a = N(5);
  365.             a.setUint8(0, 255);
  366.             a.setUint32(1, 154669603, !0);
  367.             O(a);
  368.             a = N(1 + b.length);
  369.             a.setUint8(0, 80);
  370.             for (var c = 0; c < b.length; ++c) a.setUint8(c + 1, b.charCodeAt(c));
  371.             O(a);
  372.             $a()
  373.         };
  374.         q.onmessage = ub;
  375.         q.onclose = vb;
  376.         q.onerror = function() {
  377.             console.log("socket error")
  378.         }
  379.     }
  380.  
  381.     function N(a) {
  382.         return new DataView(new ArrayBuffer(a))
  383.     }
  384.  
  385.     function O(a) {
  386.         q.send(a.buffer)
  387.     }
  388.  
  389.     function vb() {
  390.         $ && (ma = 500);
  391.         console.log("socket close");
  392.         setTimeout(I, ma);
  393.         ma *= 2
  394.     }
  395.  
  396.     function ub(a) {
  397.         wb(new DataView(a.data))
  398.     }
  399.  
  400.     function wb(a) {
  401.         function b() {
  402.             for (var b = "";;) {
  403.                 var d = a.getUint16(c, !0);
  404.                 c += 2;
  405.                 if (0 == d) break;
  406.                 b += String.fromCharCode(d)
  407.             }
  408.             return b
  409.         }
  410.         var c = 0;
  411.         240 == a.getUint8(c) && (c += 5);
  412.         switch (a.getUint8(c++)) {
  413.             case 16:
  414.                 xb(a, c);
  415.                 break;
  416.             case 17:
  417.                 aa = a.getFloat32(c, !0);
  418.                 c += 4;
  419.                 ba = a.getFloat32(c, !0);
  420.                 c += 4;
  421.                 ca = a.getFloat32(c, !0);
  422.                 c += 4;
  423.                 break;
  424.             case 20:
  425.                 k = [];
  426.                 M = [];
  427.                 break;
  428.             case 21:
  429.                 Ea = a.getInt16(c, !0);
  430.                 c += 2;
  431.                 Fa = a.getInt16(c, !0);
  432.                 c += 2;
  433.                 Ga || (Ga = !0, na = Ea, oa = Fa);
  434.                 break;
  435.             case 32:
  436.                 M.push(a.getUint32(c, !0));
  437.                 c += 4;
  438.                 break;
  439.             case 49:
  440.                 if (null != A) break;
  441.                 var l = a.getUint32(c, !0),
  442.                     c = c + 4;
  443.                 F = [];
  444.                 for (var d = 0; d < l; ++d) {
  445.                     var p = a.getUint32(c, !0),
  446.                         c = c + 4;
  447.                     F.push({
  448.                         id: p,
  449.                         name: b()
  450.                     })
  451.                 }
  452.                 ab();
  453.                 break;
  454.             case 50:
  455.                 A = [];
  456.                 l = a.getUint32(c, !0);
  457.                 c += 4;
  458.                 for (d = 0; d < l; ++d) A.push(a.getFloat32(c, !0)), c += 4;
  459.                 ab();
  460.                 break;
  461.             case 64:
  462.                 pa = a.getFloat64(c, !0);
  463.                 c += 8;
  464.                 qa = a.getFloat64(c, !0);
  465.                 c += 8;
  466.                 ra = a.getFloat64(c, !0);
  467.                 c += 8;
  468.                 sa = a.getFloat64(c, !0);
  469.                 c += 8;
  470.                 aa = (ra + pa) / 2;
  471.                 ba = (sa + qa) / 2;
  472.                 ca = 1;
  473.                 0 == k.length && (s = aa, t = ba, h = ca);
  474.                 break;
  475.             case 81:
  476.                 var g = a.getUint32(c, !0),
  477.                     c = c + 4,
  478.                     e = a.getUint32(c, !0),
  479.                     c = c + 4,
  480.                     f = a.getUint32(c, !0),
  481.                     c = c + 4;
  482.                 setTimeout(function() {
  483.                     S({
  484.                         e: g,
  485.                         f: e,
  486.                         d: f
  487.                     })
  488.                 }, 1200)
  489.         }
  490.     }
  491.  
  492.     function xb(a, b) {
  493.         bb = C = Date.now();
  494.         $ || ($ = !0, e("#connecting").hide(), cb(), L && (L(), L = null));
  495.         var c = Math.random();
  496.         Ha = !1;
  497.         var d = a.getUint16(b, !0);
  498.         b += 2;
  499.         for (var u = 0; u < d; ++u) {
  500.             var p = E[a.getUint32(b, !0)],
  501.                 g = E[a.getUint32(b + 4, !0)];
  502.             b += 8;
  503.             p && g && (g.X(), g.s = g.x, g.t = g.y, g.r = g.size, g.J = p.x, g.K = p.y, g.q = g.size, g.Q =
  504.                 C)
  505.         }
  506.         for (u = 0;;) {
  507.             d = a.getUint32(b, !0);
  508.             b += 4;
  509.             if (0 == d) break;
  510.             ++u;
  511.             var f, p = a.getInt16(b, !0);
  512.             b += 4;
  513.             g = a.getInt16(b, !0);
  514.             b += 4;
  515.             f = a.getInt16(b, !0);
  516.             b += 2;
  517.             for (var h = a.getUint8(b++), w = a.getUint8(b++), m = a.getUint8(b++), h = (h << 16 | w << 8 | m).toString(16); 6 > h.length;) h = "0" + h;
  518.             var h = "#" + h,
  519.                 w = a.getUint8(b++),
  520.                 m = !!(w & 1),
  521.                 r = !!(w & 16);
  522.             w & 2 && (b += 4);
  523.             w & 4 && (b += 8);
  524.             w & 8 && (b += 16);
  525.             for (var q, n = "";;) {
  526.                 q = a.getUint16(b, !0);
  527.                 b += 2;
  528.                 if (0 == q) break;
  529.                 n += String.fromCharCode(q)
  530.             }
  531.             q = n;
  532.             n = null;
  533.             E.hasOwnProperty(d) ? (n = E[d], n.P(), n.s = n.x, n.t = n.y, n.r = n.size, n.color = h) :
  534.                 (n = new da(d, p, g, f, h, q), v.push(n), E[d] = n, n.ua = p, n.va = g);
  535.             n.h = m;
  536.             n.n = r;
  537.             n.J = p;
  538.             n.K = g;
  539.             n.q = f;
  540.             n.sa = c;
  541.             n.Q = C;
  542.             n.ba = w;
  543.             q && n.B(q); - 1 != M.indexOf(d) && -1 == k.indexOf(n) && (document.getElementById("overlays").style.display = "none", k.push(n), n.birth = getLastUpdate(), n.birthMass = (n.size * n.size / 100), 1 == k.length && (s = n.x, t = n.y, db()))
  544.  
  545.             //UPDATE
  546.             interNodes[d] = window.getCells()[d];
  547.         }
  548.  
  549.         //UPDATE
  550.         Object.keys(interNodes).forEach(function(element, index) {
  551.             //console.log("start: " + interNodes[element].updateTime + " current: " + D + " life: " + (D - interNodes[element].updateTime));
  552.             var isRemoved = !window.getCells().hasOwnProperty(element);
  553.  
  554.             //console.log("Time not updated: " + (window.getLastUpdate() - interNodes[element].getUptimeTime()));
  555.             if (isRemoved && (window.getLastUpdate() - interNodes[element].getUptimeTime()) > 3000) {
  556.                 delete interNodes[element];
  557.             } else {
  558.                 for (var i = 0; i < getPlayer().length; i++) {
  559.                     if (isRemoved && computeDistance(getPlayer()[i].x, getPlayer()[i].y, interNodes[element].x, interNodes[element].y) < getPlayer()[i].size + 710) {
  560.  
  561.                         delete interNodes[element];
  562.                         break;
  563.                     }
  564.                 }
  565.             }
  566.         });
  567.  
  568.         c = a.getUint32(b, !0);
  569.         b += 4;
  570.         for (u = 0; u < c; u++) d = a.getUint32(b, !0), b += 4, n = E[d], null != n && n.X();
  571.         //UPDATE
  572.         //Ha && 0 == k.length && Sa(!1)
  573.     }
  574.  
  575.     //UPDATE
  576.     function computeDistance(x1, y1, x2, y2) {
  577.         var xdis = x1 - x2; // <--- FAKE AmS OF COURSE!
  578.         var ydis = y1 - y2;
  579.         var distance = Math.sqrt(xdis * xdis + ydis * ydis);
  580.  
  581.         return distance;
  582.     }
  583.  
  584.     /**
  585.      * Some horse shit of some sort.
  586.      * @return Horse Shit
  587.      */
  588.     function screenDistance() {
  589.         return Math.min(computeDistance(getOffsetX(), getOffsetY(), screenToGameX(getWidth()), getOffsetY()), computeDistance(getOffsetX(), getOffsetY(), getOffsetX(), screenToGameY(getHeight())));
  590.     }
  591.  
  592.     window.verticalDistance = function() {
  593.         return computeDistance(screenToGameX(0), screenToGameY(0), screenToGameX(getWidth()), screenToGameY(getHeight()));
  594.     }
  595.  
  596.     /**
  597.      * A conversion from the screen's horizontal coordinate system
  598.      * to the game's horizontal coordinate system.
  599.      * @param x in the screen's coordinate system
  600.      * @return x in the game's coordinate system
  601.      */
  602.     window.screenToGameX = function(x) {
  603.         return (x - getWidth() / 2) / getRatio() + getX();
  604.     }
  605.  
  606.     /**
  607.      * A conversion from the screen's vertical coordinate system
  608.      * to the game's vertical coordinate system.
  609.      * @param y in the screen's coordinate system
  610.      * @return y in the game's coordinate system
  611.      */
  612.     window.screenToGameY = function(y) {
  613.         return (y - getHeight() / 2) / getRatio() + getY();
  614.     }
  615.  
  616.     window.drawPoint = function(x_1, y_1, drawColor, text) {
  617.         if (!toggleDraw) {
  618.             dPoints.push([x_1, y_1, drawColor]);
  619.             dText.push(text);
  620.         }
  621.     }
  622.  
  623.     window.drawArc = function(x_1, y_1, x_2, y_2, x_3, y_3, drawColor) {
  624.         if (!toggleDraw) {
  625.             var radius = computeDistance(x_1, y_1, x_3, y_3);
  626.             dArc.push([x_1, y_1, x_2, y_2, x_3, y_3, radius, drawColor]);
  627.         }
  628.     }
  629.  
  630.     window.drawLine = function(x_1, y_1, x_2, y_2, drawColor) {
  631.         if (!toggleDraw) {
  632.             lines.push([x_1, y_1, x_2, y_2, drawColor]);
  633.         }
  634.     }
  635.  
  636.     window.drawCircle = function(x_1, y_1, radius, drawColor) {
  637.         if (!toggleDraw) {
  638.             circles.push([x_1, y_1, radius, drawColor]);
  639.         }
  640.     }
  641.  
  642.     function V() {
  643.  
  644.         //UPDATE
  645.         if (getPlayer().length == 0 && !reviving && ~~(getCurrentScore() / 100) > 0) {
  646.             console.log("Dead: " + ~~(getCurrentScore() / 100));
  647.             apos('send', 'pageview');
  648.         }
  649.  
  650.         if (getPlayer().length == 0) {
  651.             console.log("Revive");
  652.             setNick(originalName);
  653.             reviving = true;
  654.         } else if (getPlayer().length > 0 && reviving) {
  655.             reviving = false;
  656.             console.log("Done Reviving!");
  657.         }
  658.        
  659.         if (T()) {
  660.             var a = fa - m / 2;
  661.             var b = ga - r / 2;
  662.             64 > a * a + b * b || .01 > Math.abs(eb - ia) &&
  663.                 .01 > Math.abs(fb - ja) || (eb = ia, fb = ja, a = N(13), a.setUint8(0, 16), a.setInt32(1, ia, !0), a.setInt32(5, ja, !0), a.setUint32(9, 0, !0), O(a))
  664.         }
  665.     }
  666.  
  667.     function cb() {
  668.         if (T() && $ && null != K) {
  669.             var a = N(1 + 2 * K.length);
  670.             a.setUint8(0, 0);
  671.             for (var b = 0; b < K.length; ++b) a.setUint16(1 + 2 * b, K.charCodeAt(b), !0);
  672.             O(a)
  673.         }
  674.     }
  675.  
  676.     function T() {
  677.         return null != q && q.readyState == q.OPEN
  678.     }
  679.  
  680.     window.opCode = function(a) {
  681.         console.log("Sending op code.");
  682.         H(parseInt(a));
  683.     }
  684.  
  685.     function H(a) {
  686.         if (T()) {
  687.             var b = N(1);
  688.             b.setUint8(0, a);
  689.             O(b)
  690.         }
  691.     }
  692.  
  693.     function $a() {
  694.         if (T() && null != B) {
  695.             var a = N(1 + B.length);
  696.             a.setUint8(0, 81);
  697.             for (var b = 0; b < B.length; ++b) a.setUint8(b + 1, B.charCodeAt(b));
  698.             O(a)
  699.         }
  700.     }
  701.  
  702.     function Ta() {
  703.         m = d.innerWidth;
  704.         r = d.innerHeight;
  705.         za.width = G.width = m;
  706.         za.height = G.height = r;
  707.         var a = e("#helloContainer");
  708.         a.css("transform", "none");
  709.         var b = a.height(),
  710.             c = d.innerHeight;
  711.         b > c / 1.1 ? a.css("transform", "translate(-50%, -50%) scale(" + c / b / 1.1 + ")") : a.css("transform", "translate(-50%, -50%)");
  712.         gb()
  713.     }
  714.  
  715.     function hb() {
  716.         var a;
  717.         a = Math.max(r / 1080, m / 1920);
  718.         return a *= J
  719.     }
  720.  
  721.     function yb() {
  722.         if (0 != k.length) {
  723.             for (var a = 0, b = 0; b < k.length; b++) a += k[b].size;
  724.             a = Math.pow(Math.min(64 / a, 1), .4) * hb();
  725.             h = (9 * h + a) / 10
  726.         }
  727.     }
  728.  
  729.     function gb() {
  730.         //UPDATE
  731.         dPoints = [];
  732.         circles = [];
  733.         dArc = [];
  734.         dText = [];
  735.         lines = [];
  736.  
  737.  
  738.         var a, b = Date.now();
  739.         ++zb;
  740.         C = b;
  741.         if (0 < k.length) {
  742.             yb();
  743.             for (var c = a = 0, d = 0; d < k.length; d++) k[d].P(), a += k[d].x / k.length, c += k[d].y / k.length;
  744.             aa = a;
  745.             ba = c;
  746.             ca = h;
  747.             s = (s + a) / 2;
  748.             t = (t + c) / 2;
  749.         } else s = (29 * s + aa) / 30, t = (29 * t + ba) / 30, h = (9 * h + ca * hb()) / 10;
  750.         qb();
  751.         Aa();
  752.         Ia || f.clearRect(0, 0, m, r);
  753.         Ia ? (f.fillStyle = ta ? "#111111" : "#F2FBFF", f.globalAlpha = .05, f.fillRect(0, 0, m, r), f.globalAlpha = 1) : Ab();
  754.         v.sort(function(a, b) {
  755.             return a.size == b.size ? a.id - b.id : a.size - b.size
  756.         });
  757.         f.save();
  758.         f.translate(m / 2, r / 2);
  759.         f.scale(h, h);
  760.         f.translate(-s, -t);
  761.         //UPDATE
  762.         f.save();
  763.         f.beginPath();
  764.         f.lineWidth = 5;
  765.         f.strokeStyle = (getDarkBool() ? '#F2FBFF' : '#111111');
  766.         f.moveTo(getMapStartX(), getMapStartY());
  767.         f.lineTo(getMapStartX(), getMapEndY());
  768.         f.stroke();
  769.         f.moveTo(getMapStartX(), getMapStartY());
  770.         f.lineTo(getMapEndX(), getMapStartY());
  771.         f.stroke();
  772.         f.moveTo(getMapEndX(), getMapStartY());
  773.         f.lineTo(getMapEndX(), getMapEndY());
  774.         f.stroke();
  775.         f.moveTo(getMapStartX(), getMapEndY());
  776.         f.lineTo(getMapEndX(), getMapEndY());
  777.         f.stroke();
  778.         f.restore();
  779.        
  780.         for (d = 0; d < v.length; d++) v[d].w(f);
  781.         for (d = 0; d < Q.length; d++) Q[d].w(f);
  782.         //UPDATE
  783.         if (getPlayer().length > 0) {
  784.             var moveLoc = window.botList[botIndex].mainLoop();
  785.             if (!toggle) {
  786.                 setPoint(moveLoc[0], moveLoc[1]);
  787.             }
  788.         }
  789.         customRender(f);
  790.         if (Ga) {
  791.             na = (3 * na + Ea) / 4;
  792.             oa = (3 * oa + Fa) / 4;
  793.             f.save();
  794.             f.strokeStyle = "#FFAAAA";
  795.             f.lineWidth = 10;
  796.             f.lineCap = "round";
  797.             f.lineJoin = "round";
  798.             f.globalAlpha = .5;
  799.             f.beginPath();
  800.             for (d = 0; d < k.length; d++) f.moveTo(k[d].x, k[d].y), f.lineTo(na, oa);
  801.             f.stroke();
  802.             f.restore();
  803.         }
  804.         f.restore();
  805.         z && z.width && f.drawImage(z, m - z.width - 10, 10);
  806.         R = Math.max(R, Bb());
  807.  
  808.         //UPDATE
  809.  
  810.         var currentDate = new Date();
  811.  
  812.         var nbSeconds = 0;
  813.         if (getPlayer().length > 0) {
  814.             //nbSeconds = currentDate.getSeconds() + currentDate.getMinutes() * 60 + currentDate.getHours() * 3600 - lifeTimer.getSeconds() - lifeTimer.getMinutes() * 60 - lifeTimer.getHours() * 3600;
  815.             nbSeconds = (currentDate.getTime() - lifeTimer.getTime())/1000;
  816.         }
  817.  
  818.         bestTime = Math.max(nbSeconds, bestTime);
  819.  
  820.         var displayText = 'Score: ' + ~~(R / 100) + " Current Time: " + nbSeconds + " seconds.";
  821.  
  822.         0 != R && (null == ua && (ua = new va(24, "#FFFFFF")), ua.C(displayText), c = ua.L(), a = c.width, f.globalAlpha = .2, f.fillStyle = "#000000", f.fillRect(10, r - 10 - 24 - 10, a + 10, 34), f.globalAlpha = 1, f.drawImage(c, 15, r -
  823.             10 - 24 - 5));
  824.         Cb();
  825.         b = Date.now() - b;
  826.         b > 1E3 / 60 ? D -= .01 : b < 1E3 / 65 && (D += .01);.4 > D && (D = .4);
  827.         1 < D && (D = 1);
  828.         b = C - ib;
  829.         !T() || W ? (x += b / 2E3, 1 < x && (x = 1)) : (x -= b / 300, 0 > x && (x = 0));
  830.         0 < x && (f.fillStyle = "#000000", f.globalAlpha = .5 * x, f.fillRect(0, 0, m, r), f.globalAlpha = 1);
  831.         ib = C
  832.  
  833.         drawStats(f);
  834.     }
  835.  
  836.     //UPDATE
  837.     function customRender(d) {
  838.         d.save();
  839.         for (var i = 0; i < lines.length; i++) {
  840.             d.beginPath();
  841.  
  842.             d.lineWidth = 5;
  843.  
  844.             if (lines[i][4] == 0) {
  845.                 d.strokeStyle = "#FF0000";
  846.             } else if (lines[i][4] == 1) {
  847.                 d.strokeStyle = "#00FF00";
  848.             } else if (lines[i][4] == 2) {
  849.                 d.strokeStyle = "#0000FF";
  850.             } else if (lines[i][4] == 3) {
  851.                 d.strokeStyle = "#FF8000";
  852.             } else if (lines[i][4] == 4) {
  853.                 d.strokeStyle = "#8A2BE2";
  854.             } else if (lines[i][4] == 5) {
  855.                 d.strokeStyle = "#FF69B4";
  856.             } else if (lines[i][4] == 6) {
  857.                 d.strokeStyle = "#008080";
  858.             } else if (lines[i][4] == 7) {
  859.                 d.strokeStyle = (getDarkBool() ? '#F2FBFF' : '#111111');
  860.             } else {
  861.                 d.strokeStyle = "#000000";
  862.             }
  863.  
  864.             d.moveTo(lines[i][0], lines[i][1]);
  865.             d.lineTo(lines[i][2], lines[i][3]);
  866.  
  867.             d.stroke();
  868.         }
  869.         d.restore();
  870.         d.save();
  871.         for (var i = 0; i < circles.length; i++) {
  872.             if (circles[i][3] == 0) {
  873.                 d.strokeStyle = "#FF0000";
  874.             } else if (circles[i][3] == 1) {
  875.                 d.strokeStyle = "#00FF00";
  876.             } else if (circles[i][3] == 2) {
  877.                 d.strokeStyle = "#0000FF";
  878.             } else if (circles[i][3] == 3) {
  879.                 d.strokeStyle = "#FF8000";
  880.             } else if (circles[i][3] == 4) {
  881.                 d.strokeStyle = "#8A2BE2";
  882.             } else if (circles[i][3] == 5) {
  883.                 d.strokeStyle = "#FF69B4";
  884.             } else if (circles[i][3] == 6) {
  885.                 d.strokeStyle = "#008080";
  886.             } else if (circles[i][3] == 7) {
  887.                 d.strokeStyle = (getDarkBool() ? '#F2FBFF' : '#111111');
  888.             } else {
  889.                 d.strokeStyle = "#000000";
  890.             }
  891.             d.beginPath();
  892.  
  893.             d.lineWidth = 10;
  894.             //d.setLineDash([5]);
  895.             d.globalAlpha = 0.3;
  896.  
  897.             d.arc(circles[i][0], circles[i][1], circles[i][2], 0, 2 * Math.PI, false);
  898.  
  899.             d.stroke();
  900.         }
  901.         d.restore();
  902.         d.save();
  903.         for (var i = 0; i < dArc.length; i++) {
  904.             if (dArc[i][7] == 0) {
  905.                 d.strokeStyle = "#FF0000";
  906.             } else if (dArc[i][7] == 1) {
  907.                 d.strokeStyle = "#00FF00";
  908.             } else if (dArc[i][7] == 2) {
  909.                 d.strokeStyle = "#0000FF";
  910.             } else if (dArc[i][7] == 3) {
  911.                 d.strokeStyle = "#FF8000";
  912.             } else if (dArc[i][7] == 4) {
  913.                 d.strokeStyle = "#8A2BE2";
  914.             } else if (dArc[i][7] == 5) {
  915.                 d.strokeStyle = "#FF69B4";
  916.             } else if (dArc[i][7] == 6) {
  917.                 d.strokeStyle = "#008080";
  918.             } else if (dArc[i][7] == 7) {
  919.                 d.strokeStyle = (getDarkBool() ? '#F2FBFF' : '#111111');
  920.             } else {
  921.                 d.strokeStyle = "#000000";
  922.             }
  923.  
  924.             d.beginPath();
  925.  
  926.             d.lineWidth = 5;
  927.  
  928.             var ang1 = Math.atan2(dArc[i][1] - dArc[i][5], dArc[i][0] - dArc[i][4]);
  929.             var ang2 = Math.atan2(dArc[i][3] - dArc[i][5], dArc[i][2] - dArc[i][4]);
  930.  
  931.             d.arc(dArc[i][4], dArc[i][5], dArc[i][6], ang1, ang2, false);
  932.  
  933.             d.stroke();
  934.         }
  935.         d.restore();
  936.         d.save();
  937.         for (var i = 0; i < dPoints.length; i++) {
  938.             if (dText[i] == "") {
  939.                 var radius = 10;
  940.  
  941.                 d.beginPath();
  942.                 d.arc(dPoints[i][0], dPoints[i][1], radius, 0, 2 * Math.PI, false);
  943.  
  944.                 if (dPoints[i][2] == 0) {
  945.                     d.fillStyle = "black";
  946.                 } else if (dPoints[i][2] == 1) {
  947.                     d.fillStyle = "yellow";
  948.                 } else if (dPoints[i][2] == 2) {
  949.                     d.fillStyle = "blue";
  950.                 } else if (dPoints[i][2] == 3) {
  951.                     d.fillStyle = "red";
  952.                 } else if (dPoints[i][2] == 4) {
  953.                     d.fillStyle = "#008080";
  954.                 } else if (dPoints[i][2] == 5) {
  955.                     d.fillStyle = "#FF69B4";
  956.                 } else {
  957.                     d.fillStyle = "#000000";
  958.                 }
  959.  
  960.                 d.fill();
  961.                 d.lineWidth = 2;
  962.                 d.strokeStyle = '#003300';
  963.                 d.stroke();
  964.             } else {
  965.                 var text = new va(18, (getDarkBool() ? '#F2FBFF' : '#111111'), true, (getDarkBool() ? '#111111' : '#F2FBFF'));
  966.  
  967.                 text.C(dText[i]);
  968.                 var textRender = text.L();
  969.                 d.drawImage(textRender, dPoints[i][0] - (textRender.width / 2), dPoints[i][1] - (textRender.height / 2));
  970.             }
  971.  
  972.         }
  973.         d.restore();
  974.     }
  975.  
  976.     function drawStats(d) {
  977.         d.save()
  978.  
  979.         sessionScore = Math.max(getCurrentScore(), sessionScore);
  980.  
  981.         var botString = window.botList[botIndex].displayText();
  982.  
  983.         var debugStrings = [];
  984.         debugStrings.push("Bot: " + window.botList[botIndex].name);
  985.         debugStrings.push("Launcher: AposLauncher " + aposLauncherVersion);
  986.         debugStrings.push("T - Bot: " + (!toggle ? "On" : "Off"));
  987.         debugStrings.push("R - Lines: " + (!toggleDraw ? "On" : "Off"));
  988.  
  989.         for (var i = 0; i < botString.length; i++) {
  990.             debugStrings.push(botString[i]);
  991.         }
  992.  
  993.         debugStrings.push("");
  994.         debugStrings.push("Best Score: " + ~~(sessionScore / 100));
  995.         debugStrings.push("Best Time: " + bestTime + " seconds");
  996.         debugStrings.push("");
  997.         debugStrings.push(serverIP);
  998.  
  999.         if (getPlayer().length > 0) {
  1000.             var offsetX = -getMapStartX();
  1001.             var offsetY = -getMapStartY();
  1002.             debugStrings.push("Location: " + Math.floor(getPlayer()[0].x + offsetX) + ", " + Math.floor(getPlayer()[0].y + offsetY));
  1003.         }
  1004.  
  1005.         var offsetValue = 20;
  1006.         var text = new va(18, (getDarkBool() ? '#F2FBFF' : '#111111'));
  1007.  
  1008.         for (var i = 0; i < debugStrings.length; i++) {
  1009.             text.C(debugStrings[i]);
  1010.             var textRender = text.L();
  1011.             d.drawImage(textRender, 20, offsetValue);
  1012.             offsetValue += textRender.height;
  1013.         }
  1014.  
  1015.         if (message.length > 0) {
  1016.             var mRender = [];
  1017.             var mWidth = 0;
  1018.             var mHeight = 0;
  1019.  
  1020.             for (var i = 0; i < message.length; i++) {
  1021.                 var mText = new va(28, '#FF0000', true, '#000000');
  1022.                 mText.C(message[i]);
  1023.                 mRender.push(mText.L());
  1024.  
  1025.                 if (mRender[i].width > mWidth) {
  1026.                     mWidth = mRender[i].width;
  1027.                 }
  1028.                 mHeight += mRender[i].height;
  1029.             }
  1030.  
  1031.             var mX = getWidth() / 2 - mWidth / 2;
  1032.             var mY = 20;
  1033.  
  1034.             d.globalAlpha = 0.4;
  1035.             d.fillStyle = '#000000';
  1036.             d.fillRect(mX - 10, mY - 10, mWidth + 20, mHeight + 20);
  1037.             d.globalAlpha = 1;
  1038.  
  1039.             var mOffset = mY;
  1040.             for (var i = 0; i < mRender.length; i++) {
  1041.                 d.drawImage(mRender[i], getWidth() / 2 - mRender[i].width / 2, mOffset);
  1042.                 mOffset += mRender[i].height;
  1043.             }
  1044.         }
  1045.  
  1046.         d.restore();
  1047.     }
  1048.  
  1049.     function Ab() {
  1050.         f.fillStyle = ta ? "#111111" : "#F2FBFF";
  1051.         f.fillRect(0, 0, m, r);
  1052.         f.save();
  1053.         f.strokeStyle = ta ? "#AAAAAA" : "#000000";
  1054.         f.globalAlpha = .2 * h;
  1055.         for (var a = m / h, b = r / h, c = (a / 2 - s) % 50; c < a; c += 50) f.beginPath(), f.moveTo(c * h - .5, 0), f.lineTo(c * h - .5, b * h), f.stroke();
  1056.         for (c = (b / 2 - t) % 50; c < b; c += 50) f.beginPath(), f.moveTo(0, c * h - .5), f.lineTo(a * h, c * h - .5), f.stroke();
  1057.         f.restore()
  1058.     }
  1059.  
  1060.     function Cb() {
  1061.         if (Qa && Ja.width) {
  1062.             var a = m / 5;
  1063.             f.drawImage(Ja, 5, 5, a, a)
  1064.         }
  1065.     }
  1066.  
  1067.     function Bb() {
  1068.         for (var a = 0, b = 0; b < k.length; b++) a += k[b].q * k[b].q;
  1069.         return a
  1070.     }
  1071.  
  1072.     function ab() {
  1073.         z = null;
  1074.         if (null != A || 0 != F.length)
  1075.             if (null != A || wa) {
  1076.                 z = document.createElement("canvas");
  1077.                 var a = z.getContext("2d"),
  1078.                     b = 60,
  1079.                     b = null == A ? b + 24 * F.length : b + 180,
  1080.                     c = Math.min(200, .3 * m) / 200;
  1081.                 z.width = 200 * c;
  1082.                 z.height = b * c;
  1083.                 a.scale(c, c);
  1084.                 a.globalAlpha = .4;
  1085.                 a.fillStyle = "#000000";
  1086.                 a.fillRect(0, 0, 200, b);
  1087.                 a.globalAlpha =
  1088.                     1;
  1089.                 a.fillStyle = "#FFFFFF";
  1090.                 c = null;
  1091.                 c = Z("leaderboard");
  1092.                 a.font = "30px Ubuntu";
  1093.                 a.fillText(c, 100 - a.measureText(c).width / 2, 40);
  1094.                 if (null == A)
  1095.                     for (a.font = "20px Ubuntu", b = 0; b < F.length; ++b) c = F[b].name || Z("unnamed_cell"), wa || (c = Z("unnamed_cell")), -1 != M.indexOf(F[b].id) ? (k[0].name && (c = k[0].name), a.fillStyle = "#FFAAAA") : a.fillStyle = "#FFFFFF", c = b + 1 + ". " + c, a.fillText(c, 100 - a.measureText(c).width / 2, 70 + 24 * b);
  1096.                 else
  1097.                     for (b = c = 0; b < A.length; ++b) {
  1098.                         var d = c + A[b] * Math.PI * 2;
  1099.                         a.fillStyle = Db[b + 1];
  1100.                         a.beginPath();
  1101.                         a.moveTo(100, 140);
  1102.                         a.arc(100,
  1103.                             140, 80, c, d, !1);
  1104.                         a.fill();
  1105.                         c = d
  1106.                     }
  1107.             }
  1108.     }
  1109.  
  1110.     function Ka(a, b, c, d, e) {
  1111.         this.V = a;
  1112.         this.x = b;
  1113.         this.y = c;
  1114.         this.i = d;
  1115.         this.b = e
  1116.     }
  1117.  
  1118.     function da(a, b, c, d, e, p) {
  1119.         this.id = a;
  1120.         this.s = this.x = b;
  1121.         this.t = this.y = c;
  1122.         this.r = this.size = d;
  1123.         this.color = e;
  1124.         this.a = [];
  1125.         this.W();
  1126.         this.B(p)
  1127.     }
  1128.  
  1129.     function va(a, b, c, d) {
  1130.         a && (this.u = a);
  1131.         b && (this.S = b);
  1132.         this.U = !!c;
  1133.         d && (this.v = d)
  1134.     }
  1135.  
  1136.     function S(a, b) {
  1137.         var c = "1" == e("#helloContainer").attr("data-has-account-data");
  1138.         e("#helloContainer").attr("data-has-account-data", "1");
  1139.         if (null == b && d.localStorage.loginCache) {
  1140.             var l = JSON.parse(d.localStorage.loginCache);
  1141.             l.f = a.f;
  1142.             l.d = a.d;
  1143.             l.e = a.e;
  1144.             d.localStorage.loginCache = JSON.stringify(l)
  1145.         }
  1146.         if (c) {
  1147.             var u = +e(".agario-exp-bar .progress-bar-text").first().text().split("/")[0],
  1148.                 c = +e(".agario-exp-bar .progress-bar-text").first().text().split("/")[1].split(" ")[0],
  1149.                 l = e(".agario-profile-panel .progress-bar-star").first().text();
  1150.             if (l != a.e) S({
  1151.                 f: c,
  1152.                 d: c,
  1153.                 e: l
  1154.             }, function() {
  1155.                 e(".agario-profile-panel .progress-bar-star").text(a.e);
  1156.                 e(".agario-exp-bar .progress-bar").css("width", "100%");
  1157.                 e(".progress-bar-star").addClass("animated tada").one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",
  1158.                     function() {
  1159.                         e(".progress-bar-star").removeClass("animated tada")
  1160.                     });
  1161.                 setTimeout(function() {
  1162.                     e(".agario-exp-bar .progress-bar-text").text(a.d + "/" + a.d + " XP");
  1163.                     S({
  1164.                         f: 0,
  1165.                         d: a.d,
  1166.                         e: a.e
  1167.                     }, function() {
  1168.                         S(a, b)
  1169.                     })
  1170.                 }, 1E3)
  1171.             });
  1172.             else {
  1173.                 var p = Date.now(),
  1174.                     g = function() {
  1175.                         var c;
  1176.                         c = (Date.now() - p) / 1E3;
  1177.                         c = 0 > c ? 0 : 1 < c ? 1 : c;
  1178.                         c = c * c * (3 - 2 * c);
  1179.                         e(".agario-exp-bar .progress-bar-text").text(~~(u + (a.f - u) * c) + "/" + a.d + " XP");
  1180.                         e(".agario-exp-bar .progress-bar").css("width", (88 * (u + (a.f - u) * c) / a.d).toFixed(2) + "%");
  1181.                         1 > c ? d.requestAnimationFrame(g) : b && b()
  1182.                     };
  1183.                 d.requestAnimationFrame(g)
  1184.  
  1185.             }
  1186.         } else e(".agario-profile-panel .progress-bar-star").text(a.e),
  1187.             e(".agario-exp-bar .progress-bar-text").text(a.f + "/" + a.d + " XP"), e(".agario-exp-bar .progress-bar").css("width", (88 * a.f / a.d).toFixed(2) + "%"), b && b()
  1188.  
  1189.     }
  1190.  
  1191.     function jb(a) {
  1192.         "string" == typeof a && (a = JSON.parse(a));
  1193.         Date.now() + 18E5 > a.ja ? e("#helloContainer").attr("data-logged-in", "0") : (d.localStorage.loginCache = JSON.stringify(a), B = a.fa, e(".agario-profile-name").text(a.name), $a(), S({
  1194.             f: a.f,
  1195.             d: a.d,
  1196.             e: a.e
  1197.         }), e("#helloContainer").attr("data-logged-in", "1"))
  1198.     }
  1199.  
  1200.     function Eb(a) {
  1201.         a = a.split("\n");
  1202.         jb({
  1203.             name: a[0],
  1204.             ta: a[1],
  1205.             fa: a[2],
  1206.             ja: 1E3 *
  1207.                 +a[3],
  1208.             e: +a[4],
  1209.             f: +a[5],
  1210.             d: +a[6]
  1211.         });
  1212.         console.log("Hello Facebook?");
  1213.     }
  1214.  
  1215.     function La(a) {
  1216.         if ("connected" == a.status) {
  1217.             var b = a.authResponse.accessToken;
  1218.             d.FB.api("/me/picture?width=180&height=180", function(a) {
  1219.                 d.localStorage.fbPictureCache = a.data.url;
  1220.                 e(".agario-profile-picture").attr("src", a.data.url)
  1221.             });
  1222.             e("#helloContainer").attr("data-logged-in", "1");
  1223.             null != B ? e.ajax("https://m.agar.io/checkToken", {
  1224.                 error: function() {
  1225.                     console.log("Facebook Fail!");
  1226.                     B = null;
  1227.                     La(a)
  1228.                 },
  1229.                 success: function(a) {
  1230.                     a = a.split("\n");
  1231.                     S({
  1232.                         e: +a[0],
  1233.                         f: +a[1],
  1234.                         d: +a[2]
  1235.                     });
  1236.                     console.log("Facebook connected!");
  1237.                 },
  1238.                 dataType: "text",
  1239.                 method: "POST",
  1240.                 cache: !1,
  1241.                 crossDomain: !0,
  1242.                 data: B
  1243.             }) : e.ajax("https://m.agar.io/facebookLogin", {
  1244.                 error: function() {
  1245.                     console.log("You have a Facebook problem!");
  1246.                     B = null;
  1247.                     e("#helloContainer").attr("data-logged-in", "0")
  1248.                 },
  1249.                 success: Eb,
  1250.                 dataType: "text",
  1251.                 method: "POST",
  1252.                 cache: !1,
  1253.                 crossDomain: !0,
  1254.                 data: b
  1255.             })
  1256.         }
  1257.     }
  1258.  
  1259.     function Wa(a) {
  1260.         Y(":party");
  1261.         e("#helloContainer").attr("data-party-state", "4");
  1262.         a = decodeURIComponent(a).replace(/.*#/gim, "");
  1263.         Ma("#" + d.encodeURIComponent(a));
  1264.         e.ajax(Na + "//m.agar.io/getToken", {
  1265.             error: function() {
  1266.                 e("#helloContainer").attr("data-party-state", "6")
  1267.             },
  1268.             success: function(b) {
  1269.                 b = b.split("\n");
  1270.                 e(".partyToken").val("agar.io/#" +
  1271.                     d.encodeURIComponent(a));
  1272.                 e("#helloContainer").attr("data-party-state", "5");
  1273.                 Y(":party");
  1274.                 Ca("ws://" + b[0], a)
  1275.             },
  1276.             dataType: "text",
  1277.             method: "POST",
  1278.             cache: !1,
  1279.             crossDomain: !0,
  1280.             data: a
  1281.         })
  1282.     }
  1283.  
  1284.     function Ma(a) {
  1285.         d.history && d.history.replaceState && d.history.replaceState({}, d.document.title, a)
  1286.     }
  1287.     if (!d.agarioNoInit) {
  1288.         var Na = d.location.protocol,
  1289.             tb = "https:" == Na,
  1290.             xa = d.navigator.userAgent;
  1291.         if (-1 != xa.indexOf("Android")) d.ga && d.ga("send", "event", "MobileRedirect", "PlayStore"), setTimeout(function() {
  1292.                 d.location.href = "market://details?id=com.miniclip.agar.io"
  1293.             },
  1294.             1E3);
  1295.         else if (-1 != xa.indexOf("iPhone") || -1 != xa.indexOf("iPad") || -1 != xa.indexOf("iPod")) d.ga && d.ga("send", "event", "MobileRedirect", "AppStore"), setTimeout(function() {
  1296.             d.location.href = "https://itunes.apple.com/app/agar.io/id995999703"
  1297.         }, 1E3);
  1298.         else {
  1299.             var za, f, G, m, r, X = null,
  1300.  
  1301.                 //UPDATE
  1302.                 toggle = false,
  1303.                 toggleDraw = false,
  1304.                 tempPoint = [0, 0, 1],
  1305.                 dPoints = [],
  1306.                 circles = [],
  1307.                 dArc = [],
  1308.                 dText = [],
  1309.                 lines = [],
  1310.                 names = ["Procix94"],
  1311.                 originalName = names[Math.floor(Math.random() * names.length)],
  1312.                 sessionScore = 0,
  1313.                 serverIP = "",
  1314.                 interNodes = [],
  1315.                 lifeTimer = new Date(),
  1316.                 bestTime = 0,
  1317.                 botIndex = 0,
  1318.                 reviving = false,
  1319.                 message = [],
  1320.  
  1321.                 q = null,
  1322.                 s = 0,
  1323.                 t = 0,
  1324.                 M = [],
  1325.                 k = [],
  1326.                 E = {},
  1327.                 v = [],
  1328.                 Q = [],
  1329.                 F = [],
  1330.                 fa = 0,
  1331.                 ga = 0,
  1332.  
  1333.                 //UPDATE
  1334.                 ia = -1,
  1335.                 ja = -1,
  1336.  
  1337.                 zb = 0,
  1338.                 C = 0,
  1339.                 ib = 0,
  1340.                 K = null,
  1341.                 pa = 0,
  1342.                 qa = 0,
  1343.                 ra = 1E4,
  1344.                 sa = 1E4,
  1345.                 h = 1,
  1346.                 y = null,
  1347.                 kb = !0,
  1348.                 wa = !0,
  1349.                 Oa = !1,
  1350.                 Ha = !1,
  1351.                 R = 0,
  1352.                 ta = !1,
  1353.                 lb = !1,
  1354.                 aa = s = ~~((pa + ra) / 2),
  1355.                 ba = t = ~~((qa + sa) / 2),
  1356.                 ca = 1,
  1357.                 P = "",
  1358.                 A = null,
  1359.                 ya = !1,
  1360.                 Ga = !1,
  1361.                 Ea = 0,
  1362.                 Fa =
  1363.                 0,
  1364.                 na = 0,
  1365.                 oa = 0,
  1366.                 mb = 0,
  1367.                 Db = ["#333333", "#FF3333", "#33FF33", "#3333FF"],
  1368.                 Ia = !1,
  1369.                 $ = !1,
  1370.                 bb = 0,
  1371.                 B = null,
  1372.                 J = 1,
  1373.                 x = 1,
  1374.                 W = !0,
  1375.                 Ba = 0,
  1376.                 Da = {};
  1377.             (function() {
  1378.                 var a = d.location.search;
  1379.                 "?" == a.charAt(0) && (a = a.slice(1));
  1380.                 for (var a = a.split("&"), b = 0; b < a.length; b++) {
  1381.                     var c = a[b].split("=");
  1382.                     Da[c[0]] = c[1]
  1383.                 }
  1384.             })();
  1385.             var Qa = "ontouchstart" in d && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(d.navigator.userAgent),
  1386.                 Ja = new Image;
  1387.             Ja.src = "img/split.png";
  1388.             var nb = document.createElement("canvas");
  1389.             if ("undefined" == typeof console || "undefined" ==
  1390.                 typeof DataView || "undefined" == typeof WebSocket || null == nb || null == nb.getContext || null == d.localStorage) alert("You browser does not support this game, we recommend you to use Firefox to play this");
  1391.             else {
  1392.                 var ka = null;
  1393.                 d.setNick = function(a) {
  1394.                     //UPDATE
  1395.                     originalName = a;
  1396.                     if (getPlayer().length == 0) {
  1397.                         lifeTimer = new Date();
  1398.                     }
  1399.  
  1400.                     Xa();
  1401.                     K = a;
  1402.                     cb();
  1403.                     R = 0
  1404.                 };
  1405.                 d.setRegion = ha;
  1406.                 d.setSkins = function(a) {
  1407.                     kb = a
  1408.                 };
  1409.                 d.setNames = function(a) {
  1410.                     wa = a
  1411.                 };
  1412.                 d.setDarkTheme = function(a) {
  1413.                     ta = a
  1414.                 };
  1415.                 d.setColors = function(a) {
  1416.                     Oa = a
  1417.                 };
  1418.                 d.setShowMass = function(a) {
  1419.                     lb = a
  1420.                 };
  1421.                 d.spectate = function() {
  1422.                     K = null;
  1423.                     H(1);
  1424.                     Xa()
  1425.                 };
  1426.                 d.setGameMode = function(a) {
  1427.                     a != P && (":party" ==
  1428.                         P && e("#helloContainer").attr("data-party-state", "0"), Y(a), ":party" != a && I())
  1429.                 };
  1430.                 d.setAcid = function(a) {
  1431.                     Ia = a
  1432.                 };
  1433.                 null != d.localStorage && (null == d.localStorage.AB9 && (d.localStorage.AB9 = 0 + ~~(100 * Math.random())), mb = +d.localStorage.AB9, d.ABGroup = mb);
  1434.                 e.get(Na + "//gc.agar.io", function(a) {
  1435.                     var b = a.split(" ");
  1436.                     a = b[0];
  1437.                     b = b[1] || ""; - 1 == ["UA"].indexOf(a) && ob.push("ussr");
  1438.                     ea.hasOwnProperty(a) && ("string" == typeof ea[a] ? y || ha(ea[a]) : ea[a].hasOwnProperty(b) && (y || ha(ea[a][b])))
  1439.                 }, "text");
  1440.                 d.ga && d.ga("send", "event", "User-Agent", d.navigator.userAgent, {
  1441.                     nonInteraction: 1
  1442.                 });
  1443.                 var la = !1,
  1444.                     Ya = 0;
  1445.                 setTimeout(function() {
  1446.                     la = !0
  1447.                 }, Math.max(6E4 * Ya, 1E4));
  1448.                 var ea = {
  1449.                         AF: "JP-Tokyo",
  1450.                         AX: "EU-London",
  1451.                         AL: "EU-London",
  1452.                         DZ: "EU-London",
  1453.                         AS: "SG-Singapore",
  1454.                         AD: "EU-London",
  1455.                         AO: "EU-London",
  1456.                         AI: "US-Atlanta",
  1457.                         AG: "US-Atlanta",
  1458.                         AR: "BR-Brazil",
  1459.                         AM: "JP-Tokyo",
  1460.                         AW: "US-Atlanta",
  1461.                         AU: "SG-Singapore",
  1462.                         AT: "EU-London",
  1463.                         AZ: "JP-Tokyo",
  1464.                         BS: "US-Atlanta",
  1465.                         BH: "JP-Tokyo",
  1466.                         BD: "JP-Tokyo",
  1467.                         BB: "US-Atlanta",
  1468.                         BY: "EU-London",
  1469.                         BE: "EU-London",
  1470.                         BZ: "US-Atlanta",
  1471.                         BJ: "EU-London",
  1472.                         BM: "US-Atlanta",
  1473.                         BT: "JP-Tokyo",
  1474.                         BO: "BR-Brazil",
  1475.                         BQ: "US-Atlanta",
  1476.                         BA: "EU-London",
  1477.                         BW: "EU-London",
  1478.                         BR: "BR-Brazil",
  1479.                         IO: "JP-Tokyo",
  1480.                         VG: "US-Atlanta",
  1481.                         BN: "JP-Tokyo",
  1482.                         BG: "EU-London",
  1483.                         BF: "EU-London",
  1484.                         BI: "EU-London",
  1485.                         KH: "JP-Tokyo",
  1486.                         CM: "EU-London",
  1487.                         CA: "US-Atlanta",
  1488.                         CV: "EU-London",
  1489.                         KY: "US-Atlanta",
  1490.                         CF: "EU-London",
  1491.                         TD: "EU-London",
  1492.                         CL: "BR-Brazil",
  1493.                         CN: "CN-China",
  1494.                         CX: "JP-Tokyo",
  1495.                         CC: "JP-Tokyo",
  1496.                         CO: "BR-Brazil",
  1497.                         KM: "EU-London",
  1498.                         CD: "EU-London",
  1499.                         CG: "EU-London",
  1500.                         CK: "SG-Singapore",
  1501.                         CR: "US-Atlanta",
  1502.                         CI: "EU-London",
  1503.                         HR: "EU-London",
  1504.                         CU: "US-Atlanta",
  1505.                         CW: "US-Atlanta",
  1506.                         CY: "JP-Tokyo",
  1507.                         CZ: "EU-London",
  1508.                         DK: "EU-London",
  1509.                         DJ: "EU-London",
  1510.                         DM: "US-Atlanta",
  1511.                         DO: "US-Atlanta",
  1512.                         EC: "BR-Brazil",
  1513.                         EG: "EU-London",
  1514.                         SV: "US-Atlanta",
  1515.                         GQ: "EU-London",
  1516.                         ER: "EU-London",
  1517.                         EE: "EU-London",
  1518.                         ET: "EU-London",
  1519.                         FO: "EU-London",
  1520.                         FK: "BR-Brazil",
  1521.                         FJ: "SG-Singapore",
  1522.                         FI: "EU-London",
  1523.                         FR: "EU-London",
  1524.                         GF: "BR-Brazil",
  1525.                         PF: "SG-Singapore",
  1526.                         GA: "EU-London",
  1527.                         GM: "EU-London",
  1528.                         GE: "JP-Tokyo",
  1529.                         DE: "EU-London",
  1530.                         GH: "EU-London",
  1531.                         GI: "EU-London",
  1532.                         GR: "EU-London",
  1533.                         GL: "US-Atlanta",
  1534.                         GD: "US-Atlanta",
  1535.                         GP: "US-Atlanta",
  1536.                         GU: "SG-Singapore",
  1537.                         GT: "US-Atlanta",
  1538.                         GG: "EU-London",
  1539.                         GN: "EU-London",
  1540.                         GW: "EU-London",
  1541.                         GY: "BR-Brazil",
  1542.                         HT: "US-Atlanta",
  1543.                         VA: "EU-London",
  1544.                         HN: "US-Atlanta",
  1545.                         HK: "JP-Tokyo",
  1546.                         HU: "EU-London",
  1547.                         IS: "EU-London",
  1548.                         IN: "JP-Tokyo",
  1549.                         ID: "JP-Tokyo",
  1550.                         IR: "JP-Tokyo",
  1551.                         IQ: "JP-Tokyo",
  1552.                         IE: "EU-London",
  1553.                         IM: "EU-London",
  1554.                         IL: "JP-Tokyo",
  1555.                         IT: "EU-London",
  1556.                         JM: "US-Atlanta",
  1557.                         JP: "JP-Tokyo",
  1558.                         JE: "EU-London",
  1559.                         JO: "JP-Tokyo",
  1560.                         KZ: "JP-Tokyo",
  1561.                         KE: "EU-London",
  1562.                         KI: "SG-Singapore",
  1563.                         KP: "JP-Tokyo",
  1564.                         KR: "JP-Tokyo",
  1565.                         KW: "JP-Tokyo",
  1566.                         KG: "JP-Tokyo",
  1567.                         LA: "JP-Tokyo",
  1568.                         LV: "EU-London",
  1569.                         LB: "JP-Tokyo",
  1570.                         LS: "EU-London",
  1571.                         LR: "EU-London",
  1572.                         LY: "EU-London",
  1573.                         LI: "EU-London",
  1574.                         LT: "EU-London",
  1575.                         LU: "EU-London",
  1576.                         MO: "JP-Tokyo",
  1577.                         MK: "EU-London",
  1578.                         MG: "EU-London",
  1579.                         MW: "EU-London",
  1580.                         MY: "JP-Tokyo",
  1581.                         MV: "JP-Tokyo",
  1582.                         ML: "EU-London",
  1583.                         MT: "EU-London",
  1584.                         MH: "SG-Singapore",
  1585.                         MQ: "US-Atlanta",
  1586.                         MR: "EU-London",
  1587.                         MU: "EU-London",
  1588.                         YT: "EU-London",
  1589.                         MX: "US-Atlanta",
  1590.                         FM: "SG-Singapore",
  1591.                         MD: "EU-London",
  1592.                         MC: "EU-London",
  1593.                         MN: "JP-Tokyo",
  1594.                         ME: "EU-London",
  1595.                         MS: "US-Atlanta",
  1596.                         MA: "EU-London",
  1597.                         MZ: "EU-London",
  1598.                         MM: "JP-Tokyo",
  1599.                         NA: "EU-London",
  1600.                         NR: "SG-Singapore",
  1601.                         NP: "JP-Tokyo",
  1602.                         NL: "EU-London",
  1603.                         NC: "SG-Singapore",
  1604.                         NZ: "SG-Singapore",
  1605.                         NI: "US-Atlanta",
  1606.                         NE: "EU-London",
  1607.                         NG: "EU-London",
  1608.                         NU: "SG-Singapore",
  1609.                         NF: "SG-Singapore",
  1610.                         MP: "SG-Singapore",
  1611.                         NO: "EU-London",
  1612.                         OM: "JP-Tokyo",
  1613.                         PK: "JP-Tokyo",
  1614.                         PW: "SG-Singapore",
  1615.                         PS: "JP-Tokyo",
  1616.                         PA: "US-Atlanta",
  1617.                         PG: "SG-Singapore",
  1618.                         PY: "BR-Brazil",
  1619.                         PE: "BR-Brazil",
  1620.                         PH: "JP-Tokyo",
  1621.                         PN: "SG-Singapore",
  1622.                         PL: "EU-London",
  1623.                         PT: "EU-London",
  1624.                         PR: "US-Atlanta",
  1625.                         QA: "JP-Tokyo",
  1626.                         RE: "EU-London",
  1627.                         RO: "EU-London",
  1628.                         RU: "RU-Russia",
  1629.                         RW: "EU-London",
  1630.                         BL: "US-Atlanta",
  1631.                         SH: "EU-London",
  1632.                         KN: "US-Atlanta",
  1633.                         LC: "US-Atlanta",
  1634.                         MF: "US-Atlanta",
  1635.                         PM: "US-Atlanta",
  1636.                         VC: "US-Atlanta",
  1637.                         WS: "SG-Singapore",
  1638.                         SM: "EU-London",
  1639.                         ST: "EU-London",
  1640.                         SA: "EU-London",
  1641.                         SN: "EU-London",
  1642.                         RS: "EU-London",
  1643.                         SC: "EU-London",
  1644.                         SL: "EU-London",
  1645.                         SG: "JP-Tokyo",
  1646.                         SX: "US-Atlanta",
  1647.                         SK: "EU-London",
  1648.                         SI: "EU-London",
  1649.                         SB: "SG-Singapore",
  1650.                         SO: "EU-London",
  1651.                         ZA: "EU-London",
  1652.                         SS: "EU-London",
  1653.                         ES: "EU-London",
  1654.                         LK: "JP-Tokyo",
  1655.                         SD: "EU-London",
  1656.                         SR: "BR-Brazil",
  1657.                         SJ: "EU-London",
  1658.                         SZ: "EU-London",
  1659.                         SE: "EU-London",
  1660.                         CH: "EU-London",
  1661.                         SY: "EU-London",
  1662.                         TW: "JP-Tokyo",
  1663.                         TJ: "JP-Tokyo",
  1664.                         TZ: "EU-London",
  1665.                         TH: "JP-Tokyo",
  1666.                         TL: "JP-Tokyo",
  1667.                         TG: "EU-London",
  1668.                         TK: "SG-Singapore",
  1669.                         TO: "SG-Singapore",
  1670.                         TT: "US-Atlanta",
  1671.                         TN: "EU-London",
  1672.                         TR: "TK-Turkey",
  1673.                         TM: "JP-Tokyo",
  1674.                         TC: "US-Atlanta",
  1675.                         TV: "SG-Singapore",
  1676.                         UG: "EU-London",
  1677.                         UA: "EU-London",
  1678.                         AE: "EU-London",
  1679.                         GB: "EU-London",
  1680.                         US: "US-Atlanta",
  1681.                         UM: "SG-Singapore",
  1682.                         VI: "US-Atlanta",
  1683.                         UY: "BR-Brazil",
  1684.                         UZ: "JP-Tokyo",
  1685.                         VU: "SG-Singapore",
  1686.                         VE: "BR-Brazil",
  1687.                         VN: "JP-Tokyo",
  1688.                         WF: "SG-Singapore",
  1689.                         EH: "EU-London",
  1690.                         YE: "JP-Tokyo",
  1691.                         ZM: "EU-London",
  1692.                         ZW: "EU-London"
  1693.                     },
  1694.                     L = null;
  1695.                 d.connect = Ca;
  1696.  
  1697.                 //UPDATE
  1698.                 /**
  1699.                  * Tells you if the game is in Dark mode.
  1700.                  * @return Boolean for dark mode.
  1701.                  */
  1702.                 window.getDarkBool = function() {
  1703.                     return ta;
  1704.                 }
  1705.  
  1706.                 /**
  1707.                  * Tells you if the mass is shown.
  1708.                  * @return Boolean for player's mass.
  1709.                  */
  1710.                 window.getMassBool = function() {
  1711.                     return lb;
  1712.                 }
  1713.  
  1714.                 /**
  1715.                  * This is a copy of everything that is shown on screen.
  1716.                  * Normally stuff will time out when off the screen, this
  1717.                  * memorizes everything that leaves the screen for a little
  1718.                  * while longer.
  1719.                  * @return The memory object.
  1720.                  */
  1721.                 window.getMemoryCells = function() {
  1722.                     return interNodes;
  1723.                 }
  1724.  
  1725.                 /**
  1726.                  * [getCellsArray description]
  1727.                  * @return {[type]} [description]
  1728.                  */
  1729.                 window.getCellsArray = function() {
  1730.                     return v;
  1731.                 }
  1732.  
  1733.                 /**
  1734.                  * [getCellsArray description]
  1735.                  * @return {[type]} [description]
  1736.                  */
  1737.                 window.getCells = function() {
  1738.                     return E;
  1739.                 }
  1740.  
  1741.                 /**
  1742.                  * Returns an array with all the player's cells.
  1743.                  * @return Player's cells
  1744.                  */
  1745.                 window.getPlayer = function() {
  1746.                     return k;
  1747.                 }
  1748.  
  1749.                 /**
  1750.                  * The canvas' width.
  1751.                  * @return Integer Width
  1752.                  */
  1753.                 window.getWidth = function() {
  1754.                     return m;
  1755.                 }
  1756.  
  1757.                 /**
  1758.                  * The canvas' height
  1759.                  * @return Integer Height
  1760.                  */
  1761.                 window.getHeight = function() {
  1762.                     return r;
  1763.                 }
  1764.  
  1765.                 /**
  1766.                  * Scaling ratio of the canvas. The bigger this ration,
  1767.                  * the further that you see.
  1768.                  * @return Screen scaling ratio.
  1769.                  */
  1770.                 window.getRatio = function() {
  1771.                     return h;
  1772.                 }
  1773.  
  1774.                 /**
  1775.                  * [getOffsetX description]
  1776.                  * @return {[type]} [description]
  1777.                  */
  1778.                 window.getOffsetX = function() {
  1779.                     return aa;
  1780.                 }
  1781.  
  1782.                 window.getOffsetY = function() {
  1783.                     return ba;
  1784.                 }
  1785.  
  1786.                 window.getX = function() {
  1787.                     return s;
  1788.                 }
  1789.  
  1790.                 window.getY = function() {
  1791.                     return t;
  1792.                 }
  1793.  
  1794.                 window.getPointX = function() {
  1795.                     return ia;
  1796.                 }
  1797.  
  1798.                 window.getPointY = function() {
  1799.                     return ja;
  1800.                 }
  1801.  
  1802.                 /**
  1803.                  * The X location of the mouse.
  1804.                  * @return Integer X
  1805.                  */
  1806.                 window.getMouseX = function() {
  1807.                     return fa;
  1808.                 }
  1809.  
  1810.                 /**
  1811.                  * The Y location of the mouse.
  1812.                  * @return Integer Y
  1813.                  */
  1814.                 window.getMouseY = function() {
  1815.                     return ga;
  1816.                 }
  1817.  
  1818.                 window.getMapStartX = function() {
  1819.                     return pa;
  1820.                 }
  1821.  
  1822.                 window.getMapStartY = function() {
  1823.                     return qa;
  1824.                 }
  1825.  
  1826.                 window.getMapEndX = function() {
  1827.                     return ra;
  1828.                 }
  1829.  
  1830.                 window.getMapEndY = function() {
  1831.                     return sa;
  1832.                 }
  1833.  
  1834.                 window.getScreenDistance = function() {
  1835.                     var temp = screenDistance();
  1836.                     return temp;
  1837.                 }
  1838.  
  1839.                 /**
  1840.                  * A timestamp since the last time the server sent any data.
  1841.                  * @return Last update timestamp
  1842.                  */
  1843.                 window.getLastUpdate = function() {
  1844.                     return C;
  1845.                 }
  1846.  
  1847.                 window.getCurrentScore = function() {
  1848.                     return R;
  1849.                 }
  1850.  
  1851.                 /**
  1852.                  * The game's current mode. (":ffa", ":experimental", ":teams". ":party")
  1853.                  * @return {[type]} [description]
  1854.                  */
  1855.                 window.getMode = function() {
  1856.                     return P;
  1857.                 }
  1858.  
  1859.                 window.setPoint = function(x, y) {
  1860.                     ia = x;
  1861.                     ja = y;
  1862.                 }
  1863.  
  1864.                 window.setScore = function(a) {
  1865.                     sessionScore = a * 100;
  1866.                 }
  1867.  
  1868.                 window.setBestTime = function(a) {
  1869.                     bestTime = a;
  1870.                 }
  1871.  
  1872.                 window.best = function(a, b) {
  1873.                     setScore(a);
  1874.                     setBestTime(b);
  1875.                 }
  1876.  
  1877.                 window.setBotIndex = function(a) {
  1878.                     console.log("Changing bot");
  1879.                     botIndex = a;
  1880.                 }
  1881.  
  1882.                 window.setMessage = function(a) {
  1883.                     message = a;
  1884.                 }
  1885.                 window.updateBotList = function() {
  1886.                     window.botList = window.botList || [];
  1887.  
  1888.                     window.jQuery('#locationUnknown').text("");
  1889.  
  1890.                     window.jQuery('#locationUnknown').append(window.jQuery('<select id="bList" class="form-control" onchange="setBotIndex($(this).val());" />'));
  1891.                     window.jQuery('#locationUnknown').addClass('form-group');
  1892.  
  1893.                     for (var i = 0; i < window.botList.length; i++) {
  1894.                         if (window.botList[i].name == "Human" && window.botList.length > 1) {
  1895.                             if (botIndex == i) {
  1896.                                 botIndex = (botIndex + 1).mod(window.botList.length);
  1897.                             }
  1898.                             continue;
  1899.                         }
  1900.  
  1901.                         var bList = window.jQuery('#bList');
  1902.                         window.jQuery('<option />', {
  1903.                             value: i,
  1904.                             text: window.botList[i].name
  1905.                         }).appendTo(bList);
  1906.                     }
  1907.                 }
  1908.  
  1909.                 var ma = 500,
  1910.                     eb = -1,
  1911.                     fb = -1,
  1912.                     z = null,
  1913.                     D = 1,
  1914.                     ua = null,
  1915.                     Ua = function() {
  1916.                         var a = Date.now(),
  1917.                             b = 1E3 / 60;
  1918.                         return function() {
  1919.                             d.requestAnimationFrame(Ua);
  1920.                             var c = Date.now(),
  1921.                                 l = c - a;
  1922.                             l > b && (a = c - l % b, !T() || 240 > Date.now() - bb ? gb() : console.warn("Skipping draw"), Fb())
  1923.                         }
  1924.                     }(),
  1925.                     U = {},
  1926.                     ob = "notreallyabot;poland;usa;china;russia;canada;australia;spain;brazil;germany;ukraine;france;sweden;chaplin;north korea;south korea;japan;united kingdom;earth;greece;latvia;lithuania;estonia;finland;norway;cia;maldivas;austria;nigeria;reddit;yaranaika;confederate;9gag;indiana;4chan;italy;bulgaria;tumblr;2ch.hk;hong kong;portugal;jamaica;german empire;mexico;sanik;switzerland;croatia;chile;indonesia;bangladesh;thailand;iran;iraq;peru;moon;botswana;bosnia;netherlands;european union;taiwan;pakistan;hungary;satanist;qing dynasty;matriarchy;patriarchy;feminism;ireland;texas;facepunch;prodota;cambodia;steam;piccolo;ea;india;kc;denmark;quebec;ayy lmao;sealand;bait;tsarist russia;origin;vinesauce;stalin;belgium;luxembourg;stussy;prussia;8ch;argentina;scotland;sir;romania;belarus;wojak;doge;nasa;byzantium;imperial japan;french kingdom;somalia;turkey;mars;pokerface;8;irs;receita federal;facebook".split(";"),
  1927.                     Gb = ["8", "nasa"],
  1928.                     Hb = ["m'blob"];
  1929.                 Ka.prototype = {
  1930.                     V: null,
  1931.                     x: 0,
  1932.                     y: 0,
  1933.                     i: 0,
  1934.                     b: 0
  1935.                 };
  1936.                 da.prototype = {
  1937.                     id: 0,
  1938.                     a: null,
  1939.                     name: null,
  1940.                     o: null,    
  1941.                     O: null,
  1942.                     x: 0,
  1943.                     y: 0,
  1944.                     size: 0,
  1945.                     s: 0,
  1946.                     t: 0,
  1947.                     r: 0,
  1948.                     J: 0,
  1949.                     K: 0,
  1950.                     q: 0,
  1951.                     ba: 0,
  1952.                     Q: 0,
  1953.                     sa: 0,
  1954.                     ia: 0,
  1955.                     G: !1,
  1956.                     h: !1,
  1957.                     n: !1,
  1958.                     R: !0,
  1959.                     Y: 0,
  1960.                     //UPDATE
  1961.                     updateCode: 0,
  1962.                     danger: false,
  1963.                     dangerTimeOut: 0,
  1964.                     isNotMoving: function() {
  1965.                         return (this.x == this.s && this.y == this.t);
  1966.                     },
  1967.                     isVirus: function() {
  1968.                         return this.h;
  1969.                     },
  1970.                     getUptimeTime: function() {
  1971.                         return this.Q;
  1972.                     },
  1973.                     X: function() {
  1974.                         var a;
  1975.                         for (a = 0; a < v.length; a++)
  1976.                             if (v[a] == this) {
  1977.                                 v.splice(a, 1);
  1978.                                 break
  1979.                             }
  1980.                         delete E[this.id];
  1981.                         a = k.indexOf(this); - 1 != a && (Ha = !0, k.splice(a, 1));
  1982.                         a = M.indexOf(this.id); - 1 != a && M.splice(a, 1);
  1983.                         this.G = !0;
  1984.                         0 < this.Y && Q.push(this)
  1985.                     },
  1986.                     l: function() {
  1987.                         return Math.max(~~(.3 * this.size), 24)
  1988.                     },
  1989.                     B: function(a) {
  1990.                         if (this.name = a) null ==
  1991.                             this.o ? this.o = new va(this.l(), "#FFFFFF", !0, "#000000") : this.o.M(this.l()), this.o.C(this.name)
  1992.                     },
  1993.                     W: function() {
  1994.                         for (var a = this.I(); this.a.length > a;) {
  1995.                             var b = ~~(Math.random() * this.a.length);
  1996.                             this.a.splice(b, 1)
  1997.                         }
  1998.                         for (0 == this.a.length && 0 < a && this.a.push(new Ka(this, this.x, this.y, this.size, Math.random() - .5)); this.a.length < a;) b = ~~(Math.random() * this.a.length), b = this.a[b], this.a.push(new Ka(this, b.x, b.y, b.i, b.b))
  1999.                     },
  2000.                     I: function() {
  2001.                         var a = 10;
  2002.                         20 > this.size && (a = 0);
  2003.                         this.h && (a = 30);
  2004.                         var b = this.size;
  2005.                         this.h || (b *= h);
  2006.                         b *= D;
  2007.                         this.ba &
  2008.                             32 && (b *= .25);
  2009.                         return ~~Math.max(b, a)
  2010.                     },
  2011.                     qa: function() {
  2012.                         this.W();
  2013.                         for (var a = this.a, b = a.length, c = 0; c < b; ++c) {
  2014.                             var d = a[(c - 1 + b) % b].b,
  2015.                                 e = a[(c + 1) % b].b;
  2016.                             a[c].b += (Math.random() - .5) * (this.n ? 3 : 1);
  2017.                             a[c].b *= .7;
  2018.                             10 < a[c].b && (a[c].b = 10); - 10 > a[c].b && (a[c].b = -10);
  2019.                             a[c].b = (d + e + 8 * a[c].b) / 10
  2020.                         }
  2021.                         for (var p = this, g = this.h ? 0 : (this.id / 1E3 + C / 1E4) % (2 * Math.PI), c = 0; c < b; ++c) {
  2022.                             var f = a[c].i,
  2023.                                 d = a[(c - 1 + b) % b].i,
  2024.                                 e = a[(c + 1) % b].i;
  2025.                             if (15 < this.size && null != X && 20 < this.size * h && 0 < this.id) {
  2026.                                 var k = !1,
  2027.                                     w = a[c].x,
  2028.                                     m = a[c].y;
  2029.                                 X.ra(w - 5, m - 5, 10, 10, function(a) {
  2030.                                     a.V != p && 25 > (w -
  2031.                                         a.x) * (w - a.x) + (m - a.y) * (m - a.y) && (k = !0)
  2032.                                 });
  2033.                                 !k && (a[c].x < pa || a[c].y < qa || a[c].x > ra || a[c].y > sa) && (k = !0);
  2034.                                 k && (0 < a[c].b && (a[c].b = 0), a[c].b -= 1)
  2035.                             }
  2036.                             f += a[c].b;
  2037.                             0 > f && (f = 0);
  2038.                             f = this.n ? (19 * f + this.size) / 20 : (12 * f + this.size) / 13;
  2039.                             a[c].i = (d + e + 8 * f) / 10;
  2040.                             d = 2 * Math.PI / b;
  2041.                             e = this.a[c].i;
  2042.                             this.h && 0 == c % 2 && (e += 5);
  2043.                             a[c].x = this.x + Math.cos(d * c + g) * e;
  2044.                             a[c].y = this.y + Math.sin(d * c + g) * e
  2045.                         }
  2046.                     },
  2047.                     P: function() {
  2048.                         if (0 >= this.id) return 1;
  2049.                         var a;
  2050.                         a = (C - this.Q) / 120;
  2051.                         a = 0 > a ? 0 : 1 < a ? 1 : a;
  2052.                         var b = 0 > a ? 0 : 1 < a ? 1 : a;
  2053.                         this.l();
  2054.                         if (this.G && 1 <= b) {
  2055.                             var c = Q.indexOf(this); - 1 != c && Q.splice(c, 1)
  2056.                         }
  2057.                         this.x =
  2058.                             a * (this.J - this.s) + this.s;
  2059.                         this.y = a * (this.K - this.t) + this.t;
  2060.                         this.size = b * (this.q - this.r) + this.r;
  2061.                         return b
  2062.                     },
  2063.                     N: function() {
  2064.                         return 0 >= this.id ? !0 : this.x + this.size + 40 < s - m / 2 / h || this.y + this.size + 40 < t - r / 2 / h || this.x - this.size - 40 > s + m / 2 / h || this.y - this.size - 40 > t + r / 2 / h ? !1 : !0
  2065.                     },
  2066.                     w: function(a) {
  2067.                         if (this.N()) {
  2068.                             ++this.Y;
  2069.                             var b = 0 < this.id && !this.h && !this.n && .4 > h;
  2070.                             5 > this.I() && (b = !0);
  2071.                             if (this.R && !b)
  2072.                                 for (var c = 0; c < this.a.length; c++) this.a[c].i = this.size;
  2073.                             this.R = b;
  2074.                             a.save();
  2075.                             this.ia = C;
  2076.                             c = this.P();
  2077.                             this.G && (a.globalAlpha *= 1 - c);
  2078.                             a.lineWidth =
  2079.                                 10;
  2080.                             a.lineCap = "round";
  2081.                             a.lineJoin = this.h ? "miter" : "round";
  2082.                             Oa ? (a.fillStyle = "#FFFFFF", a.strokeStyle = "#AAAAAA") : (a.fillStyle = this.color, a.strokeStyle = this.color);
  2083.                             if (b) a.beginPath(), a.arc(this.x, this.y, this.size + 5, 0, 2 * Math.PI, !1);
  2084.                             else {
  2085.                                 this.qa();
  2086.                                 a.beginPath();
  2087.                                 var d = this.I();
  2088.                                 a.moveTo(this.a[0].x, this.a[0].y);
  2089.                                 for (c = 1; c <= d; ++c) {
  2090.                                     var e = c % d;
  2091.                                     a.lineTo(this.a[e].x, this.a[e].y)
  2092.                                 }
  2093.                             }
  2094.                             a.closePath();
  2095.                             d = this.name.toLowerCase();
  2096.                             !this.n && kb && ":teams" != P ? -1 != ob.indexOf(d) ? (U.hasOwnProperty(d) || (U[d] = new Image, (d == "notreallyabot" ? U[d].src = "http://i.imgur.com/q5FdCkx.png" : U[d].src = "skins/" +
  2097.                                 d + ".png")), c = 0 != U[d].width && U[d].complete ? U[d] : null) : c = null : c = null;
  2098.                             c = (e = c) ? -1 != Hb.indexOf(d) : !1;
  2099.                             b || a.stroke();
  2100.                             a.fill();
  2101.                             null == e || c || (a.save(), a.clip(), a.drawImage(e, this.x - this.size, this.y - this.size, 2 * this.size, 2 * this.size), a.restore());
  2102.                             (Oa || 15 < this.size) && !b && (a.strokeStyle = "#000000", a.globalAlpha *= .1, a.stroke());
  2103.                             a.globalAlpha = 1;
  2104.                             null != e && c && a.drawImage(e, this.x - 2 * this.size, this.y - 2 * this.size, 4 * this.size, 4 * this.size);
  2105.                             c = -1 != k.indexOf(this);
  2106.                             b = ~~this.y;
  2107.                             if (0 != this.id && (wa || c) && this.name && this.o && (null ==
  2108.                                     e || -1 == Gb.indexOf(d))) {
  2109.                                 e = this.o;
  2110.                                 e.C(this.name);
  2111.                                 e.M(this.l());
  2112.                                 d = 0 >= this.id ? 1 : Math.ceil(10 * h) / 10;
  2113.                                 e.ea(d);
  2114.                                 var e = e.L(),
  2115.                                     p = ~~(e.width / d),
  2116.                                     g = ~~(e.height / d);
  2117.                                 a.drawImage(e, ~~this.x - ~~(p / 2), b - ~~(g / 2), p, g);
  2118.                                 b += e.height / 2 / d + 4
  2119.                             }
  2120.                             0 < this.id && lb && (c || 0 == k.length && (!this.h || this.n) && 20 < this.size) && (null == this.O && (this.O = new va(this.l() / 2, "#FFFFFF", !0, "#000000")), c = this.O, c.M(this.l() / 2), c.C(~~(this.size * this.size / 100)), d = Math.ceil(10 * h) / 10, c.ea(d), e = c.L(), p = ~~(e.width / d), g = ~~(e.height / d), a.drawImage(e, ~~this.x - ~~(p / 2),
  2121.                                 b - ~~(g / 2), p, g));
  2122.                             a.restore()
  2123.                         }
  2124.                     }
  2125.                 };
  2126.                 va.prototype = {
  2127.                     F: "",
  2128.                     S: "#000000",
  2129.                     U: !1,
  2130.                     v: "#000000",
  2131.                     u: 16,
  2132.                     p: null,
  2133.                     T: null,
  2134.                     k: !1,
  2135.                     D: 1,
  2136.                     M: function(a) {
  2137.                         this.u != a && (this.u = a, this.k = !0)
  2138.                     },
  2139.                     ea: function(a) {
  2140.                         this.D != a && (this.D = a, this.k = !0)
  2141.                     },
  2142.                     setStrokeColor: function(a) {
  2143.                         this.v != a && (this.v = a, this.k = !0)
  2144.                     },
  2145.                     C: function(a) {
  2146.                         a != this.F && (this.F = a, this.k = !0)
  2147.                     },
  2148.                     L: function() {
  2149.                         null == this.p && (this.p = document.createElement("canvas"), this.T = this.p.getContext("2d"));
  2150.                         if (this.k) {
  2151.                             this.k = !1;
  2152.                             var a = this.p,
  2153.                                 b = this.T,
  2154.                                 c = this.F,
  2155.                                 d = this.D,
  2156.                                 e = this.u,
  2157.                                 p = e + "px Ubuntu";
  2158.                             b.font =
  2159.                                 p;
  2160.                             var g = ~~(.2 * e);
  2161.                             a.width = (b.measureText(c).width + 6) * d;
  2162.                             a.height = (e + g) * d;
  2163.                             b.font = p;
  2164.                             b.scale(d, d);
  2165.                             b.globalAlpha = 1;
  2166.                             b.lineWidth = 3;
  2167.                             b.strokeStyle = this.v;
  2168.                             b.fillStyle = this.S;
  2169.                             this.U && b.strokeText(c, 3, e - g / 2);
  2170.                             b.fillText(c, 3, e - g / 2)
  2171.                         }
  2172.                         return this.p
  2173.                     }
  2174.                 };
  2175.                 Date.now || (Date.now = function() {
  2176.                     return (new Date).getTime()
  2177.                 });
  2178.                 (function() {
  2179.                     for (var a = ["ms", "moz", "webkit", "o"], b = 0; b < a.length && !d.requestAnimationFrame; ++b) d.requestAnimationFrame = d[a[b] + "RequestAnimationFrame"], d.cancelAnimationFrame = d[a[b] + "CancelAnimationFrame"] || d[a[b] +
  2180.                         "CancelRequestAnimationFrame"];
  2181.                     d.requestAnimationFrame || (d.requestAnimationFrame = function(a) {
  2182.                         return setTimeout(a, 1E3 / 60)
  2183.                     }, d.cancelAnimationFrame = function(a) {
  2184.                         clearTimeout(a)
  2185.                     })
  2186.                 })();
  2187.                 var rb = {
  2188.                         ka: function(a) {
  2189.                             function b(a, b, c, d, e) {
  2190.                                 this.x = a;
  2191.                                 this.y = b;
  2192.                                 this.j = c;
  2193.                                 this.g = d;
  2194.                                 this.depth = e;
  2195.                                 this.items = [];
  2196.                                 this.c = []
  2197.                             }
  2198.                             var c = a.ma || 2,
  2199.                                 d = a.na || 4;
  2200.                             b.prototype = {
  2201.                                 x: 0,
  2202.                                 y: 0,
  2203.                                 j: 0,
  2204.                                 g: 0,
  2205.                                 depth: 0,
  2206.                                 items: null,
  2207.                                 c: null,
  2208.                                 H: function(a) {
  2209.                                     for (var b = 0; b < this.items.length; ++b) {
  2210.                                         var c = this.items[b];
  2211.                                         if (c.x >= a.x && c.y >= a.y && c.x < a.x + a.j && c.y < a.y + a.g) return !0
  2212.                                     }
  2213.                                     if (0 !=
  2214.                                         this.c.length) {
  2215.                                         var d = this;
  2216.                                         return this.$(a, function(b) {
  2217.                                             return d.c[b].H(a)
  2218.                                         })
  2219.                                     }
  2220.                                     return !1
  2221.                                 },
  2222.                                 A: function(a, b) {
  2223.                                     for (var c = 0; c < this.items.length; ++c) b(this.items[c]);
  2224.                                     if (0 != this.c.length) {
  2225.                                         var d = this;
  2226.                                         this.$(a, function(c) {
  2227.                                             d.c[c].A(a, b)
  2228.                                         })
  2229.                                     }
  2230.                                 },
  2231.                                 m: function(a) {
  2232.                                     0 != this.c.length ? this.c[this.Z(a)].m(a) : this.items.length >= c && this.depth < d ? (this.ha(), this.c[this.Z(a)].m(a)) : this.items.push(a)
  2233.                                 },
  2234.                                 Z: function(a) {
  2235.                                     return a.x < this.x + this.j / 2 ? a.y < this.y + this.g / 2 ? 0 : 2 : a.y < this.y + this.g / 2 ? 1 : 3
  2236.                                 },
  2237.                                 $: function(a, b) {
  2238.                                     return a.x < this.x + this.j / 2 &&
  2239.                                         (a.y < this.y + this.g / 2 && b(0) || a.y >= this.y + this.g / 2 && b(2)) || a.x >= this.x + this.j / 2 && (a.y < this.y + this.g / 2 && b(1) || a.y >= this.y + this.g / 2 && b(3)) ? !0 : !1
  2240.                                 },
  2241.                                 ha: function() {
  2242.                                     var a = this.depth + 1,
  2243.                                         c = this.j / 2,
  2244.                                         d = this.g / 2;
  2245.                                     this.c.push(new b(this.x, this.y, c, d, a));
  2246.                                     this.c.push(new b(this.x + c, this.y, c, d, a));
  2247.                                     this.c.push(new b(this.x, this.y + d, c, d, a));
  2248.                                     this.c.push(new b(this.x + c, this.y + d, c, d, a));
  2249.                                     a = this.items;
  2250.                                     this.items = [];
  2251.                                     for (c = 0; c < a.length; c++) this.m(a[c])
  2252.                                 },
  2253.                                 clear: function() {
  2254.                                     for (var a = 0; a < this.c.length; a++) this.c[a].clear();
  2255.                                     this.items.length =
  2256.                                         0;
  2257.                                     this.c.length = 0
  2258.                                 }
  2259.                             };
  2260.                             var e = {
  2261.                                 x: 0,
  2262.                                 y: 0,
  2263.                                 j: 0,
  2264.                                 g: 0
  2265.                             };
  2266.                             return {
  2267.                                 root: new b(a.ca, a.da, a.oa - a.ca, a.pa - a.da, 0),
  2268.                                 m: function(a) {
  2269.                                     this.root.m(a)
  2270.                                 },
  2271.                                 A: function(a, b) {
  2272.                                     this.root.A(a, b)
  2273.                                 },
  2274.                                 ra: function(a, b, c, d, f) {
  2275.                                     e.x = a;
  2276.                                     e.y = b;
  2277.                                     e.j = c;
  2278.                                     e.g = d;
  2279.                                     this.root.A(e, f)
  2280.                                 },
  2281.                                 H: function(a) {
  2282.                                     return this.root.H(a)
  2283.                                 },
  2284.                                 clear: function() {
  2285.                                     this.root.clear()
  2286.                                 }
  2287.                             }
  2288.                         }
  2289.                     },
  2290.                     db = function() {
  2291.                         var a = new da(0, 0, 0, 32, "#ED1C24", ""),
  2292.                             b = document.createElement("canvas");
  2293.                         b.width = 32;
  2294.                         b.height = 32;
  2295.                         var c = b.getContext("2d");
  2296.                         return function() {
  2297.                             0 < k.length && (a.color = k[0].color, a.B(k[0].name));
  2298.                             c.clearRect(0,
  2299.                                 0, 32, 32);
  2300.                             c.save();
  2301.                             c.translate(16, 16);
  2302.                             c.scale(.4, .4);
  2303.                             a.w(c);
  2304.                             c.restore();
  2305.                             var d = document.getElementById("favicon"),
  2306.                                 e = d.cloneNode(!0);
  2307.                             //UPDATE -- NO IDEA WHAT I JUST DID THERE!
  2308.                             //e.setAttribute("href", b.toDataURL("image/png"));
  2309.                             d.parentNode.replaceChild(e, d)
  2310.                         }
  2311.                     }();
  2312.                 e(function() {
  2313.                     db()
  2314.                 });
  2315.                 e(function() {
  2316.                     +d.localStorage.wannaLogin && (d.localStorage.loginCache && jb(d.localStorage.loginCache), d.localStorage.fbPictureCache && e(".agario-profile-picture").attr("src", d.localStorage.fbPictureCache))
  2317.                 });
  2318.                 d.facebookLogin = function() {
  2319.                     d.localStorage.wannaLogin = 1
  2320.                 };
  2321.                 d.fbAsyncInit =
  2322.                     function() {
  2323.                         function a() {
  2324.                             d.localStorage.wannaLogin = 1;
  2325.                             null == d.FB ? alert("You seem to have something blocking Facebook on your browser, please check for any extensions") : d.FB.login(function(a) {
  2326.                                 La(a)
  2327.                             }, {
  2328.                                 scope: "public_profile, email"
  2329.                             })
  2330.                         }
  2331.                         d.FB.init({
  2332.                             appId: "677505792353827",
  2333.                             cookie: !0,
  2334.                             xfbml: !0,
  2335.                             status: !0,
  2336.                             version: "v2.2"
  2337.                         });
  2338.                         d.FB.Event.subscribe("auth.statusChange", function(b) {
  2339.                             +d.localStorage.wannaLogin && ("connected" == b.status ? La(b) : a())
  2340.                         });
  2341.                         d.facebookLogin = a
  2342.                     };
  2343.                 d.logout = function() {
  2344.                     B = null;
  2345.                     e("#helloContainer").attr("data-logged-in",
  2346.                         "0");
  2347.                     e("#helloContainer").attr("data-has-account-data", "0");
  2348.                     delete d.localStorage.wannaLogin;
  2349.                     delete d.localStorage.loginCache;
  2350.                     delete d.localStorage.fbPictureCache;
  2351.                     I()
  2352.                 };
  2353.                 var Fb = function() {
  2354.                     function a(a, b, c, d, e) {
  2355.                         var f = b.getContext("2d"),
  2356.                             h = b.width;
  2357.                         b = b.height;
  2358.                         a.color = e;
  2359.                         a.B(c);
  2360.                         a.size = d;
  2361.                         f.save();
  2362.                         f.translate(h / 2, b / 2);
  2363.                         a.w(f);
  2364.                         f.restore()
  2365.                     }
  2366.                     var b = new da(0, 0, 0, 32, "#5bc0de", "");
  2367.                     b.id = -1;
  2368.                     var c = new da(0, 0, 0, 32, "#5bc0de", "");
  2369.                     c.id = -1;
  2370.                     var d = document.createElement("canvas");
  2371.                     d.getContext("2d");
  2372.                     d.width = d.height = 70;
  2373.                     a(c, d,
  2374.                         "", 26, "#ebc0de");
  2375.                     return function() {
  2376.                         e(".cell-spinner").filter(":visible").each(function() {
  2377.                             var c = e(this),
  2378.                                 f = Date.now(),
  2379.                                 g = this.width,
  2380.                                 h = this.height,
  2381.                                 k = this.getContext("2d");
  2382.                             k.clearRect(0, 0, g, h);
  2383.                             k.save();
  2384.                             k.translate(g / 2, h / 2);
  2385.                             for (var m = 0; 10 > m; ++m) k.drawImage(d, (.1 * f + 80 * m) % (g + 140) - g / 2 - 70 - 35, h / 2 * Math.sin((.001 * f + m) % Math.PI * 2) - 35, 70, 70);
  2386.                             k.restore();
  2387.                             (c = c.attr("data-itr")) && (c = Z(c));
  2388.                             a(b, this, c || "", +e(this).attr("data-size"), "#5bc0de")
  2389.                         })
  2390.                     }
  2391.                 }();
  2392.                 d.createParty = function() {
  2393.                     Y(":party");
  2394.                     L = function(a) {
  2395.                         Ma("/#" + d.encodeURIComponent(a));
  2396.                         e(".partyToken").val("agar.io/#" + d.encodeURIComponent(a));
  2397.                         e("#helloContainer").attr("data-party-state", "1")
  2398.                     };
  2399.                     I()
  2400.                 };
  2401.                 d.joinParty = Wa;
  2402.                 d.cancelParty = function() {
  2403.                     Ma("/");
  2404.                     e("#helloContainer").attr("data-party-state", "0");
  2405.                     Y("");
  2406.                     I()
  2407.                 };
  2408.                 e(function() {
  2409.                     e(pb)
  2410.                 })
  2411.             }
  2412.         }
  2413.     }
  2414. })(window, window.jQuery);
  2415.  
  2416. (function(i, s, o, g, r, a, m) {
  2417.     i['GoogleAnalyticsObject'] = r;
  2418.     i[r] = i[r] || function() {
  2419.         (i[r].q = i[r].q || []).push(arguments)
  2420.     }, i[r].l = 1 * new Date();
  2421.     a = s.createElement(o),
  2422.         m = s.getElementsByTagName(o)[0];
  2423.     a.async = 1;
  2424.     a.src = g;
  2425.     m.parentNode.insertBefore(a, m)
  2426. })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'apos');
  2427.  
  2428. apos('create', 'UA-64394184-1', 'auto');
  2429. apos('send', 'pageview');
  2430.  
  2431. window.ignoreStream = false;
  2432. window.refreshTwitch = function() {
  2433.     $.ajax({
  2434.         url: "https://api.twitch.tv/kraken/streams/apostolique",
  2435.         cache: false,
  2436.         dataType: "jsonp"
  2437.     }).done(function(data) {
  2438.         if (data["stream"] == null) {
  2439.             //console.log("Apostolique is not online!");
  2440.             window.setMessage([]);
  2441.             window.onmouseup = function() {};
  2442.             window.ignoreStream = false;
  2443.         } else {
  2444.             //console.log("Apostolique is online!");
  2445.             if (!window.ignoreStream) {
  2446.                 window.setMessage(["twitch.tv/apostolique is online right now!", "Click the screen to open the stream!", "Press E to ignore."]);
  2447.                 window.onmouseup = function() {
  2448.                     window.open("http://www.twitch.tv/apostolique");
  2449.                 };
  2450.             }
  2451.         }
  2452.     }).fail(function() {});
  2453. }
  2454. setInterval(window.refreshTwitch, 60000);
  2455. window.refreshTwitch();
  2456.