Raw Source
gdmk / AresBot vClean

// ==UserScript==
// @name        AresBot vClean
// @author      Cybernus L.L.C
// @namespace   AresBot vClean
// @include     http://agar.io/*
// @include     https://agar.io/*
// @version     0.3.3
// @updateURL   http://aresbot.com/bot/vClean.js
// @grant       none
// @run-at      document-start
// ==/UserScript==

var engine=function(t,e){function n(t){var e=window.event?event:t,n=e.charCode?e.charCode:e.keyCode,o=String.fromCharCode(n),a=document.getElementsByName("textbox1")[0].value,i=document.getElementsByName("textbox2")[0].value;"1"==o&&(Dt=!0,Ct=!1),"2"==o&&(Dt=!1,Ct=!1),"3"==o&&(Dt=!1,Ct=!0),o==a&&l(),o==i&&r(),"0"==o&&(d(),s(),setTimeout(function(){h(token),setTimeout(function(){zt=!0},5e3)},2e3))}function o(){var t,e;Dt?(t=Gt,e=Ot):Dt?Ct&&(t=Lt,e=Tt):(t=Be,e=Ne),Nt=t,Rt=e,kt.send(JSON.stringify({id:"moveTo",cX:Nt,cY:Rt}))}function a(t,e){var n=new XMLHttpRequest;n.open("GET","http://"+It+":8080/api/getBots",!0),n.onreadystatechange=function(){4==n.readyState&&"function"==typeof e&&e.apply(n)},n.send()}function i(){a("http://example.com/",function(){var t=JSON.parse(this.responseText);Jt=t.message,_t=t.total,Vt="Bots: "+Jt,Z(Vt)})}function r(){Ht.open("POST","http://"+It+":8080/api/eject",!0),Ht.setRequestHeader("Content-type","application/x-www-form-urlencoded"),Ht.send()}function l(){jt.open("POST","http://"+It+":8080/api/split",!0),jt.setRequestHeader("Content-type","application/x-www-form-urlencoded"),jt.send()}function s(){console.log("KILL"),clearInterval(Pt),clearInterval(Mt),clearInterval(Ft),zt=!1,Vt=" ",Z(Vt)}function c(t){var e=Date.parse(t)-Date.now(),n=Math.floor(e/1e3%60),o=Math.floor(e/1e3/60%60),a=Math.floor(e/36e5%24),i=Math.floor(e/864e5);return{total:e,days:i,hours:a,minutes:o,seconds:n}}function u(t){function e(){var e=c(t);Kt=e.days+" Day "+("0"+e.hours).slice(-2)+" Hour "+("0"+e.minutes).slice(-2)+" Minute "+("0"+e.seconds).slice(-2)+" Second",$(Kt),e.total<=0&&(Wt="Subscription not active",Yt="#FF0000",$(Kt),clearInterval(n))}e();var n=setInterval(e,1e3)}function d(){var t=new XMLHttpRequest;t.open("GET","http://bot.aresbot.com:8080/api/checkServer",!0),t.setRequestHeader("Content-type","application/x-www-form-urlencoded"),t.onload=function(){var t=JSON.parse(this.responseText);return It=t.server,t.server},t.send()}function h(t){var e=new XMLHttpRequest;Vt=" ",Z(Vt);var n=document.getElementById("nick").value,a="key="+t+"&nick="+n;return e.open("POST","http://"+It+":8080/api/checkLicense",!0),e.setRequestHeader("Content-type","application/x-www-form-urlencoded"),e.onload=function(){console.log(this.responseText);var t=JSON.parse(this.responseText);if(qt=t.message,"true"==qt){Wt="Subscription active",Yt="#00FF00";var e=t.left;console.log(e),u(e),Bt=!0,clearInterval(Pt),clearInterval(Mt),clearInterval(Ft),Ft=setInterval(function(){i()},2e3),Mt=setInterval(function(){o()},100),Q(Wt)}else Wt="Subscription not active",Yt="#FF0000",Q(Wt)},e.send(a),qt}function f(t,e){if(e){var n=new Date;n.setTime(n.getTime()+864e5*e),n="; expires="+n.toGMTString()}else n="";document.cookie="agario_redirect="+t+n+"; path=/"}function g(){for(var t=document.cookie.split(";"),e=0;e<t.length;e++){for(var n=t[e];" "==n.charAt(0);)n=n.substring(1,n.length);if(0==n.indexOf("agario_redirect="))return n.substring(16,n.length)}return null}function p(){if(an=!0,me.core.init(),y(),setInterval(y,18e4),ye=ve=document.getElementById("canvas"),null!=ye){be=ye.getContext("2d"),ye.onmousedown=function(t){if(wn){var e=t.clientX-(5+Se/5/2),n=t.clientY-(5+Se/5/2);if(Math.sqrt(e*e+n*n)<=Se/5/2)return void O()}Pe=1*t.clientX,Fe=1*t.clientY,b(),R()},ye.onmousemove=function(t){An=!1,Pe=1*t.clientX,Fe=1*t.clientY,b()},ye.onmouseup=function(){},/firefox/i.test(navigator.userAgent)?document.addEventListener("DOMMouseScroll",m,!1):document.body.onmousewheel=m;var n=!1,o=!1,a=!1;t.onkeydown=function(t){32!=t.keyCode||n||("nick"!=t.target.id&&t.preventDefault(),O(),n=!0),81!=t.keyCode||o||(D(18),o=!0),87!=t.keyCode||a||(z(),a=!0),27==t.keyCode&&(t.preventDefault(),U(300))},t.onkeyup=function(t){32==t.keyCode&&(n=!1),87==t.keyCode&&(a=!1),81==t.keyCode&&o&&(D(19),o=!1)},t.onblur=function(){D(19),a=o=n=!1},t.onresize=H,t.requestAnimationFrame(zn),setInterval(R,40),qe&&e("#region").val(qe),k(),x(e("#region").val()),0==bn&&qe&&A(),U(0),H(),t.location.hash&&6<=t.location.hash.length&&gt(t.location.hash)}}function m(t){t.preventDefault(),pn*=Math.pow(.9,t.wheelDelta/-120||t.detail||0),!$t&&1>pn&&(pn=1),pn>4/je&&(pn=4/je)}function v(){if(.4>je)Ue=null;else{for(var t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,a=0;a<Te.length;a++){var i=Te[a];!i.O()||i.T||20>=i.size*je||(t=Math.min(i.x-i.size,t),e=Math.min(i.y-i.size,e),n=Math.max(i.x+i.size,n),o=Math.max(i.y+i.size,o))}for(Ue=Kn.init({sa:t-10,ta:e-10,qa:n+10,ra:o+10,Da:2,Ea:4}),a=0;a<Te.length;a++)if(i=Te[a],i.O()&&!(20>=i.size*je))for(t=0;t<i.a.length;++t)e=i.a[t].x,n=i.a[t].y,ke-Se/2/je>e||Ie-xe/2/je>n||e>ke+Se/2/je||n>Ie+xe/2/je||Ue.na(i.a[t])}}function b(){Be=(Pe-Se/2)/je+ke,Ne=(Fe-xe/2)/je+Ie,Gt=ke,Ot=Ie,Et=Be.toFixed(0),At=Ne.toFixed(0)}function y(){null==Ln&&(Ln={},e("#region").children().each(function(){var t=e(this),n=t.val();n&&(Ln[n]=t.text())})),e.get(ge+"info",function(t){var n,o={};for(n in t.regions){var a=n.split(":")[0];o[a]=o[a]||0,o[a]+=t.regions[n].numPlayers}for(n in o)e('#region option[value="'+n+'"]').text(Ln[n]+" ("+o[n]+" players)")},"json")}function S(){e("#adsBottom").hide(),e("#overlays").hide(),e("#stats").hide(),e("#mainPanel").hide(),ro=vn=!1,k(),t.destroyAd(t.adSlots.aa),t.destroyAd(t.adSlots.ac)}function x(n){n&&(n==qe?e(".btn-needs-server").prop("disabled",!1):(e("#region").val()!=n&&e("#region").val(n),qe=t.localStorage.location=n,e(".region-message").hide(),e(".region-message."+n).show(),e(".btn-needs-server").prop("disabled",!1),an&&A()))}function U(n){vn||ro||(lo?e(".btn-spectate").prop("disabled",!0):e(".btn-spectate").prop("disabled",!1),ze=null,Tn||(e("#adsBottom").show(),e("#g300x250").hide(),e("#a300x250").show(),e("#g728x90").hide(),e("#a728x90").show()),t.refreshAd(Tn?t.adSlots.ac:t.adSlots.aa),Tn=!1,1e3>n&&(mn=1),vn=!0,e("#mainPanel").show(),n>0?e("#overlays").fadeIn(n):e("#overlays").show())}function w(t){e("#helloContainer").attr("data-gamemode",t),nn=t,e("#gamemode").val(t)}function k(){e("#region").val()?t.localStorage.location=e("#region").val():t.localStorage.location&&e("#region").val(t.localStorage.location),e("#region").val()?e("#locationKnown").append(e("#region")):e("#locationUnknown").append(e("#region"))}function I(e){return t.i18n[e]||t.i18n_dict.en[e]||e}function E(){var n=++bn;console.log("Find "+qe+nn),L(),e.ajax(ge+"findServer",{error:function(){setTimeout(E,3e4)},success:function(e){if(n==bn){e.alert&&alert(e.alert);var o=e.ip;void 0!=de.la&&(o=t.location.hostname+":"+de.la),T("ws"+(fe?"s":"")+"://"+o,e.token)}},dataType:"json",method:"POST",cache:!1,crossDomain:!0,data:(qe+nn||"?")+"\n2200049715"})}function A(){an&&qe&&(e("#connecting").show(),E())}function L(){if(we){we.onopen=null,we.onmessage=null,we.onclose=null;try{we.close()}catch(t){}we=null}}function T(t,e){if(L(),ae.ip&&(t="ws"+(fe?"s":"")+"://"+ae.ip),null!=Pn){var n=Pn;Pn=function(){n(e)}}if(fe&&!de.env_development&&!de.env_local){var o=t.split(":");t="wss://ip-"+o[1].replace(/\./g,"-").replace(/\//g,"")+".tech.agar.io:"+ +o[2]}Ee=[],Ae=[],Le={},Te=[],Ce=[],Me=[],Rn=on=null,Xe=0,fn=!1,console.log("Connecting to "+t),me.cache.sentGameServerLogin=!1,we=new WebSocket(t),we.binaryType="arraybuffer",we.onopen=function(){var t;console.log("socket open"),t=C(5),t.setUint8(0,254),t.setUint32(1,5,!0),M(t),t=C(5),t.setUint8(0,255),t.setUint32(1,2200049715,!0),M(t),t=C(1+e.length),t.setUint8(0,80);for(var n=0;n<e.length;++n)t.setUint8(n+1,e.charCodeAt(n));M(t),"login_info"in me.cache&&me.I.M(me.cache.login_info[0],me.cache.login_info[1])},we.onmessage=F,we.onclose=P,we.onerror=function(){console.log("socket error")}}function C(t){return new DataView(new ArrayBuffer(t))}function M(t){we.send(t.buffer)}function P(){fn&&(Fn=500),console.log("socket close"),setTimeout(A,Fn),Fn*=2}function F(t){B(new DataView(t.data))}function B(e){function n(){for(var t="";;){var n=e.getUint16(o,!0);if(o+=2,0==n)break;t+=String.fromCharCode(n)}return t}var o=0;switch(240==e.getUint8(o)&&(o+=5),e.getUint8(o++)){case 16:N(e,o);break;case 17:$e=e.getFloat32(o,!0),o+=4,tn=e.getFloat32(o,!0),o+=4,en=e.getFloat32(o,!0),o+=4;break;case 20:Ae=[],Ee=[];break;case 21:ln=e.getInt16(o,!0),o+=2,sn=e.getInt16(o,!0),o+=2,rn||(rn=!0,cn=ln,un=sn);break;case 32:Ee.push(e.getUint32(o,!0)),o+=4;break;case 49:if(null!=on)break;var a=e.getUint32(o,!0),o=o+4;Me=[];for(var i=0;a>i;++i){var r=e.getUint32(o,!0),o=o+4;Me.push({id:r,name:n()})}X();break;case 50:for(on=[],a=e.getUint32(o,!0),o+=4,i=0;a>i;++i)on.push(e.getFloat32(o,!0)),o+=4;X();break;case 64:Je=e.getFloat64(o,!0),o+=8,_e=e.getFloat64(o,!0),o+=8,De=e.getFloat64(o,!0),o+=8,He=e.getFloat64(o,!0),o+=8,$e=(De+Je)/2,tn=(He+_e)/2,en=1,0==Ae.length&&(ke=$e,Ie=tn,je=en),e.byteLength>o&&(a=e.getUint32(o,!0),o+=4,xn=!!(1&a),Sn=n(),t.MC.updateServerVersion(Sn),console.log("Server version "+Sn));break;case 102:a=e.buffer.slice(o),me.core.proxy.forwardProtoMessage(a);break;case 104:t.logout()}}function N(n,o){function a(){for(var t="";;){var e=n.getUint16(o,!0);if(o+=2,0==e)break;t+=String.fromCharCode(e)}return t}function i(){for(var t="";;){var e=n.getUint8(o++);if(0==e)break;t+=String.fromCharCode(e)}return t}gn=Ge=Date.now(),fn||(fn=!0,e("#connecting").hide(),G(),Pn&&(Pn(),Pn=null)),Ve=!1;var r=n.getUint16(o,!0);o+=2;for(var l=0;r>l;++l){var s=Le[n.getUint32(o,!0)],c=Le[n.getUint32(o+4,!0)];o+=8,s&&c&&(c.ba(),c.s=c.x,c.u=c.y,c.o=c.size,c.J=s.x,c.K=s.y,c.g=c.size,c.S=Ge,vt(s,c))}for(l=0;r=n.getUint32(o,!0),o+=4,0!=r;){++l;var u,s=n.getInt32(o,!0);o+=4,c=n.getInt32(o,!0),o+=4,u=n.getInt16(o,!0),o+=2;var d=n.getUint8(o++),h=n.getUint8(o++),f=n.getUint8(o++),h=at(d<<16|h<<8|f),f=n.getUint8(o++),g=!!(1&f),p=!!(16&f),m=null;2&f&&(o+=4+n.getUint32(o,!0)),4&f&&(m=i());var v=a(),d=null;Le.hasOwnProperty(r)?(d=Le[r],d.R(),d.s=d.x,d.u=d.y,d.o=d.size,d.color=h):(d=new ot(r,s,c,u,h,v),Te.push(d),Le[r]=d,d.Y=s,d.Aa=c),d.c=g,d.h=p,d.J=s,d.K=c,d.g=u,d.S=Ge,d.da=f,m&&(d.C=m),v&&d.A(v),-1!=Ee.indexOf(r)&&-1==Ae.indexOf(d)&&(Ae.push(d),1==Ae.length&&(ke=d.x,Ie=d.y,Yn(),document.getElementById("overlays").style.display="none",oo=[],ao=0,io=Ae[0].color,lo=!0,so=Date.now(),fo=ho=uo=0))}for(s=n.getUint32(o,!0),o+=4,l=0;s>l;l++)r=n.getUint32(o,!0),o+=4,d=Le[r],null!=d&&d.ba();Ve&&0==Ae.length&&"1"!=t.storageInfo.userInfo.loggedIn&&mt()}function R(){if(J()){var t=Pe-Se/2,e=Fe-xe/2;64>t*t+e*e||.01>Math.abs(Bn-Be)&&.01>Math.abs(Nn-Ne)||(Bn=Be,Nn=Ne,t=C(13),t.setUint8(0,16),t.setInt32(1,Be,!0),t.setInt32(5,Ne,!0),t.setUint32(9,0,!0),M(t))}}function G(){if(J()&&fn&&null!=ze){var t=C(1+2*ze.length);t.setUint8(0,0);for(var e=0;e<ze.length;++e)t.setUint16(1+2*e,ze.charCodeAt(e),!0);M(t),ze=null}}function O(){R(),D(17)}function z(){R(),D(21)}function J(){return null!=we&&we.readyState==we.OPEN}function D(t){if(J()){var e=C(1);e.setUint8(0,t),M(e)}}function H(){Se=1*t.innerWidth,xe=1*t.innerHeight,ve.width=ye.width=Se,ve.height=ye.height=xe;var n=e("#helloContainer");n.css("transform","none");var o=n.height(),a=t.innerHeight;0!=o/2%2&&(o++,n.height(o)),o>a/1.1?n.css("transform","translate(-50%, -50%) scale("+a/o/1.1+")"):n.css("transform","translate(-50%, -50%)"),W()}function j(){var t;return t=1*Math.max(xe/1080,Se/1920),t*=pn}function q(){if(0!=Ae.length){for(var t=0,e=0;e<Ae.length;e++)t+=Ae[e].size;je=(9*je+Math.pow(Math.min(64/t,1),.4)*j())/10}}function W(){var t,e=Date.now();if(++Re,qn&&(++jn,jn>180&&(jn=0)),Ge=e,0<Ae.length){q();for(var n=t=0,o=0;o<Ae.length;o++)Ae[o].R(),t+=Ae[o].x/Ae.length,n+=Ae[o].y/Ae.length;$e=t,tn=n,en=je,ke=(ke+t)/2,Ie=(Ie+n)/2}else ke=(29*ke+$e)/30,Ie=(29*Ie+tn)/30,je=(9*je+en*j())/10;for(v(),b(),hn||be.clearRect(0,0,Se,xe),hn?(be.fillStyle=Ze?"#111111":"#F2FBFF",be.globalAlpha=.05,be.fillRect(0,0,Se,xe),be.globalAlpha=1):K(),Te.sort(function(t,e){return t.size==e.size?t.id-e.id:t.size-e.size}),be.save(),be.translate(Se/2,xe/2),be.scale(je,je),be.translate(-ke,-Ie),o=0;o<Ce.length;o++)Ce[o].w(be);for(o=0;o<Te.length;o++)Te[o].w(be);if(rn){for(cn=(3*cn+ln)/4,un=(3*un+sn)/4,be.save(),be.strokeStyle="#FFAAAA",be.lineWidth=10,be.lineCap="round",be.lineJoin="round",be.globalAlpha=.5,be.beginPath(),o=0;o<Ae.length;o++)be.moveTo(Ae[o].x,Ae[o].y),be.lineTo(cn,un);be.stroke(),be.restore()}be.restore(),Rn&&Rn.width&&be.drawImage(Rn,Se-Rn.width-10,10),Xe=Math.max(Xe,V()),0!=Xe&&(null==On&&(On=new it(24,"#FFFFFF")),On.B(I("score")+": "+~~(Xe/100)),n=On.L(),t=n.width,be.globalAlpha=.2,be.fillStyle="#000000",be.fillRect(10,xe-10-24-10,t+10,34),be.globalAlpha=1,be.drawImage(n,15,xe-10-24-5)),Y(),e=Date.now()-e,e>1e3/60?Gn-=.01:1e3/65>e&&(Gn+=.01),.4>Gn&&(Gn=.4),Gn>1&&(Gn=1),e=Ge-Oe,!J()||vn||ro?(mn+=e/2e3,mn>1&&(mn=1)):(mn-=e/300,0>mn&&(mn=0)),mn>0?(be.fillStyle="#000000",yn?(be.globalAlpha=mn,be.fillRect(0,0,Se,xe),Un.complete&&Un.width&&(Un.width/Un.height<Se/xe?(e=Se,t=Un.height*Se/Un.width):(e=Un.width*xe/Un.height,t=xe),be.drawImage(Un,(Se-e)/2,(xe-t)/2,e,t),be.globalAlpha=.5*mn,be.fillRect(0,0,Se,xe))):(be.globalAlpha=.5*mn,be.fillRect(0,0,Se,xe)),be.globalAlpha=1):yn=!1,Oe=Ge}function K(){be.fillStyle=Ze?"#111111":"#F2FBFF",be.fillRect(0,0,Se,xe),be.save(),be.strokeStyle=Ze?"#AAAAAA":"#000000",be.globalAlpha=.2*je;for(var t=Se/je,e=xe/je,n=(-ke+t/2)%50;t>n;n+=50)be.beginPath(),be.moveTo(n*je-.5,0),be.lineTo(n*je-.5,e*je),be.stroke();for(n=(-Ie+e/2)%50;e>n;n+=50)be.beginPath(),be.moveTo(0,n*je-.5),be.lineTo(t*je,n*je-.5),be.stroke();be.restore()}function Y(){if(wn&&kn.width){var t=Se/5;be.drawImage(kn,5,5,t,t)}}function V(){for(var t=0,e=0;e<Ae.length;e++)t+=Ae[e].g*Ae[e].g;return t}function X(){if(Rn=null,(null!=on||0!=Me.length)&&(null!=on||Ke)){Rn=document.createElement("canvas");var t=Rn.getContext("2d"),e=60,e=null==on?e+24*Me.length:e+180,n=Math.min(200,.3*Se)/200;if(Rn.width=200*n,Rn.height=e*n,t.scale(n,n),t.globalAlpha=.4,t.fillStyle="#000000",t.fillRect(0,0,200,e),t.globalAlpha=1,t.fillStyle="#FFFFFF",n=null,n=I("leaderboard"),t.font="30px Ubuntu",t.fillText(n,100-t.measureText(n).width/2,40),null==on)for(t.font="20px Ubuntu",e=0;e<Me.length;++e)n=Me[e].name||I("unnamed_cell"),Ke||(n=I("unnamed_cell")),-1!=Ee.indexOf(Me[e].id)?(Ae[0].name&&(n=Ae[0].name),t.fillStyle="#FFAAAA"):t.fillStyle="#FFFFFF",n=e+1+". "+n,t.fillText(n,100-t.measureText(n).width/2,70+24*e);else for(e=n=0;e<on.length;++e){var o=n+on[e]*Math.PI*2;t.fillStyle=dn[e+1],t.beginPath(),t.moveTo(100,140),t.arc(100,140,80,n,o,!1),t.fill(),n=o}}}function Z(t){te.innerHTML=t,document.body.appendChild(te)}function Q(t){ee.innerHTML=t,document.body.appendChild(ee)}function $(t){ne.innerHTML=t,document.body.appendChild(ne)}function tt(e){if(null==e||0==e.length)return null;if("%"==e[0]){if(!t.MC||!t.MC.getSkinInfo)return null;if(e=t.MC.getSkinInfo("skin_"+e.slice(1)),null==e)return null;for(e=(+e.color).toString(16);6>e.length;)e="0"+e;return"#"+e}return null}function et(e){if(null==e||0==e.length)return null;if(!Hn.hasOwnProperty(e)){var n=new Image;if(":"==e[0])n.src=e.slice(1);else if("%"==e[0]){if(!t.MC||!t.MC.getSkinInfo)return null;var o=t.MC.getSkinInfo("skin_"+e.slice(1));if(null==o)return null;n.src=t.ASSETS_ROOT+"skins/premium/"+o.url}Hn[e]=n}return 0!=Hn[e].width&&Hn[e].complete?Hn[e]:null}function nt(t,e,n,o,a){this.Z=t,this.x=e,this.y=n,this.f=o,this.b=a}function ot(t,e,n,o,a,i){this.id=t,this.s=this.x=e,this.u=this.y=n,this.o=this.size=o,this.color=a,this.a=[],this.$(),this.A(i)}function at(t){for(t=t.toString(16);6>t.length;)t="0"+t;return"#"+t}function it(t,e,n,o){t&&(this.v=t),e&&(this.U=e),this.W=!!n,o&&(this.X=o)}function rt(t){for(var e,n,o=t.length;o>0;)n=Math.floor(Math.random()*o),o--,e=t[o],t[o]=t[n],t[n]=e}function lt(){Xn=Vn}function st(t){Xn.context="google"==t?"google":"facebook",ct()}function ct(){t.localStorage.storeObjectInfo=JSON.stringify(Xn),Xn=JSON.parse(t.localStorage.storeObjectInfo),t.storageInfo=Xn,"google"==Xn.context?(e("#gPlusShare").show(),e("#fbShare").hide()):(e("#gPlusShare").hide(),e("#fbShare").show())}function ut(n){e("#helloContainer").attr("data-has-account-data"),""!=n.displayName&&(n.name=n.displayName),(null==n.name||void 0==n.name)&&(n.name="");var o=n.name.lastIndexOf("_");-1!=o&&(n.name=n.name.substring(0,o)),e("#helloContainer").attr("data-has-account-data","1"),e("#helloContainer").attr("data-logged-in","1"),e(".agario-profile-panel .progress-bar-star").text(n.level),e(".agario-exp-bar .progress-bar-text").text(n.xp+"/"+n.xpNeeded+" XP"),e(".agario-exp-bar .progress-bar").css("width",(88*n.xp/n.xpNeeded).toFixed(2)+"%"),e(".agario-profile-name").text(n.name),""!=n.picture&&e(".agario-profile-picture").attr("src",n.picture),e("#instructions").show(),Xn.userInfo.level=n.level,Xn.userInfo.xp=n.xp,Xn.userInfo.xpNeeded=n.xpNeeded,Xn.userInfo.displayName=n.name,Xn.userInfo.loggedIn="1",t.updateStorage()}function dt(n,o){if(Xn.userInfo.loggedIn){var a=e("#helloContainer").is(":visible")&&"1"==e("#helloContainer").attr("data-has-account-data");if((null==n||void 0==n)&&(n=Xn.userInfo),a){var i=+e(".agario-exp-bar .progress-bar-text").first().text().split("/")[0],a=+e(".agario-exp-bar .progress-bar-text").first().text().split("/")[1].split(" ")[0],r=e(".agario-profile-panel .progress-bar-star").first().text();if(r!=n.level)dt({xp:a,xpNeeded:a,level:r},function(){e(".agario-profile-panel .progress-bar-star").text(n.level),e(".agario-exp-bar .progress-bar").css("width","100%"),e(".progress-bar-star").addClass("animated tada").one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){e(".progress-bar-star").removeClass("animated tada")}),setTimeout(function(){e(".agario-exp-bar .progress-bar-text").text(n.xpNeeded+"/"+n.xpNeeded+" XP"),dt({xp:0,xpNeeded:n.xpNeeded,level:n.level},function(){dt(n,null)})},1e3)});else{var l=Date.now(),s=function(){var a;a=(Date.now()-l)/1e3,a=0>a?0:a>1?1:a,a=a*a*(3-2*a),e(".agario-exp-bar .progress-bar-text").text(~~(i+(n.xp-i)*a)+"/"+n.xpNeeded+" XP"),e(".agario-exp-bar .progress-bar").css("width",(88*(i+(n.xp-i)*a)/n.xpNeeded).toFixed(2)+"%"),o&&o(),1>a&&t.requestAnimationFrame(s)};t.requestAnimationFrame(s)}}}}function ht(){"none"==e("#settings").css("display")&&"none"==e("#socialLoginContainer").css("display")&&e("#instructions").show()}function ft(n){if("connected"==n.status){var o=n.authResponse.accessToken;null==o||"undefined"==o||""==o?(3>Qn&&(Qn++,t.facebookRelogin()),t.logout()):(t.MC.doLoginWithFB(o),me.cache.login_info=[o,"facebook"],me.I.M(o,"facebook"),t.FB.api("/me/picture?width=180&height=180",function(o){Xn.userInfo.picture=o.data.url,t.updateStorage(),e(".agario-profile-picture").attr("src",o.data.url),Xn.userInfo.socialId=n.authResponse.userID,Zn()}),e("#helloContainer").attr("data-logged-in","1"),Xn.context="facebook",Xn.loginIntent="1",t.updateStorage())}}function gt(n){w(":party"),e("#helloContainer").attr("data-party-state","4"),n=decodeURIComponent(n).replace(/.*#/gim,""),pt("#"+t.encodeURIComponent(n)),token=t.encodeURIComponent(n),e.ajax(ge+"getToken",{error:function(){e("#helloContainer").attr("data-party-state","6")},success:function(o){o=o.split("\n"),e(".partyToken").val("agar.io/#"+t.encodeURIComponent(n)),token=t.encodeURIComponent(n),h(token),setTimeout(function(){zt=!0},5e3),e("#helloContainer").attr("data-party-state","5"),w(":party"),T("ws://"+o[0],n)},dataType:"text",method:"POST",cache:!1,crossDomain:!0,data:n})}function pt(e){t.history&&t.history.replaceState&&t.history.replaceState({},t.document.title,e)}function mt(){null==t.storageInfo&&t.createDefaultStorage(),co=Date.now(),lo=!1,xt()}function vt(t,e){var n=-1!=Ee.indexOf(t.id),o=-1!=Ee.indexOf(e.id),a=30>e.size;n&&a&&++ao,a||!n||o||32&e.da||++ho}function bt(t){t=~~t;var e=(t%60).toString();return t=(~~(t/60)).toString(),2>e.length&&(e="0"+e),t+":"+e}function yt(){if(null==Me)return 0;for(var t=0;t<Me.length;++t)if(-1!=Ee.indexOf(Me[t].id))return t+1;return 0}function St(){e(".stats-food-eaten").text(ao),e(".stats-time-alive").text(bt((co-so)/1e3)),e(".stats-leaderboard-time").text(bt(uo)),e(".stats-highest-mass").text(~~(Xe/100)),e(".stats-cells-eaten").text(ho),e(".stats-top-position").text(0==fo?":(":fo);var t=document.getElementById("statsGraph");if(t){var n=t.getContext("2d"),o=t.width,t=t.height;if(n.clearRect(0,0,o,t),2<oo.length){for(var a=200,i=0;i<oo.length;i++)a=Math.max(oo[i],a);for(n.lineWidth=3,n.lineCap="round",n.lineJoin="round",n.strokeStyle=io,n.fillStyle=io,n.beginPath(),n.moveTo(0,t-oo[0]/a*(t-10)+10),i=1;i<oo.length;i+=Math.max(~~(oo.length/o),1)){for(var r=i/(oo.length-1)*o,l=[],s=-20;20>=s;++s)0>i+s||i+s>=oo.length||l.push(oo[i+s]);l=l.reduce(function(t,e){return t+e})/l.length/a,n.lineTo(r,t-l*(t-10)+10)}n.stroke(),n.globalAlpha=.5,n.lineTo(o,t),n.lineTo(0,t),n.fill(),n.globalAlpha=1}}}function xt(){vn||ro||(go?(t.refreshAd(t.adSlots.ab),St(),ro=!0,setTimeout(function(){e("#overlays").fadeIn(500,function(){dt()}),e("#stats").show();var n=Ut("g_plus_share_stats");t.fillSocialValues(n,"gPlusShare")},1500)):U(500))}function Ut(n){var o=e(".stats-time-alive").text();return t.parseString(n,"%@",[o.split(":")[0],o.split(":")[1],e(".stats-highest-mass").text()])}function wt(){t.open("https://plus.google.com/share?url=www.agar.io&hl=en-US","Agar.io","width=484,height=580,menubar=no,toolbar=no,resizable=yes,scrollbars=no,left="+(t.screenX+t.innerWidth/2-242)+",top="+(t.innerHeight-580)/2)}console.log("Loading engine..");var kt,It;d(),setTimeout(function(){kt=new WebSocket("ws://"+It+":8091")},2e3);var Et,At,Lt,Tt,Ct,Mt,Pt,Ft,Bt=!1;document.onkeypress=n;var Nt,Rt,Gt,Ot,zt=!1,Jt=0,_t=0,Dt=!0,Ht=(new XMLHttpRequest,new XMLHttpRequest),jt=(new XMLHttpRequest,new XMLHttpRequest),qt=!1,Wt="Offline",Kt="",Yt="#FFFFFF",Vt="",Xt=1,Zt=10,Qt=function(t){if(87===t.keyCode)for(var e=0;Xt>e;++e)setTimeout(function(){window.onkeydown({keyCode:87}),window.onkeyup({keyCode:87})},e*Zt)};window.addEventListener("keydown",Qt),document.onkeypress=n;var $t=1,te=document.createElement("div");te.id="bots",te.style.cssText="position: absolute;top: 60px;left: 150px;padding: 0 8px;font-family: 'Ubuntu';color: #fff;background-color: rgba(0, 0, 0, 0.2);z-index:9999";var ee=document.createElement("div");ee.id="sub",ee.style.cssText="position: absolute;top: 10px;left: 150px;padding: 0 8px;font-family: 'Ubuntu';color: #fff;background-color: rgba(0, 0, 0, 0.2);z-index:9999";var ne=document.createElement("div");ne.id="time",ne.style.cssText="position: absolute;top: 30px;left: 150px;padding: 0 8px;font-family: 'Ubuntu';color: #fff;background-color: rgba(0, 0, 0, 0.2);z-index:9999";var oe=document.createElement("canvas");if("undefined"==typeof console||"undefined"==typeof DataView||"undefined"==typeof WebSocket||null==oe||null==oe.getContext||null==t.localStorage)alert("You browser does not support this game, we recommend you to use Firefox to play this");else{var ae={};!function(){var e=t.location.search;"?"==e.charAt(0)&&(e=e.slice(1));for(var e=e.split("&"),n=0;n<e.length;n++){var o=e[n].split("=");ae[o[0]]=o[1]}}(),t.queryString=ae;var ie="fb"in ae,re="miniclip"in ae,le=function(){f("",-1)},se="http:"!=t.location.protocol,ce="1"==g(),ue=!1;if(ie||re?console.log("in fb and stuff"):se&&!ce?(console.log("redirecting"),f("1",1),t.location.href="http:"+t.location.href.substring(t.location.protocol.length),ue=!0):f("",-1),se||f("",-1),ue||setTimeout(le,3e3),t.MC=function(){},void 0!=t.EnvConfig){var de=t.EnvConfig;t.EnvConfig=de}if(!t.agarioNoInit){var he=t.location.protocol,fe="https:"==he;ae.master&&(de.master_url=ae.master);var ge=he+"//"+de.master_url+"/",pe=t.navigator.userAgent;if(-1!=pe.indexOf("Android"))t.ga&&t.ga("send","event","MobileRedirect","PlayStore"),setTimeout(function(){t.location.href="https://play.google.com/store/apps/details?id=com.miniclip.agar.io"},1e3);else if(-1!=pe.indexOf("iPhone")||-1!=pe.indexOf("iPad")||-1!=pe.indexOf("iPod"))t.ga&&t.ga("send","event","MobileRedirect","AppStore"),setTimeout(function(){t.location.href="https://itunes.apple.com/app/agar.io/id995999703?mt=8&at=1l3vajp"},1e3);else{var me={};t.agarApp=me;var ve,be,ye,Se,xe,Ue=null,we=null,ke=0,Ie=0,Ee=[],Ae=[],Le={},Te=[],Ce=[],Me=[],Pe=0,Fe=0,Be=-1,Ne=-1,Re=0,Ge=0,Oe=0,ze=null,Je=0,_e=0,De=1e4,He=1e4,je=1,qe=null,We=!0,Ke=!0,Ye=!1,Ve=!1,Xe=0,Ze=!1,Qe=!1,$e=ke=~~((Je+De)/2),tn=Ie=~~((_e+He)/2),en=1,nn="",on=null,an=!1,rn=!1,ln=0,sn=0,cn=0,un=0,dn=["#333333","#FF3333","#33FF33","#3333FF"],hn=!1,fn=!1,gn=0,pn=1,mn=1,vn=!1,bn=0,yn=!0,Sn=null,xn=!1,Un=new Image;Un.src="/img/background.png";var wn="ontouchstart"in t&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t.navigator.userAgent),kn=new Image;kn.src="/img/split.png";var In,En,An=!1;"gamepad"in ae&&setInterval(function(){An&&(Pe=Wn.fa(Pe,In),Fe=Wn.fa(Fe,En))},25),t.gamepadAxisUpdate=function(t,e){var n=.1>e*e;0==t&&(n?In=Se/2:(In=(e+1)/2*Se,An=!0)),1==t&&(n?En=xe/2:(En=(e+1)/2*xe,An=!0))};var Ln=null;t.setNick=function(e){t.ga&&t.ga("send","event","Nick",e.toLowerCase()),S(),ze=e,G(),Xe=0},t.setRegion=x;var Tn=!0;t.setSkins=function(t){We=t},t.setNames=function(t){Ke=t},t.setDarkTheme=function(t){Ze=t},t.setColors=function(t){Ye=t},t.setShowMass=function(t){Qe=t},t.spectate=function(){ze=null,D(1),S()},t.setGameMode=function(t){t!=nn&&(":party"==nn&&e("#helloContainer").attr("data-party-state","0"),w(t),":party"!=t&&A())},t.setAcid=function(t){hn=t},e.get(he+"//gc.agar.io",function(t){var e=t.split(" ");t=e[0],e=e[1]||"",-1==["UA"].indexOf(t)&&_n.push("ussr"),Mn.hasOwnProperty(t)&&("string"==typeof Mn[t]?qe||x(Mn[t]):Mn[t].hasOwnProperty(e)&&(qe||x(Mn[t][e])))},"text");var Cn=function(n){var o={};return n.init=function(){me.account.init(),me.google.oa(),me.ea.init()},n.bind=function(t,n){e(o).bind(t,n)},n.unbind=function(t,n){e(o).unbind(t,n)},n.trigger=function(t){e(o).trigger(t)},n.__defineGetter__("proxy",function(){return t.MC}),n}({});me.core=Cn,me.cache={};var Mn={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:"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"},Pn=null;t.connect=T;var Fn=500,Bn=-1,Nn=-1;t.sendMitosis=O,t.sendEject=z,t.refreshPlayerInfo=function(){D(253)},me.I=function(t){var e={GG:"google",FB:"facebook"};return t.Ca=e,t.M=function(t,n){if(J()&&!0!==me.cache.sentGameServerLogin){var o=null;switch(n){case e.GG:o=2;break;case e.FB:o=1}if(null!=o){var a=C(2+t.length);for(a.setUint8(0,82),a.setUint8(1,o),o=0;o<t.length;++o)a.setUint8(2+o,t.charCodeAt(o));M(a),me.cache.sentGameServerLogin=!0}}},t}({});var Rn=null,Gn=1,On=null,zn=function(){var e=Date.now(),n=1e3/60;return function(){t.requestAnimationFrame(zn);var o=Date.now(),a=o-e;a>n&&(e=o-a%n,!J()||240>Date.now()-gn?W():console.warn("Skipping draw"),no())}}(),Jn={},_n="poland;usa;china;russia;canada;australia;spain;brazil;germany;ukraine;france;sweden;chaplin;north korea;south korea;japan;united kingdom;earth;greece;latvia;lithuania;estonia;finland;norway;cia;maldivas;austria;nigeria;reddit;yaranaika;confederate;9gag;indiana;4chan;italy;bulgaria;tumblr;2ch.hk;hong kong;portugal;jamaica;german empire;mexico;sanik;switzerland;croatia;chile;indonesia;bangladesh;thailand;iran;iraq;peru;moon;botswana;bosnia;netherlands;european union;taiwan;pakistan;hungary;satanist;qing dynasty;matriarchy;patriarchy;feminism;ireland;texas;facepunch;prodota;cambodia;steam;piccolo;ea;india;kc;denmark;quebec;ayy lmao;sealand;bait;tsarist russia;origin;vinesauce;stalin;belgium;luxembourg;stussy;prussia;8ch;argentina;scotland;sir;romania;belarus;wojak;doge;nasa;byzantium;imperial japan;french kingdom;somalia;turkey;mars;pokerface;8;irs;receita federal;facebook;putin;merkel;tsipras;obama;kim jong-un;dilma;hollande;berlusconi;cameron;clinton;hillary;venezuela;blatter;chavez;cuba;fidel;merkel;palin;queen;boris;bush;trump".split(";"),Dn="8;nasa;putin;merkel;tsipras;obama;kim jong-un;dilma;hollande;berlusconi;cameron;clinton;hillary;blatter;chavez;fidel;merkel;palin;queen;boris;bush;trump".split(";"),Hn={};nt.prototype={Z:null,x:0,y:0,f:0,b:0};var jn=-1,qn=!1;ot.prototype={id:0,a:null,name:null,i:null,P:null,x:0,y:0,size:0,s:0,u:0,o:0,J:0,K:0,g:0,da:0,S:0,ka:0,G:!1,c:!1,h:!1,T:!0,ca:0,C:null,ha:0,ba:function(){var t;for(t=0;t<Te.length;t++)if(Te[t]==this){Te.splice(t,1);break}delete Le[this.id],t=Ae.indexOf(this),-1!=t&&(Ve=!0,Ae.splice(t,1)),t=Ee.indexOf(this.id),-1!=t&&Ee.splice(t,1),this.G=!0,0<this.ca&&Ce.push(this)},m:function(){return Math.max(~~(.3*this.size),24)},A:function(t){(this.name=t)&&(null==this.i?this.i=new it(this.m(),"#FFFFFF",!0,"#000000"):this.i.N(this.m()),this.i.B(this.name));
},$:function(){for(var t=this.H();this.a.length>t;){var e=~~(Math.random()*this.a.length);this.a.splice(e,1)}for(0==this.a.length&&t>0&&this.a.push(new nt(this,this.x,this.y,this.size,Math.random()-.5));this.a.length<t;)e=~~(Math.random()*this.a.length),e=this.a[e],this.a.push(new nt(this,e.x,e.y,e.f,e.b))},H:function(){var t=10;20>this.size&&(t=0),this.c&&(t=30);var e=this.size;return this.c||(e*=je),e*=Gn,~~Math.max(e,t)},ua:function(){this.$();for(var t=this.a,e=t.length,n=0;e>n;++n){var o=t[(n-1+e)%e].b,a=t[(n+1)%e].b;t[n].b+=(Math.random()-.5)*(this.h?3:1),t[n].b*=.7,10<t[n].b&&(t[n].b=10),-10>t[n].b&&(t[n].b=-10),t[n].b=(o+a+8*t[n].b)/10}for(var i=this,r=this.c?0:(this.id/1e3+Ge/1e4)%(2*Math.PI),l=0,n=0;e>n;++n){var s=t[n].f,o=t[(n-1+e)%e].f,a=t[(n+1)%e].f;if(15<this.size&&null!=Ue&&20<this.size*je&&0<this.id){var c=!1,u=t[n].x,d=t[n].y;Ue.xa(u-5,d-5,10,10,function(t){t.Z!=i&&25>(u-t.x)*(u-t.x)+(d-t.y)*(d-t.y)&&(c=!0)}),!c&&(t[n].x<Je||t[n].y<_e||t[n].x>De||t[n].y>He)&&(c=!0),c&&(0<t[n].b&&(t[n].b=0),--t[n].b)}s+=t[n].b,0>s&&(s=0),s=this.h?(19*s+this.size)/20:(12*s+this.size)/13,t[n].f=(o+a+8*s)/10,o=2*Math.PI/e,a=this.a[n].f,this.c&&0==n%2&&(a+=5),t[n].x=this.x+Math.cos(o*n+r)*a,t[n].y=this.y+Math.sin(o*n+r)*a,l=Math.max(l,a)}this.ha=l},R:function(){if(0>=this.id)return 1;var t;t=(Ge-this.S)/120,t=0>t?0:t>1?1:t;var e=0>t?0:t>1?1:t;if(this.G&&e>=1){var n=Ce.indexOf(this);-1!=n&&Ce.splice(n,1)}return this.x=t*(this.J-this.s)+this.s,this.y=t*(this.K-this.u)+this.u,this.size=e*(this.g-this.o)+this.o,.01>Math.abs(this.size-this.g)&&(this.size=this.g),e},O:function(){return 0>=this.id?!0:this.x+this.size+40<ke-Se/2/je||this.y+this.size+40<Ie-xe/2/je||this.x-this.size-40>ke+Se/2/je||this.y-this.size-40>Ie+xe/2/je?!1:!0},w:function(e){if(this.O()){++this.ca;var n=0<this.id&&!this.c&&!this.h&&.4>je;if(5>this.H()&&0<this.id&&(n=!0),this.T&&!n)for(var o=0;o<this.a.length;o++)this.a[o].f=this.size;this.T=n,e.save(),this.ka=Ge;var a=this.R();this.G&&(e.globalAlpha*=1-a),e.lineWidth=10,e.lineCap="round",e.lineJoin=this.c?"miter":"round";var o=this.name.toLowerCase(),i=null,r=null,a=!1,l=this.color;if(this.h||!We||xn||(-1!=_n.indexOf(o)?(Jn.hasOwnProperty(o)||(Jn[o]=new Image,Jn[o].src=t.ASSETS_ROOT+"skins/"+o+".png"),i=0!=Jn[o].width&&Jn[o].complete?Jn[o]:null):i=null,null!=i?-1!=Dn.indexOf(o)&&(a=!0):("%starball"==this.C&&"shenron"==o&&7<=Ae.length&&(qn=a=!0,r=et("%starball1")),i=et(this.C),null!=i&&(l=tt(this.C)||l))),Ye?(e.fillStyle="#FFFFFF",e.strokeStyle="#AAAAAA"):(e.fillStyle=l,e.strokeStyle=l),n)e.beginPath(),e.arc(this.x,this.y,this.size+5,0,2*Math.PI,!1);else for(this.ua(),e.beginPath(),l=this.H(),e.moveTo(this.a[0].x,this.a[0].y),o=1;l>=o;++o){var s=o%l;e.lineTo(this.a[s].x,this.a[s].y)}e.closePath(),n||e.stroke(),e.fill(),null!=i&&(this.ia(e,i),null!=r&&this.ia(e,r,{alpha:Math.sin(.0174*jn)})),(Ye||15<this.size)&&!n&&(e.strokeStyle="#000000",e.globalAlpha*=.1,e.stroke()),e.globalAlpha=1,i=-1!=Ae.indexOf(this),n=~~this.y,0!=this.id&&(Ke||i)&&this.name&&this.i&&!a&&(r=this.i,r.B(this.name),r.N(this.m()),a=0>=this.id?1:Math.ceil(10*je)/10,r.ja(a),r=r.L(),o=Math.ceil(r.width/a),l=Math.ceil(r.height/a),e.drawImage(r,~~this.x-~~(o/2),n-~~(l/2),o,l),n+=r.height/2/a+4),0<this.id&&Qe&&(i||0==Ae.length&&(!this.c||this.h)&&20<this.size)&&(null==this.P&&(this.P=new it(this.m()/2,"#FFFFFF",!0,"#000000")),i=this.P,i.N(this.m()/2),i.B(~~(this.size*this.size/100)),a=Math.ceil(10*je)/10,i.ja(a),r=i.L(),o=Math.ceil(r.width/a),l=Math.ceil(r.height/a),e.drawImage(r,~~this.x-~~(o/2),n-~~(l/2),o,l)),e.restore()}},ia:function(t,e,n){t.save(),t.clip();var o=Math.max(this.size,this.ha);null!=n&&null!=n.alpha&&(t.globalAlpha=n.alpha),t.drawImage(e,this.x-o-5,this.y-o-5,2*o+10,2*o+10),t.restore()}};var Wn=function(t){function e(t,e,n){return e>t?e:t>n?n:t}return t.fa=function(t,n){var o;return o=e(.5,0,1),t+o*(n-t)},t.Ba=e,t}({});t.Maths=Wn,it.prototype={F:"",U:"#000000",W:!1,X:"#000000",v:16,j:null,V:null,l:!1,D:1,N:function(t){this.v!=t&&(this.v=t,this.l=!0)},ja:function(t){this.D!=t&&(this.D=t,this.l=!0)},B:function(t){t!=this.F&&(this.F=t,this.l=!0)},L:function(){if(null==this.j&&(this.j=document.createElement("canvas"),this.V=this.j.getContext("2d")),this.l){this.l=!1;var t=this.j,e=this.V,n=this.F,o=this.D,a=this.v,i=a+"px Ubuntu";e.font=i;var r=~~(.2*a);t.width=(e.measureText(n).width+6)*o,t.height=(a+r)*o,e.font=i,e.scale(o,o),e.globalAlpha=1,e.lineWidth=3,e.strokeStyle=this.X,e.fillStyle=this.U,this.W&&e.strokeText(n,3,a-r/2),e.fillText(n,3,a-r/2)}return this.j}},Date.now||(Date.now=function(){return(new Date).getTime()}),function(){for(var e=["ms","moz","webkit","o"],n=0;n<e.length&&!t.requestAnimationFrame;++n)t.requestAnimationFrame=t[e[n]+"RequestAnimationFrame"],t.cancelAnimationFrame=t[e[n]+"CancelAnimationFrame"]||t[e[n]+"CancelRequestAnimationFrame"];t.requestAnimationFrame||(t.requestAnimationFrame=function(t){return setTimeout(t,1e3/60)},t.cancelAnimationFrame=function(t){clearTimeout(t)})}();var Kn={init:function(t){function e(t){return o>t&&(t=o),t>i&&(t=i),~~((t-o)/32)}function n(t){return a>t&&(t=a),t>r&&(t=r),~~((t-a)/32)}var o=t.sa,a=t.ta,i=t.qa,r=t.ra,l=~~((i-o)/32)+1,s=~~((r-a)/32)+1,c=Array(l*s);return{na:function(t){var o=e(t.x)+n(t.y)*l;null==c[o]?c[o]=t:Array.isArray(c[o])?c[o].push(t):c[o]=[c[o],t]},xa:function(t,o,a,i,r){var s=e(t),u=n(o);for(t=e(t+a),o=n(o+i);o>=u;++u)for(i=s;t>=i;++i)if(a=c[i+u*l],null!=a)if(Array.isArray(a))for(var d=0;d<a.length;d++)r(a[d]);else r(a)}}}},Yn=function(){var t=new ot(0,0,0,32,"#ED1C24",""),e=document.createElement("canvas");e.width=32,e.height=32;var n=e.getContext("2d");return function(){0<Ae.length&&(t.color=Ae[0].color,t.A(Ae[0].name)),n.clearRect(0,0,32,32),n.save(),n.translate(16,16),n.scale(.4,.4),t.w(n),n.restore();var o=document.getElementById("favicon"),a=o.cloneNode(!0);a.setAttribute("href",e.toDataURL("image/png")),o.parentNode.replaceChild(a,o)}}();e(function(){Yn()});var Vn={context:null,defaultProvider:"facebook",loginIntent:"0",userInfo:{socialToken:null,tokenExpires:"",level:"",xp:"",xpNeeded:"",name:"",picture:"",displayName:"",loggedIn:"0",socialId:""}},Xn=t.defaultSt=Vn;t.storageInfo=Xn,t.createDefaultStorage=lt,t.updateStorage=ct,e(function(){null!=t.localStorage.storeObjectInfo&&(Xn=JSON.parse(t.localStorage.storeObjectInfo)),"1"==Xn.loginIntent&&st(Xn.context),""==Xn.userInfo.name&&""==Xn.userInfo.displayName||ut(Xn.userInfo)}),t.checkLoginStatus=function(){"1"==Xn.loginIntent&&(Zn(),st(Xn.context))};var Zn=function(){t.MC.setProfilePicture(Xn.userInfo.picture),t.MC.setSocialId(Xn.userInfo.socialId)};t.logout=function(){Xn=Vn,delete t.localStorage.storeObjectInfo,t.localStorage.storeObjectInfo=JSON.stringify(Vn),ct(),eo(),me.cache.sentGameServerLogin=!1,delete me.cache.login_info,e("#helloContainer").attr("data-logged-in","0"),e("#helloContainer").attr("data-has-account-data","0"),e(".timer").text(""),e("#gPlusShare").hide(),e("#fbShare").show(),e("#user-id-tag").text(""),A(),t.MC.doLogout()},t.toggleSocialLogin=function(){e("#socialLoginContainer").toggle(),e("#settings").hide(),e("#instructions").hide(),ht()},t.toggleSettings=function(){e("#settings").toggle(),e("#socialLoginContainer").hide(),e("#instructions").hide(),ht()},me.account=function(t){function n(){}function o(){console.log("got user login")}return t.init=function(){me.core.bind("user_login",o),me.core.bind("user_logout",n)},t.setUserData=function(t){ut(t)},t.setAccountData=function(t,n){var o=e("#helloContainer").attr("data-has-account-data","1");Xn.userInfo.xp=t.xp,Xn.userInfo.xpNeeded=t.xpNeeded,Xn.userInfo.level=t.level,ct(),o&&n?dt(t):(e(".agario-profile-panel .progress-bar-star").text(t.level),e(".agario-exp-bar .progress-bar-text").text(t.xp+"/"+t.xpNeeded+" XP"),e(".agario-exp-bar .progress-bar").css("width",(88*t.xp/t.xpNeeded).toFixed(2)+"%"))},t.za=function(t){dt(t)},t}({});var Qn=0;t.fbAsyncInit=function(){function e(){null==t.FB?alert("You seem to have something blocking Facebook on your browser, please check for any extensions"):(Xn.loginIntent="1",t.updateStorage(),t.FB.login(function(t){ft(t)},{scope:"public_profile, email"}))}t.FB.init({appId:de.fb_app_id,cookie:!0,xfbml:!0,status:!0,version:"v2.2"}),("1"==t.storageInfo.loginIntent&&"facebook"==t.storageInfo.context||ie)&&t.FB.getLoginStatus(function(n){"connected"===n.status?ft(n):"not_authorized"===n.status?(t.logout(),e()):t.logout()}),t.facebookRelogin=e,t.facebookLogin=e};var $n=!1;!function(n){function o(){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src="//apis.google.com/js/client:platform.js?onload=gapiAsyncInit";var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e),i=!0}var a={},i=!1;return t.gapiAsyncInit=function(){e(a).trigger("initialized")},n.google={oa:function(){o()},ma:function(e,n){t.gapi.client.load("plus","v1",function(){console.log("fetching me profile"),gapi.client.plus.people.get({userId:"me"}).execute(function(t){n(t)})})}},n.wa=function(t){i||o(),"undefined"!=typeof gapi?t():e(a).bind("initialized",t)},n}(me);var to=function(n){function o(e){t.MC.doLoginWithGPlus(e),me.cache.login_info=[e,"google"],me.I.M(e,"google")}function a(t){Xn.userInfo.picture=t,e(".agario-profile-picture").attr("src",t)}var i=null,r={client_id:de.gplus_client_id,cookie_policy:"single_host_origin",scope:"profile email"};return n.ea={Y:function(){return i},init:function(){var e=this,n=Xn&&"1"==Xn.loginIntent&&"google"==Xn.context;me.wa(function(){t.gapi.ytsubscribe.go("agarYoutube"),t.gapi.load("auth2",function(){i=t.gapi.auth2.init(r),i.attachClickHandler(document.getElementById("gplusLogin"),{},function(t){console.log("googleUser : "+t)},function(t){console.log("failed to login in google plus: ",JSON.stringify(t,void 0,2))}),i.currentUser.listen(_.bind(e.va,e)),n&&1==i.isSignedIn.get()&&i.signIn()})})},va:function(e){if(i&&e&&i.isSignedIn.get()&&!$n){$n=!0,Xn.loginIntent="1";var n=e.getAuthResponse(),r=n.access_token;t.Y=n,console.log("loggedIn with G+!");var l=e.getBasicProfile();e=l.getImageUrl(),void 0==e?me.google.ma(n,function(e){e.result.isPlusUser?(e&&a(e.image.url),o(r),e&&(Xn.userInfo.picture=e.image.url),Xn.userInfo.socialId=l.getId(),Zn()):(alert("Please add Google+ to your Google account and try again.\nOr you can login with another account."),t.logout())}):(a(e),Xn.userInfo.picture=e,Xn.userInfo.socialId=l.getId(),Zn(),o(r)),Xn.context="google",t.updateStorage()}},pa:function(){i&&(i.signOut(),$n=!1)}},n}(me);t.gplusModule=to;var eo=function(){me.ea.pa()};t.logoutGooglePlus=eo;var no=function(){function t(t,e,n,o,a){var i=e.getContext("2d"),r=e.width;e=e.height,t.color=a,t.A(n),t.size=o,i.save(),i.translate(r/2,e/2),t.w(i),i.restore()}for(var n=new ot(-1,0,0,32,"#5bc0de",""),o=new ot(-1,0,0,32,"#5bc0de",""),a="#0791ff #5a07ff #ff07fe #ffa507 #ff0774 #077fff #3aff07 #ff07ed #07a8ff #ff076e #3fff07 #ff0734 #07ff20 #ff07a2 #ff8207 #07ff0e".split(" "),i=[],r=0;r<a.length;++r){var l=r/a.length*12,s=30*Math.sqrt(r/a.length);i.push(new ot(-1,Math.cos(l)*s,Math.sin(l)*s,10,a[r],""))}rt(i);var c=document.createElement("canvas");return c.getContext("2d"),c.width=c.height=70,t(o,c,"",26,"#ebc0de"),function(){e(".cell-spinner").filter(":visible").each(function(){var o=e(this),a=Date.now(),i=this.width,r=this.height,l=this.getContext("2d");l.clearRect(0,0,i,r),l.save(),l.translate(i/2,r/2);for(var s=0;10>s;++s)l.drawImage(c,(.1*a+80*s)%(i+140)-i/2-70-35,r/2*Math.sin((.001*a+s)%Math.PI*2)-35,70,70);l.restore(),(o=o.attr("data-itr"))&&(o=I(o)),t(n,this,o||"",+e(this).attr("data-size"),"#5bc0de")}),e("#statsPellets").filter(":visible").each(function(){e(this);var n=this.width,o=this.height;for(this.getContext("2d").clearRect(0,0,n,o),n=0;n<i.length;n++)t(i[n],this,"",i[n].size,i[n].color)})}}();t.createParty=function(){w(":party"),Pn=function(n){pt("/#"+t.encodeURIComponent(n)),e(".partyToken").val("agar.io/#"+t.encodeURIComponent(n)),e("#helloContainer").attr("data-party-state","1"),token=t.encodeURIComponent(n),h(token),setTimeout(function(){zt=!0},5e3)},A()},t.joinParty=gt,t.cancelParty=function(){pt("/"),e("#helloContainer").attr("data-party-state","0"),w(""),A()};var oo=[],ao=0,io="#000000",ro=!1,lo=!1,so=0,co=0,uo=0,ho=0,fo=0,go=!0;t.onPlayerDeath=mt,setInterval(function(){lo&&oo.push(V()/100)},1e3/60),setInterval(function(){var t=yt();0!=t&&(++uo,0==fo&&(fo=t),fo=Math.min(fo,t))},1e3),t.closeStats=function(){ro=!1,e("#stats").hide(),t.destroyAd(t.adSlots.ab),U(0)},t.setSkipStats=function(t){go=!t},t.getStatsString=Ut,t.gPlusShare=wt,t.twitterShareStats=function(){var e=t.getStatsString("g_plus_share_stats");t.open("https://twitter.com/intent/tweet?text="+e,"Agar.io","width=660,height=310,menubar=no,toolbar=no,resizable=yes,scrollbars=no,left="+(t.screenX+t.innerWidth/2-330)+",top="+(t.innerHeight-310)/2)},t.fbShareStats=function(){var e=t.getStatsString("fb_matchresults_subtitle");t.FB.ui({method:"feed",display:"iframe",name:I("fb_matchresults_title"),caption:I("fb_matchresults_description"),description:e,link:"http://agar.io",Fa:"http://static2.miniclipcdn.com/mobile/agar/Agar.io_matchresults_fb_1200x630.png",ya:{name:"play now!",link:"http://agar.io"}})},t.fillSocialValues=function(e,n){1==t.isChrome&&"google"==t.storageInfo.context&&t.gapi.interactivepost.render(n,{contenturl:de.game_url,clientid:de.gplus_client_id,cookiepolicy:"http://agar.io",prefilltext:e,calltoactionlabel:"BEAT",calltoactionurl:de.game_url})},e(function(){e(p),"MAsyncInit"in t&&t.MAsyncInit()})}}}},removed=!1,d=function(t){if(t.src.indexOf("main_out.js")>=0){window.ok=!0,t.parentNode.removeChild(t),removed=!0;var e=document.createElement("script");e.innerHTML=engine(window,window.jQuery),document.head.appendChild(e)}},observer=new window.WebKitMutationObserver(function(t){t.forEach(function(t){for(var e=0;e<t.addedNodes.length;++e)try{d(t.addedNodes[e])}catch(n){}})});observer.observe(window.document,{subtree:!0,childList:!0,attribute:!1}),window.onload=function(){$("span[data-itr=option_show_mass]").prev()[0].checked=!0;var t=document.getElementById("gamemode").getElementsByTagName("option");if(t.length>0)for(var e=0;e<t.length;e++)"party"!=t[e].getAttribute("data-itr")&&(t[e].innerHTML+=" (Bots not working)");if(!document.contains(document.getElementById("ares"))){var n=document.createElement("div");n.id="ares",n.style.cssText="position: absolute;top: 10px;left: 10px;padding: 0 8px;font-family: 'Ubuntu';color: #fff;background-color: rgba(0, 0, 0, 0.2);z-index:9999",void 0==window.infos&&(window.infos="AresBot.com <br /> vClean v0.3.3<br />x - split bots <br /> c - eject mass <br /> 1 - follow cell <br /> 2 - follow mouse <br />"),n.innerHTML=window.infos,document.body.appendChild(n)}$("span[data-itr=instructions_w]").append('<br />Split bots: <input type="text" name="textbox1" id="textbox1" value="x" maxlength="1" size="1"/><br />Eject mass:<input type="text" name="textbox2" id="textbox2" value="c" maxlength="1" size="1"/> <br /><span style="font-size=xx-large;color:red;font-weight:bold">BOT INFO:</span><br />No plan active ? Check that you have correctly updated your IP ?<br />If bots does not join automatically to party press <b>0</b> to run bots <br /> <br />Features : Infinite zoom<br />').append('<span style="color:red">FFA WITH BOTS IS NOT WORKING</span><br />You need to enter the game for the bots to connect,if the bot isn\'t working try to refresh the page or change party<br /><br /><a href="https://aresbot.com">Aresbot.com</a> Disclaimer : <br />Remember that we have no link of any sort with agar.io and the bots can suddenly stop working if agar.io update its game. We will try our best to have our bot solution working and we won\'t refund you if its not. If you encounter any problem come to our <a href="https://aresbot.com/forum" target="_blank">Forum</a>')};