Found 54 repositories(showing 30)
nrwl
Nx Console is the user interface for Nx & Lerna.
Equilibris
A simple tool providing the same features as the NX console does for vs-code
iguissouma
No description available
etkachev
Plugin for Webstorm that strives to function the same as Nx Console for VsCode. UI for Nx
DorazeExplorer
// ==UserScript== // @name Launcher // @namespace AposLauncher // @include http://agar.io/ // @version 2.1 // @grant none // @author http://www.twitch.tv/apostolique // ==/UserScript== Number.prototype.mod = function(n) { return ((this%n)+n)%n; }; Array.prototype.peek = function() { return this[this.length-1]; } console.log("Running Bot Launcher!"); (function (h, f) { //UPDATE function keyAction(e) { if (84 == e.keyCode) { console.log("Toggle"); toggle = !toggle; } if (82 == e.keyCode) { console.log("ToggleDraw"); toggleDraw = !toggleDraw; } if (68 == e.keyCode) { window.setDarkTheme(!getDarkBool()); } if (70 == e.keyCode) { window.setShowMass(!getMassBool()); } } function humanPlayer() { //Don't need to do anything. return [getPointX(), getPointY()]; } function Sa() { //UPDATE if (window.botList == null) { window.botList = []; window.jQuery('#locationUnknown').append(window.jQuery('<select id="bList" class="form-control" onchange="setBotIndex($(this).val());" />')); window.jQuery('#locationUnknown').addClass('form-group'); } window.botList.push(["Human", humanPlayer]); var bList = window.jQuery('#bList'); window.jQuery('<option />', {value: (window.botList.length - 1), text: "Human"}).appendTo(bList); la = !0; za(); setInterval(za, 180000); B = ma = document.getElementById('canvas'); e = B.getContext('2d'); B.onmousedown = function (a) { if (Aa) { var b = a.clientX - (5 + p / 5 / 2), c = a.clientY - (5 + p / 5 / 2); if (Math.sqrt(b * b + c * c) <= p / 5 / 2) { K(); C(17); return } } T = a.clientX; U = a.clientY; na(); K() }; B.onmousemove = function (a) { T = a.clientX; U = a.clientY; na() }; B.onmouseup = function () { }; /firefox/i.test(navigator.userAgent) ? document.addEventListener('DOMMouseScroll', Ba, !1) : document.body.onmousewheel = Ba; var a = !1, b = !1, c = !1; h.onkeydown = function (d) { 32 != d.keyCode || a || (K(), C(17), a = !0); 81 != d.keyCode || b || (C(18), b = !0); 87 != d.keyCode || c || (K(), C(21), c = !0); 27 == d.keyCode && Ca(!0); //UPDATE keyAction(d); }; h.onkeyup = function (d) { 32 == d.keyCode && (a = !1); 87 == d.keyCode && (c = !1); 81 == d.keyCode && b && (C(19), b = !1) }; h.onblur = function () { C(19); c = b = a = !1 }; h.onresize = Da; Da(); h.requestAnimationFrame ? h.requestAnimationFrame(Ea) : setInterval(oa, 1000 / 60); setInterval(K, 40); v && f('#region').val(v); Fa(); V(f('#region').val()); null == r && v && W(); f('#overlays').show() } function Ba(a) { D *= Math.pow(0.9, a.wheelDelta / - 120 || a.detail || 0); 1 > D && (D = 1); D > 4 / g && (D = 4 / g) } function Ta() { if (0.4 > g) L = null; else { for (var a = Number.POSITIVE_INFINITY, b = Number.POSITIVE_INFINITY, c = Number.NEGATIVE_INFINITY, d = Number.NEGATIVE_INFINITY, e = 0, l = 0; l < u.length; l++) { var k = u[l]; !k.I() || k.M || 20 >= k.size * g || (e = Math.max(k.size, e), a = Math.min(k.x, a), b = Math.min(k.y, b), c = Math.max(k.x, c), d = Math.max(k.y, d)) } L = Ua.ca({ X: a - (e + 100), Y: b - (e + 100), fa: c + (e + 100), ga: d + (e + 100), da: 2, ea: 4 }); for (l = 0; l < u.length; l++) if (k = u[l], k.I() && !(20 >= k.size * g)) for (a = 0; a < k.a.length; ++a) b = k.a[a].x, c = k.a[a].y, b < s - p / 2 / g || c < t - q / 2 / g || b > s + p / 2 / g || c > t + q / 2 / g || L.i(k.a[a]) } } function na() { //UPDATE if (toggle ||window.botList[botIndex][0] == "Human") { X = (T - p / 2) / g + s; Y = (U - q / 2) / g + t } } function za() { null == Z && (Z = { }, f('#region').children().each(function () { var a = f(this), b = a.val(); b && (Z[b] = a.text()) })); f.get($ + '//m.agar.io/info', function (a) { var b = { }, c; for (c in a.regions) { var d = c.split(':') [0]; b[d] = b[d] || 0; b[d] += a.regions[c].numPlayers } for (c in b) f('#region option[value="' + c + '"]').text(Z[c] + ' (' + b[c] + ' players)') }, 'json') } function Ga() { f('#adsBottom').hide(); f('#overlays').hide(); Fa() } function V(a) { a && a != v && (f('#region').val() != a && f('#region').val(a), v = h.localStorage.location = a, f('.region-message').hide(), f('.region-message.' + a).show(), f('.btn-needs-server').prop('disabled', !1), la && W()) } function Ca(a) { E = null; f('#overlays').fadeIn(a ? 200 : 3000); a || f('#adsBottom').fadeIn(3000) } function Fa() { f('#region').val() ? h.localStorage.location = f('#region').val() : h.localStorage.location && f('#region').val(h.localStorage.location); f('#region').val() ? f('#locationKnown').append(f('#region')) : f('#locationUnknown').append(f('#region')) } function pa() { console.log('Find ' + v + M); f.ajax($ + '//m.agar.io/', { error: function () { setTimeout(pa, 1000) }, success: function (a) { a = a.split('\n'); '45.79.222.79:443' == a[0] ? pa() : Ha('ws://' + a[0]) }, dataType: 'text', method: 'POST', cache: !1, crossDomain: !0, data: v + M || '?' }) } function W() { la && v && (f('#connecting').show(), pa()) } function Ha(a) { if (r) { r.onopen = null; r.onmessage = null; r.onclose = null; try { r.close() } catch (b) { } r = null } var c = h.location.search.slice(1); /^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]+$/.test(c) && (a = 'ws://' + c); Va && (a = a.split(':'), a = a[0] + 's://ip-' + a[1].replace(/\./g, '-').replace(/\//g, '') + '.tech.agar.io:' + ( + a[2] + 2000)); F = [ ]; m = [ ]; z = { }; u = [ ]; H = [ ]; A = [ ]; w = x = null; I = 0; console.log('Connecting to ' + a); //UPDATE serverIP = a; r = new WebSocket(a); r.binaryType = 'arraybuffer'; r.onopen = Wa; r.onmessage = Xa; r.onclose = Ya; r.onerror = function () { console.log('socket error') } } function N(a) { return new DataView(new ArrayBuffer(a)) } function O(a) { r.send(a.buffer) } function Wa() { var a; aa = 500; f('#connecting').hide(); console.log('socket open'); a = N(5); a.setUint8(0, 254); a.setUint32(1, 4, !0); O(a); a = N(5); a.setUint8(0, 255); a.setUint32(1, 673720361, !0); O(a); Ia() } function Ya() { console.log('socket close'); setTimeout(W, aa); aa *= 1.5 } function Xa(a) { Za(new DataView(a.data)) } function Za(a) { function b() { for (var b = ''; ; ) { var d = a.getUint16(c, !0); c += 2; if (0 == d) break; b += String.fromCharCode(d) } return b } var c = 0; 240 == a.getUint8(c) && (c += 5); switch (a.getUint8(c++)) { case 16: $a(a, c); break; case 17: P = a.getFloat32(c, !0); c += 4; Q = a.getFloat32(c, !0); c += 4; R = a.getFloat32(c, !0); c += 4; break; case 20: m = [ ]; F = [ ]; break; case 21: qa = a.getInt16(c, !0); c += 2; ra = a.getInt16(c, !0); c += 2; sa || (sa = !0, ba = qa, ca = ra); break; case 32: F.push(a.getUint32(c, !0)); c += 4; break; case 49: if (null != x) break; var d = a.getUint32(c, !0), c = c + 4; A = [ ]; for (var e = 0; e < d; ++e) { var l = a.getUint32(c, !0), c = c + 4; A.push({ id: l, name: b() }) } Ja(); break; case 50: x = [ ]; d = a.getUint32(c, !0); c += 4; for (e = 0; e < d; ++e) x.push(a.getFloat32(c, !0)), c += 4; Ja(); break; case 64: da = a.getFloat64(c, !0), c += 8, ea = a.getFloat64(c, !0), c += 8, fa = a.getFloat64(c, !0), c += 8, ga = a.getFloat64(c, !0), c += 8, P = (fa + da) / 2, Q = (ga + ea) / 2, R = 1, 0 == m.length && (s = P, t = Q, g = R) } } function $a(a, b) { G = + new Date; var c = Math.random(); ta = !1; var d = a.getUint16(b, !0); b += 2; for (var e = 0; e < d; ++e) { var l = z[a.getUint32(b, !0)], k = z[a.getUint32(b + 4, !0)]; b += 8; l && k && (k.S(), k.p = k.x, k.q = k.y, k.o = k.size, k.D = l.x, k.F = l.y, k.n = k.size, k.L = G) } for (e = 0; ; ) { d = a.getUint32(b, !0); b += 4; if (0 == d) break; ++e; var h, l = a.getInt16(b, !0); b += 2; k = a.getInt16(b, !0); b += 2; h = a.getInt16(b, !0); b += 2; for (var g = a.getUint8(b++), f = a.getUint8(b++), p = a.getUint8(b++), g = (g << 16 | f << 8 | p).toString(16); 6 > g.length; ) g = '0' + g; var g = '#' + g, f = a.getUint8(b++), p = !!(f & 1), r = !!(f & 16); f & 2 && (b += 4); f & 4 && (b += 8); f & 8 && (b += 16); for (var q, n = ''; ; ) { q = a.getUint16(b, !0); b += 2; if (0 == q) break; n += String.fromCharCode(q) } q = n; n = null; z.hasOwnProperty(d) ? (n = z[d], n.K(), n.p = n.x, n.q = n.y, n.o = n.size, n.color = g) : (n = new Ka(d, l, k, h, g, q), n.ka = l, n.la = k); n.d = p; n.j = r; n.D = l; n.F = k; n.n = h; n.ja = c; n.L = G; n.W = f; q && n.Z(q); - 1 != F.indexOf(d) && - 1 == m.indexOf(n) && (document.getElementById('overlays').style.display = 'none', m.push(n), 1 == m.length && (s = n.x, t = n.y)) //UPDATE interNodes[d] = window.getCells()[d]; } //UPDATE Object.keys(interNodes).forEach(function (element, index) { //console.log("start: " + interNodes[element].updateTime + " current: " + D + " life: " + (D - interNodes[element].updateTime)); var isRemoved = !window.getCells().hasOwnProperty(element); if (isRemoved && (getLastUpdate() - interNodes[element].L) > 3000) { delete interNodes[element]; } else if (isRemoved && computeDistance(getOffsetX(), getOffsetY(), interNodes[element].x, interNodes[element].y) < screenDistance()) { //console.log("Too close! Remove " + computeDistance(getOffsetX(), getOffsetY(), interNodes[element].x, interNodes[element].y) + " || " + screenDistance()); delete interNodes[element]; } }); c = a.getUint32(b, !0); b += 4; for (e = 0; e < c; e++) d = a.getUint32(b, !0), b += 4, n = z[d], null != n && n.S(); //ta && 0 == m.length && Ca(!1) } //UPDATE function computeDistance(x1, y1, x2, y2) { var xdis = x1 - x2; // <--- FAKE AmS OF COURSE! var ydis = y1 - y2; var distance = Math.sqrt(xdis * xdis + ydis * ydis); return distance; } function screenDistance() { return Math.min(computeDistance (getOffsetX(), getOffsetY(), screenToGameX(getWidth()), getOffsetY()), computeDistance (getOffsetX(), getOffsetY(), getOffsetX(), screenToGameY(getHeight()))); } function screenToGameX(x) { return (x - getWidth() / 2) / getRatio() + getX(); } function screenToGameY(y) { return (y - getHeight() / 2) / getRatio() + getY();; } window.drawPoint = function(x_1, y_1, drawColor, text) { if (!toggleDraw) { dPoints.push([x_1, y_1, drawColor]); dText.push(text); } } window.drawArc = function(x_1, y_1, x_2, y_2, x_3, y_3, drawColor) { if (!toggleDraw) { var radius = computeDistance(x_1, y_1, x_3, y_3); dArc.push([x_1, y_1, x_2, y_2, x_3, y_3, radius, drawColor]); } } window.drawLine = function(x_1, y_1, x_2, y_2, drawColor) { if (!toggleDraw) { lines.push([x_1, y_1, x_2, y_2, drawColor]); } } window.drawCircle = function(x_1, y_1, radius, drawColor) { if (!toggleDraw) { circles.push([x_1, y_1, radius, drawColor]); } } function K() { //UPDATE if (getPlayer().length == 0) { setNick(originalName); } var a; if (ua()) { a = T - p / 2; var b = U - q / 2; 64 > a * a + b * b || 0.01 > Math.abs(La - X) && 0.01 > Math.abs(Ma - Y) || (La = X, Ma = Y, a = N(21), a.setUint8(0, 16), a.setFloat64(1, X, !0), a.setFloat64(9, Y, !0), a.setUint32(17, 0, !0), O(a)) } } function Ia() { if (ua() && null != E) { var a = N(1 + 2 * E.length); a.setUint8(0, 0); for (var b = 0; b < E.length; ++b) a.setUint16(1 + 2 * b, E.charCodeAt(b), !0); O(a) } } function ua() { return null != r && r.readyState == r.OPEN } function C(a) { if (ua()) { var b = N(1); b.setUint8(0, a); O(b) } } function Ea() { oa(); h.requestAnimationFrame(Ea) } function Da() { p = h.innerWidth; q = h.innerHeight; ma.width = B.width = p; ma.height = B.height = q; oa() } function Na() { var a; a = 1 * Math.max(q / 1080, p / 1920); return a *= D } function ab() { if (0 != m.length) { for (var a = 0, b = 0; b < m.length; b++) a += m[b].size; a = Math.pow(Math.min(64 / a, 1), 0.4) * Na(); g = (9 * g + a) / 10 } } function oa() { //UPDATE dPoints = []; circles = []; dArc = []; dText = []; lines = []; var a, b = Date.now(); ++bb; G = b; if (0 < m.length) { ab(); for (var c = a = 0, d = 0; d < m.length; d++) m[d].K(), a += m[d].x / m.length, c += m[d].y / m.length; P = a; Q = c; R = g; s = (s + a) / 2; t = (t + c) / 2 } else s = (29 * s + P) / 30, t = (29 * t + Q) / 30, g = (9 * g + R * Na()) / 10; Ta(); na(); va || e.clearRect(0, 0, p, q); va ? (e.fillStyle = ha ? '#111111' : '#F2FBFF', e.globalAlpha = 0.05, e.fillRect(0, 0, p, q), e.globalAlpha = 1) : cb(); u.sort(function (a, b) { return a.size == b.size ? a.id - b.id : a.size - b.size }); e.save(); e.translate(p / 2, q / 2); e.scale(g, g); e.translate( - s, - t); for (d = 0; d < H.length; d++) H[d].T(); for (d = 0; d < u.length; d++) u[d].T(); //UPDATE if (getPlayer().length > 0) { var moveLoc = window.botList[botIndex][1](); if (!toggle) { setPoint(moveLoc[0], moveLoc[1]); } } customRender(e); if (sa) { ba = (3 * ba + qa) / 4; ca = (3 * ca + ra) / 4; e.save(); e.strokeStyle = '#FFAAAA'; e.lineWidth = 10; e.lineCap = 'round'; e.lineJoin = 'round'; e.globalAlpha = 0.5; e.beginPath(); for (d = 0; d < m.length; d++) e.moveTo(m[d].x, m[d].y), e.lineTo(ba, ca); e.stroke(); e.restore() } e.restore(); w && w.width && e.drawImage(w, p - w.width - 10, 10); I = Math.max(I, db()); //UPDATE sessionScore = Math.max(I, sessionScore); 0 != I && (null == ia && (ia = new ja(24, '#FFFFFF', true,'#000000')), ia.u('Score: ' + ~~(I / 100) + ' || Best Score: ' + ~~(sessionScore / 100) + " || Best time alive: " + bestTime + " seconds"), c = ia.G(), a = c.width, e.globalAlpha = 0.2, e.fillStyle = '#000000', e.fillRect(10, q - 10 - 24 - 10, a + 10, 34), e.globalAlpha = 1, e.drawImage(c, 15, q - 10 - 24 - 5)); eb(); b = Date.now() - b; b > 1000 / 60 ? y -= 0.01 : b < 1000 / 65 && (y += 0.01); 0.4 > y && (y = 0.4); 1 < y && (y = 1) drawStats(e); } //UPDATE function customRender(d) { d.save(); for(var i = 0; i < lines.length; i++) { d.beginPath(); d.lineWidth = 5; if (lines[i][4] == 0) { d.strokeStyle = "#FF0000"; } else if (lines[i][4] == 1) { d.strokeStyle = "#00FF00"; } else if (lines[i][4] == 2) { d.strokeStyle = "#0000FF"; } else if (lines[i][4] == 3) { d.strokeStyle = "#FF8000"; } else if (lines[i][4] == 4) { d.strokeStyle = "#8A2BE2"; } else if (lines[i][4] == 5) { d.strokeStyle = "#FF69B4"; } else if (lines[i][4] == 6) { d.strokeStyle = "#008080"; } else if (lines[i][4] == 7) { d.strokeStyle = "#FFFFFF"; } else { d.strokeStyle = "#000000"; } d.moveTo(lines[i][0], lines[i][1]); d.lineTo(lines[i][2], lines[i][3]); d.stroke(); } d.restore(); d.save(); for(var i = 0; i < circles.length; i++) { if (circles[i][3] == 0) { d.strokeStyle = "#FF0000"; } else if (circles[i][3] == 1) { d.strokeStyle = "#00FF00"; } else if (circles[i][3] == 2) { d.strokeStyle = "#0000FF"; } else if (circles[i][3] == 3) { d.strokeStyle = "#FF8000"; } else if (circles[i][3] == 4) { d.strokeStyle = "#8A2BE2"; } else if (circles[i][3] == 5) { d.strokeStyle = "#FF69B4"; } else if (circles[i][3] == 6) { d.strokeStyle = "#008080"; } else if (circles[i][3] == 7) { d.strokeStyle = "#FFFFFF"; } else { d.strokeStyle = "#000000"; } d.beginPath(); d.lineWidth = 10; //d.setLineDash([5]); d.globalAlpha = 0.3; d.arc(circles[i][0], circles[i][1], circles[i][2], 0, 2 * Math.PI, false); d.stroke(); } d.restore(); d.save(); for(var i = 0; i < dArc.length; i++) { if (dArc[i][7] == 0) { d.strokeStyle = "#FF0000"; } else if (dArc[i][7] == 1) { d.strokeStyle = "#00FF00"; } else if (dArc[i][7] == 2) { d.strokeStyle = "#0000FF"; } else if (dArc[i][7] == 3) { d.strokeStyle = "#FF8000"; } else if (dArc[i][7] == 4) { d.strokeStyle = "#8A2BE2"; } else if (dArc[i][7] == 5) { d.strokeStyle = "#FF69B4"; } else if (dArc[i][7] == 6) { d.strokeStyle = "#008080"; } else if (dArc[i][7] == 7) { d.strokeStyle = "#FFFFFF"; } else { d.strokeStyle = "#000000"; } d.beginPath(); d.lineWidth = 5; var ang1 = Math.atan2(dArc[i][1] - dArc[i][5], dArc[i][0] - dArc[i][4]); var ang2 = Math.atan2(dArc[i][3] - dArc[i][5], dArc[i][2] - dArc[i][4]); d.arc(dArc[i][4], dArc[i][5], dArc[i][6], ang1, ang2, false); d.stroke(); } d.restore(); d.save(); for (var i = 0; i < dPoints.length; i++) { if (dText[i] == "") { var radius = 10; d.beginPath(); d.arc(dPoints[i][0], dPoints[i][1], radius, 0, 2 * Math.PI, false); if (dPoints[i][2] == 0) { d.fillStyle = "black"; } else if (dPoints[i][2] == 1) { d.fillStyle = "yellow"; } else if (dPoints[i][2] == 2) { d.fillStyle = "blue"; } else if (dPoints[i][2] == 3) { d.fillStyle = "red"; } else if (dPoints[i][2] == 4) { d.fillStyle = "#008080"; } else if (dPoints[i][2] == 5) { d.fillStyle = "#FF69B4"; } else { d.fillStyle = "#000000"; } d.fill(); d.lineWidth = 2; d.strokeStyle = '#003300'; d.stroke(); } else { var text = new ja(18, (getDarkBool() ? '#F2FBFF' : '#111111'), true, '#000000'); text.u(dText[i]); var textRender = text.G(); d.drawImage(textRender, dPoints[i][0], dPoints[i][1]); } } d.restore(); } function drawStats(d) { var currentDate = new Date(); var nbSeconds = 0; if (getPlayer().length > 0) { nbSeconds = (currentDate.getSeconds() + (currentDate.getMinutes() * 60) + (currentDate.getHours() * 60 * 60)) - (lifeTimer.getSeconds() + (lifeTimer.getMinutes() * 60) + (lifeTimer.getHours() * 60 * 60)); } bestTime = Math.max(nbSeconds, bestTime); var debugStrings = []; debugStrings.push("T - Bot: " + (!toggle ? "On" : "Off")); debugStrings.push("R - Lines: " + (!toggleDraw ? "On" : "Off")); debugStrings.push("Server: " + serverIP); debugStrings.push("Survived for: " + nbSeconds + " seconds"); if (getPlayer().length > 0) { debugStrings.push("Location: " + Math.floor(getPlayer()[0].x) + ", " + Math.floor(getPlayer()[0].y)); } var offsetValue = 20; var text = new ja(18, (getDarkBool() ? '#F2FBFF' : '#111111')); for (var i = 0; i < debugStrings.length; i++) { text.u(debugStrings[i]); var textRender = text.G(); d.drawImage(textRender, 20, offsetValue); offsetValue += textRender.height; } } function cb() { e.fillStyle = ha ? '#111111' : '#F2FBFF'; e.fillRect(0, 0, p, q); e.save(); e.strokeStyle = ha ? '#AAAAAA' : '#000000'; e.globalAlpha = 0.2; e.scale(g, g); for (var a = p / g, b = q / g, c = - 0.5 + ( - s + a / 2) % 50; c < a; c += 50) e.beginPath(), e.moveTo(c, 0), e.lineTo(c, b), e.stroke(); for (c = - 0.5 + ( - t + b / 2) % 50; c < b; c += 50) e.beginPath(), e.moveTo(0, c), e.lineTo(a, c), e.stroke(); e.restore() } function eb() { if (Aa && wa.width) { var a = p / 5; e.drawImage(wa, 5, 5, a, a) } } function db() { for (var a = 0, b = 0; b < m.length; b++) a += m[b].n * m[b].n; return a } function Ja() { w = null; if (null != x || 0 != A.length) if (null != x || ka) { w = document.createElement('canvas'); var a = w.getContext('2d'), b = 60, b = null == x ? b + 24 * A.length : b + 180, c = Math.min(200, 0.3 * p) / 200; w.width = 200 * c; w.height = b * c; a.scale(c, c); a.globalAlpha = 0.4; a.fillStyle = '#000000'; a.fillRect(0, 0, 200, b); a.globalAlpha = 1; a.fillStyle = '#FFFFFF'; c = null; c = 'Leaderboard'; a.font = '30px Ubuntu'; a.fillText(c, 100 - a.measureText(c).width / 2, 40); if (null == x) for (a.font = '20px Ubuntu', b = 0; b < A.length; ++b) c = A[b].name || 'An unnamed cell', ka || (c = 'An unnamed cell'), - 1 != F.indexOf(A[b].id) ? (m[0].name && (c = m[0].name), a.fillStyle = '#FFAAAA') : a.fillStyle = '#FFFFFF', c = b + 1 + '. ' + c, a.fillText(c, 100 - a.measureText(c).width / 2, 70 + 24 * b); else for (b = c = 0; b < x.length; ++b) { var d = c + x[b] * Math.PI * 2; a.fillStyle = fb[b + 1]; a.beginPath(); a.moveTo(100, 140); a.arc(100, 140, 80, c, d, !1); a.fill(); c = d } } } function Ka(a, b, c, d, e, l) { u.push(this); z[a] = this; this.id = a; this.p = this.x = b; this.q = this.y = c; this.o = this.size = d; this.color = e; this.a = [ ]; this.l = [ ]; this.R(); this.Z(l) } function ja(a, b, c, d) { a && (this.r = a); b && (this.N = b); this.P = !!c; d && (this.s = d) } var $ = h.location.protocol, Va = 'https:' == $, //UPDATE toggle = false, toggleDraw = false, tempPoint = [0, 0, 1], dPoints = [], circles = [], dArc = [], dText = [], lines = [], originalName = "NotReallyABot", sessionScore = 0, serverIP = "", interNodes = [], lifeTimer = new Date(), bestTime = 0, botIndex = 0, ma, e, B, p, q, L = null, r = null, s = 0, t = 0, F = [ ], m = [ ], z = { }, u = [ ], H = [ ], A = [ ], T = 0, U = 0, X = - 1, Y = - 1, bb = 0, G = 0, E = null, da = 0, ea = 0, fa = 10000, ga = 10000, g = 1, v = null, Oa = !0, ka = !0, xa = !1, ta = !1, I = 0, ha = !1, Pa = !1, P = s = ~~((da + fa) / 2), Q = t = ~~((ea + ga) / 2), R = 1, M = '', x = null, la = !1, sa = !1, qa = 0, ra = 0, ba = 0, ca = 0, Qa = 0, fb = [ '#333333', '#FF3333', '#33FF33', '#3333FF' ], va = !1, D = 1, Aa = 'ontouchstart' in h && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), wa = new Image; wa.src = 'img/split.png'; var Ra = document.createElement('canvas'); if ('undefined' == typeof console || 'undefined' == typeof DataView || 'undefined' == typeof WebSocket || null == Ra || null == Ra.getContext || null == h.localStorage) alert('You browser does not support this game, we recommend you to use Firefox to play this'); else { var Z = null; h.setNick = function (a) { //UPDATE originalName = a; if (getPlayer().length == 0) { lifeTimer = new Date(); } Ga(); E = a; Ia(); I = 0 }; h.setRegion = V; h.setSkins = function (a) { Oa = a }; h.setNames = function (a) { ka = a }; h.setDarkTheme = function (a) { ha = a }; h.setColors = function (a) { xa = a }; h.setShowMass = function (a) { Pa = a }; h.spectate = function () { E = null; C(1); Ga() }; h.setGameMode = function (a) { a != M && (M = a, W()) }; h.setAcid = function (a) { va = a }; null != h.localStorage && (null == h.localStorage.AB8 && (h.localStorage.AB8 = 0 + ~~(100 * Math.random())), Qa = + h.localStorage.AB8, h.ABGroup = Qa); f.get($ + '//gc.agar.io', function (a) { var b = a.split(' '); a = b[0]; b = b[1] || ''; - 1 == 'DE IL PL HU BR AT UA'.split(' ').indexOf(a) && ya.push('nazi'); - 1 == ['UA'].indexOf(a) && ya.push('ussr'); S.hasOwnProperty(a) && ('string' == typeof S[a] ? v || V(S[a]) : S[a].hasOwnProperty(b) && (v || V(S[a][b]))) }, 'text'); setTimeout(function () { }, 300000); var S = { AF: 'JP-Tokyo', AX: 'EU-London', AL: 'EU-London', DZ: 'EU-London', AS: 'SG-Singapore', AD: 'EU-London', AO: 'EU-London', AI: 'US-Atlanta', AG: 'US-Atlanta', AR: 'BR-Brazil', AM: 'JP-Tokyo', AW: 'US-Atlanta', AU: 'SG-Singapore', AT: 'EU-London', AZ: 'JP-Tokyo', BS: 'US-Atlanta', BH: 'JP-Tokyo', BD: 'JP-Tokyo', BB: 'US-Atlanta', BY: 'EU-London', BE: 'EU-London', BZ: 'US-Atlanta', BJ: 'EU-London', BM: 'US-Atlanta', BT: 'JP-Tokyo', BO: 'BR-Brazil', BQ: 'US-Atlanta', BA: 'EU-London', BW: 'EU-London', BR: 'BR-Brazil', IO: 'JP-Tokyo', VG: 'US-Atlanta', BN: 'JP-Tokyo', BG: 'EU-London', BF: 'EU-London', BI: 'EU-London', KH: 'JP-Tokyo', CM: 'EU-London', CA: 'US-Atlanta', CV: 'EU-London', KY: 'US-Atlanta', CF: 'EU-London', TD: 'EU-London', CL: 'BR-Brazil', CN: 'CN-China', CX: 'JP-Tokyo', CC: 'JP-Tokyo', CO: 'BR-Brazil', KM: 'EU-London', CD: 'EU-London', CG: 'EU-London', CK: 'SG-Singapore', CR: 'US-Atlanta', CI: 'EU-London', HR: 'EU-London', CU: 'US-Atlanta', CW: 'US-Atlanta', CY: 'JP-Tokyo', CZ: 'EU-London', DK: 'EU-London', DJ: 'EU-London', DM: 'US-Atlanta', DO: 'US-Atlanta', EC: 'BR-Brazil', EG: 'EU-London', SV: 'US-Atlanta', GQ: 'EU-London', ER: 'EU-London', EE: 'EU-London', ET: 'EU-London', FO: 'EU-London', FK: 'BR-Brazil', FJ: 'SG-Singapore', FI: 'EU-London', FR: 'EU-London', GF: 'BR-Brazil', PF: 'SG-Singapore', GA: 'EU-London', GM: 'EU-London', GE: 'JP-Tokyo', DE: 'EU-London', GH: 'EU-London', GI: 'EU-London', GR: 'EU-London', GL: 'US-Atlanta', GD: 'US-Atlanta', GP: 'US-Atlanta', GU: 'SG-Singapore', GT: 'US-Atlanta', GG: 'EU-London', GN: 'EU-London', GW: 'EU-London', GY: 'BR-Brazil', HT: 'US-Atlanta', VA: 'EU-London', HN: 'US-Atlanta', HK: 'JP-Tokyo', HU: 'EU-London', IS: 'EU-London', IN: 'JP-Tokyo', ID: 'JP-Tokyo', IR: 'JP-Tokyo', IQ: 'JP-Tokyo', IE: 'EU-London', IM: 'EU-London', IL: 'JP-Tokyo', IT: 'EU-London', JM: 'US-Atlanta', JP: 'JP-Tokyo', JE: 'EU-London', JO: 'JP-Tokyo', KZ: 'JP-Tokyo', KE: 'EU-London', KI: 'SG-Singapore', KP: 'JP-Tokyo', KR: 'JP-Tokyo', KW: 'JP-Tokyo', KG: 'JP-Tokyo', LA: 'JP-Tokyo', LV: 'EU-London', LB: 'JP-Tokyo', LS: 'EU-London', LR: 'EU-London', LY: 'EU-London', LI: 'EU-London', LT: 'EU-London', LU: 'EU-London', MO: 'JP-Tokyo', MK: 'EU-London', MG: 'EU-London', MW: 'EU-London', MY: 'JP-Tokyo', MV: 'JP-Tokyo', ML: 'EU-London', MT: 'EU-London', MH: 'SG-Singapore', MQ: 'US-Atlanta', MR: 'EU-London', MU: 'EU-London', YT: 'EU-London', MX: 'US-Atlanta', FM: 'SG-Singapore', MD: 'EU-London', MC: 'EU-London', MN: 'JP-Tokyo', ME: 'EU-London', MS: 'US-Atlanta', MA: 'EU-London', MZ: 'EU-London', MM: 'JP-Tokyo', NA: 'EU-London', NR: 'SG-Singapore', NP: 'JP-Tokyo', NL: 'EU-London', NC: 'SG-Singapore', NZ: 'SG-Singapore', NI: 'US-Atlanta', NE: 'EU-London', NG: 'EU-London', NU: 'SG-Singapore', NF: 'SG-Singapore', MP: 'SG-Singapore', NO: 'EU-London', OM: 'JP-Tokyo', PK: 'JP-Tokyo', PW: 'SG-Singapore', PS: 'JP-Tokyo', PA: 'US-Atlanta', PG: 'SG-Singapore', PY: 'BR-Brazil', PE: 'BR-Brazil', PH: 'JP-Tokyo', PN: 'SG-Singapore', PL: 'EU-London', PT: 'EU-London', PR: 'US-Atlanta', QA: 'JP-Tokyo', RE: 'EU-London', RO: 'EU-London', RU: 'RU-Russia', RW: 'EU-London', BL: 'US-Atlanta', SH: 'EU-London', KN: 'US-Atlanta', LC: 'US-Atlanta', MF: 'US-Atlanta', PM: 'US-Atlanta', VC: 'US-Atlanta', WS: 'SG-Singapore', SM: 'EU-London', ST: 'EU-London', SA: 'EU-London', SN: 'EU-London', RS: 'EU-London', SC: 'EU-London', SL: 'EU-London', SG: 'JP-Tokyo', SX: 'US-Atlanta', SK: 'EU-London', SI: 'EU-London', SB: 'SG-Singapore', SO: 'EU-London', ZA: 'EU-London', SS: 'EU-London', ES: 'EU-London', LK: 'JP-Tokyo', SD: 'EU-London', SR: 'BR-Brazil', SJ: 'EU-London', SZ: 'EU-London', SE: 'EU-London', CH: 'EU-London', SY: 'EU-London', TW: 'JP-Tokyo', TJ: 'JP-Tokyo', TZ: 'EU-London', TH: 'JP-Tokyo', TL: 'JP-Tokyo', TG: 'EU-London', TK: 'SG-Singapore', TO: 'SG-Singapore', TT: 'US-Atlanta', TN: 'EU-London', TR: 'TK-Turkey', TM: 'JP-Tokyo', TC: 'US-Atlanta', TV: 'SG-Singapore', UG: 'EU-London', UA: 'EU-London', AE: 'EU-London', GB: 'EU-London', US: { AL: 'US-Atlanta', AK: 'US-Fremont', AZ: 'US-Fremont', AR: 'US-Atlanta', CA: 'US-Fremont', CO: 'US-Fremont', CT: 'US-Atlanta', DE: 'US-Atlanta', FL: 'US-Atlanta', GA: 'US-Atlanta', HI: 'US-Fremont', ID: 'US-Fremont', IL: 'US-Atlanta', IN: 'US-Atlanta', IA: 'US-Atlanta', KS: 'US-Atlanta', KY: 'US-Atlanta', LA: 'US-Atlanta', ME: 'US-Atlanta', MD: 'US-Atlanta', MA: 'US-Atlanta', MI: 'US-Atlanta', MN: 'US-Fremont', MS: 'US-Atlanta', MO: 'US-Atlanta', MT: 'US-Fremont', NE: 'US-Fremont', NV: 'US-Fremont', NH: 'US-Atlanta', NJ: 'US-Atlanta', NM: 'US-Fremont', NY: 'US-Atlanta', NC: 'US-Atlanta', ND: 'US-Fremont', OH: 'US-Atlanta', OK: 'US-Atlanta', OR: 'US-Fremont', PA: 'US-Atlanta', RI: 'US-Atlanta', SC: 'US-Atlanta', SD: 'US-Fremont', TN: 'US-Atlanta', TX: 'US-Atlanta', UT: 'US-Fremont', VT: 'US-Atlanta', VA: 'US-Atlanta', WA: 'US-Fremont', WV: 'US-Atlanta', WI: 'US-Atlanta', WY: 'US-Fremont', DC: 'US-Atlanta', AS: 'US-Atlanta', GU: 'US-Atlanta', MP: 'US-Atlanta', PR: 'US-Atlanta', UM: 'US-Atlanta', VI: 'US-Atlanta' }, UM: 'SG-Singapore', VI: 'US-Atlanta', UY: 'BR-Brazil', UZ: 'JP-Tokyo', VU: 'SG-Singapore', VE: 'BR-Brazil', VN: 'JP-Tokyo', WF: 'SG-Singapore', EH: 'EU-London', YE: 'JP-Tokyo', ZM: 'EU-London', ZW: 'EU-London' }; h.connect = Ha; //UPDATE window.getDarkBool = function() { return ha; } window.getMassBool = function() { return Pa; } window.getMemoryCells = function() { return interNodes; } window.getCellsArray = function() { return u; } window.getCells = function() { return z; } window.getPlayer = function() { return m; } window.getWidth = function() { return p; } window.getHeight = function() { return q; } window.getRatio = function() { return g; } window.getOffsetX = function() { return P; } window.getOffsetY = function() { return Q; } window.getX = function() { return s; } window.getY = function() { return t; } window.getPointX = function() { return X; } window.getPointY = function() { return Y; } window.getMouseX = function() { return T; } window.getMouseY = function() { return U; } window.getScreenDistance = function() { var temp = screenDistance(); return temp; } window.getLastUpdate = function() { return G; } window.setPoint = function(x, y) { X = x; Y = y; } window.createFake = function(a, b, c, d, e, f) { var n = new Ka(a, b, c, d, e, f); return n; } window.setScore = function(a) { sessionScore = a * 100; } window.setBestTime = function(a) { bestTime = a; } window.best = function(a, b) { setScore(a); setBestTime(b); } window.setBotIndex = function(a) { console.log("Changing bot"); botIndex = a; } var aa = 500, La = - 1, Ma = - 1, w = null, y = 1, ia = null, J = { }, ya = 'poland;usa;china;russia;canada;australia;spain;brazil;germany;ukraine;france;sweden;hitler;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(';'), gb = [ '8', 'nasa' ], hb = [ 'm\'blob' ]; Ka.prototype = { id: 0, a: null, //points l: null, //pointsAcc name: null, //name k: null, //nameCache J: null, //sizeCache x: 0, y: 0, size: 0, p: 0, //ox q: 0, //oy o: 0, //oSize D: 0, //nx F: 0, //ny n: 0, //nSize W: 0, //drawTime L: 0, //updateTime ja: 0, ba: 0, A: !1, d: !1, j: !1, M: !0, //UPDATE updateCode: 0, danger: false, dangerTimeOut: 0, S: function () { var a; for (a = 0; a < u.length; a++) if (u[a] == this) { u.splice(a, 1); break } delete z[this.id]; a = m.indexOf(this); - 1 != a && (ta = !0, m.splice(a, 1)); a = F.indexOf(this.id); - 1 != a && F.splice(a, 1); this.A = !0; H.push(this) }, h: function () { return Math.max(~~(0.3 * this.size), 24) }, Z: function (a) { if (this.name = a) null == this.k ? this.k = new ja(this.h(), '#FFFFFF', !0, '#000000') : this.k.H(this.h()), this.k.u(this.name) }, R: function () { for (var a = this.C(); this.a.length > a; ) { var b = ~~(Math.random() * this.a.length); this.a.splice(b, 1); this.l.splice(b, 1) } 0 == this.a.length && 0 < a && (this.a.push({ Q: this, e: this.size, x: this.x, y: this.y }), this.l.push(Math.random() - 0.5)); for (; this.a.length < a; ) { var b = ~~(Math.random() * this.a.length), c = this.a[b]; this.a.splice(b, 0, { Q: this, e: c.e, x: c.x, y: c.y }); this.l.splice(b, 0, this.l[b]) } }, C: function () { var a = 10; 20 > this.size && (a = 0); this.d && (a = 30); var b = this.size; this.d || (b *= g); b *= y; this.W & 32 && (b *= 0.25); return ~~Math.max(b, a) }, ha: function () { this.R(); for (var a = this.a, b = this.l, c = a.length, d = 0; d < c; ++d) { var e = b[(d - 1 + c) % c], l = b[(d + 1) % c]; b[d] += (Math.random() - 0.5) * (this.j ? 3 : 1); b[d] *= 0.7; 10 < b[d] && (b[d] = 10); - 10 > b[d] && (b[d] = - 10); b[d] = (e + l + 8 * b[d]) / 10 } for (var k = this, h = this.d ? 0 : (this.id / 1000 + G / 10000) % (2 * Math.PI), d = 0; d < c; ++d) { var f = a[d].e, e = a[(d - 1 + c) % c].e, l = a[(d + 1) % c].e; if (15 < this.size && null != L && 20 < this.size * g) { var m = !1, p = a[d].x, q = a[d].y; L.ia(p - 5, q - 5, 10, 10, function (a) { a.Q != k && 25 > (p - a.x) * (p - a.x) + (q - a.y) * (q - a.y) && (m = !0) }); !m && (a[d].x < da || a[d].y < ea || a[d].x > fa || a[d].y > ga) && (m = !0); m && (0 < b[d] && (b[d] = 0), b[d] -= 1) } f += b[d]; 0 > f && (f = 0); f = this.j ? (19 * f + this.size) / 20 : (12 * f + this.size) / 13; a[d].e = (e + l + 8 * f) / 10; e = 2 * Math.PI / c; l = this.a[d].e; this.d && 0 == d % 2 && (l += 5); a[d].x = this.x + Math.cos(e * d + h) * l; a[d].y = this.y + Math.sin(e * d + h) * l } }, K: function () { var a; a = (G - this.L) / 120; a = 0 > a ? 0 : 1 < a ? 1 : a; var b = 0 > a ? 0 : 1 < a ? 1 : a; this.h(); if (this.A && 1 <= b) { var c = H.indexOf(this); - 1 != c && H.splice(c, 1) } this.x = a * (this.D - this.p) + this.p; this.y = a * (this.F - this.q) + this.q; this.size = b * (this.n - this.o) + this.o; return b }, I: function () { return this.x + this.size + 40 < s - p / 2 / g || this.y + this.size + 40 < t - q / 2 / g || this.x - this.size - 40 > s + p / 2 / g || this.y - this.size - 40 > t + q / 2 / g ? !1 : !0 }, T: function () { if (this.I()) { var a = !this.d && !this.j && 0.4 > g; 5 > this.C() && (a = !0); if (this.M && !a) for (var b = 0; b < this.a.length; b++) this.a[b].e = this.size; this.M = a; e.save(); this.ba = G; b = this.K(); this.A && (e.globalAlpha *= 1 - b); e.lineWidth = 10; e.lineCap = 'round'; e.lineJoin = this.d ? 'miter' : 'round'; xa ? (e.fillStyle = '#FFFFFF', e.strokeStyle = '#AAAAAA') : (e.fillStyle = this.color, e.strokeStyle = this.color); if (a) e.beginPath(), e.arc(this.x, this.y, this.size, 0, 2 * Math.PI, !1); else { this.ha(); e.beginPath(); var c = this.C(); e.moveTo(this.a[0].x, this.a[0].y); for (b = 1; b <= c; ++b) { var d = b % c; e.lineTo(this.a[d].x, this.a[d].y) } } e.closePath(); c = this.name.toLowerCase(); !this.j && Oa && ':teams' != M ? - 1 != ya.indexOf(c) ? (J.hasOwnProperty(c) || (J[c] = new Image, J[c].src = 'skins/' + c + '.png'), b = 0 != J[c].width && J[c].complete ? J[c] : null) : b = null : b = null; b = (d = b) ? - 1 != hb.indexOf(c) : !1; a || e.stroke(); e.fill(); null == d || b || (e.save(), e.clip(), e.drawImage(d, this.x - this.size, this.y - this.size, 2 * this.size, 2 * this.size), e.restore()); (xa || 15 < this.size) && !a && (e.strokeStyle = '#000000', e.globalAlpha *= 0.1, e.stroke()); e.globalAlpha = 1; null != d && b && e.drawImage(d, this.x - 2 * this.size, this.y - 2 * this.size, 4 * this.size, 4 * this.size); b = - 1 != m.indexOf(this); a = ~~this.y; if ((ka || b) && this.name && this.k && (null == d || - 1 == gb.indexOf(c))) { d = this.k; d.u(this.name); d.H(this.h()); c = Math.ceil(10 * g) / 10; d.$(c); var d = d.G(), f = ~~(d.width / c), l = ~~(d.height / c); e.drawImage(d, ~~this.x - ~~(f / 2), a - ~~(l / 2), f, l); a += d.height / 2 / c + 4 } Pa && (b || 0 == m.length && (!this.d || this.j) && 20 < this.size) && (null == this.J && (this.J = new ja(this.h() / 2, '#FFFFFF', !0, '#000000')), b = this.J, b.H(this.h() / 2), b.u(~~(this.size * this.size / 100)), c = Math.ceil(10 * g) / 10, b.$(c), d = b.G(), f = ~~(d.width / c), l = ~~(d.height / c), e.drawImage(d, ~~this.x - ~~(f / 2), a - ~~(l / 2), f, l)); e.restore() } } }; ja.prototype = { w: '', N: '#000000', P: !1, s: '#000000', r: 16, m: null, O: null, g: !1, v: 1, H: function (a) { this.r != a && (this.r = a, this.g = !0) }, $: function (a) { this.v != a && (this.v = a, this.g = !0) }, setStrokeColor: function (a) { this.s != a && (this.s = a, this.g = !0) }, u: function (a) { a != this.w && (this.w = a, this.g = !0) }, G: function () { null == this.m && (this.m = document.createElement('canvas'), this.O = this.m.getContext('2d')); if (this.g) { this.g = !1; var a = this.m, b = this.O, c = this.w, d = this.v, e = this.r, l = e + 'px Ubuntu'; b.font = l; var k = ~~(0.2 * e); a.width = (b.measureText(c).width + 6) * d; a.height = (e + k) * d; b.font = l; b.scale(d, d); b.globalAlpha = 1; b.lineWidth = 3; b.strokeStyle = this.s; b.fillStyle = this.N; this.P && b.strokeText(c, 3, e - k / 2); b.fillText(c, 3, e - k / 2) } return this.m } }; Date.now || (Date.now = function () { return (new Date).getTime() }); var Ua = { ca: function (a) { function b(a, b, c, d, e) { this.x = a; this.y = b; this.f = c; this.c = d; this.depth = e; this.items = [ ]; this.b = [ ] } var c = a.da || 2, d = a.ea || 4; b.prototype = { x: 0, y: 0, f: 0, c: 0, depth: 0, items: null, b: null, B: function (a) { for (var b = 0; b < this.items.length; ++b) { var c = this.items[b]; if (c.x >= a.x && c.y >= a.y && c.x < a.x + a.f && c.y < a.y + a.c) return !0 } if (0 != this.b.length) { var d = this; return this.V(a, function (b) { return d.b[b].B(a) }) } return !1 }, t: function (a, b) { for (var c = 0; c < this.items.length; ++c) b(this.items[c]); if (0 != this.b.length) { var d = this; this.V(a, function (c) { d.b[c].t(a, b) }) } }, i: function (a) { 0 != this.b.length ? this.b[this.U(a)].i(a) : this.items.length >= c && this.depth < d ? (this.aa(), this.b[this.U(a)].i(a)) : this.items.push(a) }, U: function (a) { return a.x < this.x + this.f / 2 ? a.y < this.y + this.c / 2 ? 0 : 2 : a.y < this.y + this.c / 2 ? 1 : 3 }, V: function (a, b) { return a.x < this.x + this.f / 2 && (a.y < this.y + this.c / 2 && b(0) || a.y >= this.y + this.c / 2 && b(2)) || a.x >= this.x + this.f / 2 && (a.y < this.y + this.c / 2 && b(1) || a.y >= this.y + this.c / 2 && b(3)) ? !0 : !1 }, aa: function () { var a = this.depth + 1, c = this.f / 2, d = this.c / 2; this.b.push(new b(this.x, this.y, c, d, a)); this.b.push(new b(this.x + c, this.y, c, d, a)); this.b.push(new b(this.x, this.y + d, c, d, a)); this.b.push(new b(this.x + c, this.y + d, c, d, a)); a = this.items; this.items = [ ]; for (c = 0; c < a.length; c++) this.i(a[c]) }, clear: function () { for (var a = 0; a < this.b.length; a++) this.b[a].clear(); this.items.length = 0; this.b.length = 0 } }; var e = { x: 0, y: 0, f: 0, c: 0 }; return { root: new b(a.X, a.Y, a.fa - a.X, a.ga - a.Y, 0), i: function (a) { this.root.i(a) }, t: function (a, b) { this.root.t(a, b) }, ia: function (a, b, c, d, f) { e.x = a; e.y = b; e.f = c; e.c = d; this.root.t(e, f) }, B: function (a) { return this.root.B(a) }, clear: function () { this.root.clear() } } } }; h.onload = Sa } }) (window, window.jQuery);
joao3024
// ==UserScript== // @name Launcher // @namespace AposLauncher // @include http://agar.io/ // @version 2.1 // @grant none // @author http://www.twitch.tv/apostolique // ==/UserScript== Number.prototype.mod = function(n) { return ((this%n)+n)%n; }; Array.prototype.peek = function() { return this[this.length-1]; } console.log("Running Bot Launcher!"); (function (h, f) { //UPDATE function keyAction(e) { if (84 == e.keyCode) { console.log("Toggle"); toggle = !toggle; } if (82 == e.keyCode) { console.log("ToggleDraw"); toggleDraw = !toggleDraw; } if (68 == e.keyCode) { window.setDarkTheme(!getDarkBool()); } if (70 == e.keyCode) { window.setShowMass(!getMassBool()); } } function humanPlayer() { //Don't need to do anything. return [getPointX(), getPointY()]; } function Sa() { //UPDATE if (window.botList == null) { window.botList = []; window.jQuery('#locationUnknown').append(window.jQuery('<select id="bList" class="form-control" onchange="setBotIndex($(this).val());" />')); window.jQuery('#locationUnknown').addClass('form-group'); } window.botList.push(["Human", humanPlayer]); var bList = window.jQuery('#bList'); window.jQuery('<option />', {value: (window.botList.length - 1), text: "Human"}).appendTo(bList); la = !0; za(); setInterval(za, 180000); B = ma = document.getElementById('canvas'); e = B.getContext('2d'); B.onmousedown = function (a) { if (Aa) { var b = a.clientX - (5 + p / 5 / 2), c = a.clientY - (5 + p / 5 / 2); if (Math.sqrt(b * b + c * c) <= p / 5 / 2) { K(); C(17); return } } T = a.clientX; U = a.clientY; na(); K() }; B.onmousemove = function (a) { T = a.clientX; U = a.clientY; na() }; B.onmouseup = function () { }; /firefox/i.test(navigator.userAgent) ? document.addEventListener('DOMMouseScroll', Ba, !1) : document.body.onmousewheel = Ba; var a = !1, b = !1, c = !1; h.onkeydown = function (d) { 32 != d.keyCode || a || (K(), C(17), a = !0); 81 != d.keyCode || b || (C(18), b = !0); 87 != d.keyCode || c || (K(), C(21), c = !0); 27 == d.keyCode && Ca(!0); //UPDATE keyAction(d); }; h.onkeyup = function (d) { 32 == d.keyCode && (a = !1); 87 == d.keyCode && (c = !1); 81 == d.keyCode && b && (C(19), b = !1) }; h.onblur = function () { C(19); c = b = a = !1 }; h.onresize = Da; Da(); h.requestAnimationFrame ? h.requestAnimationFrame(Ea) : setInterval(oa, 1000 / 60); setInterval(K, 40); v && f('#region').val(v); Fa(); V(f('#region').val()); null == r && v && W(); f('#overlays').show() } function Ba(a) { D *= Math.pow(0.9, a.wheelDelta / - 120 || a.detail || 0); 1 > D && (D = 1); D > 4 / g && (D = 4 / g) } function Ta() { if (0.4 > g) L = null; else { for (var a = Number.POSITIVE_INFINITY, b = Number.POSITIVE_INFINITY, c = Number.NEGATIVE_INFINITY, d = Number.NEGATIVE_INFINITY, e = 0, l = 0; l < u.length; l++) { var k = u[l]; !k.I() || k.M || 20 >= k.size * g || (e = Math.max(k.size, e), a = Math.min(k.x, a), b = Math.min(k.y, b), c = Math.max(k.x, c), d = Math.max(k.y, d)) } L = Ua.ca({ X: a - (e + 100), Y: b - (e + 100), fa: c + (e + 100), ga: d + (e + 100), da: 2, ea: 4 }); for (l = 0; l < u.length; l++) if (k = u[l], k.I() && !(20 >= k.size * g)) for (a = 0; a < k.a.length; ++a) b = k.a[a].x, c = k.a[a].y, b < s - p / 2 / g || c < t - q / 2 / g || b > s + p / 2 / g || c > t + q / 2 / g || L.i(k.a[a]) } } function na() { //UPDATE if (toggle ||window.botList[botIndex][0] == "Human") { X = (T - p / 2) / g + s; Y = (U - q / 2) / g + t } } function za() { null == Z && (Z = { }, f('#region').children().each(function () { var a = f(this), b = a.val(); b && (Z[b] = a.text()) })); f.get($ + '//m.agar.io/info', function (a) { var b = { }, c; for (c in a.regions) { var d = c.split(':') [0]; b[d] = b[d] || 0; b[d] += a.regions[c].numPlayers } for (c in b) f('#region option[value="' + c + '"]').text(Z[c] + ' (' + b[c] + ' players)') }, 'json') } function Ga() { f('#adsBottom').hide(); f('#overlays').hide(); Fa() } function V(a) { a && a != v && (f('#region').val() != a && f('#region').val(a), v = h.localStorage.location = a, f('.region-message').hide(), f('.region-message.' + a).show(), f('.btn-needs-server').prop('disabled', !1), la && W()) } function Ca(a) { E = null; f('#overlays').fadeIn(a ? 200 : 3000); a || f('#adsBottom').fadeIn(3000) } function Fa() { f('#region').val() ? h.localStorage.location = f('#region').val() : h.localStorage.location && f('#region').val(h.localStorage.location); f('#region').val() ? f('#locationKnown').append(f('#region')) : f('#locationUnknown').append(f('#region')) } function pa() { console.log('Find ' + v + M); f.ajax($ + '//m.agar.io/', { error: function () { setTimeout(pa, 1000) }, success: function (a) { a = a.split('\n'); '45.79.222.79:443' == a[0] ? pa() : Ha('ws://' + a[0]) }, dataType: 'text', method: 'POST', cache: !1, crossDomain: !0, data: v + M || '?' }) } function W() { la && v && (f('#connecting').show(), pa()) } function Ha(a) { if (r) { r.onopen = null; r.onmessage = null; r.onclose = null; try { r.close() } catch (b) { } r = null } var c = h.location.search.slice(1); /^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]+$/.test(c) && (a = 'ws://' + c); Va && (a = a.split(':'), a = a[0] + 's://ip-' + a[1].replace(/\./g, '-').replace(/\//g, '') + '.tech.agar.io:' + ( + a[2] + 2000)); F = [ ]; m = [ ]; z = { }; u = [ ]; H = [ ]; A = [ ]; w = x = null; I = 0; console.log('Connecting to ' + a); //UPDATE serverIP = a; r = new WebSocket(a); r.binaryType = 'arraybuffer'; r.onopen = Wa; r.onmessage = Xa; r.onclose = Ya; r.onerror = function () { console.log('socket error') } } function N(a) { return new DataView(new ArrayBuffer(a)) } function O(a) { r.send(a.buffer) } function Wa() { var a; aa = 500; f('#connecting').hide(); console.log('socket open'); a = N(5); a.setUint8(0, 254); a.setUint32(1, 4, !0); O(a); a = N(5); a.setUint8(0, 255); a.setUint32(1, 673720361, !0); O(a); Ia() } function Ya() { console.log('socket close'); setTimeout(W, aa); aa *= 1.5 } function Xa(a) { Za(new DataView(a.data)) } function Za(a) { function b() { for (var b = ''; ; ) { var d = a.getUint16(c, !0); c += 2; if (0 == d) break; b += String.fromCharCode(d) } return b } var c = 0; 240 == a.getUint8(c) && (c += 5); switch (a.getUint8(c++)) { case 16: $a(a, c); break; case 17: P = a.getFloat32(c, !0); c += 4; Q = a.getFloat32(c, !0); c += 4; R = a.getFloat32(c, !0); c += 4; break; case 20: m = [ ]; F = [ ]; break; case 21: qa = a.getInt16(c, !0); c += 2; ra = a.getInt16(c, !0); c += 2; sa || (sa = !0, ba = qa, ca = ra); break; case 32: F.push(a.getUint32(c, !0)); c += 4; break; case 49: if (null != x) break; var d = a.getUint32(c, !0), c = c + 4; A = [ ]; for (var e = 0; e < d; ++e) { var l = a.getUint32(c, !0), c = c + 4; A.push({ id: l, name: b() }) } Ja(); break; case 50: x = [ ]; d = a.getUint32(c, !0); c += 4; for (e = 0; e < d; ++e) x.push(a.getFloat32(c, !0)), c += 4; Ja(); break; case 64: da = a.getFloat64(c, !0), c += 8, ea = a.getFloat64(c, !0), c += 8, fa = a.getFloat64(c, !0), c += 8, ga = a.getFloat64(c, !0), c += 8, P = (fa + da) / 2, Q = (ga + ea) / 2, R = 1, 0 == m.length && (s = P, t = Q, g = R) } } function $a(a, b) { G = + new Date; var c = Math.random(); ta = !1; var d = a.getUint16(b, !0); b += 2; for (var e = 0; e < d; ++e) { var l = z[a.getUint32(b, !0)], k = z[a.getUint32(b + 4, !0)]; b += 8; l && k && (k.S(), k.p = k.x, k.q = k.y, k.o = k.size, k.D = l.x, k.F = l.y, k.n = k.size, k.L = G) } for (e = 0; ; ) { d = a.getUint32(b, !0); b += 4; if (0 == d) break; ++e; var h, l = a.getInt16(b, !0); b += 2; k = a.getInt16(b, !0); b += 2; h = a.getInt16(b, !0); b += 2; for (var g = a.getUint8(b++), f = a.getUint8(b++), p = a.getUint8(b++), g = (g << 16 | f << 8 | p).toString(16); 6 > g.length; ) g = '0' + g; var g = '#' + g, f = a.getUint8(b++), p = !!(f & 1), r = !!(f & 16); f & 2 && (b += 4); f & 4 && (b += 8); f & 8 && (b += 16); for (var q, n = ''; ; ) { q = a.getUint16(b, !0); b += 2; if (0 == q) break; n += String.fromCharCode(q) } q = n; n = null; z.hasOwnProperty(d) ? (n = z[d], n.K(), n.p = n.x, n.q = n.y, n.o = n.size, n.color = g) : (n = new Ka(d, l, k, h, g, q), n.ka = l, n.la = k); n.d = p; n.j = r; n.D = l; n.F = k; n.n = h; n.ja = c; n.L = G; n.W = f; q && n.Z(q); - 1 != F.indexOf(d) && - 1 == m.indexOf(n) && (document.getElementById('overlays').style.display = 'none', m.push(n), 1 == m.length && (s = n.x, t = n.y)) //UPDATE interNodes[d] = window.getCells()[d]; } //UPDATE Object.keys(interNodes).forEach(function (element, index) { //console.log("start: " + interNodes[element].updateTime + " current: " + D + " life: " + (D - interNodes[element].updateTime)); var isRemoved = !window.getCells().hasOwnProperty(element); if (isRemoved && (getLastUpdate() - interNodes[element].L) > 3000) { delete interNodes[element]; } else if (isRemoved && computeDistance(getOffsetX(), getOffsetY(), interNodes[element].x, interNodes[element].y) < screenDistance()) { //console.log("Too close! Remove " + computeDistance(getOffsetX(), getOffsetY(), interNodes[element].x, interNodes[element].y) + " || " + screenDistance()); delete interNodes[element]; } }); c = a.getUint32(b, !0); b += 4; for (e = 0; e < c; e++) d = a.getUint32(b, !0), b += 4, n = z[d], null != n && n.S(); //ta && 0 == m.length && Ca(!1) } //UPDATE function computeDistance(x1, y1, x2, y2) { var xdis = x1 - x2; // <--- FAKE AmS OF COURSE! var ydis = y1 - y2; var distance = Math.sqrt(xdis * xdis + ydis * ydis); return distance; } function screenDistance() { return Math.min(computeDistance (getOffsetX(), getOffsetY(), screenToGameX(getWidth()), getOffsetY()), computeDistance (getOffsetX(), getOffsetY(), getOffsetX(), screenToGameY(getHeight()))); } function screenToGameX(x) { return (x - getWidth() / 2) / getRatio() + getX(); } function screenToGameY(y) { return (y - getHeight() / 2) / getRatio() + getY();; } window.drawPoint = function(x_1, y_1, drawColor, text) { if (!toggleDraw) { dPoints.push([x_1, y_1, drawColor]); dText.push(text); } } window.drawArc = function(x_1, y_1, x_2, y_2, x_3, y_3, drawColor) { if (!toggleDraw) { var radius = computeDistance(x_1, y_1, x_3, y_3); dArc.push([x_1, y_1, x_2, y_2, x_3, y_3, radius, drawColor]); } } window.drawLine = function(x_1, y_1, x_2, y_2, drawColor) { if (!toggleDraw) { lines.push([x_1, y_1, x_2, y_2, drawColor]); } } window.drawCircle = function(x_1, y_1, radius, drawColor) { if (!toggleDraw) { circles.push([x_1, y_1, radius, drawColor]); } } function K() { //UPDATE if (getPlayer().length == 0) { setNick(originalName); } var a; if (ua()) { a = T - p / 2; var b = U - q / 2; 64 > a * a + b * b || 0.01 > Math.abs(La - X) && 0.01 > Math.abs(Ma - Y) || (La = X, Ma = Y, a = N(21), a.setUint8(0, 16), a.setFloat64(1, X, !0), a.setFloat64(9, Y, !0), a.setUint32(17, 0, !0), O(a)) } } function Ia() { if (ua() && null != E) { var a = N(1 + 2 * E.length); a.setUint8(0, 0); for (var b = 0; b < E.length; ++b) a.setUint16(1 + 2 * b, E.charCodeAt(b), !0); O(a) } } function ua() { return null != r && r.readyState == r.OPEN } function C(a) { if (ua()) { var b = N(1); b.setUint8(0, a); O(b) } } function Ea() { oa(); h.requestAnimationFrame(Ea) } function Da() { p = h.innerWidth; q = h.innerHeight; ma.width = B.width = p; ma.height = B.height = q; oa() } function Na() { var a; a = 1 * Math.max(q / 1080, p / 1920); return a *= D } function ab() { if (0 != m.length) { for (var a = 0, b = 0; b < m.length; b++) a += m[b].size; a = Math.pow(Math.min(64 / a, 1), 0.4) * Na(); g = (9 * g + a) / 10 } } function oa() { //UPDATE dPoints = []; circles = []; dArc = []; dText = []; lines = []; var a, b = Date.now(); ++bb; G = b; if (0 < m.length) { ab(); for (var c = a = 0, d = 0; d < m.length; d++) m[d].K(), a += m[d].x / m.length, c += m[d].y / m.length; P = a; Q = c; R = g; s = (s + a) / 2; t = (t + c) / 2 } else s = (29 * s + P) / 30, t = (29 * t + Q) / 30, g = (9 * g + R * Na()) / 10; Ta(); na(); va || e.clearRect(0, 0, p, q); va ? (e.fillStyle = ha ? '#111111' : '#F2FBFF', e.globalAlpha = 0.05, e.fillRect(0, 0, p, q), e.globalAlpha = 1) : cb(); u.sort(function (a, b) { return a.size == b.size ? a.id - b.id : a.size - b.size }); e.save(); e.translate(p / 2, q / 2); e.scale(g, g); e.translate( - s, - t); for (d = 0; d < H.length; d++) H[d].T(); for (d = 0; d < u.length; d++) u[d].T(); //UPDATE if (getPlayer().length > 0) { var moveLoc = window.botList[botIndex][1](); if (!toggle) { setPoint(moveLoc[0], moveLoc[1]); } } customRender(e); if (sa) { ba = (3 * ba + qa) / 4; ca = (3 * ca + ra) / 4; e.save(); e.strokeStyle = '#FFAAAA'; e.lineWidth = 10; e.lineCap = 'round'; e.lineJoin = 'round'; e.globalAlpha = 0.5; e.beginPath(); for (d = 0; d < m.length; d++) e.moveTo(m[d].x, m[d].y), e.lineTo(ba, ca); e.stroke(); e.restore() } e.restore(); w && w.width && e.drawImage(w, p - w.width - 10, 10); I = Math.max(I, db()); //UPDATE sessionScore = Math.max(I, sessionScore); 0 != I && (null == ia && (ia = new ja(24, '#FFFFFF', true,'#000000')), ia.u('Score: ' + ~~(I / 100) + ' || Best Score: ' + ~~(sessionScore / 100) + " || Best time alive: " + bestTime + " seconds"), c = ia.G(), a = c.width, e.globalAlpha = 0.2, e.fillStyle = '#000000', e.fillRect(10, q - 10 - 24 - 10, a + 10, 34), e.globalAlpha = 1, e.drawImage(c, 15, q - 10 - 24 - 5)); eb(); b = Date.now() - b; b > 1000 / 60 ? y -= 0.01 : b < 1000 / 65 && (y += 0.01); 0.4 > y && (y = 0.4); 1 < y && (y = 1) drawStats(e); } //UPDATE function customRender(d) { d.save(); for(var i = 0; i < lines.length; i++) { d.beginPath(); d.lineWidth = 5; if (lines[i][4] == 0) { d.strokeStyle = "#FF0000"; } else if (lines[i][4] == 1) { d.strokeStyle = "#00FF00"; } else if (lines[i][4] == 2) { d.strokeStyle = "#0000FF"; } else if (lines[i][4] == 3) { d.strokeStyle = "#FF8000"; } else if (lines[i][4] == 4) { d.strokeStyle = "#8A2BE2"; } else if (lines[i][4] == 5) { d.strokeStyle = "#FF69B4"; } else if (lines[i][4] == 6) { d.strokeStyle = "#008080"; } else if (lines[i][4] == 7) { d.strokeStyle = "#FFFFFF"; } else { d.strokeStyle = "#000000"; } d.moveTo(lines[i][0], lines[i][1]); d.lineTo(lines[i][2], lines[i][3]); d.stroke(); } d.restore(); d.save(); for(var i = 0; i < circles.length; i++) { if (circles[i][3] == 0) { d.strokeStyle = "#FF0000"; } else if (circles[i][3] == 1) { d.strokeStyle = "#00FF00"; } else if (circles[i][3] == 2) { d.strokeStyle = "#0000FF"; } else if (circles[i][3] == 3) { d.strokeStyle = "#FF8000"; } else if (circles[i][3] == 4) { d.strokeStyle = "#8A2BE2"; } else if (circles[i][3] == 5) { d.strokeStyle = "#FF69B4"; } else if (circles[i][3] == 6) { d.strokeStyle = "#008080"; } else if (circles[i][3] == 7) { d.strokeStyle = "#FFFFFF"; } else { d.strokeStyle = "#000000"; } d.beginPath(); d.lineWidth = 10; //d.setLineDash([5]); d.globalAlpha = 0.3; d.arc(circles[i][0], circles[i][1], circles[i][2], 0, 2 * Math.PI, false); d.stroke(); } d.restore(); d.save(); for(var i = 0; i < dArc.length; i++) { if (dArc[i][7] == 0) { d.strokeStyle = "#FF0000"; } else if (dArc[i][7] == 1) { d.strokeStyle = "#00FF00"; } else if (dArc[i][7] == 2) { d.strokeStyle = "#0000FF"; } else if (dArc[i][7] == 3) { d.strokeStyle = "#FF8000"; } else if (dArc[i][7] == 4) { d.strokeStyle = "#8A2BE2"; } else if (dArc[i][7] == 5) { d.strokeStyle = "#FF69B4"; } else if (dArc[i][7] == 6) { d.strokeStyle = "#008080"; } else if (dArc[i][7] == 7) { d.strokeStyle = "#FFFFFF"; } else { d.strokeStyle = "#000000"; } d.beginPath(); d.lineWidth = 5; var ang1 = Math.atan2(dArc[i][1] - dArc[i][5], dArc[i][0] - dArc[i][4]); var ang2 = Math.atan2(dArc[i][3] - dArc[i][5], dArc[i][2] - dArc[i][4]); d.arc(dArc[i][4], dArc[i][5], dArc[i][6], ang1, ang2, false); d.stroke(); } d.restore(); d.save(); for (var i = 0; i < dPoints.length; i++) { if (dText[i] == "") { var radius = 10; d.beginPath(); d.arc(dPoints[i][0], dPoints[i][1], radius, 0, 2 * Math.PI, false); if (dPoints[i][2] == 0) { d.fillStyle = "black"; } else if (dPoints[i][2] == 1) { d.fillStyle = "yellow"; } else if (dPoints[i][2] == 2) { d.fillStyle = "blue"; } else if (dPoints[i][2] == 3) { d.fillStyle = "red"; } else if (dPoints[i][2] == 4) { d.fillStyle = "#008080"; } else if (dPoints[i][2] == 5) { d.fillStyle = "#FF69B4"; } else { d.fillStyle = "#000000"; } d.fill(); d.lineWidth = 2; d.strokeStyle = '#003300'; d.stroke(); } else { var text = new ja(18, (getDarkBool() ? '#F2FBFF' : '#111111'), true, '#000000'); text.u(dText[i]); var textRender = text.G(); d.drawImage(textRender, dPoints[i][0], dPoints[i][1]); } } d.restore(); } function drawStats(d) { var currentDate = new Date(); var nbSeconds = 0; if (getPlayer().length > 0) { nbSeconds = (currentDate.getSeconds() + (currentDate.getMinutes() * 60) + (currentDate.getHours() * 60 * 60)) - (lifeTimer.getSeconds() + (lifeTimer.getMinutes() * 60) + (lifeTimer.getHours() * 60 * 60)); } bestTime = Math.max(nbSeconds, bestTime); var debugStrings = []; debugStrings.push("T - Bot: " + (!toggle ? "On" : "Off")); debugStrings.push("R - Lines: " + (!toggleDraw ? "On" : "Off")); debugStrings.push("Server: " + serverIP); debugStrings.push("Survived for: " + nbSeconds + " seconds"); if (getPlayer().length > 0) { debugStrings.push("Location: " + Math.floor(getPlayer()[0].x) + ", " + Math.floor(getPlayer()[0].y)); } var offsetValue = 20; var text = new ja(18, (getDarkBool() ? '#F2FBFF' : '#111111')); for (var i = 0; i < debugStrings.length; i++) { text.u(debugStrings[i]); var textRender = text.G(); d.drawImage(textRender, 20, offsetValue); offsetValue += textRender.height; } } function cb() { e.fillStyle = ha ? '#111111' : '#F2FBFF'; e.fillRect(0, 0, p, q); e.save(); e.strokeStyle = ha ? '#AAAAAA' : '#000000'; e.globalAlpha = 0.2; e.scale(g, g); for (var a = p / g, b = q / g, c = - 0.5 + ( - s + a / 2) % 50; c < a; c += 50) e.beginPath(), e.moveTo(c, 0), e.lineTo(c, b), e.stroke(); for (c = - 0.5 + ( - t + b / 2) % 50; c < b; c += 50) e.beginPath(), e.moveTo(0, c), e.lineTo(a, c), e.stroke(); e.restore() } function eb() { if (Aa && wa.width) { var a = p / 5; e.drawImage(wa, 5, 5, a, a) } } function db() { for (var a = 0, b = 0; b < m.length; b++) a += m[b].n * m[b].n; return a } function Ja() { w = null; if (null != x || 0 != A.length) if (null != x || ka) { w = document.createElement('canvas'); var a = w.getContext('2d'), b = 60, b = null == x ? b + 24 * A.length : b + 180, c = Math.min(200, 0.3 * p) / 200; w.width = 200 * c; w.height = b * c; a.scale(c, c); a.globalAlpha = 0.4; a.fillStyle = '#000000'; a.fillRect(0, 0, 200, b); a.globalAlpha = 1; a.fillStyle = '#FFFFFF'; c = null; c = 'Leaderboard'; a.font = '30px Ubuntu'; a.fillText(c, 100 - a.measureText(c).width / 2, 40); if (null == x) for (a.font = '20px Ubuntu', b = 0; b < A.length; ++b) c = A[b].name || 'An unnamed cell', ka || (c = 'An unnamed cell'), - 1 != F.indexOf(A[b].id) ? (m[0].name && (c = m[0].name), a.fillStyle = '#FFAAAA') : a.fillStyle = '#FFFFFF', c = b + 1 + '. ' + c, a.fillText(c, 100 - a.measureText(c).width / 2, 70 + 24 * b); else for (b = c = 0; b < x.length; ++b) { var d = c + x[b] * Math.PI * 2; a.fillStyle = fb[b + 1]; a.beginPath(); a.moveTo(100, 140); a.arc(100, 140, 80, c, d, !1); a.fill(); c = d } } } function Ka(a, b, c, d, e, l) { u.push(this); z[a] = this; this.id = a; this.p = this.x = b; this.q = this.y = c; this.o = this.size = d; this.color = e; this.a = [ ]; this.l = [ ]; this.R(); this.Z(l) } function ja(a, b, c, d) { a && (this.r = a); b && (this.N = b); this.P = !!c; d && (this.s = d) } var $ = h.location.protocol, Va = 'https:' == $, //UPDATE toggle = false, toggleDraw = false, tempPoint = [0, 0, 1], dPoints = [], circles = [], dArc = [], dText = [], lines = [], originalName = "NotReallyABot", sessionScore = 0, serverIP = "", interNodes = [], lifeTimer = new Date(), bestTime = 0, botIndex = 0, ma, e, B, p, q, L = null, r = null, s = 0, t = 0, F = [ ], m = [ ], z = { }, u = [ ], H = [ ], A = [ ], T = 0, U = 0, X = - 1, Y = - 1, bb = 0, G = 0, E = null, da = 0, ea = 0, fa = 10000, ga = 10000, g = 1, v = null, Oa = !0, ka = !0, xa = !1, ta = !1, I = 0, ha = !1, Pa = !1, P = s = ~~((da + fa) / 2), Q = t = ~~((ea + ga) / 2), R = 1, M = '', x = null, la = !1, sa = !1, qa = 0, ra = 0, ba = 0, ca = 0, Qa = 0, fb = [ '#333333', '#FF3333', '#33FF33', '#3333FF' ], va = !1, D = 1, Aa = 'ontouchstart' in h && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), wa = new Image; wa.src = 'img/split.png'; var Ra = document.createElement('canvas'); if ('undefined' == typeof console || 'undefined' == typeof DataView || 'undefined' == typeof WebSocket || null == Ra || null == Ra.getContext || null == h.localStorage) alert('You browser does not support this game, we recommend you to use Firefox to play this'); else { var Z = null; h.setNick = function (a) { //UPDATE originalName = a; if (getPlayer().length == 0) { lifeTimer = new Date(); } Ga(); E = a; Ia(); I = 0 }; h.setRegion = V; h.setSkins = function (a) { Oa = a }; h.setNames = function (a) { ka = a }; h.setDarkTheme = function (a) { ha = a }; h.setColors = function (a) { xa = a }; h.setShowMass = function (a) { Pa = a }; h.spectate = function () { E = null; C(1); Ga() }; h.setGameMode = function (a) { a != M && (M = a, W()) }; h.setAcid = function (a) { va = a }; null != h.localStorage && (null == h.localStorage.AB8 && (h.localStorage.AB8 = 0 + ~~(100 * Math.random())), Qa = + h.localStorage.AB8, h.ABGroup = Qa); f.get($ + '//gc.agar.io', function (a) { var b = a.split(' '); a = b[0]; b = b[1] || ''; - 1 == 'DE IL PL HU BR AT UA'.split(' ').indexOf(a) && ya.push('nazi'); - 1 == ['UA'].indexOf(a) && ya.push('ussr'); S.hasOwnProperty(a) && ('string' == typeof S[a] ? v || V(S[a]) : S[a].hasOwnProperty(b) && (v || V(S[a][b]))) }, 'text'); setTimeout(function () { }, 300000); var S = { AF: 'JP-Tokyo', AX: 'EU-London', AL: 'EU-London', DZ: 'EU-London', AS: 'SG-Singapore', AD: 'EU-London', AO: 'EU-London', AI: 'US-Atlanta', AG: 'US-Atlanta', AR: 'BR-Brazil', AM: 'JP-Tokyo', AW: 'US-Atlanta', AU: 'SG-Singapore', AT: 'EU-London', AZ: 'JP-Tokyo', BS: 'US-Atlanta', BH: 'JP-Tokyo', BD: 'JP-Tokyo', BB: 'US-Atlanta', BY: 'EU-London', BE: 'EU-London', BZ: 'US-Atlanta', BJ: 'EU-London', BM: 'US-Atlanta', BT: 'JP-Tokyo', BO: 'BR-Brazil', BQ: 'US-Atlanta', BA: 'EU-London', BW: 'EU-London', BR: 'BR-Brazil', IO: 'JP-Tokyo', VG: 'US-Atlanta', BN: 'JP-Tokyo', BG: 'EU-London', BF: 'EU-London', BI: 'EU-London', KH: 'JP-Tokyo', CM: 'EU-London', CA: 'US-Atlanta', CV: 'EU-London', KY: 'US-Atlanta', CF: 'EU-London', TD: 'EU-London', CL: 'BR-Brazil', CN: 'CN-China', CX: 'JP-Tokyo', CC: 'JP-Tokyo', CO: 'BR-Brazil', KM: 'EU-London', CD: 'EU-London', CG: 'EU-London', CK: 'SG-Singapore', CR: 'US-Atlanta', CI: 'EU-London', HR: 'EU-London', CU: 'US-Atlanta', CW: 'US-Atlanta', CY: 'JP-Tokyo', CZ: 'EU-London', DK: 'EU-London', DJ: 'EU-London', DM: 'US-Atlanta', DO: 'US-Atlanta', EC: 'BR-Brazil', EG: 'EU-London', SV: 'US-Atlanta', GQ: 'EU-London', ER: 'EU-London', EE: 'EU-London', ET: 'EU-London', FO: 'EU-London', FK: 'BR-Brazil', FJ: 'SG-Singapore', FI: 'EU-London', FR: 'EU-London', GF: 'BR-Brazil', PF: 'SG-Singapore', GA: 'EU-London', GM: 'EU-London', GE: 'JP-Tokyo', DE: 'EU-London', GH: 'EU-London', GI: 'EU-London', GR: 'EU-London', GL: 'US-Atlanta', GD: 'US-Atlanta', GP: 'US-Atlanta', GU: 'SG-Singapore', GT: 'US-Atlanta', GG: 'EU-London', GN: 'EU-London', GW: 'EU-London', GY: 'BR-Brazil', HT: 'US-Atlanta', VA: 'EU-London', HN: 'US-Atlanta', HK: 'JP-Tokyo', HU: 'EU-London', IS: 'EU-London', IN: 'JP-Tokyo', ID: 'JP-Tokyo', IR: 'JP-Tokyo', IQ: 'JP-Tokyo', IE: 'EU-London', IM: 'EU-London', IL: 'JP-Tokyo', IT: 'EU-London', JM: 'US-Atlanta', JP: 'JP-Tokyo', JE: 'EU-London', JO: 'JP-Tokyo', KZ: 'JP-Tokyo', KE: 'EU-London', KI: 'SG-Singapore', KP: 'JP-Tokyo', KR: 'JP-Tokyo', KW: 'JP-Tokyo', KG: 'JP-Tokyo', LA: 'JP-Tokyo', LV: 'EU-London', LB: 'JP-Tokyo', LS: 'EU-London', LR: 'EU-London', LY: 'EU-London', LI: 'EU-London', LT: 'EU-London', LU: 'EU-London', MO: 'JP-Tokyo', MK: 'EU-London', MG: 'EU-London', MW: 'EU-London', MY: 'JP-Tokyo', MV: 'JP-Tokyo', ML: 'EU-London', MT: 'EU-London', MH: 'SG-Singapore', MQ: 'US-Atlanta', MR: 'EU-London', MU: 'EU-London', YT: 'EU-London', MX: 'US-Atlanta', FM: 'SG-Singapore', MD: 'EU-London', MC: 'EU-London', MN: 'JP-Tokyo', ME: 'EU-London', MS: 'US-Atlanta', MA: 'EU-London', MZ: 'EU-London', MM: 'JP-Tokyo', NA: 'EU-London', NR: 'SG-Singapore', NP: 'JP-Tokyo', NL: 'EU-London', NC: 'SG-Singapore', NZ: 'SG-Singapore', NI: 'US-Atlanta', NE: 'EU-London', NG: 'EU-London', NU: 'SG-Singapore', NF: 'SG-Singapore', MP: 'SG-Singapore', NO: 'EU-London', OM: 'JP-Tokyo', PK: 'JP-Tokyo', PW: 'SG-Singapore', PS: 'JP-Tokyo', PA: 'US-Atlanta', PG: 'SG-Singapore', PY: 'BR-Brazil', PE: 'BR-Brazil', PH: 'JP-Tokyo', PN: 'SG-Singapore', PL: 'EU-London', PT: 'EU-London', PR: 'US-Atlanta', QA: 'JP-Tokyo', RE: 'EU-London', RO: 'EU-London', RU: 'RU-Russia', RW: 'EU-London', BL: 'US-Atlanta', SH: 'EU-London', KN: 'US-Atlanta', LC: 'US-Atlanta', MF: 'US-Atlanta', PM: 'US-Atlanta', VC: 'US-Atlanta', WS: 'SG-Singapore', SM: 'EU-London', ST: 'EU-London', SA: 'EU-London', SN: 'EU-London', RS: 'EU-London', SC: 'EU-London', SL: 'EU-London', SG: 'JP-Tokyo', SX: 'US-Atlanta', SK: 'EU-London', SI: 'EU-London', SB: 'SG-Singapore', SO: 'EU-London', ZA: 'EU-London', SS: 'EU-London', ES: 'EU-London', LK: 'JP-Tokyo', SD: 'EU-London', SR: 'BR-Brazil', SJ: 'EU-London', SZ: 'EU-London', SE: 'EU-London', CH: 'EU-London', SY: 'EU-London', TW: 'JP-Tokyo', TJ: 'JP-Tokyo', TZ: 'EU-London', TH: 'JP-Tokyo', TL: 'JP-Tokyo', TG: 'EU-London', TK: 'SG-Singapore', TO: 'SG-Singapore', TT: 'US-Atlanta', TN: 'EU-London', TR: 'TK-Turkey', TM: 'JP-Tokyo', TC: 'US-Atlanta', TV: 'SG-Singapore', UG: 'EU-London', UA: 'EU-London', AE: 'EU-London', GB: 'EU-London', US: { AL: 'US-Atlanta', AK: 'US-Fremont', AZ: 'US-Fremont', AR: 'US-Atlanta', CA: 'US-Fremont', CO: 'US-Fremont', CT: 'US-Atlanta', DE: 'US-Atlanta', FL: 'US-Atlanta', GA: 'US-Atlanta', HI: 'US-Fremont', ID: 'US-Fremont', IL: 'US-Atlanta', IN: 'US-Atlanta', IA: 'US-Atlanta', KS: 'US-Atlanta', KY: 'US-Atlanta', LA: 'US-Atlanta', ME: 'US-Atlanta', MD: 'US-Atlanta', MA: 'US-Atlanta', MI: 'US-Atlanta', MN: 'US-Fremont', MS: 'US-Atlanta', MO: 'US-Atlanta', MT: 'US-Fremont', NE: 'US-Fremont', NV: 'US-Fremont', NH: 'US-Atlanta', NJ: 'US-Atlanta', NM: 'US-Fremont', NY: 'US-Atlanta', NC: 'US-Atlanta', ND: 'US-Fremont', OH: 'US-Atlanta', OK: 'US-Atlanta', OR: 'US-Fremont', PA: 'US-Atlanta', RI: 'US-Atlanta', SC: 'US-Atlanta', SD: 'US-Fremont', TN: 'US-Atlanta', TX: 'US-Atlanta', UT: 'US-Fremont', VT: 'US-Atlanta', VA: 'US-Atlanta', WA: 'US-Fremont', WV: 'US-Atlanta', WI: 'US-Atlanta', WY: 'US-Fremont', DC: 'US-Atlanta', AS: 'US-Atlanta', GU: 'US-Atlanta', MP: 'US-Atlanta', PR: 'US-Atlanta', UM: 'US-Atlanta', VI: 'US-Atlanta' }, UM: 'SG-Singapore', VI: 'US-Atlanta', UY: 'BR-Brazil', UZ: 'JP-Tokyo', VU: 'SG-Singapore', VE: 'BR-Brazil', VN: 'JP-Tokyo', WF: 'SG-Singapore', EH: 'EU-London', YE: 'JP-Tokyo', ZM: 'EU-London', ZW: 'EU-London' }; h.connect = Ha; //UPDATE window.getDarkBool = function() { return ha; } window.getMassBool = function() { return Pa; } window.getMemoryCells = function() { return interNodes; } window.getCellsArray = function() { return u; } window.getCells = function() { return z; } window.getPlayer = function() { return m; } window.getWidth = function() { return p; } window.getHeight = function() { return q; } window.getRatio = function() { return g; } window.getOffsetX = function() { return P; } window.getOffsetY = function() { return Q; } window.getX = function() { return s; } window.getY = function() { return t; } window.getPointX = function() { return X; } window.getPointY = function() { return Y; } window.getMouseX = function() { return T; } window.getMouseY = function() { return U; } window.getScreenDistance = function() { var temp = screenDistance(); return temp; } window.getLastUpdate = function() { return G; } window.setPoint = function(x, y) { X = x; Y = y; } window.createFake = function(a, b, c, d, e, f) { var n = new Ka(a, b, c, d, e, f); return n; } window.setScore = function(a) { sessionScore = a * 100; } window.setBestTime = function(a) { bestTime = a; } window.best = function(a, b) { setScore(a); setBestTime(b); } window.setBotIndex = function(a) { console.log("Changing bot"); botIndex = a; } var aa = 500, La = - 1, Ma = - 1, w = null, y = 1, ia = null, J = { }, ya = 'poland;usa;china;russia;canada;australia;spain;brazil;germany;ukraine;france;sweden;hitler;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(';'), gb = [ '8', 'nasa' ], hb = [ 'm\'blob' ]; Ka.prototype = { id: 0, a: null, //points l: null, //pointsAcc name: null, //name k: null, //nameCache J: null, //sizeCache x: 0, y: 0, size: 0, p: 0, //ox q: 0, //oy o: 0, //oSize D: 0, //nx F: 0, //ny n: 0, //nSize W: 0, //drawTime L: 0, //updateTime ja: 0, ba: 0, A: !1, d: !1, j: !1, M: !0, //UPDATE updateCode: 0, danger: false, dangerTimeOut: 0, S: function () { var a; for (a = 0; a < u.length; a++) if (u[a] == this) { u.splice(a, 1); break } delete z[this.id]; a = m.indexOf(this); - 1 != a && (ta = !0, m.splice(a, 1)); a = F.indexOf(this.id); - 1 != a && F.splice(a, 1); this.A = !0; H.push(this) }, h: function () { return Math.max(~~(0.3 * this.size), 24) }, Z: function (a) { if (this.name = a) null == this.k ? this.k = new ja(this.h(), '#FFFFFF', !0, '#000000') : this.k.H(this.h()), this.k.u(this.name) }, R: function () { for (var a = this.C(); this.a.length > a; ) { var b = ~~(Math.random() * this.a.length); this.a.splice(b, 1); this.l.splice(b, 1) } 0 == this.a.length && 0 < a && (this.a.push({ Q: this, e: this.size, x: this.x, y: this.y }), this.l.push(Math.random() - 0.5)); for (; this.a.length < a; ) { var b = ~~(Math.random() * this.a.length), c = this.a[b]; this.a.splice(b, 0, { Q: this, e: c.e, x: c.x, y: c.y }); this.l.splice(b, 0, this.l[b]) } }, C: function () { var a = 10; 20 > this.size && (a = 0); this.d && (a = 30); var b = this.size; this.d || (b *= g); b *= y; this.W & 32 && (b *= 0.25); return ~~Math.max(b, a) }, ha: function () { this.R(); for (var a = this.a, b = this.l, c = a.length, d = 0; d < c; ++d) { var e = b[(d - 1 + c) % c], l = b[(d + 1) % c]; b[d] += (Math.random() - 0.5) * (this.j ? 3 : 1); b[d] *= 0.7; 10 < b[d] && (b[d] = 10); - 10 > b[d] && (b[d] = - 10); b[d] = (e + l + 8 * b[d]) / 10 } for (var k = this, h = this.d ? 0 : (this.id / 1000 + G / 10000) % (2 * Math.PI), d = 0; d < c; ++d) { var f = a[d].e, e = a[(d - 1 + c) % c].e, l = a[(d + 1) % c].e; if (15 < this.size && null != L && 20 < this.size * g) { var m = !1, p = a[d].x, q = a[d].y; L.ia(p - 5, q - 5, 10, 10, function (a) { a.Q != k && 25 > (p - a.x) * (p - a.x) + (q - a.y) * (q - a.y) && (m = !0) }); !m && (a[d].x < da || a[d].y < ea || a[d].x > fa || a[d].y > ga) && (m = !0); m && (0 < b[d] && (b[d] = 0), b[d] -= 1) } f += b[d]; 0 > f && (f = 0); f = this.j ? (19 * f + this.size) / 20 : (12 * f + this.size) / 13; a[d].e = (e + l + 8 * f) / 10; e = 2 * Math.PI / c; l = this.a[d].e; this.d && 0 == d % 2 && (l += 5); a[d].x = this.x + Math.cos(e * d + h) * l; a[d].y = this.y + Math.sin(e * d + h) * l } }, K: function () { var a; a = (G - this.L) / 120; a = 0 > a ? 0 : 1 < a ? 1 : a; var b = 0 > a ? 0 : 1 < a ? 1 : a; this.h(); if (this.A && 1 <= b) { var c = H.indexOf(this); - 1 != c && H.splice(c, 1) } this.x = a * (this.D - this.p) + this.p; this.y = a * (this.F - this.q) + this.q; this.size = b * (this.n - this.o) + this.o; return b }, I: function () { return this.x + this.size + 40 < s - p / 2 / g || this.y + this.size + 40 < t - q / 2 / g || this.x - this.size - 40 > s + p / 2 / g || this.y - this.size - 40 > t + q / 2 / g ? !1 : !0 }, T: function () { if (this.I()) { var a = !this.d && !this.j && 0.4 > g; 5 > this.C() && (a = !0); if (this.M && !a) for (var b = 0; b < this.a.length; b++) this.a[b].e = this.size; this.M = a; e.save(); this.ba = G; b = this.K(); this.A && (e.globalAlpha *= 1 - b); e.lineWidth = 10; e.lineCap = 'round'; e.lineJoin = this.d ? 'miter' : 'round'; xa ? (e.fillStyle = '#FFFFFF', e.strokeStyle = '#AAAAAA') : (e.fillStyle = this.color, e.strokeStyle = this.color); if (a) e.beginPath(), e.arc(this.x, this.y, this.size, 0, 2 * Math.PI, !1); else { this.ha(); e.beginPath(); var c = this.C(); e.moveTo(this.a[0].x, this.a[0].y); for (b = 1; b <= c; ++b) { var d = b % c; e.lineTo(this.a[d].x, this.a[d].y) } } e.closePath(); c = this.name.toLowerCase(); !this.j && Oa && ':teams' != M ? - 1 != ya.indexOf(c) ? (J.hasOwnProperty(c) || (J[c] = new Image, J[c].src = 'skins/' + c + '.png'), b = 0 != J[c].width && J[c].complete ? J[c] : null) : b = null : b = null; b = (d = b) ? - 1 != hb.indexOf(c) : !1; a || e.stroke(); e.fill(); null == d || b || (e.save(), e.clip(), e.drawImage(d, this.x - this.size, this.y - this.size, 2 * this.size, 2 * this.size), e.restore()); (xa || 15 < this.size) && !a && (e.strokeStyle = '#000000', e.globalAlpha *= 0.1, e.stroke()); e.globalAlpha = 1; null != d && b && e.drawImage(d, this.x - 2 * this.size, this.y - 2 * this.size, 4 * this.size, 4 * this.size); b = - 1 != m.indexOf(this); a = ~~this.y; if ((ka || b) && this.name && this.k && (null == d || - 1 == gb.indexOf(c))) { d = this.k; d.u(this.name); d.H(this.h()); c = Math.ceil(10 * g) / 10; d.$(c); var d = d.G(), f = ~~(d.width / c), l = ~~(d.height / c); e.drawImage(d, ~~this.x - ~~(f / 2), a - ~~(l / 2), f, l); a += d.height / 2 / c + 4 } Pa && (b || 0 == m.length && (!this.d || this.j) && 20 < this.size) && (null == this.J && (this.J = new ja(this.h() / 2, '#FFFFFF', !0, '#000000')), b = this.J, b.H(this.h() / 2), b.u(~~(this.size * this.size / 100)), c = Math.ceil(10 * g) / 10, b.$(c), d = b.G(), f = ~~(d.width / c), l = ~~(d.height / c), e.drawImage(d, ~~this.x - ~~(f / 2), a - ~~(l / 2), f, l)); e.restore() } } }; ja.prototype = { w: '', N: '#000000', P: !1, s: '#000000', r: 16, m: null, O: null, g: !1, v: 1, H: function (a) { this.r != a && (this.r = a, this.g = !0) }, $: function (a) { this.v != a && (this.v = a, this.g = !0) }, setStrokeColor: function (a) { this.s != a && (this.s = a, this.g = !0) }, u: function (a) { a != this.w && (this.w = a, this.g = !0) }, G: function () { null == this.m && (this.m = document.createElement('canvas'), this.O = this.m.getContext('2d')); if (this.g) { this.g = !1; var a = this.m, b = this.O, c = this.w, d = this.v, e = this.r, l = e + 'px Ubuntu'; b.font = l; var k = ~~(0.2 * e); a.width = (b.measureText(c).width + 6) * d; a.height = (e + k) * d; b.font = l; b.scale(d, d); b.globalAlpha = 1; b.lineWidth = 3; b.strokeStyle = this.s; b.fillStyle = this.N; this.P && b.strokeText(c, 3, e - k / 2); b.fillText(c, 3, e - k / 2) } return this.m } }; Date.now || (Date.now = function () { return (new Date).getTime() }); var Ua = { ca: function (a) { function b(a, b, c, d, e) { this.x = a; this.y = b; this.f = c; this.c = d; this.depth = e; this.items = [ ]; this.b = [ ] } var c = a.da || 2, d = a.ea || 4; b.prototype = { x: 0, y: 0, f: 0, c: 0, depth: 0, items: null, b: null, B: function (a) { for (var b = 0; b < this.items.length; ++b) { var c = this.items[b]; if (c.x >= a.x && c.y >= a.y && c.x < a.x + a.f && c.y < a.y + a.c) return !0 } if (0 != this.b.length) { var d = this; return this.V(a, function (b) { return d.b[b].B(a) }) } return !1 }, t: function (a, b) { for (var c = 0; c < this.items.length; ++c) b(this.items[c]); if (0 != this.b.length) { var d = this; this.V(a, function (c) { d.b[c].t(a, b) }) } }, i: function (a) { 0 != this.b.length ? this.b[this.U(a)].i(a) : this.items.length >= c && this.depth < d ? (this.aa(), this.b[this.U(a)].i(a)) : this.items.push(a) }, U: function (a) { return a.x < this.x + this.f / 2 ? a.y < this.y + this.c / 2 ? 0 : 2 : a.y < this.y + this.c / 2 ? 1 : 3 }, V: function (a, b) { return a.x < this.x + this.f / 2 && (a.y < this.y + this.c / 2 && b(0) || a.y >= this.y + this.c / 2 && b(2)) || a.x >= this.x + this.f / 2 && (a.y < this.y + this.c / 2 && b(1) || a.y >= this.y + this.c / 2 && b(3)) ? !0 : !1 }, aa: function () { var a = this.depth + 1, c = this.f / 2, d = this.c / 2; this.b.push(new b(this.x, this.y, c, d, a)); this.b.push(new b(this.x + c, this.y, c, d, a)); this.b.push(new b(this.x, this.y + d, c, d, a)); this.b.push(new b(this.x + c, this.y + d, c, d, a)); a = this.items; this.items = [ ]; for (c = 0; c < a.length; c++) this.i(a[c]) }, clear: function () { for (var a = 0; a < this.b.length; a++) this.b[a].clear(); this.items.length = 0; this.b.length = 0 } }; var e = { x: 0, y: 0, f: 0, c: 0 }; return { root: new b(a.X, a.Y, a.fa - a.X, a.ga - a.Y, 0), i: function (a) { this.root.i(a) }, t: function (a, b) { this.root.t(a, b) }, ia: function (a, b, c, d, f) { e.x = a; e.y = b; e.f = c; e.c = d; this.root.t(e, f) }, B: function (a) { return this.root.B(a) }, clear: function () { this.root.clear() } } } }; h.onload = Sa } }) (window, window.jQuery);
lazyengs
Nx Console in the Console
JP3402
NX DNS Manager is a Nintendo Switch homebrew tool for managing Atmosphere’s DNS redirection. It provides a simple UI to easily toggle host files and entries (default.txt/emummc.txt) directly on your console.
itmtr
// ==UserScript== // @name Launcher // @namespace AposLauncher // @include http://agar.io/ // @version 2 // @grant none // @author http://www.twitch.tv/apostolique // ==/UserScript== Number.prototype.mod = function(n) { return ((this%n)+n)%n; }; Array.prototype.peek = function() { return this[this.length-1]; } console.log("Running Bot Launcher!"); (function (f, g) { function keyAction(e) { if (84 == e.keyCode) { console.log("Toggle"); toggle = !toggle; } if (82 == e.keyCode) { console.log("ToggleDraw"); toggleDraw = !toggleDraw; } if (68 == e.keyCode) { f.setDarkTheme(!getDarkBool()); } if (70 == e.keyCode) { f.setShowMass(!getMassBool()); } } function humanPlayer() { //Don't need to do anything. return [getPointX(), getPointY()]; } function Pa() { if (f.botList == null) { f.botList = []; g('#locationUnknown').append(g('<select id="bList" class="form-control" onchange="setBotIndex($(this).val());" />')); g('#locationUnknown').addClass('form-group'); } f.botList.push(["Human", humanPlayer]); var bList = g('#bList'); g('<option />', {value: (f.botList.length - 1), text: "Human"}).appendTo(bList); ja = !0; xa(); setInterval(xa, 180000); A = ka = document.getElementById('canvas'); e = A.getContext('2d'); A.onmousedown = function (a) { if (ya) { var b = a.clientX - (5 + p / 5 / 2), c = a.clientY - (5 + p / 5 / 2); if (Math.sqrt(b * b + c * c) <= p / 5 / 2) { K(); B(17); return } } S = a.clientX; T = a.clientY; la(); K() }; A.onmousemove = function (a) { S = a.clientX; T = a.clientY; la() }; A.onmouseup = function (a) { }; /firefox/i.test(navigator.userAgent) ? document.addEventListener('DOMMouseScroll', za, !1) : document.body.onmousewheel = za; var a = !1, b = !1, c = !1; f.onkeydown = function (d) { 32 != d.keyCode || a || (K(), B(17), a = !0); 81 != d.keyCode || b || (B(18), b = !0); 87 != d.keyCode || c || (K(), B(21), c = !0); 27 == d.keyCode && Aa(!0) keyAction(d); }; f.onkeyup = function (d) { 32 == d.keyCode && (a = !1); 87 == d.keyCode && (c = !1); 81 == d.keyCode && b && (B(19), b = !1) }; f.onblur = function () { B(19); c = b = a = !1 }; f.onresize = Ba; Ba(); f.requestAnimationFrame ? f.requestAnimationFrame(Ca) : setInterval(ma, 1000 / 60); setInterval(K, 40); u && g('#region').val(u); Da(); U(g('#region').val()); null == m && u && V(); g('#overlays').show() } function za(a) { C *= Math.pow(0.9, a.wheelDelta / - 120 || a.detail || 0); 1 > C && (C = 1); C > 4 / h && (C = 4 / h) } function Qa() { if (0.35 > h) L = null; else { for (var a = Number.POSITIVE_INFINITY, b = Number.POSITIVE_INFINITY, c = Number.NEGATIVE_INFINITY, d = Number.NEGATIVE_INFINITY, e = 0, q = 0; q < n.length; q++) n[q].shouldRender() && (e = Math.max(n[q].size, e), a = Math.min(n[q].x, a), b = Math.min(n[q].y, b), c = Math.max(n[q].x, c), d = Math.max(n[q].y, d)); L = QUAD.init({ minX: a - (e + 100), minY: b - (e + 100), maxX: c + (e + 100), maxY: d + (e + 100) }); for (q = 0; q < n.length; q++) if (a = n[q], a.shouldRender()) for (b = 0; b < a.points.length; ++b) L.insert(a.points[b]) } } function la() { if (toggle ||f.botList[botIndex][0] == "Human") { W = (S - p / 2) / h + s; X = (T - r / 2) / h + t } } function xa() { null == Y && (Y = { }, g('#region').children().each(function () { var a = g(this), b = a.val(); b && (Y[b] = a.text()) })); g.get(F + '//m.agar.io/info', function (a) { var b = { }, c; for (c in a.regions) { var d = c.split(':') [0]; b[d] = b[d] || 0; b[d] += a.regions[c].numPlayers } for (c in b) g('#region option[value="' + c + '"]').text(Y[c] + ' (' + b[c] + ' players)') }, 'json') } function Ea() { g('#adsBottom').hide(); g('#overlays').hide(); Da() } function U(a) { a && a != u && (g('#region').val() != a && g('#region').val(a), u = f.localStorage.location = a, g('.region-message').hide(), g('.region-message.' + a).show(), g('.btn-needs-server').prop('disabled', !1), ja && V()) } function Aa(a) { D = null; g('#overlays').fadeIn(a ? 200 : 3000); a || g('#adsBottom').fadeIn(3000) } function Da() { g('#region').val() ? f.localStorage.location = g('#region').val() : f.localStorage.location && g('#region').val(f.localStorage.location); g('#region').val() ? g('#locationKnown').append(g('#region')) : g('#locationUnknown').append(g('#region')) } function na() { console.log('Find ' + u + M); g.ajax(F + '//m.agar.io/', { error: function () { setTimeout(na, 1000) }, success: function (a) { a = a.split('\n'); '45.79.222.79:443' == a[0] ? na() : Fa('ws://' + a[0]) }, dataType: 'text', method: 'POST', cache: !1, crossDomain: !0, data: u + M || '?' }) } function V() { ja && u && (g('#connecting').show(), na()) } function Fa(a) { if (m) { m.onopen = null; m.onmessage = null; m.onclose = null; try { m.close() } catch (b) { } m = null } var c = f.location.search.slice(1); /^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]+$/.test(c) && (a = 'ws://' + c); Ga && (a = a.split(':'), a = a[0] + 's://ip-' + a[1].replace(/\./g, '-').replace(/\//g, '') + '.tech.agar.io:' + ( + a[2] + 2000)); E = [ ]; l = [ ]; y = { }; n = [ ]; G = [ ]; z = [ ]; v = w = null; H = 0; console.log('Connecting to ' + a); serverIP = a; m = new WebSocket(a, Ga ? [ 'binary', 'base64' ] : [ ]); m.binaryType = 'arraybuffer'; m.onopen = Ra; m.onmessage = Sa; m.onclose = Ta; m.onerror = function () { console.log('socket error') } } function Ra(a) { Z = 500; g('#connecting').hide(); console.log('socket open'); a = new ArrayBuffer(5); var b = new DataView(a); b.setUint8(0, 254); b.setUint32(1, 4, !0); m.send(a); a = new ArrayBuffer(5); b = new DataView(a); b.setUint8(0, 255); b.setUint32(1, 673720360, !0); m.send(a); Ha() } function Ta(a) { console.log('socket close'); setTimeout(V, Z); Z *= 1.5 } function Sa(a) { function b() { for (var a = ''; ; ) { var b = d.getUint16(c, !0); c += 2; if (0 == b) break; a += String.fromCharCode(b) } return a } var c = 0, d = new DataView(a.data); 240 == d.getUint8(c) && (c += 5); switch (d.getUint8(c++)) { case 16: Ua(d, c); break; case 17: N = d.getFloat32(c, !0); c += 4; O = d.getFloat32(c, !0); c += 4; P = d.getFloat32(c, !0); c += 4; break; case 20: l = [ ]; E = [ ]; break; case 21: oa = d.getInt16(c, !0); c += 2; pa = d.getInt16(c, !0); c += 2; qa || (qa = !0, $ = oa, aa = pa); break; case 32: E.push(d.getUint32(c, !0)); c += 4; break; case 49: if (null != w) break; a = d.getUint32(c, !0); c += 4; z = [ ]; for (var e = 0; e < a; ++e) { var q = d.getUint32(c, !0), c = c + 4; z.push({ id: q, name: b() }) } Ia(); break; case 50: w = [ ]; a = d.getUint32(c, !0); c += 4; for (e = 0; e < a; ++e) w.push(d.getFloat32(c, !0)), c += 4; Ia(); break; case 64: ba = d.getFloat64(c, !0), c += 8, ca = d.getFloat64(c, !0), c += 8, da = d.getFloat64(c, !0), c += 8, ea = d.getFloat64(c, !0), c += 8, N = (da + ba) / 2, O = (ea + ca) / 2, P = 1, 0 == l.length && (s = N, t = O, h = P) } } function Ua(a, b) { I = + new Date; var c = Math.random(); ra = !1; var d = a.getUint16(b, !0); b += 2; for (var e = 0; e < d; ++e) { var q = y[a.getUint32(b, !0)], f = y[a.getUint32(b + 4, !0)]; b += 8; q && f && (f.destroy(), f.ox = f.x, f.oy = f.y, f.oSize = f.size, f.nx = q.x, f.ny = q.y, f.nSize = f.size, f.updateTime = I) } for (e = 0; ; ) { d = a.getUint32(b, !0); b += 4; if (0 == d) break; ++e; var g, q = a.getInt16(b, !0); b += 2; f = a.getInt16(b, !0); b += 2; g = a.getInt16(b, !0); b += 2; for (var h = a.getUint8(b++), m = a.getUint8(b++), p = a.getUint8(b++), h = (h << 16 | m << 8 | p).toString(16); 6 > h.length; ) h = '0' + h; var h = '#' + h, k = a.getUint8(b++), m = !!(k & 1), p = !!(k & 16); k & 2 && (b += 4); k & 4 && (b += 8); k & 8 && (b += 16); for (var n, k = ''; ; ) { n = a.getUint16(b, !0); b += 2; if (0 == n) break; k += String.fromCharCode(n) } n = k; k = null; y.hasOwnProperty(d) ? (k = y[d], k.updatePos(), k.ox = k.x, k.oy = k.y, k.oSize = k.size, k.color = h) : (k = new Ja(d, q, f, g, h, n), k.pX = q, k.pY = f); k.isVirus = m; k.isAgitated = p; k.nx = q; k.ny = f; k.nSize = g; k.updateCode = c; k.updateTime = I; n && k.setName(n); - 1 != E.indexOf(d) && - 1 == l.indexOf(k) && (document.getElementById('overlays').style.display = 'none', l.push(k), 1 == l.length && (s = k.x, t = k.y)) interNodes[d] = y[d]; } Object.keys(interNodes).forEach(function (element, index) { //console.log("start: " + interNodes[element].updateTime + " current: " + D + " life: " + (D - interNodes[element].updateTime)); var isRemoved = !y.hasOwnProperty(element); if (isRemoved && (getLastUpdate() - interNodes[element].updateTime) > 3000) { delete interNodes[element]; } else if (isRemoved && computeDistance(getOffsetX(), getOffsetY(), interNodes[element].x, interNodes[element].y) < screenDistance()) { //console.log("Too close! Remove " + computeDistance(getOffsetX(), getOffsetY(), interNodes[element].x, interNodes[element].y) + " || " + screenDistance()); delete interNodes[element]; } }); c = a.getUint32(b, !0); b += 4; for (e = 0; e < c; e++) d = a.getUint32(b, !0), b += 4, k = y[d], null != k && k.destroy(); //ra && 0 == l.length && (setNick(originalName), restartPlz = true, console.log("Dead")) } function computeDistance(x1, y1, x2, y2) { var xdis = x1 - x2; // <--- FAKE AmS OF COURSE! var ydis = y1 - y2; var distance = Math.sqrt(xdis * xdis + ydis * ydis); return distance; } function screenDistance() { return Math.min(computeDistance (getOffsetX(), getOffsetY(), screenToGameX(getWidth()), getOffsetY()), computeDistance (getOffsetX(), getOffsetY(), getOffsetX(), screenToGameY(getHeight()))); } function screenToGameX(x) { return (x - getWidth() / 2) / getRatio() + getX(); } function screenToGameY(y) { return (y - getHeight() / 2) / getRatio() + getY();; } f.drawPoint = function(x_1, y_1, drawColor, text) { if (!toggleDraw) { dPoints.push([x_1, y_1, drawColor]); dText.push(text); } } f.drawArc = function(x_1, y_1, x_2, y_2, x_3, y_3, drawColor) { if (!toggleDraw) { var radius = computeDistance(x_1, y_1, x_3, y_3); dArc.push([x_1, y_1, x_2, y_2, x_3, y_3, radius, drawColor]); } } f.drawLine = function(x_1, y_1, x_2, y_2, drawColor) { if (!toggleDraw) { lines.push([x_1, y_1, x_2, y_2, drawColor]); } } function K() { if (getPlayer().length == 0) { setNick(originalName); restartPlz = false; } if (sa()) { var a = S - p / 2, b = T - r / 2; 64 > a * a + b * b || Ka == W && La == X || (Ka = W, La = X, a = new ArrayBuffer(21), b = new DataView(a), b.setUint8(0, 16), b.setFloat64(1, W, !0), b.setFloat64(9, X, !0), b.setUint32(17, 0, !0), m.send(a)) } } function Ha() { if (sa() && null != D) { var a = new ArrayBuffer(1 + 2 * D.length), b = new DataView(a); b.setUint8(0, 0); for (var c = 0; c < D.length; ++c) b.setUint16(1 + 2 * c, D.charCodeAt(c), !0); m.send(a) } } function sa() { return null != m && m.readyState == m.OPEN } function B(a) { if (sa()) { var b = new ArrayBuffer(1); (new DataView(b)).setUint8(0, a); m.send(b) } } function Ca() { ma(); f.requestAnimationFrame(Ca) } function Ba() { p = f.innerWidth; r = f.innerHeight; ka.width = A.width = p; ka.height = A.height = r; ma() } function Ma() { var a; a = 1 * Math.max(r / 1080, p / 1920); return a *= C } function Va() { if (0 != l.length) { for (var a = 0, b = 0; b < l.length; b++) a += l[b].size; a = Math.pow(Math.min(64 / a, 1), 0.4) * Ma(); h = (9 * h + a) / 10 } } function ma() { dPoints = []; dArc = []; dText = []; lines = []; var a, b, c = + new Date; ++Wa; I = + new Date; if (0 < l.length) { Va(); for (var d = a = b = 0; d < l.length; d++) l[d].updatePos(), b += l[d].x / l.length, a += l[d].y / l.length; N = b; O = a; P = h; s = (s + b) / 2; t = (t + a) / 2 } else s = (29 * s + N) / 30, t = (29 * t + O) / 30, h = (9 * h + P * Ma()) / 10; Qa(); la(); ta || e.clearRect(0, 0, p, r); if (ta) e.fillStyle = fa ? '#111111' : '#F2FBFF', e.globalAlpha = 0.05, e.fillRect(0, 0, p, r), e.globalAlpha = 1; else { e.fillStyle = fa ? '#111111' : '#F2FBFF'; e.fillRect(0, 0, p, r); e.save(); e.strokeStyle = fa ? '#AAAAAA' : '#000000'; e.globalAlpha = 0.2; e.scale(h, h); b = p / h; a = r / h; for (d = - 0.5 + ( - s + b / 2) % 50; d < b; d += 50) e.beginPath(), e.moveTo(d, 0), e.lineTo(d, a), e.stroke(); for (d = - 0.5 + ( - t + a / 2) % 50; d < a; d += 50) e.beginPath(), e.moveTo(0, d), e.lineTo(b, d), e.stroke(); e.restore() } n.sort(function (a, b) { return a.size == b.size ? a.id - b.id : a.size - b.size }); e.save(); e.translate(p / 2, r / 2); e.scale(h, h); e.translate( - s, - t); for (d = 0; d < G.length; d++) G[d].draw(); for (d = 0; d < n.length; d++) n[d].draw(); if (getPlayer().length > 0) { var moveLoc = f.botList[botIndex][1](); if (!toggle) { setPoint(moveLoc[0], moveLoc[1]); } } customRender(e); if (qa) { $ = (3 * $ + oa) / 4; aa = (3 * aa + pa) / 4; e.save(); e.strokeStyle = '#FFAAAA'; e.lineWidth = 10; e.lineCap = 'round'; e.lineJoin = 'round'; e.globalAlpha = 0.5; e.beginPath(); for (d = 0; d < l.length; d++) e.moveTo(l[d].x, l[d].y), e.lineTo($, aa); e.stroke(); e.restore() } e.restore(); v && v.width && e.drawImage(v, p - v.width - 10, 10); H = Math.max(H, Xa()); 0 != H && (null == ga && (ga = new ha(24, '#FFFFFF')), ga.setValue('Score: ' + ~~(H / 100) + ' || Best Score: ' + ~~(sessionScore / 100) + " || Best time alive: " + bestTime + " seconds"), a = ga.render(), b = a.width, e.globalAlpha = 0.2, e.fillStyle = '#000000', e.fillRect(10, r - 10 - 24 - 10, b + 10, 34), e.globalAlpha = 1, e.drawImage(a, 15, r - 10 - 24 - 5)); Ya(); c = + new Date - c; c > 1000 / 60 ? x -= 0.01 : c < 1000 / 65 && (x += 0.01); 0.4 > x && (x = 0.4); 1 < x && (x = 1) drawStats(e); } function customRender(d) { for(var i = 0; i < lines.length; i++) { d.beginPath(); d.lineWidth = 5; if (lines[i][4] == 0) { d.strokeStyle = "#FF0000"; } else if (lines[i][4] == 1) { d.strokeStyle = "#00FF00"; } else if (lines[i][4] == 2) { d.strokeStyle = "#0000FF"; } else if (lines[i][4] == 3) { d.strokeStyle = "#FF8000"; } else if (lines[i][4] == 4) { d.strokeStyle = "#8A2BE2"; } else if (lines[i][4] == 5) { d.strokeStyle = "#FF69B4"; } else if (lines[i][4] == 6) { d.strokeStyle = "#008080"; } else if (lines[i][4] == 7) { d.strokeStyle = "#FFFFFF"; } else { d.strokeStyle = "#000000"; } d.moveTo(lines[i][0], lines[i][1]); d.lineTo(lines[i][2], lines[i][3]); d.stroke(); } d.lineWidth = 1; for(var i = 0; i < dArc.length; i++) { if (dArc[i][7] == 0) { d.strokeStyle = "#FF0000"; } else if (dArc[i][7] == 1) { d.strokeStyle = "#00FF00"; } else if (dArc[i][7] == 2) { d.strokeStyle = "#0000FF"; } else if (dArc[i][7] == 3) { d.strokeStyle = "#FF8000"; } else if (dArc[i][7] == 4) { d.strokeStyle = "#8A2BE2"; } else if (dArc[i][7] == 5) { d.strokeStyle = "#FF69B4"; } else if (dArc[i][7] == 6) { d.strokeStyle = "#008080"; } else if (dArc[i][7] == 7) { d.strokeStyle = "#FFFFFF"; } else { d.strokeStyle = "#000000"; } d.beginPath(); d.lineWidth = 5; var ang1 = Math.atan2(dArc[i][1] - dArc[i][5], dArc[i][0] - dArc[i][4]); var ang2 = Math.atan2(dArc[i][3] - dArc[i][5], dArc[i][2] - dArc[i][4]); d.arc(dArc[i][4], dArc[i][5], dArc[i][6], ang1, ang2, false); d.stroke(); } d.lineWidth = 1; for (var i = 0; i < dPoints.length; i++) { if (dText[i] == "") { var radius = 10; d.beginPath(); d.arc(dPoints[i][0], dPoints[i][1], radius, 0, 2 * Math.PI, false); if (dPoints[i][2] == 0) { d.fillStyle = "black"; } else if (dPoints[i][2] == 1) { d.fillStyle = "yellow"; } else if (dPoints[i][2] == 2) { d.fillStyle = "blue"; } else if (dPoints[i][2] == 3) { d.fillStyle = "red"; } else if (dPoints[i][2] == 4) { d.fillStyle = "#008080"; } else if (dPoints[i][2] == 5) { d.fillStyle = "#FF69B4"; } else { d.fillStyle = "#000000"; } d.fill(); d.lineWidth = 2; d.strokeStyle = '#003300'; d.stroke(); } else { var text = new ha(18, (getDarkBool() ? '#F2FBFF' : '#111111')); text.setValue(dText[i]); var textRender = text.render(); d.drawImage(textRender, dPoints[i][0], dPoints[i][1]); } } d.lineWidth = 1; } function drawStats(d) { var currentDate = new Date(); var nbSeconds = 0; if (getPlayer().length > 0) { nbSeconds = (currentDate.getSeconds() + (currentDate.getMinutes() * 60) + (currentDate.getHours() * 60 * 60)) - (lifeTimer.getSeconds() + (lifeTimer.getMinutes() * 60) + (lifeTimer.getHours() * 60 * 60)); } bestTime = Math.max(nbSeconds, bestTime); var debugStrings = []; debugStrings.push("T - Bot: " + (!toggle ? "On" : "Off")); debugStrings.push("R - Lines: " + (!toggleDraw ? "On" : "Off")); debugStrings.push("Server: " + serverIP); debugStrings.push("Survived for: " + nbSeconds + " seconds"); if (getPlayer().length > 0) { debugStrings.push("Location: " + Math.floor(getPlayer()[0].x) + ", " + Math.floor(getPlayer()[0].y)); } var offsetValue = 20; var text = new ha(18, (getDarkBool() ? '#F2FBFF' : '#111111')); for (var i = 0; i < debugStrings.length; i++) { text.setValue(debugStrings[i]); var textRender = text.render(); d.drawImage(textRender, 20, offsetValue); offsetValue += textRender.height; } } function Ya() { if (ya && ua.width) { var a = p / 5; e.drawImage(ua, 5, 5, a, a) } } function Xa() { for (var a = 0, b = 0; b < l.length; b++) a += l[b].nSize * l[b].nSize; return a } function Ia() { v = null; if (null != w || 0 != z.length) if (null != w || ia) { v = document.createElement('canvas'); var a = v.getContext('2d'), b = 60, b = null == w ? b + 24 * z.length : b + 180, c = Math.min(200, 0.3 * p) / 200; v.width = 200 * c; v.height = b * c; a.scale(c, c); a.globalAlpha = 0.4; a.fillStyle = '#000000'; a.fillRect(0, 0, 200, b); a.globalAlpha = 1; a.fillStyle = '#FFFFFF'; c = null; c = 'Leaderboard'; a.font = '30px Ubuntu'; a.fillText(c, 100 - a.measureText(c).width / 2, 40); if (null == w) for (a.font = '20px Ubuntu', b = 0; b < z.length; ++b) c = z[b].name || 'An unnamed cell', ia || (c = 'An unnamed cell'), - 1 != E.indexOf(z[b].id) ? (l[0].name && (c = l[0].name), a.fillStyle = '#FFAAAA') : a.fillStyle = '#FFFFFF', c = b + 1 + '. ' + c, a.fillText(c, 100 - a.measureText(c).width / 2, 70 + 24 * b); else for (b = c = 0; b < w.length; ++b) angEnd = c + w[b] * Math.PI * 2, a.fillStyle = Za[b + 1], a.beginPath(), a.moveTo(100, 140), a.arc(100, 140, 80, c, angEnd, !1), a.fill(), c = angEnd } } function Ja(a, b, c, d, e, f) { n.push(this); y[a] = this; this.id = a; this.ox = this.x = b; this.oy = this.y = c; this.oSize = this.size = d; this.color = e; this.points = [ ]; this.pointsAcc = [ ]; this.createPoints(); this.setName(f) } function ha(a, b, c, d) { a && (this._size = a); b && (this._color = b); this._stroke = !!c; d && (this._strokeColor = d) } var F = f.location.protocol, Ga = 'https:' == F; if ('agar.io' != f.location.hostname && 'localhost' != f.location.hostname && '10.10.2.13' != f.location.hostname) f.location = F + '//agar.io/'; else if (f.top != f) f.top.location = F + '//agar.io/'; else { var ka, toggle = false, toggleDraw = false, splitted = false, splitting = false, virusBait = false, tempPoint = [0, 0, 1], dPoints = [], dArc = [], dText = [], lines = [], originalName = "itmtr by iCan", sessionScore = 0, serverIP = "", interNodes = [], lifeTimer = new Date(), bestTime = 0, botIndex = 0, restartPlz = false, e, A, p, r, L = null, m = null, s = 0, t = 0, E = [ ], l = [ ], y = { }, n = [ ], G = [ ], z = [ ], S = 0, T = 0, W = - 1, X = - 1, Wa = 0, I = 0, D = null, ba = 0, ca = 0, da = 10000, ea = 10000, h = 1, u = null, Na = !0, ia = !0, va = !1, ra = !1, H = 0, fa = !1, Oa = !1, N = s = ~~((ba + da) / 2), O = t = ~~((ca + ea) / 2), P = 1, M = '', w = null, ja = !1, qa = !1, oa = 0, pa = 0, $ = 0, aa = 0, Q = 0, Za = [ '#333333', '#FF3333', '#33FF33', '#3333FF' ], ta = !1, C = 1, ya = 'ontouchstart' in f && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), ua = new Image; ua.src = 'img/split.png'; Q = document.createElement('canvas'); if ('undefined' == typeof console || 'undefined' == typeof DataView || 'undefined' == typeof WebSocket || null == Q || null == Q.getContext || null == f.localStorage) alert('You browser does not support this game, we recommend you to use Firefox to play this'); else { var Y = null; f.setNick = function (a) { originalName = a; if (getPlayer().length == 0) { lifeTimer = new Date(); } Ea(); D = a; Ha(); H = 0 }; f.setRegion = U; f.setSkins = function (a) { Na = a }; f.setNames = function (a) { ia = a }; f.setDarkTheme = function (a) { fa = a }; f.setColors = function (a) { va = a }; f.setShowMass = function (a) { Oa = a }; f.spectate = function () { D = null; B(1); Ea() }; f.setGameMode = function (a) { a != M && (M = a, V()) }; f.setAcid = function (a) { ta = a }; null != f.localStorage && (null == f.localStorage.AB8 && (f.localStorage.AB8 = 0 + ~~(100 * Math.random())), Q = + f.localStorage.AB8, f.ABGroup = Q); g.get(F + '//gc.agar.io', function (a) { var b = a.split(' '); a = b[0]; b = b[1] || ''; - 1 == 'DE IL PL HU BR AT UA'.split(' ').indexOf(a) && wa.push('nazi'); - 1 == ['UA'].indexOf(a) && wa.push('ussr'); R.hasOwnProperty(a) && ('string' == typeof R[a] ? u || U(R[a]) : R[a].hasOwnProperty(b) && (u || U(R[a][b]))) }, 'text'); setTimeout(function () { }, 300000); var R = { AF: 'JP-Tokyo', AX: 'EU-London', AL: 'EU-London', DZ: 'EU-London', AS: 'SG-Singapore', AD: 'EU-London', AO: 'EU-London', AI: 'US-Atlanta', AG: 'US-Atlanta', AR: 'BR-Brazil', AM: 'JP-Tokyo', AW: 'US-Atlanta', AU: 'SG-Singapore', AT: 'EU-London', AZ: 'JP-Tokyo', BS: 'US-Atlanta', BH: 'JP-Tokyo', BD: 'JP-Tokyo', BB: 'US-Atlanta', BY: 'EU-London', BE: 'EU-London', BZ: 'US-Atlanta', BJ: 'EU-London', BM: 'US-Atlanta', BT: 'JP-Tokyo', BO: 'BR-Brazil', BQ: 'US-Atlanta', BA: 'EU-London', BW: 'EU-London', BR: 'BR-Brazil', IO: 'JP-Tokyo', VG: 'US-Atlanta', BN: 'JP-Tokyo', BG: 'EU-London', BF: 'EU-London', BI: 'EU-London', KH: 'JP-Tokyo', CM: 'EU-London', CA: 'US-Atlanta', CV: 'EU-London', KY: 'US-Atlanta', CF: 'EU-London', TD: 'EU-London', CL: 'BR-Brazil', CN: 'CN-China', CX: 'JP-Tokyo', CC: 'JP-Tokyo', CO: 'BR-Brazil', KM: 'EU-London', CD: 'EU-London', CG: 'EU-London', CK: 'SG-Singapore', CR: 'US-Atlanta', CI: 'EU-London', HR: 'EU-London', CU: 'US-Atlanta', CW: 'US-Atlanta', CY: 'JP-Tokyo', CZ: 'EU-London', DK: 'EU-London', DJ: 'EU-London', DM: 'US-Atlanta', DO: 'US-Atlanta', EC: 'BR-Brazil', EG: 'EU-London', SV: 'US-Atlanta', GQ: 'EU-London', ER: 'EU-London', EE: 'EU-London', ET: 'EU-London', FO: 'EU-London', FK: 'BR-Brazil', FJ: 'SG-Singapore', FI: 'EU-London', FR: 'EU-London', GF: 'BR-Brazil', PF: 'SG-Singapore', GA: 'EU-London', GM: 'EU-London', GE: 'JP-Tokyo', DE: 'EU-London', GH: 'EU-London', GI: 'EU-London', GR: 'EU-London', GL: 'US-Atlanta', GD: 'US-Atlanta', GP: 'US-Atlanta', GU: 'SG-Singapore', GT: 'US-Atlanta', GG: 'EU-London', GN: 'EU-London', GW: 'EU-London', GY: 'BR-Brazil', HT: 'US-Atlanta', VA: 'EU-London', HN: 'US-Atlanta', HK: 'JP-Tokyo', HU: 'EU-London', IS: 'EU-London', IN: 'JP-Tokyo', ID: 'JP-Tokyo', IR: 'JP-Tokyo', IQ: 'JP-Tokyo', IE: 'EU-London', IM: 'EU-London', IL: 'JP-Tokyo', IT: 'EU-London', JM: 'US-Atlanta', JP: 'JP-Tokyo', JE: 'EU-London', JO: 'JP-Tokyo', KZ: 'JP-Tokyo', KE: 'EU-London', KI: 'SG-Singapore', KP: 'JP-Tokyo', KR: 'JP-Tokyo', KW: 'JP-Tokyo', KG: 'JP-Tokyo', LA: 'JP-Tokyo', LV: 'EU-London', LB: 'JP-Tokyo', LS: 'EU-London', LR: 'EU-London', LY: 'EU-London', LI: 'EU-London', LT: 'EU-London', LU: 'EU-London', MO: 'JP-Tokyo', MK: 'EU-London', MG: 'EU-London', MW: 'EU-London', MY: 'JP-Tokyo', MV: 'JP-Tokyo', ML: 'EU-London', MT: 'EU-London', MH: 'SG-Singapore', MQ: 'US-Atlanta', MR: 'EU-London', MU: 'EU-London', YT: 'EU-London', MX: 'US-Atlanta', FM: 'SG-Singapore', MD: 'EU-London', MC: 'EU-London', MN: 'JP-Tokyo', ME: 'EU-London', MS: 'US-Atlanta', MA: 'EU-London', MZ: 'EU-London', MM: 'JP-Tokyo', NA: 'EU-London', NR: 'SG-Singapore', NP: 'JP-Tokyo', NL: 'EU-London', NC: 'SG-Singapore', NZ: 'SG-Singapore', NI: 'US-Atlanta', NE: 'EU-London', NG: 'EU-London', NU: 'SG-Singapore', NF: 'SG-Singapore', MP: 'SG-Singapore', NO: 'EU-London', OM: 'JP-Tokyo', PK: 'JP-Tokyo', PW: 'SG-Singapore', PS: 'JP-Tokyo', PA: 'US-Atlanta', PG: 'SG-Singapore', PY: 'BR-Brazil', PE: 'BR-Brazil', PH: 'JP-Tokyo', PN: 'SG-Singapore', PL: 'EU-London', PT: 'EU-London', PR: 'US-Atlanta', QA: 'JP-Tokyo', RE: 'EU-London', RO: 'EU-London', RU: 'RU-Russia', RW: 'EU-London', BL: 'US-Atlanta', SH: 'EU-London', KN: 'US-Atlanta', LC: 'US-Atlanta', MF: 'US-Atlanta', PM: 'US-Atlanta', VC: 'US-Atlanta', WS: 'SG-Singapore', SM: 'EU-London', ST: 'EU-London', SA: 'EU-London', SN: 'EU-London', RS: 'EU-London', SC: 'EU-London', SL: 'EU-London', SG: 'JP-Tokyo', SX: 'US-Atlanta', SK: 'EU-London', SI: 'EU-London', SB: 'SG-Singapore', SO: 'EU-London', ZA: 'EU-London', SS: 'EU-London', ES: 'EU-London', LK: 'JP-Tokyo', SD: 'EU-London', SR: 'BR-Brazil', SJ: 'EU-London', SZ: 'EU-London', SE: 'EU-London', CH: 'EU-London', SY: 'EU-London', TW: 'JP-Tokyo', TJ: 'JP-Tokyo', TZ: 'EU-London', TH: 'JP-Tokyo', TL: 'JP-Tokyo', TG: 'EU-London', TK: 'SG-Singapore', TO: 'SG-Singapore', TT: 'US-Atlanta', TN: 'EU-London', TR: 'TK-Turkey', TM: 'JP-Tokyo', TC: 'US-Atlanta', TV: 'SG-Singapore', UG: 'EU-London', UA: 'EU-London', AE: 'EU-London', GB: 'EU-London', US: { AL: 'US-Atlanta', AK: 'US-Fremont', AZ: 'US-Fremont', AR: 'US-Atlanta', CA: 'US-Fremont', CO: 'US-Fremont', CT: 'US-Atlanta', DE: 'US-Atlanta', FL: 'US-Atlanta', GA: 'US-Atlanta', HI: 'US-Fremont', ID: 'US-Fremont', IL: 'US-Atlanta', IN: 'US-Atlanta', IA: 'US-Atlanta', KS: 'US-Atlanta', KY: 'US-Atlanta', LA: 'US-Atlanta', ME: 'US-Atlanta', MD: 'US-Atlanta', MA: 'US-Atlanta', MI: 'US-Atlanta', MN: 'US-Fremont', MS: 'US-Atlanta', MO: 'US-Atlanta', MT: 'US-Fremont', NE: 'US-Fremont', NV: 'US-Fremont', NH: 'US-Atlanta', NJ: 'US-Atlanta', NM: 'US-Fremont', NY: 'US-Atlanta', NC: 'US-Atlanta', ND: 'US-Fremont', OH: 'US-Atlanta', OK: 'US-Atlanta', OR: 'US-Fremont', PA: 'US-Atlanta', RI: 'US-Atlanta', SC: 'US-Atlanta', SD: 'US-Fremont', TN: 'US-Atlanta', TX: 'US-Atlanta', UT: 'US-Fremont', VT: 'US-Atlanta', VA: 'US-Atlanta', WA: 'US-Fremont', WV: 'US-Atlanta', WI: 'US-Atlanta', WY: 'US-Fremont', DC: 'US-Atlanta', AS: 'US-Atlanta', GU: 'US-Atlanta', MP: 'US-Atlanta', PR: 'US-Atlanta', UM: 'US-Atlanta', VI: 'US-Atlanta' }, UM: 'SG-Singapore', VI: 'US-Atlanta', UY: 'BR-Brazil', UZ: 'JP-Tokyo', VU: 'SG-Singapore', VE: 'BR-Brazil', VN: 'JP-Tokyo', WF: 'SG-Singapore', EH: 'EU-London', YE: 'JP-Tokyo', ZM: 'EU-London', ZW: 'EU-London' }; f.connect = Fa; f.getDarkBool = function() { return fa; } f.getMassBool = function() { return Oa; } f.getMemoryCells = function() { return interNodes; } f.getCellsArray = function() { return n; } f.getCells = function() { return y; } f.getPlayer = function() { return l; } f.getWidth = function() { return p; } f.getHeight = function() { return r; } f.getRatio = function() { return h; } f.getOffsetX = function() { return N; } f.getOffsetY = function() { return O; } f.getX = function() { return s; } f.getY = function() { return t; } f.getPointX = function() { return W; } f.getPointY = function() { return X; } f.getMouseX = function() { return S; } f.getMouseY = function() { return T; } f.getScreenDistance = function() { var temp = screenDistance(); return temp; } f.getLastUpdate = function() { return I; } f.setPoint = function(x, y) { W = x; X = y; } f.createFake = function(a, b, c, d, e, f) { var n = new Ja(a, b, c, d, e, f); return n; } f.setScore = function(a) { sessionScore = a * 100; } f.setBestTime = function(a) { bestTime = a; } f.best = function(a, b) { setScore(a); setBestTime(b); } f.setBotIndex = function(a) { console.log("Changing bot"); botIndex = a; } var Z = 500, Ka = - 1, La = - 1, v = null, x = 1, ga = null, J = { }, wa = 'poland;usa;china;russia;canada;australia;spain;brazil;germany;ukraine;france;sweden;hitler;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'.split(';'), $a = [ '8', 'nasa' ], ab = [ 'm\'blob' ]; Ja.prototype = { id: 0, points: null, pointsAcc: null, name: null, nameCache: null, sizeCache: null, x: 0, y: 0, size: 0, ox: 0, oy: 0, oSize: 0, nx: 0, ny: 0, nSize: 0, updateTime: 0, updateCode: 0, drawTime: 0, destroyed: !1, isVirus: !1, isAgitated: !1, wasSimpleDrawing: !0, destroy: function () { var a; for (a = 0; a < n.length; a++) if (n[a] == this) { n.splice(a, 1); break } delete y[this.id]; a = l.indexOf(this); - 1 != a && (ra = !0, l.splice(a, 1)); a = E.indexOf(this.id); - 1 != a && E.splice(a, 1); this.destroyed = !0; G.push(this) }, getNameSize: function () { return Math.max(~~(0.3 * this.size), 24) }, setName: function (a) { if (this.name = a) null == this.nameCache ? this.nameCache = new ha(this.getNameSize(), '#FFFFFF', !0, '#000000') : this.nameCache.setSize(this.getNameSize()), this.nameCache.setValue(this.name) }, createPoints: function () { for (var a = this.getNumPoints(); this.points.length > a; ) { var b = ~~(Math.random() * this.points.length); this.points.splice(b, 1); this.pointsAcc.splice(b, 1) } 0 == this.points.length && 0 < a && (this.points.push({ c: this, v: this.size, x: this.x, y: this.y }), this.pointsAcc.push(Math.random() - 0.5)); for (; this.points.length < a; ) { var b = ~~(Math.random() * this.points.length), c = this.points[b]; this.points.splice(b, 0, { c: this, v: c.v, x: c.x, y: c.y }); this.pointsAcc.splice(b, 0, this.pointsAcc[b]) } }, getNumPoints: function () { var a = 10; 20 > this.size && (a = 5); this.isVirus && (a = 30); var b = this.size; this.isVirus || (b *= h); b *= x; return ~~Math.max(b, a) }, movePoints: function () { this.createPoints(); for (var a = this.points, b = this.pointsAcc, c = a.length, d = 0; d < c; ++d) { var e = b[(d - 1 + c) % c], f = b[(d + 1) % c]; b[d] += (Math.random() - 0.5) * (this.isAgitated ? 3 : 1); b[d] *= 0.7; 10 < b[d] && (b[d] = 10); - 10 > b[d] && (b[d] = - 10); b[d] = (e + f + 8 * b[d]) / 10 } for (var h = this, d = 0; d < c; ++d) { var g = a[d].v, e = a[(d - 1 + c) % c].v, f = a[(d + 1) % c].v; if (15 < this.size && null != L) { var l = !1, m = a[d].x, n = a[d].y; L.retrieve2(m - 5, n - 5, 10, 10, function (a) { a.c != h && 25 > (m - a.x) * (m - a.x) + (n - a.y) * (n - a.y) && (l = !0) }); !l && (a[d].x < ba || a[d].y < ca || a[d].x > da || a[d].y > ea) && (l = !0); l && (0 < b[d] && (b[d] = 0), b[d] -= 1) } g += b[d]; 0 > g && (g = 0); g = this.isAgitated ? (19 * g + this.size) / 20 : (12 * g + this.size) / 13; a[d].v = (e + f + 8 * g) / 10; e = 2 * Math.PI / c; f = this.points[d].v; this.isVirus && 0 == d % 2 && (f += 5); a[d].x = this.x + Math.cos(e * d) * f; a[d].y = this.y + Math.sin(e * d) * f } }, updatePos: function () { var a; a = (I - this.updateTime) / 120; a = 0 > a ? 0 : 1 < a ? 1 : a; var b = 0 > a ? 0 : 1 < a ? 1 : a; this.getNameSize(); if (this.destroyed && 1 <= b) { var c = G.indexOf(this); - 1 != c && G.splice(c, 1) } this.x = a * (this.nx - this.ox) + this.ox; this.y = a * (this.ny - this.oy) + this.oy; this.size = b * (this.nSize - this.oSize) + this.oSize; return b }, shouldRender: function () { return this.x + this.size + 40 < s - p / 2 / h || this.y + this.size + 40 < t - r / 2 / h || this.x - this.size - 40 > s + p / 2 / h || this.y - this.size - 40 > t + r / 2 / h ? !1 : !0 }, draw: function () { if (this.shouldRender()) { var a = !this.isVirus && !this.isAgitated && 0.35 > h; if (this.wasSimpleDrawing && !a) for (var b = 0; b < this.points.length; b++) this.points[b].v = this.size; this.wasSimpleDrawing = a; e.save(); this.drawTime = I; b = this.updatePos(); this.destroyed && (e.globalAlpha *= 1 - b); e.lineWidth = 10; e.lineCap = 'round'; e.lineJoin = this.isVirus ? 'mitter' : 'round'; va ? (e.fillStyle = '#FFFFFF', e.strokeStyle = '#AAAAAA') : (e.fillStyle = this.color, e.strokeStyle = this.color); if (a) e.beginPath(), e.arc(this.x, this.y, this.size, 0, 2 * Math.PI, !1); else { this.movePoints(); e.beginPath(); var c = this.getNumPoints(); e.moveTo(this.points[0].x, this.points[0].y); for (b = 1; b <= c; ++b) { var d = b % c; e.lineTo(this.points[d].x, this.points[d].y) } } e.closePath(); c = this.name.toLowerCase(); !this.isAgitated && Na && '' == M ? - 1 != wa.indexOf(c) ? (J.hasOwnProperty(c) || (J[c] = new Image, J[c].src = 'skins/' + c + '.png'), b = 0 != J[c].width && J[c].complete ? J[c] : null) : b = null : b = null; b = (d = b) ? - 1 != ab.indexOf(c) : !1; a || e.stroke(); e.fill(); null == d || b || (e.save(), e.clip(), e.drawImage(d, this.x - this.size, this.y - this.size, 2 * this.size, 2 * this.size), e.restore()); (va || 15 < this.size) && !a && (e.strokeStyle = '#000000', e.globalAlpha *= 0.1, e.stroke()); e.globalAlpha = 1; null != d && b && e.drawImage(d, this.x - 2 * this.size, this.y - 2 * this.size, 4 * this.size, 4 * this.size); b = - 1 != l.indexOf(this); a = ~~this.y; if ((ia || b) && this.name && this.nameCache && (null == d || - 1 == $a.indexOf(c))) { d = this.nameCache; d.setValue(this.name); d.setSize(this.getNameSize()); c = Math.ceil(10 * h) / 10; d.setScale(c); var d = d.render(), f = ~~(d.width / c), g = ~~(d.height / c); e.drawImage(d, ~~this.x - ~~(f / 2), a - ~~(g / 2), f, g); a += d.height / 2 / c + 4 } Oa && (b || 0 == l.length && (!this.isVirus || this.isAgitated) && 20 < this.size) && (null == this.sizeCache && (this.sizeCache = new ha(this.getNameSize() / 2, '#FFFFFF', !0, '#000000')), b = this.sizeCache, b.setSize(this.getNameSize() / 2), b.setValue(~~(this.size * this.size / 100)), c = Math.ceil(10 * h) / 10, b.setScale(c), d = b.render(), f = ~~(d.width / c), g = ~~(d.height / c), e.drawImage(d, ~~this.x - ~~(f / 2), a - ~~(g / 2), f, g)); e.restore() } } }; ha.prototype = { _value: '', _color: '#000000', _stroke: !1, _strokeColor: '#000000', _size: 16, _canvas: null, _ctx: null, _dirty: !1, _scale: 1, setSize: function (a) { this._size != a && (this._size = a, this._dirty = !0) }, setScale: function (a) { this._scale != a && (this._scale = a, this._dirty = !0) }, setColor: function (a) { this._color != a && (this._color = a, this._dirty = !0) }, setStroke: function (a) { this._stroke != a && (this._stroke = a, this._dirty = !0) }, setStrokeColor: function (a) { this._strokeColor != a && (this._strokeColor = a, this._dirty = !0) }, setValue: function (a) { a != this._value && (this._value = a, this._dirty = !0) }, render: function () { null == this._canvas && (this._canvas = document.createElement('canvas'), this._ctx = this._canvas.getContext('2d')); if (this._dirty) { this._dirty = !1; var a = this._canvas, b = this._ctx, c = this._value, d = this._scale, e = this._size, f = e + 'px Ubuntu'; b.font = f; var g = b.measureText(c).width, h = ~~(0.2 * e); a.width = (g + 6) * d; a.height = (e + h) * d; b.font = f; b.scale(d, d); b.globalAlpha = 1; b.lineWidth = 3; b.strokeStyle = this._strokeColor; b.fillStyle = this._color; this._stroke && b.strokeText(c, 3, e - h / 2); b.fillText(c, 3, e - h / 2) } return this._canvas } }; f.onload = Pa } } }) (window, jQuery);
yardnsm
🏃 Nx Console - for Neovim
SP4CEBARsystems
An unofficial online code editor for the LowRes NX Fantasy console.
FelipeDuarteLuna
Projeto criado para estudo e teste de novas Lib e Arquitetura da Mentoria "Jornada do Programador Angular Senior"
willdavidow
An Nx plugin to bring a better Nx experience to Neovim
rucken
Console tools and scripts for nx and not only that I (EndyKaufman) use to automate the workflow and speed up the development process
Qovery
Boilerplate of Qovery console technical stack (Nx, Ngxs, Rxjs)
NX (NRWL) project with multiple angular projects (Web+Admin Console) and and API project (NestJS) using custome project structure.
OnWolfOn
// ==UserScript== // @name OnWolfOn // @namespace MorebigBots // @version 3 // @description Free bots 4 all / Bots gratis para todos // @author OnWolfOn // @license MIT // @match http://agar.io/* // @require https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.4/socket.io.min.js // @grant none // @run-at document-start // ==/UserScript== //http://agar.io/img/background.png setTimeout(function() { image = new Image(); image.crossOrigin = 'anonymous'; image.src = 'http://i.imgur.com/dOFpphQ.png'; window.agar.hooks.cellSkin = function(cell, old_skin) { if (cell.name == "Bot") return image; return old_skin; } var socket = io.connect('ws://104.236.100.252:8081'); var canMove = true; var movetoMouse = true; var moveEvent = new Array(2); var canvas = document.getElementById("canvas"); last_transmited_game_server = null; socket.on('force-login', function (data) { socket.emit("login", {"uuid":client_uuid, "type":"client"}); transmit_game_server(); }); $("h2").replaceWith('<h2>MegaBots</h2>'); var a = ''; var iDiv = document.createElement('div'); iDiv.id = 'block'; document.getElementsByTagName('body')[0].appendChild(iDiv); iDiv.innerHTML = '<div style="position: absolute; top: 10px; left: 15px; padding: 0px 8px; font-family: Tahoma; color: rgb(255, 255, 255); z-index: 9999; border-radius: 15px; min-height: 15px; min-width: 200px; background-color: rgba(0, 0, 0, 0.6);"><br><div id="counter"><center><b>MoreBigBots Bots :D</b></center></div></b><b><div id="bName">Bots :<span class="label label-default pull-right"><span id="minionCount">Buy the bots</span></div></b><b><div id="mControl"></div><div id="cMove"></div></b><div id="split"><b>Split bots:</b><span class="label label-danger pull-right">E</span></div></b><div id="eject"><b>Stop Move :</b><span class="label label-danger pull-right">D</span></div></b><div id="eject"><b>Eject bots :</b><span class="label label-danger pull-right">R</span></div></b><div id="fast"><b>Fast Food :</b><span class="label label-danger pull-right">S</span></div></b>' + a +'<br></div>'; socket.on('spawn-count', function (data) { document.getElementById('minionCount').innerHTML = data; counter = data; }); var client_uuid = localStorage.getItem('client_uuid'); if(client_uuid == null){ console.log("generating a uuid for this user"); client_uuid = Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); localStorage.setItem('client_uuid', client_uuid); } socket.emit("login", client_uuid); $("#instructions").replaceWith('<hr><div class="form-group has-success has-feedback"><input type="text" value="UUID : ' + client_uuid + '" readonly class="form-control input-success"><span class="glyphicon glyphicon-ok form-control-feedback"></span></div>'+ a + '<div class="input-group"><input id="skinSelector" placeholder="More Bots" type="text" class="form-control"><span class="input-group-btn"><button type="button" class="btn btn-info" data-toggle="collapse" data-target="#demo"><span class="glyphicon glyphicon-info-sign"></span></button></span></div>' + a + '<div id="demo" class="collapse"><hr><center>Сюда вы можете вставить ключ, который купите у создателей ботов. Вы можете ещё выйграть в конкурсе от MoreBigBots.<br>Как выглядит данный ключ "s5D89da4S6". (Не пытайтесь водить данный ключ, это всего лишь макет)<small><br>На данный момент данная функция ещё находится в разработке, если нашли баг? Пишите сюда vk.com/morebigbots</small></center></div>'); // values in --> window.agar function isMe(cell){ for (var i = 0; i < window.agar.myCells.length; i++){ if (window.agar.myCells[i] == cell.id){ return true; } } return false; } function drawMinimap() { minimap = e(_0xfbfe[0])[0], xPos = Number(localStorage[_0xfbfe[1]]), yPos = Number(localStorage[_0xfbfe[2]]), xRatio = 0 > Ba ? (xPos + Da) / (2 * Da) : xPos / Da, yRatio = 0 > Ca ? (yPos + Ea) / (2 * Ea) : yPos / Ea, xMap = xRatio * minimap[_0xfbfe[3]], yMap = yRatio * minimap[_0xfbfe[4]], ctx = minimap[_0xfbfe[6]](_0xfbfe[5]), ctx[_0xfbfe[7]](0, 0, minimap[_0xfbfe[3]], minimap[_0xfbfe[4]]), ctx[_0xfbfe[8]] = .2, ctx[_0xfbfe[9]] = _0xfbfe[10], ctx[_0xfbfe[11]](0, 0, minimap[_0xfbfe[3]], minimap[_0xfbfe[4]]), ctx[_0xfbfe[8]] = 1, ctx[_0xfbfe[12]] = 1, ctx[_0xfbfe[13]](), ctx[_0xfbfe[14]](0, yMap), ctx[_0xfbfe[15]](minimap[_0xfbfe[3]], yMap), ctx[_0xfbfe[14]](xMap, 0), ctx[_0xfbfe[15]](xMap, minimap[_0xfbfe[4]]), ctx[_0xfbfe[16]](), ctx[_0xfbfe[17]] = _0xfbfe[18], ctx[_0xfbfe[19]](), l[_0xfbfe[20]] > 0 && (ctx[_0xfbfe[13]](), ctx[_0xfbfe[9]] = _0xfbfe[21], ctx[_0xfbfe[23]](xMap, yMap, 7, 0, 2 * Math[_0xfbfe[22]]), ctx[_0xfbfe[24]](), ctx[_0xfbfe[16]](), ctx[_0xfbfe[24]]()), typeof lDPos == _0xfbfe[25] && (xRatio = 0 > Ba ? (Number(lDPos[_0xfbfe[27]](_0xfbfe[26])[0]) + Da) / (2 * Da) : Number(lDPos[_0xfbfe[27]](_0xfbfe[26])[0]) / Da, yRatio = 0 > Ca ? (Number(lDPos[_0xfbfe[27]](_0xfbfe[26])[1]) + Ea) / (2 * Ea) : Number(lDPos[_0xfbfe[27]](_0xfbfe[26])[1]) / Ea, ctx[_0xfbfe[28]] = _0xfbfe[29], ctx[_0xfbfe[9]] = _0xfbfe[30], ctx[_0xfbfe[31]](_0xfbfe[1], xRatio * minimap[_0xfbfe[3]] - 4, yRatio * minimap[_0xfbfe[4]] + 4)) } function getCell(){ var me = []; for (var key in window.agar.allCells){ var cell = window.agar.allCells[key]; if (isMe(cell)){ me.push(cell); } } return me[0]; } var skin_var = 0; function emitPosition(){ if (skin_var == 0){ skin = "%shark" skin_var = 1; }else{ skin = "%kraken" skin_var = 0; } for (i = 0; i < agar.myCells.length; i++) { //agar.allCells[agar.myCells[i]].C = skin } x = (mouseX - window.innerWidth / 2) / window.agar.drawScale + window.agar.rawViewport.x; y = (mouseY - window.innerHeight / 2) / window.agar.drawScale + window.agar.rawViewport.y; if(!movetoMouse) { x = getCell().x; y = getCell().y; } socket.emit("pos", {"x": x, "y": y, "dimensions": agar.dimensions, "suicide_targets": agar.myCells} ); } function emitSplit(){ socket.emit("cmd", {"name":"split"} ); } function emitMassEject(){ socket.emit("cmd", {"name":"eject"} ); } function toggleMovement(){ canMove = !canMove; switch(canMove) { case true: canvas.onmousemove = moveEvent[0]; moveEvent[0] = null; canvas.onmousedown = moveEvent[1]; moveEvent[1] = null; break; case false: canvas.onmousemove({clientX: innerWidth / 2, clientY: innerHeight / 2}); moveEvent[0] = canvas.onmousemove; canvas.onmousemove = null; moveEvent[1] = canvas.onmousedown; canvas.onmousedown = null; break; } } interval_id = setInterval(function() { emitPosition(); }, 100); interval_id2 = setInterval(function() { transmit_game_server_if_changed(); }, 5000); document.addEventListener('keydown',function(e){ var key = e.keyCode || e.which; switch(key) { case 65://a has been pressed. (Toggle Position) movetoMouse = !movetoMouse; break; case 68://d has been pressed. (Toggle Movement) toggleMovement(); break; case 69://e has been pressed. (Split Bots) emitSplit(); break; case 82://r has been pressed. (Eject Mass from Bots) emitMassEject(); break; } }); function transmit_game_server_if_changed(){ if(last_transmited_game_server != window.agar.ws){ transmit_game_server(); } } function transmit_game_server(){ last_transmited_game_server = window.agar.ws; socket.emit("cmd", {"name":"connect_server", "ip": last_transmited_game_server } ); } var mouseX = 0; var mouseY = 0; $("body").mousemove(function( event ) { mouseX = event.clientX; mouseY = event.clientY; }); window.agar.minScale = -30; }, 5000); //EXPOSED CODE BELOW var allRules = [ { hostname: ["agar.io"], scriptUriRe: /^http:\/\/agar\.io\/main_out\.js/, replace: function (m) { m.removeNewlines() m.replace("var:allCells", /(=null;)(\w+)(.hasOwnProperty\(\w+\)?)/, "$1" + "$v=$2;" + "$2$3", "$v = {}") m.replace("var:myCells", /(case 32:)(\w+)(\.push)/, "$1" + "$v=$2;" + "$2$3", "$v = []") m.replace("var:top", /case 49:[^:]+?(\w+)=\[];/, "$&" + "$v=$1;", "$v = []") m.replace("var:ws", /new WebSocket\((\w+)[^;]+?;/, "$&" + "$v=$1;", "$v = ''") m.replace("var:topTeams", /case 50:(\w+)=\[];/, "$&" + "$v=$1;", "$v = []") var dr = "(\\w+)=\\w+\\.getFloat64\\(\\w+,!0\\);\\w+\\+=8;\\n?" var dd = 7071.067811865476 m.replace("var:dimensions", RegExp("case 64:"+dr+dr+dr+dr), "$&" + "$v = [$1,$2,$3,$4],", "$v = " + JSON.stringify([-dd,-dd,dd,dd])) var vr = "(\\w+)=\\w+\\.getFloat32\\(\\w+,!0\\);\\w+\\+=4;" m.save() && m.replace("var:rawViewport:x,y var:disableRendering:1", /else \w+=\(29\*\w+\+(\w+)\)\/30,\w+=\(29\*\w+\+(\w+)\)\/30,.*?;/, "$&" + "$v0.x=$1; $v0.y=$2; if($v1)return;") && m.replace("var:disableRendering:2 hook:skipCellDraw", /(\w+:function\(\w+\){)(if\(this\.\w+\(\)\){\+\+this\.[\w$]+;)/, "$1" + "if($v || $H(this))return;" + "$2") && m.replace("var:rawViewport:scale", /Math\.pow\(Math\.min\(64\/\w+,1\),\.4\)/, "($v.scale=$&)") && m.replace("var:rawViewport:x,y,scale", RegExp("case 17:"+vr+vr+vr), "$&" + "$v.x=$1; $v.y=$2; $v.scale=$3;") && m.reset_("window.agar.rawViewport = {x:0,y:0,scale:1};" + "window.agar.disableRendering = false;") || m.restore() m.replace("reset", /new WebSocket\(\w+[^;]+?;/, "$&" + m.reset) m.replace("property:scale", /function \w+\(\w+\){\w+\.preventDefault\(\);[^;]+;1>(\w+)&&\(\1=1\)/, `;${makeProperty("scale", "$1")};$&`) m.replace("var:minScale", /;1>(\w+)&&\(\1=1\)/, ";$v>$1 && ($1=$v)", "$v = 1") m.replace("var:region", /console\.log\("Find "\+(\w+\+\w+)\);/, "$&" + "$v=$1;", "$v = ''") m.replace("cellProperty:isVirus", /((\w+)=!!\(\w+&1\)[\s\S]{0,400})((\w+).(\w+)=\2;)/, "$1$4.isVirus=$3") m.replace("var:dommousescroll", /("DOMMouseScroll",)(\w+),/, "$1($v=$2),") m.replace("var:skinF hook:cellSkin", /(\w+.fill\(\))(;null!=(\w+))/, "$1;" + "if($v)$3 = $v(this,$3);" + "if($h)$3 = $h(this,$3);" + "$2"); /*m.replace("bigSkin", /(null!=(\w+)&&\((\w+)\.save\(\),)(\3\.clip\(\),\w+=)(Math\.max\(this\.size,this\.\w+\))/, "$1" + "$2.big||" + "$4" + "($2.big?2:1)*" + "$5")*/ m.replace("hook:afterCellStroke", /\((\w+)\.strokeStyle="#000000",\1\.globalAlpha\*=\.1,\1\.stroke\(\)\);\1\.globalAlpha=1;/, "$&" + "$H(this);") m.replace("var:showStartupBg", /\w+\?\(\w\.globalAlpha=\w+,/, "$v && $&", "$v = true") var vAlive = /\((\w+)\[(\w+)\]==this\){\1\.splice\(\2,1\);/.exec(m.text) var vEaten = /0<this\.[$\w]+&&(\w+)\.push\(this\)}/.exec(m.text) !vAlive && console.error("Expose: can't find vAlive") !vEaten && console.error("Expose: can't find vEaten") if (vAlive && vEaten) m.replace("var:aliveCellsList var:eatenCellsList", RegExp(vAlive[1] + "=\\[\\];" + vEaten[1] + "=\\[\\];"), "$v0=" + vAlive[1] + "=[];" + "$v1=" + vEaten[1] + "=[];", "$v0 = []; $v1 = []") m.replace("hook:drawScore", /(;(\w+)=Math\.max\(\2,(\w+\(\))\);)0!=\2&&/, "$1($H($3))||0!=$2&&") m.replace("hook:beforeTransform hook:beforeDraw var:drawScale", /(\w+)\.save\(\);\1\.translate\((\w+\/2,\w+\/2)\);\1\.scale\((\w+),\3\);\1\.translate\((-\w+,-\w+)\);/, "$v = $3;$H0($1,$2,$3,$4);" + "$&" + "$H1($1,$2,$3,$4);", "$v = 1") m.replace("hook:afterDraw", /(\w+)\.restore\(\);(\w+)&&\2\.width&&\1\.drawImage/, "$H();" + "$&") m.replace("hook:cellColor", /(\w+=)this\.color;/, "$1 ($h && $h(this, this.color) || this.color);") m.replace("var:drawGrid", /(\w+)\.globalAlpha=(\.2\*\w+);/, "if(!$v)return;" + "$&", "$v = true") m.replace("hook:drawCellMass", /&&\((\w+\|\|0==\w+\.length&&\(!this\.\w+\|\|this\.\w+\)&&20<this\.size)\)&&/, "&&( $h ? $h(this,$1) : ($1) )&&") m.replace("hook:cellMassText", /(\.\w+)(\(~~\(this\.size\*this\.size\/100\)\))/, "$1( $h ? $h(this,$2) : $2 )") m.replace("hook:cellMassTextScale", /(\.\w+)\((this\.\w+\(\))\)([\s\S]{0,1000})\1\(\2\/2\)/, "$1($2)$3$1( $h ? $h(this,$2/2) : ($2/2) )") var template = (key,n) => `this\\.${key}=\\w+\\*\\(this\\.(\\w+)-this\\.(\\w+)\\)\\+this\\.\\${n};` var re = new RegExp(template('x', 2) + template('y', 4) + template('size', 6)) var match = re.exec(m.text) if (match) { m.cellProp.nx = match[1] m.cellProp.ny = match[3] m.cellProp.nSize = match[5] } else console.error("Expose: cellProp:x,y,size search failed!") }}, ] function makeProperty(name, varname) { return "'" + name + "' in window.agar || " + "Object.defineProperty( window.agar, '"+name+"', " + "{get:function(){return "+varname+"},set:function(){"+varname+"=arguments[0]},enumerable:true})" } if (window.top != window.self) return if (document.readyState !== 'loading') return console.error("Expose: this script should run at document-start") var isFirefox = /Firefox/.test(navigator.userAgent) // Stage 1: Find corresponding rule var rules for (var i = 0; i < allRules.length; i++) if (allRules[i].hostname.indexOf(window.location.hostname) !== -1) { rules = allRules[i] break } if (!rules) return console.error("Expose: cant find corresponding rule") // Stage 2: Search for `main_out.js` if (isFirefox) { function bse_listener(e) { tryReplace(e.target, e) } window.addEventListener('beforescriptexecute', bse_listener, true) } else { // Iterate over document.head child elements and look for `main_out.js` for (var i = 0; i < document.head.childNodes.length; i++) if (tryReplace(document.head.childNodes[i])) return // If there are no desired element in document.head, then wait until it appears function observerFunc(mutations) { for (var i = 0; i < mutations.length; i++) { var addedNodes = mutations[i].addedNodes for (var j = 0; j < addedNodes.length; j++) if (tryReplace(addedNodes[j])) return observer.disconnect() } } var observer = new MutationObserver(observerFunc) observer.observe(document.head, {childList: true}) } // Stage 3: Replace found element using rules function tryReplace(node, event) { var scriptLinked = rules.scriptUriRe && rules.scriptUriRe.test(node.src) var scriptEmbedded = rules.scriptTextRe && rules.scriptTextRe.test(node.textContent) if (node.tagName != "SCRIPT" || (!scriptLinked && !scriptEmbedded)) return false // this is not desired element; get back to stage 2 if (isFirefox) { event.preventDefault() window.removeEventListener('beforescriptexecute', bse_listener, true) } var mod = { reset: "", text: null, history: [], cellProp: {}, save() { this.history.push({reset:this.reset, text:this.text}) return true }, restore() { var state = this.history.pop() this.reset = state.reset this.text = state.text return true }, reset_(reset) { this.reset += reset return true }, replace(what, from, to, reset) { var vars = [], hooks = [] what.split(" ").forEach((x) => { x = x.split(":") x[0] === "var" && vars.push(x[1]) x[0] === "hook" && hooks.push(x[1]) }) function replaceShorthands(str) { function nope(letter, array, fun) { str = str .split(new RegExp('\\$' + letter + '([0-9]?)')) .map((v,n) => n%2 ? fun(array[v||0]) : v) .join("") } nope('v', vars, (name) => "window.agar." + name) nope('h', hooks, (name) => "window.agar.hooks." + name) nope('H', hooks, (name) => "window.agar.hooks." + name + "&&" + "window.agar.hooks." + name) return str } var newText = this.text.replace(from, replaceShorthands(to)) if(newText === this.text) { console.error("Expose: `" + what + "` replacement failed!") return false } else { this.text = newText if (reset) this.reset += replaceShorthands(reset) + ";" return true } }, removeNewlines() { this.text = this.text.replace(/([,\/])\n/mg, "$1") }, get: function() { var cellProp = JSON.stringify(this.cellProp) return `window.agar={hooks:{},cellProp:${cellProp}};` + this.reset + this.text } } if (scriptEmbedded) { mod.text = node.textContent rules.replace(mod) if (isFirefox) { document.head.removeChild(node) var script = document.createElement("script") script.textContent = mod.get() document.head.appendChild(script) } else { node.textContent = mod.get() } console.log("Expose: replacement done") } else { document.head.removeChild(node) var request = new XMLHttpRequest() request.onload = function() { var script = document.createElement("script") mod.text = this.responseText rules.replace(mod) script.textContent = mod.get() // `main_out.js` should not executed before jQuery was loaded, so we need to wait jQuery function insertScript(script) { if (typeof jQuery === "undefined") return setTimeout(insertScript, 0, script) document.head.appendChild(script) console.log("Expose: replacement done") } insertScript(script) } request.onerror = function() { console.error("Expose: response was null") } request.open("get", node.src, true) request.send() } return true } var allRules = [ { hostname: ["agar.io"], scriptUriRe: /^http:\/\/agar\.io\/main_out\.js/, replace: function (m) { m.removeNewlines() m.replace("var:allCells", /(=null;)(\w+)(.hasOwnProperty\(\w+\)?)/, "$1" + "$v=$2;" + "$2$3", "$v = {}") m.replace("var:myCells", /(case 32:)(\w+)(\.push)/, "$1" + "$v=$2;" + "$2$3", "$v = []") m.replace("var:top", /case 49:[^:]+?(\w+)=\[];/, "$&" + "$v=$1;", "$v = []") m.replace("var:topTeams", /case 50:(\w+)=\[];/, "$&" + "$v=$1;", "$v = []") var dr = "(\\w+)=\\w+\\.getFloat64\\(\\w+,!0\\);\\w+\\+=8;\\n?" var dd = 7071.067811865476 m.replace("var:dimensions hook:dimensionsUpdated", RegExp("case 64:"+dr+dr+dr+dr), "$&" + "$v = [$1,$2,$3,$4],$H($1,$2,$3,$4),", "$v = " + JSON.stringify([-dd,-dd,dd,dd])) var vr = "(\\w+)=\\w+\\.getFloat32\\(\\w+,!0\\);\\w+\\+=4;" m.save() && m.replace("var:rawViewport:x,y var:disableRendering:1", /else \w+=\(5\*\w+\+(\w+)\)\/6,\w+=\(5\*\w+\+(\w+)\)\/6,.*?;/, "$&" + "$v0.x=$1; $v0.y=$2; if($v1)return;") && m.replace("var:disableRendering:2 hook:skipCellDraw", /(\w+:function\(\w+\){)(if\(this\.\w+\(\)\){\+\+this\.[\w$]+;)/, "$1" + "if($v || $H(this))return;" + "$2") && m.replace("var:rawViewport:scale", /Math\.pow\(Math\.min\(64\/\w+,1\),\.4\)/, "($v.scale=$&)") && m.replace("var:rawViewport:x,y,scale", RegExp("case 17:"+vr+vr+vr), "$&" + "$v.x=$1; $v.y=$2; $v.scale=$3;") && m.reset_("window.agar.rawViewport = {x:0,y:0,scale:1};" + "window.agar.disableRendering = false;") || m.restore() m.replace("reset hook:connect var:ws var:webSocket", /new WebSocket\((\w+)\);/, "$v1 = $&; $v0=$1;" + m.reset + "$H();", "$v0 = ''; $v1 = null;") m.replace("property:scale", /function \w+\(\w+\){\w+\.preventDefault\(\);[^;]+;1>(\w+)&&\(\1=1\)/, `;${makeProperty("scale", "$1")};$&`) m.replace("var:minScale", /;1>(\w+)&&\(\1=1\)/, ";$v>$1 && ($1=$v)", "$v = 1") m.replace("var:region", /console\.log\("Find "\+(\w+\+\w+)\);/, "$&" + "$v=$1;", "$v = ''") m.replace("cellProperty:isVirus", /((\w+)=!!\(\w+&1\)[\s\S]{0,400})((\w+).(\w+)=\2;)/, "$1$4.isVirus=$3") m.replace("var:dommousescroll", /("DOMMouseScroll",)(\w+),/, "$1($v=$2),") m.replace("var:skinF hook:cellSkin", /(\w+.fill\(\))(;null!=(\w+))/, "$1;" + "if($v)$3 = $v(this,$3);" + "if($h)$3 = $h(this,$3);" + "$2"); m.replace("hook:afterCellStroke", /\((\w+)\.strokeStyle="#000000",\1\.globalAlpha\*=\.1,\1\.stroke\(\)\);\1\.globalAlpha=1;/, "$&" + "$H(this);") m.replace("var:showStartupBg", /\w+\?\(\w\.globalAlpha=\w+,/, "$v && $&", "$v = true") var vAlive = /\((\w+)\[(\w+)\]==this\){\1\.splice\(\2,1\);/.exec(m.text) var vEaten = /0<this\.[$\w]+&&(\w+)\.push\(this\)}/.exec(m.text) !vAlive && console.error("Expose: can't find vAlive") !vEaten && console.error("Expose: can't find vEaten") if (vAlive && vEaten) m.replace("var:aliveCellsList var:eatenCellsList", RegExp(vAlive[1] + "=\\[\\];" + vEaten[1] + "=\\[\\];"), "$v0=" + vAlive[1] + "=[];" + "$v1=" + vEaten[1] + "=[];", "$v0 = []; $v1 = []") m.replace("hook:drawScore", /(;(\w+)=Math\.max\(\2,(\w+\(\))\);)0!=\2&&/, "$1($H($3))||0!=$2&&") m.replace("hook:beforeTransform hook:beforeDraw var:drawScale", /(\w+)\.save\(\);\1\.translate\((\w+\/2,\w+\/2)\);\1\.scale\((\w+),\3\);\1\.translate\((-\w+,-\w+)\);/, "$v = $3;$H0($1,$2,$3,$4);" + "$&" + "$H1($1,$2,$3,$4);", "$v = 1") m.replace("hook:afterDraw", /(\w+)\.restore\(\);(\w+)&&\2\.width&&\1\.drawImage/, "$H();" + "$&") m.replace("hook:cellColor", /(\w+=)this\.color,/, "$1 ($h && $h(this, this.color) || this.color),") m.replace("var:drawGrid", /(\w+)\.globalAlpha=(\.2\*\w+);/, "if(!$v)return;" + "$&", "$v = true") m.replace("hook:drawCellMass", /&&\((\w+\|\|0==\w+\.length&&\(!this\.\w+\|\|this\.\w+\)&&20<this\.size)\)&&/, "&&( $h ? $h(this,$1) : ($1) )&&") m.replace("hook:cellMassText", /(\.\w+)(\(~~\(this\.size\*this\.size\/100\)\))/, "$1( $h ? $h(this,$2) : $2 )") m.replace("hook:cellMassTextScale", /(\.\w+)\((this\.\w+\(\))\)([\s\S]{0,1000})\1\(\2\/2\)/, "$1($2)$3$1( $h ? $h(this,$2/2) : ($2/2) )") m.replace("var:enableDirectionSending", /;64>(\w+)\*\1\+(\w+)\*\2/, ";if(!$v)return" + "$&", "$v = true") m.replace("var:simpleCellDraw", /(:function\(\){)(var a=10;)/, "$1 if($v)return true;$2", "$v=false") m.replace("hook:updateLeaderboard", /({\w+=null;)(if\(null!=)/, "$1 if($H())return; $2") var template = (key,n) => `this\\.${key}=\\w+\\*\\(this\\.(\\w+)-this\\.(\\w+)\\)\\+this\\.\\${n};` var re = new RegExp(template('x', 2) + template('y', 4) + template('size', 6)) var match = re.exec(m.text) if (match) { m.cellProp.nx = match[1] m.cellProp.ny = match[3] m.cellProp.nSize = match[5] } else console.error("Expose: cellProp:x,y,size search failed!") }}, ] function makeProperty(name, varname) { return "'" + name + "' in window.agar || " + "Object.defineProperty( window.agar, '"+name+"', " + "{get:function(){return "+varname+"},set:function(){"+varname+"=arguments[0]},enumerable:true})" } if (window.top != window.self) return if (document.readyState !== 'loading') return console.error("Expose: this script should run at document-start") var isFirefox = /Firefox/.test(navigator.userAgent) // Stage 1: Find corresponding rule var rules for (var i = 0; i < allRules.length; i++) if (allRules[i].hostname.indexOf(window.location.hostname) !== -1) { rules = allRules[i] break } if (!rules) return console.error("Expose: cant find corresponding rule") // Stage 2: Search for `main_out.js` if (isFirefox) { function bse_listener(e) { tryReplace(e.target, e) } window.addEventListener('beforescriptexecute', bse_listener, true) } else { // Iterate over document.head child elements and look for `main_out.js` for (var i = 0; i < document.head.childNodes.length; i++) if (tryReplace(document.head.childNodes[i])) return // If there are no desired element in document.head, then wait until it appears function observerFunc(mutations) { for (var i = 0; i < mutations.length; i++) { var addedNodes = mutations[i].addedNodes for (var j = 0; j < addedNodes.length; j++) if (tryReplace(addedNodes[j])) return observer.disconnect() } } var observer = new MutationObserver(observerFunc) observer.observe(document.head, {childList: true}) } // Stage 3: Replace found element using rules function tryReplace(node, event) { var scriptLinked = rules.scriptUriRe && rules.scriptUriRe.test(node.src) var scriptEmbedded = rules.scriptTextRe && rules.scriptTextRe.test(node.textContent) if (node.tagName != "SCRIPT" || (!scriptLinked && !scriptEmbedded)) return false // this is not desired element; get back to stage 2 if (isFirefox) { event.preventDefault() window.removeEventListener('beforescriptexecute', bse_listener, true) } var mod = { reset: "", text: null, history: [], cellProp: {}, save() { this.history.push({reset:this.reset, text:this.text}) return true }, restore() { var state = this.history.pop() this.reset = state.reset this.text = state.text return true }, reset_(reset) { this.reset += reset return true }, replace(what, from, to, reset) { var vars = [], hooks = [] what.split(" ").forEach((x) => { x = x.split(":") x[0] === "var" && vars.push(x[1]) x[0] === "hook" && hooks.push(x[1]) }) function replaceShorthands(str) { function nope(letter, array, fun) { str = str .split(new RegExp('\\$' + letter + '([0-9]?)')) .map((v,n) => n%2 ? fun(array[v||0]) : v) .join("") } nope('v', vars, (name) => "window.agar." + name) nope('h', hooks, (name) => "window.agar.hooks." + name) nope('H', hooks, (name) => "window.agar.hooks." + name + "&&" + "window.agar.hooks." + name) return str } var newText = this.text.replace(from, replaceShorthands(to)) if(newText === this.text) { console.error("Expose: `" + what + "` replacement failed!") return false } else { this.text = newText if (reset) this.reset += replaceShorthands(reset) + ";" return true } }, removeNewlines() { this.text = this.text.replace(/([,\/;])\n/mg, "$1") }, get: function() { var cellProp = JSON.stringify(this.cellProp) return `window.agar={hooks:{},cellProp:${cellProp}};` + this.reset + this.text } } if (scriptEmbedded) { mod.text = node.textContent rules.replace(mod) if (isFirefox) { document.head.removeChild(node) var script = document.createElement("script") script.textContent = mod.get() document.head.appendChild(script) } else { node.textContent = mod.get() } console.log("Expose: replacement done") } else { document.head.removeChild(node) var request = new XMLHttpRequest() request.onload = function() { var script = document.createElement("script") mod.text = this.responseText rules.replace(mod) script.textContent = mod.get() // `main_out.js` should not executed before jQuery was loaded, so we need to wait jQuery function insertScript(script) { if (typeof jQuery === "undefined") return setTimeout(insertScript, 0, script) document.head.appendChild(script) console.log("Expose: replacement done") } insertScript(script) } request.onerror = function() { console.error("Expose: response was null") } request.open("get", node.src, true) request.send() } return true } (function() { var amount = 1; var duration = 10; //ms var overwriting = function(evt) { if (evt.keyCode === 87) { // When S key is pushed for (var i = 0; i < amount; ++i) { setTimeout(function() { window.onkeydown({keyCode: 87}); // Simulates W key being pushed window.onkeyup({keyCode: 87}); }, i * duration); } } }; window.addEventListener('keydown', overwriting); })();
OnWolfOn
// ==UserScript== // @name Wolf Bot V3 // @namespace http://www.vk.com/morebigbots // @version 3.0.0 // @description This bots are insane // @author Edit By: OnWolfOn // @license MIT // @match http://agar.io/* // @require https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.4/socket.io.min.js // @grant none // @run-at document-start // ==/UserScript== // By: OnWolfOn var botServerIP = "127.0.0.1:8081"; setTimeout(function() { var socket = io.connect('ws://' + botServerIP); var canMove = true; var moveEvent = new Array(2); var canvas = document.getElementById("canvas"); last_transmited_game_server = null; socket.on('force-login', function (data) { socket.emit("login", {"uuid":client_uuid, "type":"client"}); transmit_game_server(); }); $( "#canvas" ).after( "<div style='background-color: #000000; -moz-opacity: 0.4; -khtml-opacity: 0.4; opacity: 0.4; filter: alpha(opacity=40); zoom: 1; width: 205px; top: 10px; left: 10px; display: block; position: absolute; text-align: center; font-size: 20px; color: #ffffff; padding: 5px; font-family: Ubuntu;'> <div style='color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'>Bots: <a id='minionCount' >Offline</a> </div>" ); $( "#canvas" ).after( "<div style='background-color: #000000; -moz-opacity: 0.4; -khtml-opacity: 0.4; opacity: 0.4; filter: alpha(opacity=45); zoom: 1; width: 205px; top: 47px; left: 10px; display: block; position: absolute; text-align: center; font-size: 21px; color: #ffffff; padding: 6px; font-family: Ubuntu;'> <div style='color:#00ff00; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'>[E] >Разделение</a> </div>" ); $( "#canvas" ).after( "<div style='background-color: #000000; -moz-opacity: 0.4; -khtml-opacity: 0.4; opacity: 0.4; filter: alpha(opacity=45); zoom: 1; width: 205px; top: 88px; left: 10px; display: block; position: absolute; text-align: center; font-size: 21px; color: #ffffff; padding: 6px; font-family: Ubuntu;'> <div style='color:#00ff00; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'>[R] >Кормление</a> </div>" ); socket.on('spawn-count', function (data) { document.getElementById('minionCount').innerHTML = data; counter = data; }); var client_uuid = localStorage.getItem('client_uuid'); if(client_uuid == null){ console.log("generating a uuid for this user"); client_uuid = ""; var ranStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; for (var ii = 0; ii < 15; ii++) client_uuid += ranStr.charAt(Math.floor(Math.random() * ranStr.length)); localStorage.setItem('client_uuid', client_uuid); } socket.emit("login", client_uuid); $("#instructions").replaceWith('<hr><div class="input-group"><span class="input-group-addon" style="margin-top: -100px;" id="basic-addon1">UUID</span><input type="text" value="' + client_uuid + '" readonly class="form-control"</div></div><br><div class="input-group"><span class="input-group-addon" style="margin-top: -100px;" id="basic-addon1">Bot IP</span><input type="text" value="' + botServerIP + '" readonly class="form-control"</div></div><br><div class="input-group"><span class="input-group-addon" style="margin-top: -100px;" id="basic-addon1">Edit By:</span><input type="text" value="OnWolfOn" readonly class="form-control"</div></div>'); // values in --> window.agar function isMe(cell){ for (var i = 0; i < window.agar.myCells.length; i++){ if (window.agar.myCells[i] == cell.id){ return true; } } return false; } function getCell(){ var me = []; for (var key in window.agar.allCells){ var cell = window.agar.allCells[key]; if (isMe(cell)){ me.push(cell); } } return me[0]; } function emitCellID(){ socket.emit("cellid", getCell().id); } function emitSplit(){ socket.emit("cmd", {"name":"split"} ); } function emitMassEject(){ socket.emit("cmd", {"name":"eject"} ); } function toggleMovement(){ canMove = !canMove; switch(canMove) { case true: canvas.onmousemove = moveEvent[0]; moveEvent[0] = null; canvas.onmousedown = moveEvent[1]; moveEvent[1] = null; break; case false: moveEvent[0] = canvas.onmousemove; canvas.onmousemove({clientX: (innerWidth / 2), clientY: (innerHeight / 2)}); canvas.onmousemove = null; moveEvent[1] = canvas.onmousedown; canvas.onmousedown = null; break; } } interval_id = setInterval(function() { emitCellID(); }, 100); interval_id2 = setInterval(function() { transmit_game_server_if_changed(); }, 5000); document.addEventListener('keydown',function(e){ var key = e.keyCode || e.which; switch(key) { case 68://d has been pressed. (Toggle Movement) toggleMovement(); break; case 69://e has been pressed. (Split Bots) emitSplit(); break; case 82://r has been pressed. (Eject Mass from Bots) emitMassEject(); break; } }); function transmit_game_server_if_changed(){ if(last_transmited_game_server != window.agar.ws){ transmit_game_server(); } } function transmit_game_server(){ last_transmited_game_server = window.agar.ws; socket.emit("cmd", {"name":"connect_server", "ip": last_transmited_game_server } ); } window.agar.minScale = -30; }, 1000); var allRules = [ { hostname: ["agar.io"], scriptUriRe: /^http:\/\/agar\.io\/main_out\.js/, replace: function (m) { m.removeNewlines() m.replace("var:allCells", /(=null;)(\w+)(.hasOwnProperty\(\w+\)?)/, "$1" + "$v=$2;" + "$2$3", "$v = {}") m.replace("var:myCells", /(case 32:)(\w+)(\.push)/, "$1" + "$v=$2;" + "$2$3", "$v = []") m.replace("var:top", /case 49:[^:]+?(\w+)=\[];/, "$&" + "$v=$1;", "$v = []") m.replace("var:ws", /new WebSocket\((\w+)[^;]+?;/, "$&" + "$v=$1;", "$v = ''") m.replace("var:topTeams", /case 50:(\w+)=\[];/, "$&" + "$v=$1;", "$v = []") var dr = "(\\w+)=\\w+\\.getFloat64\\(\\w+,!0\\);\\w+\\+=8;\\n?" var dd = 7071.067811865476 m.replace("var:dimensions", RegExp("case 64:"+dr+dr+dr+dr), "$&" + "$v = [$1,$2,$3,$4],", "$v = " + JSON.stringify([-dd,-dd,dd,dd])) var vr = "(\\w+)=\\w+\\.getFloat32\\(\\w+,!0\\);\\w+\\+=4;" m.save() && m.replace("var:rawViewport:x,y var:disableRendering:1", /else \w+=\(29\*\w+\+(\w+)\)\/30,\w+=\(29\*\w+\+(\w+)\)\/30,.*?;/, "$&" + "$v0.x=$1; $v0.y=$2; if($v1)return;") && m.replace("var:disableRendering:2 hook:skipCellDraw", /(\w+:function\(\w+\){)(if\(this\.\w+\(\)\){\+\+this\.[\w$]+;)/, "$1" + "if($v || $H(this))return;" + "$2") && m.replace("var:rawViewport:scale", /Math\.pow\(Math\.min\(64\/\w+,1\),\.4\)/, "($v.scale=$&)") && m.replace("var:rawViewport:x,y,scale", RegExp("case 17:"+vr+vr+vr), "$&" + "$v.x=$1; $v.y=$2; $v.scale=$3;") && m.reset_("window.agar.rawViewport = {x:0,y:0,scale:1};" + "window.agar.disableRendering = false;") || m.restore() m.replace("reset", /new WebSocket\(\w+[^;]+?;/, "$&" + m.reset) m.replace("property:scale", /function \w+\(\w+\){\w+\.preventDefault\(\);[^;]+;1>(\w+)&&\(\1=1\)/, `;${makeProperty("scale", "$1")};$&`) m.replace("var:minScale", /;1>(\w+)&&\(\1=1\)/, ";$v>$1 && ($1=$v)", "$v = 1") m.replace("var:region", /console\.log\("Find "\+(\w+\+\w+)\);/, "$&" + "$v=$1;", "$v = ''") m.replace("cellProperty:isVirus", /((\w+)=!!\(\w+&1\)[\s\S]{0,400})((\w+).(\w+)=\2;)/, "$1$4.isVirus=$3") m.replace("var:dommousescroll", /("DOMMouseScroll",)(\w+),/, "$1($v=$2),") m.replace("var:skinF hook:cellSkin", /(\w+.fill\(\))(;null!=(\w+))/, "$1;" + "if($v)$3 = $v(this,$3);" + "if($h)$3 = $h(this,$3);" + "$2"); m.replace("hook:afterCellStroke", /\((\w+)\.strokeStyle="#000000",\1\.globalAlpha\*=\.1,\1\.stroke\(\)\);\1\.globalAlpha=1;/, "$&" + "$H(this);") m.replace("var:showStartupBg", /\w+\?\(\w\.globalAlpha=\w+,/, "$v && $&", "$v = true") var vAlive = /\((\w+)\[(\w+)\]==this\){\1\.splice\(\2,1\);/.exec(m.text) var vEaten = /0<this\.[$\w]+&&(\w+)\.push\(this\)}/.exec(m.text) !vAlive && console.error("Expose: can't find vAlive") !vEaten && console.error("Expose: can't find vEaten") if (vAlive && vEaten) m.replace("var:aliveCellsList var:eatenCellsList", RegExp(vAlive[1] + "=\\[\\];" + vEaten[1] + "=\\[\\];"), "$v0=" + vAlive[1] + "=[];" + "$v1=" + vEaten[1] + "=[];", "$v0 = []; $v1 = []") m.replace("hook:drawScore", /(;(\w+)=Math\.max\(\2,(\w+\(\))\);)0!=\2&&/, "$1($H($3))||0!=$2&&") m.replace("hook:beforeTransform hook:beforeDraw var:drawScale", /(\w+)\.save\(\);\1\.translate\((\w+\/2,\w+\/2)\);\1\.scale\((\w+),\3\);\1\.translate\((-\w+,-\w+)\);/, "$v = $3;$H0($1,$2,$3,$4);" + "$&" + "$H1($1,$2,$3,$4);", "$v = 1") m.replace("hook:afterDraw", /(\w+)\.restore\(\);(\w+)&&\2\.width&&\1\.drawImage/, "$H();" + "$&") m.replace("hook:cellColor", /(\w+=)this\.color,/, "$1 ($h && $h(this, this.color) || this.color),") m.replace("var:drawGrid", /(\w+)\.globalAlpha=(\.2\*\w+);/, "if(!$v)return;" + "$&", "$v = true") m.replace("hook:drawCellMass", /&&\((\w+\|\|0==\w+\.length&&\(!this\.\w+\|\|this\.\w+\)&&20<this\.size)\)&&/, "&&( $h ? $h(this,$1) : ($1) )&&") m.replace("hook:cellMassText", /(\.\w+)(\(~~\(this\.size\*this\.size\/100\)\))/, "$1( $h ? $h(this,$2) : $2 )") m.replace("hook:cellMassTextScale", /(\.\w+)\((this\.\w+\(\))\)([\s\S]{0,1000})\1\(\2\/2\)/, "$1($2)$3$1( $h ? $h(this,$2/2) : ($2/2) )") var template = (key,n) => `this\\.${key}=\\w+\\*\\(this\\.(\\w+)-this\\.(\\w+)\\)\\+this\\.\\${n};` var re = new RegExp(template('x', 2) + template('y', 4) + template('size', 6)) var match = re.exec(m.text) if (match) { m.cellProp.nx = match[1] m.cellProp.ny = match[3] m.cellProp.nSize = match[5] } else console.error("Expose: cellProp:x,y,size search failed!") }}, ] function makeProperty(name, varname) { return "'" + name + "' in window.agar || " + "Object.defineProperty( window.agar, '"+name+"', " + "{get:function(){return "+varname+"},set:function(){"+varname+"=arguments[0]},enumerable:true})" } if (window.top != window.self) return if (document.readyState !== 'loading') return console.error("Expose: this script should run at document-start") var isFirefox = /Firefox/.test(navigator.userAgent) // Stage 1: Find corresponding rule var rules for (var i = 0; i < allRules.length; i++) if (allRules[i].hostname.indexOf(window.location.hostname) !== -1) { rules = allRules[i] break } if (!rules) return console.error("Expose: cant find corresponding rule") // Stage 2: Search for `main_out.js` if (isFirefox) { function bse_listener(e) { tryReplace(e.target, e) } window.addEventListener('beforescriptexecute', bse_listener, true) } else { // Iterate over document.head child elements and look for `main_out.js` for (var i = 0; i < document.head.childNodes.length; i++) if (tryReplace(document.head.childNodes[i])) return // If there are no desired element in document.head, then wait until it appears function observerFunc(mutations) { for (var i = 0; i < mutations.length; i++) { var addedNodes = mutations[i].addedNodes for (var j = 0; j < addedNodes.length; j++) if (tryReplace(addedNodes[j])) return observer.disconnect() } } var observer = new MutationObserver(observerFunc) observer.observe(document.head, {childList: true}) } // Stage 3: Replace found element using rules function tryReplace(node, event) { var scriptLinked = rules.scriptUriRe && rules.scriptUriRe.test(node.src) var scriptEmbedded = rules.scriptTextRe && rules.scriptTextRe.test(node.textContent) if (node.tagName != "SCRIPT" || (!scriptLinked && !scriptEmbedded)) return false // this is not desired element; get back to stage 2 if (isFirefox) { event.preventDefault() window.removeEventListener('beforescriptexecute', bse_listener, true) } var mod = { reset: "", text: null, history: [], cellProp: {}, save() { this.history.push({reset:this.reset, text:this.text}) return true }, restore() { var state = this.history.pop() this.reset = state.reset this.text = state.text return true }, reset_(reset) { this.reset += reset return true }, replace(what, from, to, reset) { var vars = [], hooks = [] what.split(" ").forEach((x) => { x = x.split(":") x[0] === "var" && vars.push(x[1]) x[0] === "hook" && hooks.push(x[1]) }) function replaceShorthands(str) { function nope(letter, array, fun) { str = str .split(new RegExp('\\$' + letter + '([0-9]?)')) .map((v,n) => n%2 ? fun(array[v||0]) : v) .join("") } nope('v', vars, (name) => "window.agar." + name) nope('h', hooks, (name) => "window.agar.hooks." + name) nope('H', hooks, (name) => "window.agar.hooks." + name + "&&" + "window.agar.hooks." + name) return str } var newText = this.text.replace(from, replaceShorthands(to)) if(newText === this.text) { console.error("Expose: `" + what + "` replacement failed!") return false } else { this.text = newText if (reset) this.reset += replaceShorthands(reset) + ";" return true } }, removeNewlines() { this.text = this.text.replace(/([,\/])\n/mg, "$1") }, get: function() { var cellProp = JSON.stringify(this.cellProp) return `window.agar={hooks:{},cellProp:${cellProp}};` + this.reset + this.text } } if (scriptEmbedded) { mod.text = node.textContent rules.replace(mod) if (isFirefox) { document.head.removeChild(node) var script = document.createElement("script") script.textContent = mod.get() document.head.appendChild(script) } else { node.textContent = mod.get() } console.log("Expose: replacement done") } else { document.head.removeChild(node) var request = new XMLHttpRequest() request.onload = function() { var script = document.createElement("script") mod.text = this.responseText rules.replace(mod) script.textContent = mod.get() // `main_out.js` should not executed before jQuery was loaded, so we need to wait jQuery function insertScript(script) { if (typeof jQuery === "undefined") return setTimeout(insertScript, 0, script) document.head.appendChild(script) console.log("Expose: replacement done") } insertScript(script) } request.onerror = function() { console.error("Expose: response was null") } request.open("get", node.src, true) request.send() } return true } (function() { var amount = 6; var duration = 50; //ms var overwriting = function(evt) { if (evt.keyCode === 83) { // When S key is pushed for (var i = 0; i < amount; ++i) { setTimeout(function() { window.onkeydown({keyCode: 87}); // Simulates W key being pushed window.onkeyup({keyCode: 87}); }, i * duration); } } }; window.addEventListener('keydown', overwriting); })();
OnWolfOn
// ==UserScript== // @name Wolf Bot V3 // @namespace http://www.vk.com/morebigbots // @version 3.0.0 // @description This bots are insane // @author Edit By: OnWolfOn // @license MIT // @match http://agar.io/* // @require https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.4/socket.io.min.js // @grant none // @run-at document-start // ==/UserScript== // By: OnWolfOn var botServerIP = "127.0.0.1:8081"; setTimeout(function() { var socket = io.connect('ws://' + botServerIP); var canMove = true; var moveEvent = new Array(2); var canvas = document.getElementById("canvas"); last_transmited_game_server = null; socket.on('force-login', function (data) { socket.emit("login", {"uuid":client_uuid, "type":"client"}); transmit_game_server(); }); $( "#canvas" ).after( "<div style='background-color: #000000; -moz-opacity: 0.4; -khtml-opacity: 0.4; opacity: 0.4; filter: alpha(opacity=40); zoom: 1; width: 205px; top: 10px; left: 10px; display: block; position: absolute; text-align: center; font-size: 20px; color: #ffffff; padding: 5px; font-family: Ubuntu;'> <div style='color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'>Bots: <a id='minionCount' >Offline</a> </div>" ); $( "#canvas" ).after( "<div style='background-color: #000000; -moz-opacity: 0.4; -khtml-opacity: 0.4; opacity: 0.4; filter: alpha(opacity=45); zoom: 1; width: 205px; top: 47px; left: 10px; display: block; position: absolute; text-align: center; font-size: 21px; color: #ffffff; padding: 6px; font-family: Ubuntu;'> <div style='color:#00ff00; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'>[E] >Разделение</a> </div>" ); $( "#canvas" ).after( "<div style='background-color: #000000; -moz-opacity: 0.4; -khtml-opacity: 0.4; opacity: 0.4; filter: alpha(opacity=45); zoom: 1; width: 205px; top: 88px; left: 10px; display: block; position: absolute; text-align: center; font-size: 21px; color: #ffffff; padding: 6px; font-family: Ubuntu;'> <div style='color:#00ff00; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'>[R] >Кормление</a> </div>" ); socket.on('spawn-count', function (data) { document.getElementById('minionCount').innerHTML = data; counter = data; }); var client_uuid = localStorage.getItem('client_uuid'); if(client_uuid == null){ console.log("generating a uuid for this user"); client_uuid = ""; var ranStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; for (var ii = 0; ii < 15; ii++) client_uuid += ranStr.charAt(Math.floor(Math.random() * ranStr.length)); localStorage.setItem('client_uuid', client_uuid); } socket.emit("login", client_uuid); $("#instructions").replaceWith('<hr><div class="input-group"><span class="input-group-addon" style="margin-top: -100px;" id="basic-addon1">UUID</span><input type="text" value="' + client_uuid + '" readonly class="form-control"</div></div><br><div class="input-group"><span class="input-group-addon" style="margin-top: -100px;" id="basic-addon1">Bot IP</span><input type="text" value="' + botServerIP + '" readonly class="form-control"</div></div><br><div class="input-group"><span class="input-group-addon" style="margin-top: -100px;" id="basic-addon1">Edit By:</span><input type="text" value="OnWolfOn" readonly class="form-control"</div></div>'); // values in --> window.agar function isMe(cell){ for (var i = 0; i < window.agar.myCells.length; i++){ if (window.agar.myCells[i] == cell.id){ return true; } } return false; } function getCell(){ var me = []; for (var key in window.agar.allCells){ var cell = window.agar.allCells[key]; if (isMe(cell)){ me.push(cell); } } return me[0]; } function emitCellID(){ socket.emit("cellid", getCell().id); } function emitSplit(){ socket.emit("cmd", {"name":"split"} ); } function emitMassEject(){ socket.emit("cmd", {"name":"eject"} ); } function toggleMovement(){ canMove = !canMove; switch(canMove) { case true: canvas.onmousemove = moveEvent[0]; moveEvent[0] = null; canvas.onmousedown = moveEvent[1]; moveEvent[1] = null; break; case false: moveEvent[0] = canvas.onmousemove; canvas.onmousemove({clientX: (innerWidth / 2), clientY: (innerHeight / 2)}); canvas.onmousemove = null; moveEvent[1] = canvas.onmousedown; canvas.onmousedown = null; break; } } interval_id = setInterval(function() { emitCellID(); }, 100); interval_id2 = setInterval(function() { transmit_game_server_if_changed(); }, 5000); document.addEventListener('keydown',function(e){ var key = e.keyCode || e.which; switch(key) { case 68://d has been pressed. (Toggle Movement) toggleMovement(); break; case 69://e has been pressed. (Split Bots) emitSplit(); break; case 82://r has been pressed. (Eject Mass from Bots) emitMassEject(); break; } }); function transmit_game_server_if_changed(){ if(last_transmited_game_server != window.agar.ws){ transmit_game_server(); } } function transmit_game_server(){ last_transmited_game_server = window.agar.ws; socket.emit("cmd", {"name":"connect_server", "ip": last_transmited_game_server } ); } window.agar.minScale = -30; }, 1000); var allRules = [ { hostname: ["agar.io"], scriptUriRe: /^http:\/\/agar\.io\/main_out\.js/, replace: function (m) { m.removeNewlines() m.replace("var:allCells", /(=null;)(\w+)(.hasOwnProperty\(\w+\)?)/, "$1" + "$v=$2;" + "$2$3", "$v = {}") m.replace("var:myCells", /(case 32:)(\w+)(\.push)/, "$1" + "$v=$2;" + "$2$3", "$v = []") m.replace("var:top", /case 49:[^:]+?(\w+)=\[];/, "$&" + "$v=$1;", "$v = []") m.replace("var:ws", /new WebSocket\((\w+)[^;]+?;/, "$&" + "$v=$1;", "$v = ''") m.replace("var:topTeams", /case 50:(\w+)=\[];/, "$&" + "$v=$1;", "$v = []") var dr = "(\\w+)=\\w+\\.getFloat64\\(\\w+,!0\\);\\w+\\+=8;\\n?" var dd = 7071.067811865476 m.replace("var:dimensions", RegExp("case 64:"+dr+dr+dr+dr), "$&" + "$v = [$1,$2,$3,$4],", "$v = " + JSON.stringify([-dd,-dd,dd,dd])) var vr = "(\\w+)=\\w+\\.getFloat32\\(\\w+,!0\\);\\w+\\+=4;" m.save() && m.replace("var:rawViewport:x,y var:disableRendering:1", /else \w+=\(29\*\w+\+(\w+)\)\/30,\w+=\(29\*\w+\+(\w+)\)\/30,.*?;/, "$&" + "$v0.x=$1; $v0.y=$2; if($v1)return;") && m.replace("var:disableRendering:2 hook:skipCellDraw", /(\w+:function\(\w+\){)(if\(this\.\w+\(\)\){\+\+this\.[\w$]+;)/, "$1" + "if($v || $H(this))return;" + "$2") && m.replace("var:rawViewport:scale", /Math\.pow\(Math\.min\(64\/\w+,1\),\.4\)/, "($v.scale=$&)") && m.replace("var:rawViewport:x,y,scale", RegExp("case 17:"+vr+vr+vr), "$&" + "$v.x=$1; $v.y=$2; $v.scale=$3;") && m.reset_("window.agar.rawViewport = {x:0,y:0,scale:1};" + "window.agar.disableRendering = false;") || m.restore() m.replace("reset", /new WebSocket\(\w+[^;]+?;/, "$&" + m.reset) m.replace("property:scale", /function \w+\(\w+\){\w+\.preventDefault\(\);[^;]+;1>(\w+)&&\(\1=1\)/, `;${makeProperty("scale", "$1")};$&`) m.replace("var:minScale", /;1>(\w+)&&\(\1=1\)/, ";$v>$1 && ($1=$v)", "$v = 1") m.replace("var:region", /console\.log\("Find "\+(\w+\+\w+)\);/, "$&" + "$v=$1;", "$v = ''") m.replace("cellProperty:isVirus", /((\w+)=!!\(\w+&1\)[\s\S]{0,400})((\w+).(\w+)=\2;)/, "$1$4.isVirus=$3") m.replace("var:dommousescroll", /("DOMMouseScroll",)(\w+),/, "$1($v=$2),") m.replace("var:skinF hook:cellSkin", /(\w+.fill\(\))(;null!=(\w+))/, "$1;" + "if($v)$3 = $v(this,$3);" + "if($h)$3 = $h(this,$3);" + "$2"); m.replace("hook:afterCellStroke", /\((\w+)\.strokeStyle="#000000",\1\.globalAlpha\*=\.1,\1\.stroke\(\)\);\1\.globalAlpha=1;/, "$&" + "$H(this);") m.replace("var:showStartupBg", /\w+\?\(\w\.globalAlpha=\w+,/, "$v && $&", "$v = true") var vAlive = /\((\w+)\[(\w+)\]==this\){\1\.splice\(\2,1\);/.exec(m.text) var vEaten = /0<this\.[$\w]+&&(\w+)\.push\(this\)}/.exec(m.text) !vAlive && console.error("Expose: can't find vAlive") !vEaten && console.error("Expose: can't find vEaten") if (vAlive && vEaten) m.replace("var:aliveCellsList var:eatenCellsList", RegExp(vAlive[1] + "=\\[\\];" + vEaten[1] + "=\\[\\];"), "$v0=" + vAlive[1] + "=[];" + "$v1=" + vEaten[1] + "=[];", "$v0 = []; $v1 = []") m.replace("hook:drawScore", /(;(\w+)=Math\.max\(\2,(\w+\(\))\);)0!=\2&&/, "$1($H($3))||0!=$2&&") m.replace("hook:beforeTransform hook:beforeDraw var:drawScale", /(\w+)\.save\(\);\1\.translate\((\w+\/2,\w+\/2)\);\1\.scale\((\w+),\3\);\1\.translate\((-\w+,-\w+)\);/, "$v = $3;$H0($1,$2,$3,$4);" + "$&" + "$H1($1,$2,$3,$4);", "$v = 1") m.replace("hook:afterDraw", /(\w+)\.restore\(\);(\w+)&&\2\.width&&\1\.drawImage/, "$H();" + "$&") m.replace("hook:cellColor", /(\w+=)this\.color,/, "$1 ($h && $h(this, this.color) || this.color),") m.replace("var:drawGrid", /(\w+)\.globalAlpha=(\.2\*\w+);/, "if(!$v)return;" + "$&", "$v = true") m.replace("hook:drawCellMass", /&&\((\w+\|\|0==\w+\.length&&\(!this\.\w+\|\|this\.\w+\)&&20<this\.size)\)&&/, "&&( $h ? $h(this,$1) : ($1) )&&") m.replace("hook:cellMassText", /(\.\w+)(\(~~\(this\.size\*this\.size\/100\)\))/, "$1( $h ? $h(this,$2) : $2 )") m.replace("hook:cellMassTextScale", /(\.\w+)\((this\.\w+\(\))\)([\s\S]{0,1000})\1\(\2\/2\)/, "$1($2)$3$1( $h ? $h(this,$2/2) : ($2/2) )") var template = (key,n) => `this\\.${key}=\\w+\\*\\(this\\.(\\w+)-this\\.(\\w+)\\)\\+this\\.\\${n};` var re = new RegExp(template('x', 2) + template('y', 4) + template('size', 6)) var match = re.exec(m.text) if (match) { m.cellProp.nx = match[1] m.cellProp.ny = match[3] m.cellProp.nSize = match[5] } else console.error("Expose: cellProp:x,y,size search failed!") }}, ] function makeProperty(name, varname) { return "'" + name + "' in window.agar || " + "Object.defineProperty( window.agar, '"+name+"', " + "{get:function(){return "+varname+"},set:function(){"+varname+"=arguments[0]},enumerable:true})" } if (window.top != window.self) return if (document.readyState !== 'loading') return console.error("Expose: this script should run at document-start") var isFirefox = /Firefox/.test(navigator.userAgent) // Stage 1: Find corresponding rule var rules for (var i = 0; i < allRules.length; i++) if (allRules[i].hostname.indexOf(window.location.hostname) !== -1) { rules = allRules[i] break } if (!rules) return console.error("Expose: cant find corresponding rule") // Stage 2: Search for `main_out.js` if (isFirefox) { function bse_listener(e) { tryReplace(e.target, e) } window.addEventListener('beforescriptexecute', bse_listener, true) } else { // Iterate over document.head child elements and look for `main_out.js` for (var i = 0; i < document.head.childNodes.length; i++) if (tryReplace(document.head.childNodes[i])) return // If there are no desired element in document.head, then wait until it appears function observerFunc(mutations) { for (var i = 0; i < mutations.length; i++) { var addedNodes = mutations[i].addedNodes for (var j = 0; j < addedNodes.length; j++) if (tryReplace(addedNodes[j])) return observer.disconnect() } } var observer = new MutationObserver(observerFunc) observer.observe(document.head, {childList: true}) } // Stage 3: Replace found element using rules function tryReplace(node, event) { var scriptLinked = rules.scriptUriRe && rules.scriptUriRe.test(node.src) var scriptEmbedded = rules.scriptTextRe && rules.scriptTextRe.test(node.textContent) if (node.tagName != "SCRIPT" || (!scriptLinked && !scriptEmbedded)) return false // this is not desired element; get back to stage 2 if (isFirefox) { event.preventDefault() window.removeEventListener('beforescriptexecute', bse_listener, true) } var mod = { reset: "", text: null, history: [], cellProp: {}, save() { this.history.push({reset:this.reset, text:this.text}) return true }, restore() { var state = this.history.pop() this.reset = state.reset this.text = state.text return true }, reset_(reset) { this.reset += reset return true }, replace(what, from, to, reset) { var vars = [], hooks = [] what.split(" ").forEach((x) => { x = x.split(":") x[0] === "var" && vars.push(x[1]) x[0] === "hook" && hooks.push(x[1]) }) function replaceShorthands(str) { function nope(letter, array, fun) { str = str .split(new RegExp('\\$' + letter + '([0-9]?)')) .map((v,n) => n%2 ? fun(array[v||0]) : v) .join("") } nope('v', vars, (name) => "window.agar." + name) nope('h', hooks, (name) => "window.agar.hooks." + name) nope('H', hooks, (name) => "window.agar.hooks." + name + "&&" + "window.agar.hooks." + name) return str } var newText = this.text.replace(from, replaceShorthands(to)) if(newText === this.text) { console.error("Expose: `" + what + "` replacement failed!") return false } else { this.text = newText if (reset) this.reset += replaceShorthands(reset) + ";" return true } }, removeNewlines() { this.text = this.text.replace(/([,\/])\n/mg, "$1") }, get: function() { var cellProp = JSON.stringify(this.cellProp) return `window.agar={hooks:{},cellProp:${cellProp}};` + this.reset + this.text } } if (scriptEmbedded) { mod.text = node.textContent rules.replace(mod) if (isFirefox) { document.head.removeChild(node) var script = document.createElement("script") script.textContent = mod.get() document.head.appendChild(script) } else { node.textContent = mod.get() } console.log("Expose: replacement done") } else { document.head.removeChild(node) var request = new XMLHttpRequest() request.onload = function() { var script = document.createElement("script") mod.text = this.responseText rules.replace(mod) script.textContent = mod.get() // `main_out.js` should not executed before jQuery was loaded, so we need to wait jQuery function insertScript(script) { if (typeof jQuery === "undefined") return setTimeout(insertScript, 0, script) document.head.appendChild(script) console.log("Expose: replacement done") } insertScript(script) } request.onerror = function() { console.error("Expose: response was null") } request.open("get", node.src, true) request.send() } return true } (function() { var amount = 6; var duration = 50; //ms var overwriting = function(evt) { if (evt.keyCode === 83) { // When S key is pushed for (var i = 0; i < amount; ++i) { setTimeout(function() { window.onkeydown({keyCode: 87}); // Simulates W key being pushed window.onkeyup({keyCode: 87}); }, i * duration); } } }; window.addEventListener('keydown', overwriting); })();
Briaayaann123
// ==UserScript== // @name Leyvagarbots // @version 2.0.0 (New) // @author Leyva el crack // @match http://agar.io/* // @require https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.5/socket.io.min.js // @grant none // @run-at document-start // ==/UserScript== setTimeout(function() { var real_minx = -7071; var real_miny = -7071; var real_maxx = 7071; var real_maxy = 7071; var lastsent = { minx: 0, miny: 0, maxx: 0, maxy: 0 }; function valcompare(Y, Z) { return 0.01 > Y - Z && -0.01 < Y - Z } window.agar.hooks.dimensionsUpdated = function(server_minx, server_miny, server_maxx, server_maxy) { if (valcompare(server_maxx - server_minx, server_maxy - server_miny)) { real_minx = server_minx; real_miny = server_miny; real_maxx = server_maxx; real_maxy = server_maxy } else { if (valcompare(server_minx, lastsent.minx)) { if (0.01 < server_maxx - lastsent.maxx || -0.01 > server_maxx - lastsent.maxx) { real_minx = server_minx; real_maxx = server_minx + 14142.135623730952 } } if (0.01 < server_minx - lastsent.minx || -0.01 > server_minx - lastsent.minx) { if (valcompare(server_maxx, lastsent.maxx)) { real_maxx = server_maxx; real_minx = server_maxx - 14142.135623730952 } } if (0.01 < server_miny - lastsent.miny || -0.01 > server_miny - lastsent.miny) { if (valcompare(server_maxy, lastsent.maxy)) { real_maxy = server_maxy; real_miny = server_maxy - 14142.135623730952 } } if (valcompare(server_miny, lastsent.miny)) { if (0.01 < server_maxy - lastsent.maxy || -0.01 > server_maxy - lastsent.maxy) { real_miny = server_miny; real_maxy = server_miny + 14142.135623730952 } } if (server_minx < real_minx) { real_minx = server_minx; real_maxx = server_minx + 14142.135623730952 } if (server_maxx > real_maxx) { real_maxx = server_maxx; real_minx = server_maxx - 14142.135623730952 } if (server_miny < real_miny) { real_miny = server_miny; real_maxy = server_miny + 14142.135623730952 } if (server_maxy > real_maxy) { real_maxy = server_maxy; real_miny = server_maxy - 14142.135623730952 } lastsent.minx = server_minx; lastsent.miny = server_miny; lastsent.maxy = server_maxy; lastsent.maxx = server_maxx } offset_x = real_minx || -7071; offset_y = real_miny || -7071 }; var socket = io.connect('ws://127.0.0.1:8081'); var canMove = true; var movetoMouse = true; var moveEvent = new Array(2); var canvas = document.getElementById("canvas"); last_transmited_game_server = null; socket.on('force-login', function(data) { socket.emit("login", { "uuid": client_uuid, "type": "client" }); transmit_game_server() }); var a = ''; var iDiv = document.createElement('div'); iDiv.id = 'block'; document.getElementsByTagName('body')[0].appendChild(iDiv); iDiv.innerHTML = '<div style="position: absolute; top: 10px; left: 15px; padding: 0px 8px; font-family: Tahoma; color: rgb(255, 255, 255); z-index: 9999; border-radius: 5px; min-height: 15px; min-width: 200px; background-color: rgba(0, 0, 0, 0.6);"><br><div id="counter"><center><b>Leyvagar bots! V2.1</b></center></div></b>' + a +'<b><div id="bName">Bots :<span class="label label-default pull-right"><span id="minionCount">Esperando... AUTOR: adf.ly/1YuXMG</span></div></b><b><div id="mControl"></div><div id="cMove"></div></b><div id="split"><b>Separar Bots:</b><span class="label label-info pull-right">E</span></div></b><div id="eject"><b>Dar Masa :</b><span class="label label-info pull-right">R</span></div></b>' + a +'<br></div>'; setInterval(function(){ if(!movetoMouse){ document.getElementById('mControl').innerHTML = '<div id="mControl">Controlar Con Mouse :<span class="label label-danger pull-right">No</span></div>'; }else{ document.getElementById('mControl').innerHTML = '<div id="mControl">Controlar Con Mouse :<span class="label label-success pull-right">Si</span></div>'; } if(canMove){ document.getElementById('cMove').innerHTML = '<div id="cMove">No Moverse :<span class="label label-danger pull-right">No</span></div>'; }else{ document.getElementById('cMove').innerHTML = '<div id="cMove">No Moverse :<span class="label label-success pull-right">Si</span></div>'; } }, 1000); socket.on('spawn-count', function(data) { document.getElementById('minionCount').innerHTML = data }); var client_uuid = localStorage.getItem('client_uuid'); if (client_uuid == null) { console.log("generating a uuid for this user"); client_uuid = ""; var ranStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; for (var ii = 0; ii < 15; ii++) client_uuid += ranStr.charAt(Math.floor(Math.random() * ranStr.length)); localStorage.setItem('client_uuid', client_uuid) } socket.emit("login", client_uuid); $("#instructions").replaceWith('<br><div class="input-group"><span class="input-group-addon" id="basic-addon1">UUID</span><input type="text" value="' + client_uuid + '" readonly class="form-control"</div>'); function isMe(cell) { for (var i = 0; i < window.agar.myCells.length; i++) { if (window.agar.myCells[i] == cell.id) { return true } } return false } window.agar.hooks.drawCellMass = function(cell, old_draw) { if(cell.size > 20) return cell; } window.agar.hooks.cellMassTextScale = function(cell, old_scale) { } function getCell() { var me = []; for (var key in window.agar.allCells) { var cell = window.agar.allCells[key]; if (isMe(cell)) { me.push(cell) } } return me[0] } var skin_var = 0; function emitPosition() { for (i = 0; i < agar.myCells.length; i++) {} x = (mouseX - window.innerWidth / 2) / window.agar.drawScale + window.agar.rawViewport.x; y = (mouseY - window.innerHeight / 2) / window.agar.drawScale + window.agar.rawViewport.y; if (!movetoMouse) { x = getCell().x; y = getCell().y } socket.emit("pos", { "x": x - (real_minx + 7071), "y": y - (real_miny + 7071), "dimensions": [-7071, -7071, 7071, 7071] }) } function emitSplit() { socket.emit("cmd", { "name": "split" }) } function emitMassEject() { socket.emit("cmd", { "name": "eject" }) } function toggleMovement() { canMove = !canMove; switch (canMove) { case true: canvas.onmousemove = moveEvent[0]; moveEvent[0] = null; canvas.onmousedown = moveEvent[1]; moveEvent[1] = null; break; case false: canvas.onmousemove({ clientX: innerWidth / 2, clientY: innerHeight / 2 }); moveEvent[0] = canvas.onmousemove; canvas.onmousemove = null; moveEvent[1] = canvas.onmousedown; canvas.onmousedown = null; break } } interval_id = setInterval(function() { emitPosition() }, 100); interval_id2 = setInterval(function() { transmit_game_server_if_changed() }, 5000); document.addEventListener('keydown', function(e) { var key = e.keyCode || e.which; switch (key) { case 65: movetoMouse = !movetoMouse; if(movetoMouse) { document.getElementById('ismoveToMouse').innerHTML = "On"; } else { document.getElementById('ismoveToMouse').innerHTML = "Off"; } break; case 68: toggleMovement(); if(!canMove) { document.getElementById('isStopMove').innerHTML = "On"; } else { document.getElementById('isStopMove').innerHTML = "Off"; } break; case 69: emitSplit(); break; case 82: emitMassEject(); break } }); function transmit_game_server_if_changed() { if (last_transmited_game_server != window.agar.ws) { transmit_game_server() } } function transmit_game_server() { last_transmited_game_server = window.agar.ws; socket.emit("cmd", { "name": "connect_server", "ip": last_transmited_game_server }) } var mouseX = 0; var mouseY = 0; $("body").mousemove(function(event) { mouseX = event.clientX; mouseY = event.clientY }); window.agar.minScale = -30 }, 5000); var allRules = [ { hostname: ["agar.io"], scriptUriRe: /^http:\/\/agar\.io\/main_out\.js/, replace: function (m) { m.removeNewlines() m.replace("var:allCells", /(=null;)(\w+)(.hasOwnProperty\(\w+\)?)/, "$1" + "$v=$2;" + "$2$3", "$v = {}") m.replace("var:myCells", /(case 32:)(\w+)(\.push)/, "$1" + "$v=$2;" + "$2$3", "$v = []") m.replace("var:top", /case 49:[^:]+?(\w+)=\[];/, "$&" + "$v=$1;", "$v = []") m.replace("var:topTeams", /case 50:(\w+)=\[];/, "$&" + "$v=$1;", "$v = []") var dr = "(\\w+)=\\w+\\.getFloat64\\(\\w+,!0\\);\\w+\\+=8;\\n?" var dd = 7071.067811865476 m.replace("var:dimensions hook:dimensionsUpdated", RegExp("case 64:"+dr+dr+dr+dr), "$&" + "$v = [$1,$2,$3,$4],$H($1,$2,$3,$4),", "$v = " + JSON.stringify([-dd,-dd,dd,dd])) var vr = "(\\w+)=\\w+\\.getFloat32\\(\\w+,!0\\);\\w+\\+=4;" m.save() && m.replace("var:rawViewport:x,y var:disableRendering:1", /else \w+=\(5\*\w+\+(\w+)\)\/6,\w+=\(5\*\w+\+(\w+)\)\/6,.*?;/, "$&" + "$v0.x=$1; $v0.y=$2; if($v1)return;") && m.replace("var:disableRendering:2 hook:skipCellDraw", /(\w+:function\(\w+\){)(if\(this\.\w+\(\)\){\+\+this\.[\w$]+;)/, "$1" + "if($v || $H(this))return;" + "$2") && m.replace("var:rawViewport:scale", /Math\.pow\(Math\.min\(64\/\w+,1\),\.4\)/, "($v.scale=$&)") && m.replace("var:rawViewport:x,y,scale", RegExp("case 17:"+vr+vr+vr), "$&" + "$v.x=$1; $v.y=$2; $v.scale=$3;") && m.reset_("window.agar.rawViewport = {x:0,y:0,scale:1};" + "window.agar.disableRendering = false;") || m.restore() m.replace("reset hook:connect var:ws var:webSocket", /new WebSocket\((\w+)\);/, "$v1 = $&; $v0=$1;" + m.reset + "$H();", "$v0 = ''; $v1 = null;") m.replace("property:scale", /function \w+\(\w+\){\w+\.preventDefault\(\);[^;]+;1>(\w+)&&\(\1=1\)/, `;${makeProperty("scale", "$1")};$&`) m.replace("var:minScale", /;1>(\w+)&&\(\1=1\)/, ";$v>$1 && ($1=$v)", "$v = 1") m.replace("var:region", /console\.log\("Find "\+(\w+\+\w+)\);/, "$&" + "$v=$1;", "$v = ''") m.replace("cellProperty:isVirus", /((\w+)=!!\(\w+&1\)[\s\S]{0,400})((\w+).(\w+)=\2;)/, "$1$4.isVirus=$3") m.replace("var:dommousescroll", /("DOMMouseScroll",)(\w+),/, "$1($v=$2),") m.replace("var:skinF hook:cellSkin", /(\w+.fill\(\))(;null!=(\w+))/, "$1;" + "if($v)$3 = $v(this,$3);" + "if($h)$3 = $h(this,$3);" + "$2"); m.replace("hook:afterCellStroke", /\((\w+)\.strokeStyle="#000000",\1\.globalAlpha\*=\.1,\1\.stroke\(\)\);\1\.globalAlpha=1;/, "$&" + "$H(this);") m.replace("var:showStartupBg", /\w+\?\(\w\.globalAlpha=\w+,/, "$v && $&", "$v = true") var vAlive = /\((\w+)\[(\w+)\]==this\){\1\.splice\(\2,1\);/.exec(m.text) var vEaten = /0<this\.[$\w]+&&(\w+)\.push\(this\)}/.exec(m.text) !vAlive && console.error("Expose: can't find vAlive") !vEaten && console.error("Expose: can't find vEaten") if (vAlive && vEaten) m.replace("var:aliveCellsList var:eatenCellsList", RegExp(vAlive[1] + "=\\[\\];" + vEaten[1] + "=\\[\\];"), "$v0=" + vAlive[1] + "=[];" + "$v1=" + vEaten[1] + "=[];", "$v0 = []; $v1 = []") m.replace("hook:drawScore", /(;(\w+)=Math\.max\(\2,(\w+\(\))\);)0!=\2&&/, "$1($H($3))||0!=$2&&") m.replace("hook:beforeTransform hook:beforeDraw var:drawScale", /(\w+)\.save\(\);\1\.translate\((\w+\/2,\w+\/2)\);\1\.scale\((\w+),\3\);\1\.translate\((-\w+,-\w+)\);/, "$v = $3;$H0($1,$2,$3,$4);" + "$&" + "$H1($1,$2,$3,$4);", "$v = 1") m.replace("hook:afterDraw", /(\w+)\.restore\(\);(\w+)&&\2\.width&&\1\.drawImage/, "$H();" + "$&") m.replace("hook:cellColor", /(\w+=)this\.color,/, "$1 ($h && $h(this, this.color) || this.color),") m.replace("var:drawGrid", /(\w+)\.globalAlpha=(\.2\*\w+);/, "if(!$v)return;" + "$&", "$v = true") m.replace("hook:drawCellMass", /&&\((\w+\|\|0==\w+\.length&&\(!this\.\w+\|\|this\.\w+\)&&20<this\.size)\)&&/, "&&( $h ? $h(this,$1) : ($1) )&&") m.replace("hook:cellMassText", /(\.\w+)(\(~~\(this\.size\*this\.size\/100\)\))/, "$1( $h ? $h(this,$2) : $2 )") m.replace("hook:cellMassTextScale", /(\.\w+)\((this\.\w+\(\))\)([\s\S]{0,1000})\1\(\2\/2\)/, "$1($2)$3$1( $h ? $h(this,$2/2) : ($2/2) )") m.replace("var:enableDirectionSending", /;64>(\w+)\*\1\+(\w+)\*\2/, ";if(!$v)return" + "$&", "$v = true") m.replace("var:simpleCellDraw", /(:function\(\){)(var a=10;)/, "$1 if($v)return true;$2", "$v=false") m.replace("hook:updateLeaderboard", /({\w+=null;)(if\(null!=)/, "$1 if($H())return; $2") var template = (key,n) => `this\\.${key}=\\w+\\*\\(this\\.(\\w+)-this\\.(\\w+)\\)\\+this\\.\\${n};` var re = new RegExp(template('x', 2) + template('y', 4) + template('size', 6)) var match = re.exec(m.text) if (match) { m.cellProp.nx = match[1] m.cellProp.ny = match[3] m.cellProp.nSize = match[5] } else console.error("Expose: cellProp:x,y,size search failed!") }}, ] function makeProperty(name, varname) { return "'" + name + "' in window.agar || " + "Object.defineProperty( window.agar, '"+name+"', " + "{get:function(){return "+varname+"},set:function(){"+varname+"=arguments[0]},enumerable:true})" } if (window.top != window.self) return if (document.readyState !== 'loading') return console.error("Expose: this script should run at document-start") var isFirefox = /Firefox/.test(navigator.userAgent) // Stage 1: Find corresponding rule var rules for (var i = 0; i < allRules.length; i++) if (allRules[i].hostname.indexOf(window.location.hostname) !== -1) { rules = allRules[i] break } if (!rules) return console.error("Expose: cant find corresponding rule") // Stage 2: Search for `main_out.js` if (isFirefox) { function bse_listener(e) { tryReplace(e.target, e) } window.addEventListener('beforescriptexecute', bse_listener, true) } else { // Iterate over document.head child elements and look for `main_out.js` for (var i = 0; i < document.head.childNodes.length; i++) if (tryReplace(document.head.childNodes[i])) return // If there are no desired element in document.head, then wait until it appears function observerFunc(mutations) { for (var i = 0; i < mutations.length; i++) { var addedNodes = mutations[i].addedNodes for (var j = 0; j < addedNodes.length; j++) if (tryReplace(addedNodes[j])) return observer.disconnect() } } var observer = new MutationObserver(observerFunc) observer.observe(document.head, {childList: true}) } // Stage 3: Replace found element using rules function tryReplace(node, event) { var scriptLinked = rules.scriptUriRe && rules.scriptUriRe.test(node.src) var scriptEmbedded = rules.scriptTextRe && rules.scriptTextRe.test(node.textContent) if (node.tagName != "SCRIPT" || (!scriptLinked && !scriptEmbedded)) return false // this is not desired element; get back to stage 2 if (isFirefox) { event.preventDefault() window.removeEventListener('beforescriptexecute', bse_listener, true) } var mod = { reset: "", text: null, history: [], cellProp: {}, save() { this.history.push({reset:this.reset, text:this.text}) return true }, restore() { var state = this.history.pop() this.reset = state.reset this.text = state.text return true }, reset_(reset) { this.reset += reset return true }, replace(what, from, to, reset) { var vars = [], hooks = [] what.split(" ").forEach((x) => { x = x.split(":") x[0] === "var" && vars.push(x[1]) x[0] === "hook" && hooks.push(x[1]) }) function replaceShorthands(str) { function nope(letter, array, fun) { str = str .split(new RegExp('\\$' + letter + '([0-9]?)')) .map((v,n) => n%2 ? fun(array[v||0]) : v) .join("") } nope('v', vars, (name) => "window.agar." + name) nope('h', hooks, (name) => "window.agar.hooks." + name) nope('H', hooks, (name) => "window.agar.hooks." + name + "&&" + "window.agar.hooks." + name) return str } var newText = this.text.replace(from, replaceShorthands(to)) if(newText === this.text) { console.error("Expose: `" + what + "` replacement failed!") return false } else { this.text = newText if (reset) this.reset += replaceShorthands(reset) + ";" return true } }, removeNewlines() { this.text = this.text.replace(/([,\/;])\n/mg, "$1") }, get: function() { var cellProp = JSON.stringify(this.cellProp) return `window.agar={hooks:{},cellProp:${cellProp}};` + this.reset + this.text } } if (scriptEmbedded) { mod.text = node.textContent rules.replace(mod) if (isFirefox) { document.head.removeChild(node) var script = document.createElement("script") script.textContent = mod.get() document.head.appendChild(script) } else { node.textContent = mod.get() } console.log("Expose: replacement done") } else { document.head.removeChild(node) var request = new XMLHttpRequest() request.onload = function() { var script = document.createElement("script") mod.text = this.responseText rules.replace(mod) script.textContent = mod.get() // `main_out.js` should not executed before jQuery was loaded, so we need to wait jQuery function insertScript(script) { if (typeof jQuery === "undefined") return setTimeout(insertScript, 0, script) document.head.appendChild(script) console.log("Expose: replacement done") } insertScript(script) } request.onerror = function() { console.error("Expose: response was null") } request.open("get", node.src, true) request.send() } return true }
bayuperkasa345
// ==UserScript== // @name AgarBot // @namespace Apos // @description Plays Agar // @include http://agar.io/ // @version 1 // @grant none // @author twitch.tv/apostolique // ==/UserScript== (function (g, q) { function wa() { ha(); setInterval(ha, 180000); z = $ = document.getElementById('canvas'); d = z.getContext('2d'); z.onmousedown = function (a) { if (ia) { var b = a.clientX - (5 + l / 5 / 2), c = a.clientY - (5 + l / 5 / 2); if (Math.sqrt(b * b + c * c) <= l / 5 / 2) { E(); A(17); return } } N = a.clientX; O = a.clientY; aa(); E() }; z.onmousemove = function (a) { N = a.clientX; O = a.clientY; aa() }; z.onmouseup = function (a) { }; var a = !1, b = !1, c = !1; g.onkeydown = function (e) { 32 != e.keyCode || a || (E(), A(17), a = !0); 81 != e.keyCode || b || (A(18), b = !0); 87 != e.keyCode || c || (E(), A(21), c = !0); 27 == e.keyCode && q('#overlays').fadeIn(200) if (84 == e.keyCode) { console.log("Toggle"); toggle = !toggle; } if (82 == e.keyCode) { console.log("ToggleDraw"); toggleDraw = !toggleDraw; } }; g.onkeyup = function (e) { 32 == e.keyCode && (a = !1); 87 == e.keyCode && (c = !1); 81 == e.keyCode && b && (A(19), b = !1) }; g.onblur = function () { A(19); c = b = a = !1 }; g.onresize = ja; ja(); g.requestAnimationFrame ? g.requestAnimationFrame(ka) : setInterval(ba, 1000 / 60); setInterval(E, 40); la(q('#region').val()); q('#overlays').show() } function xa() { if (0.5 > k) F = null; else { for (var a = Number.POSITIVE_INFINITY, b = Number.POSITIVE_INFINITY, c = Number.NEGATIVE_INFINITY, e = Number.NEGATIVE_INFINITY, d = 0, f = 0; f < p.length; f++) p[f].shouldRender() && (d = Math.max(p[f].size, d), a = Math.min(p[f].x, a), b = Math.min(p[f].y, b), c = Math.max(p[f].x, c), e = Math.max(p[f].y, e)); F = QUAD.init({ minX: a - (d + 100), minY: b - (d + 100), maxX: c + (d + 100), maxY: e + (d + 100) }); for (f = 0; f < p.length; f++) if (a = p[f], a.shouldRender()) for (b = 0; b < a.points.length; ++b) F.insert(a.points[b]) } } function aa() { P = (N - l / 2) / k + s; Q = (O - r / 2) / k + t } function ha() { null == R && (R = { }, q('#region').children().each(function () { var a = q(this), b = a.val(); b && (R[b] = a.text()) })); q.get('http://m.agar.io/info', function (a) { var b = { }, c; for (c in a.regions) { var e = c.split(':') [0]; b[e] = b[e] || 0; b[e] += a.regions[c].numPlayers } for (c in b) q('#region option[value="' + c + '"]').text(R[c] + ' (' + b[c] + ' players)') }, 'json') } function ma() { q('#adsBottom').hide(); q('#overlays').hide() } function la(a) { a && a != G && (G = a, ca()) } function na() { console.log('Find ' + G + H); q.ajax('http://m.agar.io/', { error: function () { setTimeout(na, 1000) }, success: function (a) { a = a.split('\n'); oa('ws://' + a[0]) }, dataType: 'text', method: 'POST', cache: !1, crossDomain: !0, data: G + H || '?' }) } function ca() { G && (q('#connecting').show(), na()) } function oa(a) { h && (h.onopen = null, h.onmessage = null, h.onclose = null, h.close(), h = null); B = [ ]; m = [ ]; v = { }; p = [ ]; C = [ ]; w = [ ]; x = null; console.log('Connecting to ' + a); h = new WebSocket(a); h.binaryType = 'arraybuffer'; h.onopen = ya; h.onmessage = za; h.onclose = Aa; h.onerror = function () { console.log('socket error') } } function ya(a) { q('#connecting').hide(); console.log('socket open'); a = new ArrayBuffer(5); var b = new DataView(a); b.setUint8(0, 254); b.setUint32(1, 1, !0); h.send(a); a = new ArrayBuffer(5); b = new DataView(a); b.setUint8(0, 255); b.setUint32(1, 1, !0); h.send(a); pa() } function Aa(a) { console.log('socket close'); setTimeout(ca, 500) } function za(a) { function b() { for (var a = ''; ; ) { var b = e.getUint16(c, !0); c += 2; if (0 == b) break; a += String.fromCharCode(b) } return a } var c = 1, e = new DataView(a.data); switch (e.getUint8(0)) { case 16: Ba(e); break; case 17: I = e.getFloat32(1, !0); J = e.getFloat32(5, !0); K = e.getFloat32(9, !0); break; case 20: m = [ ]; B = [ ]; break; case 32: B.push(e.getUint32(1, !0)); break; case 49: if (null != x) break; a = e.getUint32(c, !0); c += 4; w = [ ]; for (var d = 0; d < a; ++d) { var f = e.getUint32(c, !0), c = c + 4; w.push({ id: f, name: b() }) } qa(); break; case 50: x = [ ]; a = e.getUint32(c, !0); c += 4; for (d = 0; d < a; ++d) x.push(e.getFloat32(c, !0)), c += 4; qa(); break; case 64: S = e.getFloat64(1, !0), T = e.getFloat64(9, !0), U = e.getFloat64(17, !0), V = e.getFloat64(25, !0), I = (U + S) / 2, J = (V + T) / 2, K = 1, 0 == m.length && (s = I, t = J, k = K) } } function Ba(a) { D = + new Date; var b = Math.random(), c = 1; da = !1; for (var e = a.getUint16(c, !0), c = c + 2, d = 0; d < e; ++d) { var f = v[a.getUint32(c, !0)], g = v[a.getUint32(c + 4, !0)], c = c + 8; f && g && (g.destroy(), g.ox = g.x, g.oy = g.y, g.oSize = g.size, g.nx = f.x, g.ny = f.y, g.nSize = g.size, g.updateTime = D) } for (; ; ) { e = a.getUint32(c, !0); c += 4; if (0 == e) break; for (var d = a.getFloat32(c, !0), c = c + 4, f = a.getFloat32(c, !0), c = c + 4, g = a.getFloat32(c, !0), c = c + 4, h = a.getUint8(c++), k = a.getUint8(c++), l = a.getUint8(c++), h = (h << 16 | k << 8 | l).toString(16); 6 > h.length; ) h = '0' + h; h = '#' + h; l = a.getUint8(c++); k = !!(l & 1); l & 2 && (c += 4); l & 4 && (c += 8); l & 8 && (c += 16); for (l = ''; ; ) { var n = a.getUint16(c, !0), c = c + 2; if (0 == n) break; l += String.fromCharCode(n) } n = null; v.hasOwnProperty(e) ? (n = v[e], n.updatePos(), n.ox = n.x, n.oy = n.y, n.oSize = n.size, n.color = h) : (n = new ra(e, d, f, g, h, k, l), n.pX = d, n.pY = f); n.nx = d; n.ny = f; n.nSize = g; n.updateCode = b; n.updateTime = D; - 1 != B.indexOf(e) && - 1 == m.indexOf(n) && (document.getElementById('overlays').style.display = 'none', m.push(n), 1 == m.length && (s = n.x, t = n.y)) } a.getUint16(c, !0); c += 2; f = a.getUint32(c, !0); c += 4; for (d = 0; d < f; d++) e = a.getUint32(c, !0), c += 4, v[e] && (v[e].updateCode = b); for (d = 0; d < p.length; d++) p[d].updateCode != b && p[d--].destroy(); da && 0 == m.length && q('#overlays').fadeIn(3000) && setNick(originalName) } function computeDistance(x1, y1, x2, y2) { var xdis = x1 - x2; // <--- FAKE AmS OF COURSE! var ydis = y1 - y2; var distance = Math.sqrt(Math.pow(xdis, 2) + Math.pow(ydis, 2)); return distance; } function computerDistanceFromCircleEdge(x1, y1, x2, y2, s2) { var tempD = computeDistance(x2, y2, x1, y1); var offsetX = 0; var offsetY = 0; var ratioX = tempD / (x2 - x1); var ratioY = tempD / (y2 - y1); offsetX = x2 - (s2 / ratioX); offsetY = y2 - (s2 / ratioY); return computeDistance(x1, y1, offsetX, offsetY); } function getListmasedOnFunction(booleanFunction, listToUse) { var dotList = []; Object.keys(listToUse).forEach(function (element, index) { if (booleanFunction(element)){ dotList.push(v[element]); } }); return dotList; } //TODO: Make it only go to a virus if it's big enough. If it shrinks, it shouldn't only grab a single dot and go back in. function getAllNiceViruses() { var dotList = []; if (m.length == 1) { dotList = getListmasedOnFunction(function (element){ if (v[element].isVirus && (v[element].size *1.10 <= m[0].size) && v[element].size * 1.15 >= m[0].size) { return true; } return false; }, v); } return dotList; } function getAllThreats() { var dotList = []; dotList = getListmasedOnFunction(function (element){ var isMe = false; for (var i = 0; i < m.length; i++) { if (v[element].id == m[i].id) { isMe = true; break; } } for (var i = 0; i < m.length; i++) { if (!isMe && (!v[element].isVirus && (v[element].size >= m[i].oSize * 1.15))) { return true; } else if (v[element].isVirus && (v[element].size * 1.15 <= m[i].oSize)) { return true; } return false; } }, v); return dotList; } function getAllFood() { var elementList = []; var dotList = []; elementList = getListmasedOnFunction(function (element){ var isMe = false; for (var i = 0; i < m.length; i++) { if (v[element].id == m[i].id) { isMe = true; break; } } for (var i = 0; i < m.length; i++) { if (!isMe && !v[element].isVirus && (v[element].size * 1.25 <= m[i].size) || (v[element].size <= 11)){return true;} else{return false;} } }, v); for (var i = 0; i < elementList.length; i++) { dotList.push([elementList[i].x, elementList[i].y, elementList[i].size]); } return dotList; } function clusterFood(foodList, blobSize) { var clusters = []; var addedCluster = false; for (var i = 0; i < foodList.length; i++) { for (var j = 0; j < clusters.length; j++) { if (computeDistance(foodList[i][0], foodList[i][1], clusters[j][0], clusters[j][1]) < blobSize * 1.5) { clusters[j][0] = (foodList[i][0] + clusters[j][0]) / 2; clusters[j][1] = (foodList[i][1] + clusters[j][1]) / 2; clusters[j][2] += foodList[i][2]; addedCluster = true; break; } } if (!addedCluster) { clusters.push([foodList[i][0], foodList[i][1], foodList[i][2]]); } addedCluster = false; } return clusters; } //Given two points on a line, finds the slope of a perpendicular line crossing it. function inverseSlope(x1, y1, x2, y2) { var m = (y1 - y2) / (x1 - x2); return (-1) / m; } //Given a slope and an offset, returns two points on that line. function pointsOnLine(slope, useX, useY) { var b = useY - slope * useX; return [[useX - 100, slope * (useX - 100) + b], [useX + 100, slope * (useX + 100) + b]]; } //Using a line formed from point a to b, tells if point c is on S side of that line. function isSideLine(a, b, c) { if ((b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]) > 0) { return true; } return false; } function findDestination() { dPoints = []; lines = []; var tempMoveX = P; var tempMoveY = Q; if (m[0] != null) { var allPossibleFood = null; allPossibleFood = getAllFood(); // #1 /*for (var i = -1000; i < 1000; i += m[0].size) { for (var j = -1000; j < 1000; j += m[0].size) { allPossibleFood.push([m[0].x + i, m[0].y + j, -200]); } }*/ var allPossibleThreats = getAllThreats(); var allPossibleNiceViruses = getAllNiceViruses(); var closestNiceViruse = null; if (allPossibleNiceViruses.length != 0) { closestNiceViruse = [allPossibleNiceViruses[0], computeDistance(allPossibleNiceViruses[0].x, allPossibleNiceViruses[0].y, m[0].x, m[0].y)]; for (var i = 1; i < allPossibleNiceViruses.length; i++) { var testD = computeDistance(allPossibleNiceViruses[i].x, allPossibleNiceViruses[i].y, m[0].x, m[0].y) if (testD < closestNiceViruse[1]) { closestNiceViruse = [allPossibleNiceViruses[i], testD]; } } console.log("NO WAY!!! LET THE TROLLING mEGIN!"); } var allThreatLines = []; var allThreatLinesmool = []; var allFallbackPointsLeft = []; var allFallbackPointsRight = []; var allFallbackmool = []; var allFallbackCount = []; var closestThreatIndex = null; var closestThreatD = null; var closestThreatIndex2 = null; var closestThreatD2 = null; var isSafeSpot = true; var clusterAllFood = clusterFood(allPossibleFood, m[0].oSize); for (var i = 0; i < allPossibleThreats.length; i++) { var tempD = computerDistanceFromCircleEdge(m[0].x, m[0].y, allPossibleThreats[i].x, allPossibleThreats[i].y, allPossibleThreats[i].size); if (closestThreatIndex != null) { if (closestThreatD > tempD) { closestThreatIndex2 = closestThreatIndex; closestThreatD2 = closestThreatD; closestThreatIndex = i; closestThreatD = tempD; } } else { closestThreatIndex = i; closestThreatD = tempD; } var ratioX = tempD / (allPossibleThreats[i].x - m[0].x); var ratioY = tempD / (allPossibleThreats[i].y - m[0].y); var offsetX = 0; var offsetY = 0; var offsetEscapeX = 0; var offsetEscapeY = 0; var offsetLeftX = 0; var offsetLeftY = 0; var offsetRightX = 0; var offsetRightY = 0; var offsetEscapeLeftX = 0; var offsetEscapeLeftY = 0; var offsetEscapeRightX = 0; var offsetEscapeRightY = 0; var escape = 5; var escapeMid = 3; iSlope = inverseSlope(allPossibleThreats[i].x, allPossibleThreats[i].y, m[0].x, m[0].y); var sidePoints = pointsOnLine(iSlope, allPossibleThreats[i].x, allPossibleThreats[i].y); var SD = computeDistance(allPossibleThreats[i].x, allPossibleThreats[i].y, sidePoints[0][0], sidePoints[0][1]); var ratioLeftX = SD / (allPossibleThreats[i].x - sidePoints[0][0]); var ratioLeftY = SD / (allPossibleThreats[i].y - sidePoints[0][1]); if (allPossibleThreats[i].size >= m[0].size * 4) { offsetX = allPossibleThreats[i].x - (allPossibleThreats[i].size / ratioX * 1.5); offsetY = allPossibleThreats[i].y - (allPossibleThreats[i].size / ratioY * 1.5); offsetLeftX = allPossibleThreats[i].x - (allPossibleThreats[i].size / ratioLeftX * 3); offsetLeftY = allPossibleThreats[i].y - (allPossibleThreats[i].size / ratioLeftY * 3); offsetRightX = allPossibleThreats[i].x + (allPossibleThreats[i].size / ratioLeftX * 3); offsetRightY = allPossibleThreats[i].y + (allPossibleThreats[i].size / ratioLeftY * 3); offsetEscapeX = allPossibleThreats[i].x - (allPossibleThreats[i].size / ratioX * escape); offsetEscapeY = allPossibleThreats[i].y - (allPossibleThreats[i].size / ratioY * escape); offsetEscapeLeftX = offsetEscapeX - (allPossibleThreats[i].size / ratioLeftX * escapeMid); offsetEscapeLeftY = offsetEscapeY - (allPossibleThreats[i].size / ratioLeftY * escapeMid); offsetEscapeRightX = offsetEscapeX + (allPossibleThreats[i].size / ratioLeftX * escapeMid); offsetEscapeRightY = offsetEscapeY + (allPossibleThreats[i].size / ratioLeftY * escapeMid); } else if (allPossibleThreats[i].size >= m[0].size * 2.1) { offsetX = allPossibleThreats[i].x - (allPossibleThreats[i].size / ratioX * 4); offsetY = allPossibleThreats[i].y - (allPossibleThreats[i].size / ratioY * 4); offsetLeftX = allPossibleThreats[i].x - (allPossibleThreats[i].size / ratioLeftX * 4); offsetLeftY = allPossibleThreats[i].y - (allPossibleThreats[i].size / ratioLeftY * 4); offsetRightX = allPossibleThreats[i].x + (allPossibleThreats[i].size / ratioLeftX * 4); offsetRightY = allPossibleThreats[i].y + (allPossibleThreats[i].size / ratioLeftY * 4); offsetEscapeX = allPossibleThreats[i].x - (allPossibleThreats[i].size / ratioX * escape); offsetEscapeY = allPossibleThreats[i].y - (allPossibleThreats[i].size / ratioY * escape); offsetEscapeLeftX = offsetEscapeX - (allPossibleThreats[i].size / ratioLeftX * escapeMid); offsetEscapeLeftY = offsetEscapeY - (allPossibleThreats[i].size / ratioLeftY * escapeMid); offsetEscapeRightX = offsetEscapeX + (allPossibleThreats[i].size / ratioLeftX * escapeMid); offsetEscapeRightY = offsetEscapeY + (allPossibleThreats[i].size / ratioLeftY * escapeMid); } else { offsetX = allPossibleThreats[i].x - (allPossibleThreats[i].size / ratioX * 1); offsetY = allPossibleThreats[i].y - (allPossibleThreats[i].size / ratioY * 1); offsetLeftX = allPossibleThreats[i].x - (allPossibleThreats[i].size / ratioLeftX * 3); offsetLeftY = allPossibleThreats[i].y - (allPossibleThreats[i].size / ratioLeftY * 3); offsetRightX = allPossibleThreats[i].x + (allPossibleThreats[i].size / ratioLeftX * 3); offsetRightY = allPossibleThreats[i].y + (allPossibleThreats[i].size / ratioLeftY * 3); offsetEscapeX = allPossibleThreats[i].x - (allPossibleThreats[i].size / ratioX * escape); offsetEscapeY = allPossibleThreats[i].y - (allPossibleThreats[i].size / ratioY * escape); offsetEscapeLeftX = offsetEscapeX - (allPossibleThreats[i].size / ratioLeftX * escapeMid); offsetEscapeLeftY = offsetEscapeY - (allPossibleThreats[i].size / ratioLeftY * escapeMid); offsetEscapeRightX = offsetEscapeX + (allPossibleThreats[i].size / ratioLeftX * escapeMid); offsetEscapeRightY = offsetEscapeY + (allPossibleThreats[i].size / ratioLeftY * escapeMid); } if (m[0].x < allPossibleThreats[i].x && m[0].y > allPossibleThreats[i].y) { var c = offsetRightX; offsetRightX = offsetLeftX; offsetLeftX = c; var d = offsetRightY; offsetRightY = offsetLeftY; offsetLeftY = d; var e = offsetEscapeRightX; offsetEscapeRightX = offsetEscapeLeftX; offsetEscapeLeftX = e; var f = offsetEscapeRightY; offsetEscapeRightY = offsetEscapeLeftY; offsetEscapeLeftY = f; //console.log("Swap"); } else if (m[0].x > allPossibleThreats[i].x && m[0].y > allPossibleThreats[i].y) { var c = offsetRightX; offsetRightX = offsetLeftX; offsetLeftX = c; var d = offsetRightY; offsetRightY = offsetLeftY; offsetLeftY = d; var e = offsetEscapeRightX; offsetEscapeRightX = offsetEscapeLeftX; offsetEscapeLeftX = e; var f = offsetEscapeRightY; offsetEscapeRightY = offsetEscapeLeftY; offsetEscapeLeftY = f; //console.log("Swap"); } //offsetX = ((allPossibleThreats[i].x + m[0].x) / 2); //offsetY = ((allPossibleThreats[i].y + m[0].y) / 2); drawPoint(offsetX, offsetY, 2); drawPoint(offsetLeftX, offsetLeftY, 3); drawPoint(offsetRightX, offsetRightY, 3); var SSlope = inverseSlope(allPossibleThreats[i].x, allPossibleThreats[i].y, sidePoints[0][0], sidePoints[0][1]); threatLineLeft = [[offsetLeftX, offsetLeftY], [offsetX, offsetY]]; threatLineRight = [[offsetRightX, offsetRightY], [offsetX, offsetY]]; threatLine = pointsOnLine(iSlope, offsetX, offsetY); drawLine(allPossibleThreats[i].x, allPossibleThreats[i].y, m[0].x, m[0].y, 3); //drawLine(threatLine[0][0], threatLine[0][1], threatLine[1][0], threatLine[1][1], 0); drawLine(threatLineLeft[0][0], threatLineLeft[0][1], threatLineLeft[1][0], threatLineLeft[1][1], 0); drawLine(threatLineRight[0][0], threatLineRight[0][1], threatLineRight[1][0], threatLineRight[1][1], 0); allThreatLines.push([threatLineLeft, threatLineRight]); drawPoint(offsetEscapeLeftX, offsetEscapeLeftY, 4); drawPoint(offsetEscapeRightX, offsetEscapeRightY, 4); //drawPoint(offsetEscapeX, offsetEscapeY, 4); //allFallbackPoints.push([offsetEscapeX, offsetEscapeY]); allFallbackPointsLeft.push([offsetEscapeLeftX, offsetEscapeLeftY]); allFallbackPointsRight.push([offsetEscapeRightX, offsetEscapeRightY]); //allFallbackPoints.push([offsetEscapeRightX, offsetEscapeRightY]); allFallbackmool.push(true); //allFallbackmool.push(true); allFallbackCount.push(0); //allFallbackCount.push(0); var badSide = isSideLine(threatLine[0], threatLine[1], [allPossibleThreats[i].x, allPossibleThreats[i].y]); var badSideLeft = isSideLine(threatLineLeft[0], threatLineLeft[1], [allPossibleThreats[i].x, allPossibleThreats[i].y]); var badSideRight = isSideLine(threatLineRight[0], threatLineRight[1], [allPossibleThreats[i].x, allPossibleThreats[i].y]); allThreatLinesmool.push([badSideLeft, badSideRight]); isSafeSpot = ( badSideLeft != isSideLine(threatLineLeft[0], threatLineLeft[1], [m[0].x, m[0].y]) && badSideRight != isSideLine(threatLineRight[0], threatLineRight[1], [m[0].x, m[0].y]) && isSafeSpot ); var removeClusterList = []; for (var j = 0; j < clusterAllFood.length; j++) { if ( badSideLeft == isSideLine(threatLineLeft[0], threatLineLeft[1], [clusterAllFood[j][0], clusterAllFood[j][1]]) && badSideRight == isSideLine(threatLineRight[0], threatLineRight[1], [clusterAllFood[j][0], clusterAllFood[j][1]]) ) { removeClusterList.push(j); } } for (var j = removeClusterList.length - 1; j >= 0; j--) { if (!toggle) { drawPoint(clusterAllFood[j][0], clusterAllFood[j][1], 0); } clusterAllFood.splice(removeClusterList[j], 1); } if ( badSideLeft == isSideLine(threatLineLeft[0], threatLineLeft[1], [tempPoint[0], tempPoint[1]]) && badSideRight == isSideLine(threatLineRight[0], threatLineRight[1], [tempPoint[0], tempPoint[1]]) ) { tempPoint[2] = 0; } } for (var i = 0; i < clusterAllFood.length; i++) { //console.log("mefore: " + clusterAllFood[i][2]); clusterAllFood[i][2] = clusterAllFood[i][2] * 6 - computeDistance(clusterAllFood[i][0], clusterAllFood[i][1], m[0].ox, m[0].oy); if (!toggle) { drawPoint(clusterAllFood[i][0], clusterAllFood[i][1], 1); } //console.log("After: " + clusterAllFood[i][2]); } if (clusterAllFood.length != 0 && isSafeSpot) { biggestCluster = clusterAllFood[0]; for (var i = 1; i < clusterAllFood.length; i++) { if (clusterAllFood[i][2] > biggestCluster[2]) { biggestCluster = clusterAllFood[i]; } } /** * #1 Get a list of all the food. * #2 Get a list of all the threats. * #3 Remove all the food near threats. * #4 Find closest food after the filter. */ if (closestNiceViruse != null && closestNiceViruse[0].size * 1.15 <= m[0].size) { for (var i = 0; i < m.length; i++) { drawLine(m[i].ox, m[i].oy, closestNiceViruse[0].x, closestNiceViruse[0].y, 5); } virusmait = true; tempMoveX = closestNiceViruse[0].x; tempMoveY = closestNiceViruse[0].y; } else { for (var i = 0; i < m.length; i++) { drawLine(m[i].ox, m[i].oy, biggestCluster[0], biggestCluster[1], 1); } virusmait = false; tempMoveX = biggestCluster[0]; tempMoveY = biggestCluster[1]; //console.log("Moving"); } //console.log("X: " + P + " Y: " + Q); if (!toggle) { if (m.length > 1 && splitted) { splitted = false; tempMoveX = biggestCluster[0]; tempMoveY = biggestCluster[1]; } if (splitting) { tempMoveX = biggestCluster[0]; tempMoveY = biggestCluster[1]; A(17); splitting = false; splitted = true; } if (biggestCluster[2] * 2.5 < m[0].size && biggestCluster[2] > m[0].size / 5 && biggestCluster[2] > 11 && !splitted && !splitting) { drawLine(m[0].x, m[0].y, biggestCluster[0], biggestCluster[1], 4); var worthyTargetDistance = computeDistance(m[0].x, m[0].y, biggestCluster[0], biggestCluster[1]); console.log("I want to split."); if ((worthyTargetDistance < m[0].size * 3) && m.length == 1) { tempMoveX = biggestCluster[0]; tempMoveY = biggestCluster[1]; splitting = true; } } } } else if (!virusmait) { //console.log("I'm lost, where do I go?"); /*if (closestThreatIndex2 != null) { if (allPossibleThreats[closestThreatIndex].x < allPossibleThreats[closestThreatIndex2].x && allPossibleThreats[closestThreatIndex].y < allPossibleThreats[closestThreatIndex2].y) { tempMoveX = allFallbackPointsLeft[closestThreatIndex][0]; tempMoveY = allFallbackPointsLeft[closestThreatIndex][1]; } else if (allPossibleThreats[closestThreatIndex].x > allPossibleThreats[closestThreatIndex2].x && allPossibleThreats[closestThreatIndex].y < allPossibleThreats[closestThreatIndex2].y) { tempMoveX = allFallbackPointsRight[closestThreatIndex][0]; tempMoveY = allFallbackPointsRight[closestThreatIndex][1]; } else if (allPossibleThreats[closestThreatIndex].x < allPossibleThreats[closestThreatIndex2].x && allPossibleThreats[closestThreatIndex].y > allPossibleThreats[closestThreatIndex2].y) { tempMoveX = allFallbackPointsRight[closestThreatIndex][0]; tempMoveY = allFallbackPointsRight[closestThreatIndex][1]; } else if (allPossibleThreats[closestThreatIndex].x > allPossibleThreats[closestThreatIndex2].x && allPossibleThreats[closestThreatIndex].y > allPossibleThreats[closestThreatIndex2].y) { tempMoveX = allFallbackPointsLeft[closestThreatIndex][0]; tempMoveY = allFallbackPointsLeft[closestThreatIndex][1]; } else { console.log("Hmm, WTF!!!"); } } else { tempMoveX = allFallbackPointsLeft[closestThreatIndex][0]; tempMoveY = allFallbackPointsLeft[closestThreatIndex][1]; }*/ tempMoveX = allFallbackPointsLeft[closestThreatIndex][0]; tempMoveY = allFallbackPointsLeft[closestThreatIndex][1]; if (tempMoveX < S || tempMoveX > U) { tempMoveX = allFallbackPointsRight[closestThreatIndex][0]; tempMoveY = allFallbackPointsRight[closestThreatIndex][1]; } else if (tempMoveX < T || tempMoveX > V) { tempMoveX = allFallbackPointsRight[closestThreatIndex][0]; tempMoveY = allFallbackPointsRight[closestThreatIndex][1]; } drawLine(m[0].x, m[0].y, tempMoveX, tempMoveY, 6); //#1 Find closest enemy. //#2 go to its teal line. /*for (var i = 0; i < allFallbackPoints.length; i++) { for (var j = 0; j < allThreatLines.length; j++) { var badSideLeft = allThreatLinesmool[0]; var badSideRight = allThreatLinesmool[1]; if (allFallbackmool[i] && badSideLeft != isSideLine(allThreatLines[j][0][0], allThreatLines[j][0][1], allFallbackPoints[i]) && badSideRight != isSideLine(allThreatLines[j][1][0], allThreatLines[j][1][1], allFallbackPoints[i]) ) { allFallbackmool[i] = true; //console.log("Step 1"); } else { //console.log("Failed Step 1"); allFallbackmool[i] = false; allFallbackCount[i] += 1; } } } var closestFallback = null; var fallbackDistance = null; for (var i = 1; i < allFallbackPoints.length; i++) { if (allFallbackmool[i]) { var tempDistance = computeDistance(m[0].x, m[0].y, allFallbackPoints[i][0], allFallbackPoints[i][1]); if (closestFallback != null) { if (tempDistance < fallbackDistance) { closestFallback = allFallbackPoints[i]; fallbackDistance = tempDistance; } } else { //console.log("FOUND CHILL SPOT!"); closestFallback = allFallbackPoints[i]; fallbackDistance = tempDistance; } } } if (closestFallback != null) { console.log("ESCAPING"); tempMoveX = closestFallback[0]; tempMoveY = closestFallback[1]; drawLine(m[0].x, m[0].y, tempMoveX, tempMoveY, 6); } else { console.log("NOPE! NEVER RUNNING AWAY!"); }*/ //#1 Loop through fallbackpoints //#2 Loop through threatlines //#3 Verify if a point is fine. If not, add counter to point's overlaps //#4 Go to closest safe point, otherwise find point with lowest counter. } drawPoint(tempPoint[0], tempPoint[1], tempPoint[2]); tempPoint[2] = 1; } if (!toggle) { P = tempMoveX; Q = tempMoveY; } } function drawPoint(x_1, y_1, drawColor) { if (!toggleDraw) { var x1 = ((x_1 - I) * k) + l/2; var y1 = ((y_1 - J) * k) + r/2; dPoints.push([x1, y1, drawColor]); } } function drawLine(x_1, y_1, x_2, y_2, drawColor) { if (!toggleDraw) { var x1 = ((x_1 - I) * k) + l/2; var y1 = ((y_1 - J) * k) + r/2; var x2 = ((x_2 - I) * k) + l/2; var y2 = ((y_2 - J) * k) + r/2; lines.push([x1, y1, x2, y2, drawColor]); } } function E() { findDestination(); if (null != h && h.readyState == h.OPEN) { var a = N - l / 2, b = O - r / 2; 64 > a * a + b * b || sa == P && ta == Q || (sa = P, ta = Q, a = new ArrayBuffer(21), b = new DataView(a), b.setUint8(0, 16), b.setFloat64(1, P, !0), b.setFloat64(9, Q, !0), b.setUint32(17, 0, !0), h.send(a)) } } function pa() { if (null != h && h.readyState == h.OPEN && null != L) { var a = new ArrayBuffer(1 + 2 * L.length), b = new DataView(a); b.setUint8(0, 0); for (var c = 0; c < L.length; ++c) b.setUint16(1 + 2 * c, L.charCodeAt(c), !0); h.send(a) } } function A(a) { if (null != h && h.readyState == h.OPEN) { var b = new ArrayBuffer(1); (new DataView(b)).setUint8(0, a); h.send(b) } } function ka() { ba(); g.requestAnimationFrame(ka) } function ja() { l = g.innerWidth; r = g.innerHeight; $.width = z.width = l; $.height = z.height = r; ba() } function Ca() { if (0 != m.length) { for (var a = 0, b = 0; b < m.length; b++) a += m[b].size; a = Math.pow(Math.min(64 / a, 1), 0.4) * Math.max(r / 1080, l / 1920); k = (9 * k + a) / 10 } } function ba() { var a = + new Date; ++Da; D = + new Date; if (0 < m.length) { Ca(); for (var b = 0, c = 0, e = 0; e < m.length; e++) m[e].updatePos(), b += m[e].x / m.length, c += m[e].y / m.length; I = b; J = c; K = k; s = (s + b) / 2; t = (t + c) / 2 } else s = (29 * s + I) / 30, t = (29 * t + J) / 30, k = (9 * k + K) / 10; xa(); aa(); d.clearRect(0, 0, l, r); d.fillStyle = ea ? '#111111' : '#F2FBFF'; d.fillRect(0, 0, l, r); d.save(); d.strokeStyle = ea ? '#AAAAAA' : '#000000'; d.globalAlpha = 0.2; d.scale(k, k); b = l / k; c = r / k; for (e = - 0.5 + ( - s + b / 2) % 50; e < b; e += 50) d.beginPath(), d.moveTo(e, 0), d.lineTo(e, c), d.stroke(); for (e = - 0.5 + ( - t + c / 2) % 50; e < c; e += 50) d.beginPath(), d.moveTo(0, e), d.lineTo(b, e), d.stroke(); d.restore(); p.sort(function (a, b) { return a.size == b.size ? a.id - b.id : a.size - b.size }); d.save(); d.translate(l / 2, r / 2); d.scale(k, k); d.translate( - s, - t); for (e = 0; e < C.length; e++) C[e].draw(); for (e = 0; e < p.length; e++) p[e].draw(); d.restore(); y && 0 != w.length && d.drawImage(y, l - y.width - 10, 10); M = Math.max(M, Ea()); sessionScore = Math.max(sessionScore, M); 0 != M && (null == W && (W = new X(24, '#FFFFFF')), W.setValue('Score: ' + ~~(M / 100) + ' || Best Score: ' + ~~(sessionScore / 100)), c = W.render(), b = c.width, d.globalAlpha = 0.2, d.fillStyle = '#000000', d.fillRect(10, r - 10 - 24 - 10, b + 10, 34), d.globalAlpha = 1, d.drawImage(c, 15, r - 10 - 24 - 5)); Fa(); a = + new Date - a; a > 1000 / 60 ? u -= 0.01 : a < 1000 / 65 && (u += 0.01); 0.4 > u && (u = 0.4); 1 < u && (u = 1) for (var i = 0; i < dPoints.length; i++) { var radius = 10; d.beginPath(); d.arc(dPoints[i][0], dPoints[i][1], radius, 0, 2 * Math.PI, false); if (dPoints[i][2] == 0) { d.fillStyle = "black"; } else if (dPoints[i][2] == 1) { d.fillStyle = "yellow"; } else if (dPoints[i][2] == 2) { d.fillStyle = "blue"; } else if (dPoints[i][2] == 3) { d.fillStyle = "red"; } else if (dPoints[i][2] == 4) { d.fillStyle = "#008080"; } else { d.fillStyle = "#000000"; } d.fill(); d.lineWidth = 2; d.strokeStyle = '#003300'; d.stroke(); } d.lineWidth = 1; for(var i = 0; i < lines.length; i++) { d.beginPath(); d.lineWidth = 5; if (lines[i][4] == 0) { d.strokeStyle = "#FF0000"; } else if (lines[i][4] == 1) { d.strokeStyle = "#00FF00"; } else if (lines[i][4] == 2) { d.strokeStyle = "#0000FF"; } else if (lines[i][4] == 3) { d.strokeStyle = "#FF8000"; } else if (lines[i][4] == 4) { d.strokeStyle = "#8A2BE2"; } else if (lines[i][4] == 5) { d.strokeStyle = "#FF69B4"; } else if (lines[i][4] == 6) { d.strokeStyle = "#008080"; } else { d.strokeStyle = "#000000"; } d.moveTo(lines[i][0], lines[i][1]); d.lineTo(lines[i][2], lines[i][3]); d.stroke(); } d.lineWidth = 1; } function Fa() { if (ia && fa.width) { var a = l / 5; d.drawImage(fa, 5, 5, a, a) } } function Ea() { for (var a = 0, b = 0; b < m.length; b++) a += m[b].nSize * m[b].nSize; return a } function qa() { if (0 != w.length) if (Y) { y = document.createElement('canvas'); var a = y.getContext('2d'), b = 60, b = null == x ? b + 24 * w.length : b + 180, c = Math.min(200, 0.3 * l) / 200; y.width = 200 * c; y.height = b * c; a.scale(c, c); a.globalAlpha = 0.4; a.fillStyle = '#000000'; a.fillRect(0, 0, 200, b); a.globalAlpha = 1; a.fillStyle = '#FFFFFF'; c = null; c = 'Leaderboard'; a.font = '30px Ubuntu'; a.fillText(c, 100 - a.measureText(c).width / 2, 40); if (null == x) { for (a.font = '20px Ubuntu', b = 0; b < w.length; ++b) { c = w[b].name || 'An unnamed cell', Y || (c = 'An unnamed cell'), - 1 != B.indexOf(w[b].id) ? (m[0].name && (c = m[0].name), a.fillStyle = '#FFAAAA') : a.fillStyle = '#FFFFFF', c = b + 1 + '. ' + c, a.fillText(c, 100 - a.measureText(c).width / 2, 70 + 24 * b); } } else for (b = c = 0; b < x.length; ++b) angEnd = c + x[b] * Math.PI * 2, a.fillStyle = Ga[b + 1], a.beginPath(), a.moveTo(100, 140), a.arc(100, 140, 80, c, angEnd, !1), a.fill(), c = angEnd } else y = null } function ra(a, b, c, e, d, f, g) { p.push(this); v[a] = this; this.id = a; this.ox = this.x = b; this.oy = this.y = c; this.oSize = this.size = e; this.color = d; this.isVirus = f; this.points = [ ]; this.pointsAcc = [ ]; this.createPoints(); this.setName(g) } function X(a, b, c, e) { a && (this._size = a); b && (this._color = b); this._stroke = !!c; e && (this._strokeColor = e) } if ('agar.io' != g.location.hostname && 'localhost' != g.location.hostname && '10.10.2.13' != g.location.hostname) g.location = 'http://agar.io/'; else if (g.top != g) g.top.location = 'http://agar.io/'; else { var $, toggle = false, toggleDraw = false, splitted = false, splitting = false, virusBait = false, tempPoint = [0, 0, 1], dPoints = [], lines = [], originalName, sessionScore = 0, d, z, l, r, F = null, h = null, s = 0, t = 0, B = [ ], m = [ ], v = { }, p = [ ], C = [ ], w = [ ], N = 0, O = 0, P = - 1, Q = - 1, Da = 0, D = 0, L = null, S = 0, T = 0, U = 10000, V = 10000, k = 1, G = null, ua = !0, Y = !0, ga = !1, da = !1, M = 0, ea = !1, va = !1, I = s = ~~((S + U) / 2), J = t = ~~((T + V) / 2), K = 1, H = '', x = null, Ga = [ '#333333', '#FF3333', '#33FF33', '#3333FF' ], ia = 'ontouchstart' in g && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), fa = new Image; fa.src = 'img/split.png'; var R = null; g.setNick = function (a) { originalName = a; ma(); L = a; pa(); M = 0 }; g.setRegion = la; g.setSkins = function (a) { ua = a }; g.setNames = function (a) { Y = a }; g.setDarkTheme = function (a) { ea = a }; g.setColors = function (a) { ga = a }; g.setShowMass = function (a) { va = a }; g.spectate = function () { A(1); ma() }; g.setGameMode = function (a) { a != H && (H = a, ca()) }; g.connect = oa; var sa = - 1, ta = - 1, y = null, u = 1, W = null, Z = { }, Ha = 'notreallyabot;poland;usa;china;russia;canada;australia;spain;brazil;germany;ukraine;france;sweden;hitler;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;ussr;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;nazi;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;isis;doge;nasa;byzantium;imperial japan;french kingdom;somalia;turkey;mars;pokerface'.split(';'), Ia = [ 'm\'blob' ]; ra.prototype = { id: 0, points: null, pointsAcc: null, name: null, nameCache: null, sizeCache: null, x: 0, y: 0, size: 0, ox: 0, oy: 0, oSize: 0, nx: 0, ny: 0, nSize: 0, updateTime: 0, updateCode: 0, drawTime: 0, destroyed: !1, isVirus: !1, destroy: function () { var a; for (a = 0; a < p.length; a++) if (p[a] == this) { p.splice(a, 1); break } delete v[this.id]; a = m.indexOf(this); - 1 != a && (da = !0, m.splice(a, 1)); a = B.indexOf(this.id); - 1 != a && B.splice(a, 1); this.destroyed = !0; C.push(this) }, getNameSize: function () { return Math.max(~~(0.3 * this.size), 24) }, setName: function (a) { if (this.name = a) null == this.nameCache ? this.nameCache = new X(this.getNameSize(), '#FFFFFF', !0, '#000000') : this.nameCache.setSize(this.getNameSize()), this.nameCache.setValue(this.name) }, createPoints: function () { for (var a = this.getNumPoints(); this.points.length > a; ) { var b = ~~(Math.random() * this.points.length); this.points.splice(b, 1); this.pointsAcc.splice(b, 1) } 0 == this.points.length && 0 < a && (this.points.push({ c: this, v: this.size, x: this.x, y: this.y }), this.pointsAcc.push(Math.random() - 0.5)); for (; this.points.length < a; ) { var b = ~~(Math.random() * this.points.length), c = this.points[b]; this.points.splice(b, 0, { c: this, v: c.v, x: c.x, y: c.y }); this.pointsAcc.splice(b, 0, this.pointsAcc[b]) } }, getNumPoints: function () { var a = 10; 20 > this.size && (a = 5); this.isVirus && (a = 30); return ~~Math.max(this.size * k * (this.isVirus ? Math.min(2 * u, 1) : u), a) }, movePoints: function () { this.createPoints(); for (var a = this.points, b = this.pointsAcc, c = b.concat(), e = a.concat(), d = e.length, f = 0; f < d; ++f) { var g = c[(f - 1 + d) % d], h = c[(f + 1) % d]; b[f] += Math.random() - 0.5; b[f] *= 0.7; 10 < b[f] && (b[f] = 10); - 10 > b[f] && (b[f] = - 10); b[f] = (g + h + 8 * b[f]) / 10 } for (var l = this, f = 0; f < d; ++f) { c = e[f].v; g = e[(f - 1 + d) % d].v; h = e[(f + 1) % d].v; if (15 < this.size && null != F) { var k = !1, n = a[f].x, m = a[f].y; F.retrieve2(n - 5, m - 5, 10, 10, function (a) { a.c != l && 25 > (n - a.x) * (n - a.x) + (m - a.y) * (m - a.y) && (k = !0) }); !k && (a[f].x < S || a[f].y < T || a[f].x > U || a[f].y > V) && (k = !0); k && (0 < b[f] && (b[f] = 0), b[f] -= 1) } c += b[f]; 0 > c && (c = 0); c = (12 * c + this.size) / 13; a[f].v = (g + h + 8 * c) / 10; g = 2 * Math.PI / d; h = this.points[f].v; this.isVirus && 0 == f % 2 && (h += 5); a[f].x = this.x + Math.cos(g * f) * h; a[f].y = this.y + Math.sin(g * f) * h } }, updatePos: function () { var a; a = (D - this.updateTime) / 120; a = 0 > a ? 0 : 1 < a ? 1 : a; a = a * a * (3 - 2 * a); this.getNameSize(); if (this.destroyed && 1 <= a) { var b = C.indexOf(this); - 1 != b && C.splice(b, 1) } this.x = a * (this.nx - this.ox) + this.ox; this.y = a * (this.ny - this.oy) + this.oy; this.size = a * (this.nSize - this.oSize) + this.oSize; return a }, shouldRender: function () { return this.x + this.size + 40 < s - l / 2 / k || this.y + this.size + 40 < t - r / 2 / k || this.x - this.size - 40 > s + l / 2 / k || this.y - this.size - 40 > t + r / 2 / k ? !1 : !0 }, draw: function () { if (this.shouldRender()) { var a = !this.isVirus && 0.5 > k; d.save(); this.drawTime = D; var b = this.updatePos(); this.destroyed && (d.globalAlpha *= 1 - b); d.lineWidth = 10; d.lineCap = 'round'; d.lineJoin = this.isVirus ? 'mitter' : 'round'; ga ? (d.fillStyle = '#FFFFFF', d.strokeStyle = '#AAAAAA') : (d.fillStyle = this.color, d.strokeStyle = this.color); if (a) d.beginPath(), d.arc(this.x, this.y, this.size, 0, 2 * Math.PI, !1); else { this.movePoints(); d.beginPath(); b = this.getNumPoints(); d.moveTo(this.points[0].x, this.points[0].y); for (var c = 1; c <= b; ++c) { var e = c % b; d.lineTo(this.points[e].x, this.points[e].y) } } d.closePath(); b = this.name.toLowerCase(); ua && '' == H ? - 1 != Ha.indexOf(b) ? (Z.hasOwnProperty(b) || (Z[b] = new Image, b == "notreallyabot" ? Z[b].src = "http://i.imgur.com/ZW5T4cd.png" : Z[b].src = 'skins/' + b + '.png'), c = Z[b]) : c = null : c = null; b = c ? - 1 != Ia.indexOf(b) : !1; a || d.stroke(); d.fill(); null != c && 0 < c.width && !b && (d.save(), d.clip(), d.drawImage(c, this.x - this.size, this.y - this.size, 2 * this.size, 2 * this.size), d.restore()); (ga || 15 < this.size) && !a && (d.strokeStyle = '#000000', d.globalAlpha *= 0.1, d.stroke()); d.globalAlpha = 1; null != c && 0 < c.width && b && d.drawImage(c, this.x - 2 * this.size, this.y - 2 * this.size, 4 * this.size, 4 * this.size); c = - 1 != m.indexOf(this); a = ~~this.y; if ((Y || c) && this.name && this.nameCache) { e = this.nameCache; e.setValue(this.name); e.setSize(this.getNameSize()); b = Math.ceil(10 * k) / 10; e.setScale(b); var e = e.render(), g = ~~(e.width / b), f = ~~(e.height / b); d.drawImage(e, ~~this.x - ~~(g / 2), a - ~~(f / 2), g, f); a += e.height / 2 / b + 4 } va && c && (null == this.sizeCache && (this.sizeCache = new X(this.getNameSize() / 2, '#FFFFFF', !0, '#000000')), c = this.sizeCache, c.setSize(this.getNameSize() / 2), c.setValue(~~(this.size * this.size / 100)), b = Math.ceil(10 * k) / 10, c.setScale(b), e = c.render(), g = ~~(e.width / b), f = ~~(e.height / b), d.drawImage(e, ~~this.x - ~~(g / 2), a - ~~(f / 2), g, f)); d.restore() } } }; X.prototype = { _value: '', _color: '#000000', _stroke: !1, _strokeColor: '#000000', _size: 16, _canvas: null, _ctx: null, _dirty: !1, _scale: 1, setSize: function (a) { this._size != a && (this._size = a, this._dirty = !0) }, setScale: function (a) { this._scale != a && (this._scale = a, this._dirty = !0) }, setColor: function (a) { this._color != a && (this._color = a, this._dirty = !0) }, setStroke: function (a) { this._stroke != a && (this._stroke = a, this._dirty = !0) }, setStrokeColor: function (a) { this._strokeColor != a && (this._strokeColor = a, this._dirty = !0) }, setValue: function (a) { a != this._value && (this._value = a, this._dirty = !0) }, render: function () { null == this._canvas && (this._canvas = document.createElement('canvas'), this._ctx = this._canvas.getContext('2d')); if (this._dirty) { this._dirty = !1; var a = this._canvas, b = this._ctx, c = this._value, e = this._scale, d = this._size, f = d + 'px Ubuntu'; b.font = f; var g = b.measureText(c).width, h = ~~(0.2 * d); a.width = (g + 6) * e; a.height = (d + h) * e; b.font = f; b.scale(e, e); b.globalAlpha = 1; b.lineWidth = 3; b.strokeStyle = this._strokeColor; b.fillStyle = this._color; this._stroke && b.strokeText(c, 3, d - h / 2); b.fillText(c, 3, d - h / 2) } return this._canvas } }; g.onload = wa } }) (window, jQuery);
gaoxufei
nx console
Aliadeek
Nx Console is the user interface for Nx & Lerna.
jerryorta-dev
Nx angular repo to troubleshoot VScode nx console extension
Ehte22
No description available
danplubell
No description available
SoftwareTestTerumo
No description available
zhm8366
No description available
StijnDeVosSISW
Launcher application for different NX version. This is a console application.
vsavkin
No description available