Advertisement
Guest User

Untitled

a guest
Jun 24th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 64.42 KB | None | 0 0
  1. ! function(e, t) {
  2. function a(e, t, a, i, o, s, n, r) {
  3. this.id = e, this.x = t, this.y = a, this.lastX = t, this.lastY = a, this.mass = i, this.clanTag = o, this.setNick(s), this.skinURL = n, 7 == r.length && (this.color = r), this.alive = !0, this.updateTime = Date.now()
  4. }
  5. function i() {}
  6. function o() {
  7. if (null !== document.getElementById("canvas")) {
  8. var t = document.getElementById("canvas");
  9. return t.addEventListener("mousemove", function(t) {
  10. if (e.play && e.cursorTracking) {
  11. var a = 1 * t.clientX,
  12. i = 1 * t.clientY;
  13. e.cursorX = (a - e.innerW / 2) / e.viewScale + e.playerX, e.cursorY = (i - e.innerH / 2) / e.viewScale + e.playerY
  14. }
  15. }, !1), void(e.gameCtx = t.getContext("2d"))
  16. }
  17. setTimeout(o, 50)
  18. }
  19. function s() {
  20. return window.MC ? (window.MC._showNickDialog = window.MC.showNickDialog, window.MC.showNickDialog = function() {
  21. window.MC._showNickDialog.apply(this, arguments), window.onkeydown = function() {}
  22. }, window.MC._showStatsDialog = window.MC.showStatsDialog, window.MC.showStatsDialog = function() {
  23. window.MC._showStatsDialog.apply(this, arguments), window.onkeydown = function() {}
  24. }, window.MC._onPlayerSpawn = window.MC.onPlayerSpawn, window.MC.onPlayerSpawn = function() {
  25. window.MC._onPlayerSpawn.apply(this, arguments), e.play = !0, f.sendPlayerSpawn()
  26. }, window.MC._onPlayerDeath = window.MC.onPlayerDeath, void(window.MC.onPlayerDeath = function() {
  27. window.MC._onPlayerDeath.apply(this, arguments), e.play = !1, f.sendPlayerDeath(), f.updateDeathLocations(e.playerX, e.playerY), window.onkeydown = function() {}
  28. })) : void setTimeout(s, 50)
  29. }
  30. function n() {
  31. var a = 1 * window.innerWidth,
  32. i = 1 * window.innerHeight,
  33. o = t("#helloContainer"),
  34. s = o.innerHeight();
  35. 0 != s ? e.menuHeight = s : s = e.menuHeight || 760;
  36. var n = Math.min(1, i / s),
  37. r = s * n,
  38. l = Math.round(i / 2 - .5 * r),
  39. c = "translate(-50%, 0%) scale(" + n + ")";
  40. o.css("transform", c), o.css("-ms-transform", c), o.css("-webkit-transform", c), o.css("top", "" + l + "px"), e.innerW = a, e.innerH = i
  41. }
  42. function r() {
  43. return window.jQuery("#helloContainer").innerHeight() > 0 ? void n() : void setTimeout(r, 50)
  44. }
  45. function l() {
  46. return e.play ? d[c].exit : void 0
  47. }! function() {
  48. window.core && (window.core = null, delete window.core), t.ajax("http://agar.io/agario.core.js", {
  49. success: function(e) {
  50. var t = e;
  51. t = t.replace(/if\((\+\w\[\w>>3\])<1\.0\){/i, "if($1<window.ogario.zoom){"), t = t.replace(/(\d\.\d;return}function\s*)([\w$]+\(.,.\)){/i, "$1$2{return;"), t = t.replace(/do\s*if\((\w)\){((\w)=!\((\+\w\[\w>>2\])<=20\.0\);)([\w$]+\(\d+,\w\[\w>>2]\|0\)\|0;[\w$]+\(\d+,\w\[\w>>2]\|0,(\+\(\+\w\[\w>>2\]\)),(\+\(\+\w\[\w>>2\]\)),\+\(\+\w\[\w>>2\])\+5\.0(\),0\.0,6\.283185307179586,0\)\|0;[\w$]+\(\d+,\w\[\w>>2]\|0\)\|0;\w=\w\[\w>>2\]\|0;)if\(\w\){([\w$]+\(\d+,\w\|0,\w&255\|0,\w&255\|0,\w&255\|0\)\|0;)([\w$]+\(\d+,\w\[\w>>2]\|0\)\|0;)/i, "var gameCtx=null,ogario=null,nick=null,skin=null,cellSize=null,isFood=false,isVirus=false,isMyCell=false;do if($1=1,$1){cellSize=$4;$2 if(!$3){isFood=true;if(!window.ogario.showFood){break;}if(window.ogario.autoHideFood&&window.ogario.playerMass>1000){window.ogario.showFood=false;}if(!window.ogario.rainbowFood){window.ogario.foodCache.push({x:$6,y:$7,size:cellSize});break;}}$5$8 if($3){gameCtx=window.ogario.gameCtx;if(gameCtx){var ogario=window.ogario;ogario.globalApha=gameCtx.globalAlpha;if(gameCtx.lineJoin=='miter'){isVirus=true;if(ogario.setVirusColor&&ogario.setVirusStrokeColor){gameCtx.fillStyle=ogario.setVirusColor(cellSize);gameCtx.strokeStyle=ogario.setVirusStrokeColor(cellSize);}else{gameCtx.fillStyle=gameCtx.strokeStyle=ogario.virusColor;}gameCtx.stroke();gameCtx.globalAlpha*=ogario.virusAlpha;}else{if(ogario.cellMemOffset!==null&&ogario.getString){if((a[ogario.cellMemOffset+ogario.nameMemOffset+4>>0]&1)==0|0){nick=ogario.getString(ogario.cellMemOffset+ogario.nameMemOffset+5);}else{nick=ogario.getString(c[ogario.cellMemOffset+ogario.nameMemOffset+12>>2]|0);}}if(nick&&nick.length>0){if(ogario.playerNick&&nick===ogario.playerNick){isMyCell=true;}if(ogario.customSkins&&ogario.getCustomSkin){skin=ogario.getCustomSkin(nick);}}if(ogario.play){if(ogario.oppColors&&ogario.setOppColor){gameCtx.fillStyle=ogario.setOppColor(cellSize,isMyCell);}else{$9}if(ogario.splitRange&&ogario.cacheBiggerCells){ogario.cacheBiggerCells($6,$7,cellSize);}}else{$9}if(ogario.transparentCells){gameCtx.globalAlpha*=ogario.cellsAlpha;}}$10gameCtx.globalAlpha=ogario.globalApha;if((ogario.transparentSkins||ogario.oppColors)&&!(isMyCell&&!ogario.ownTransparentSkin)){gameCtx.globalAlpha*=ogario.skinsAlpha;}if(skin){gameCtx.save();gameCtx.clip();gameCtx.drawImage(skin,$6-cellSize,$7-cellSize,2*cellSize,2*cellSize);gameCtx.restore();}}else{$9$10}break;"), t = t.replace(/(if\(\(\w\[\w\+\d+>>0\]\|0\)==0\?\(\(\(\(\w\[\w\+\d+>>2\]\|0\)\+\(\w\[\d+\]\|0\)\|0\)>>>0\)%10\|0\|0\)!=0:0\){\w=\w\[\w>>2\]\|0;[\w$]+\(\d+,\w\|0\)\|0;\w=\w;return})([\w$]+\(\w,\w\);)/i, "if(gameCtx&&ogario){gameCtx.globalAlpha=ogario.globalApha;}$1 var hideCellInfo=false;if(cellSize&&cellSize>=40){if(!isVirus&&!isMyCell&&ogario.autoHideCellsInfo&&ogario.setAutoHideCellsInfo){hideCellInfo=ogario.setAutoHideCellsInfo(cellSize);}if(!hideCellInfo){$2}}else{$2}"), t = t.replace(/(\w\[\w\+(\d+)>>3]=(\w);\w\[\w\+(\d+)>>3]=(\w);\w\[\w\+(\d+)>>3]=(\w);\w\[\w\+(\d+)>>3]=(\w);)/i, "$1 if(window.ogario.setMapCoords){window.ogario.setMapCoords($3,$5,$7,$9,$2,$8);}"), t = t.replace(/(do{\w=\+\w\[\(\w\[\w>>2\]\|0\)\+\d+>>2];\w=\w\+\s*)(\+\(~~\+\w\(\+\(\w\*\w\/100\.0\)\)\|0\))(;\w=\w\+4\|0}while\(\(\w\|0\)!=\(\w\|0\)\);(\w)=(\w);)/i, "window.ogario.playerCellsMass=[]; $1$2; window.ogario.playerCellsMass.push($2); $3 window.ogario.playerMass=$5; if(window.ogario.calculateMass){window.ogario.calculateMass();}"), t = t.replace(/([\w$]+\(\d+,\w\[\w>>2\]\|0,(\+\w),(\+\w)\)\|0;[\w$]+\(\d+,\w\[\w>>2\]\|0,\+-(\+\w\[\w\+\d+>>3\]),\+-(\+\w\[\w\+\d+>>3\])\)\|0;)/i, "$1 window.ogario.viewScale=$2; window.ogario.playerX=$4; window.ogario.playerY=$5; if(window.ogario.customDraw){window.ogario.customDraw();}"), t = t.replace(/(if\(\w<=)(20\.0)(\){\w=\w;return})(if\(!\w\){if\(\(\w\[\d+\]\|0\)!=\(\w\[\d+\]\|0\)\){\w=\w;return}if\(\(\w\[\w\+\d+>>0\]\|0\)!=0\?\(\w\[\w>>0\]\|0\)==0:0\){\w=\w;return}})/i, "$140.0$3"), t = t.replace(/(\w=~~\(\+\(\w\[\w\+\d+>>2\]\|0\)\/\w)\);([\w$]+\(\w\)\|0;)(\w=~~\(\+\(\w\[\w\+\d+>>2\]\|0\)\/\w)\);(if\(!\w\){\w=\w;return})/i, "$1/0.6);$2$3/0.6);$4"), t = t.replace(/(\w=\w\[\w>>2\]\|0;)(\w\[\w>>3\]=\w;)(\w\[\w>>0\]=a\[\w>>0\];)/i, "$1 if(window.ogario.autoZoom){$2}$3"), t = t.replace(/(function\s*([\w$]+)\(\w\){return\s*[\w$]+\(\w,\w\)})/i, "$1 window.ogario.getString=$2;"), t = t.replace(/(if\(\(\w\[\d+\]\|0\)!=0\?\(\w\[\d+\]\|\w\[(\w)\+\d+>>0\]\)<<24>>24==0:0\))((\w)=\w\[(\w)\+\d+>>2\]\|0;)else/i, "window.ogario.cellMemOffset=$2; $1 if(window.ogario.customSkins){$4=0;}else{$3}else"), t = t.replace(/(\w=\w\+(\d+)\|0;\w=~~\(\+\w\[\w\+\d+>>2\]\*\.3\);)/i, "$1 window.ogario.nameMemOffset=$2;"), t = t.replace(/(while\(0\);)([\w$]+\(\w,\w\);)([\w$]+\(\w,\w\);)([\w$]+\(\w,\w\);)([\w$]+\(\w,\w\);)(\w\[\w\+\d+>>0\]=1;\w=\w;return})/i, "$1$3$4$5$6");
  52. var a = document.createElement("script");
  53. a.textContent = t, a.async = !0, document.body.appendChild(a)
  54. },
  55. dataType: "text",
  56. method: "GET",
  57. cache: !1,
  58. crossDomain: !0
  59. })
  60. }();
  61. var c = "en",
  62. d = {
  63. pl: {
  64. start: "Start",
  65. settings: "Ustawienia",
  66. autoZoom: "Auto zoom",
  67. autoHideCellsInfo: "Autoukrywanie nazw i masy",
  68. autoHideFood: "Autoukrywanie pokarmu",
  69. hideOwnName: "Ukryj własną nazwę",
  70. customSkins: "WÅ‚asne skiny",
  71. rainbowFood: "Kolorowy pokarm",
  72. transparentCells: "Przezroczyste kulki",
  73. transparentSkins: "Przezroczyste skiny",
  74. ownTransparentSkin: "WÅ‚asny przezroczysty skin",
  75. showBgSectors: "Sektory w tle",
  76. showMapBorders: "Granice mapy",
  77. showMiniMap: "Pokaż minimapę",
  78. oppColors: "Kolory przeciwników",
  79. splitRange: "Zasięg podziału",
  80. showFPS: "Pokaż statystyki gry",
  81. textStroke: "Obwódki tekstu",
  82. disableShift: "Wyłącz Shift",
  83. disableAlt: "Wyłącz Alt",
  84. hideChat: "Ukryj czat",
  85. mouseControl: "Split/feed myszkÄ…",
  86. mouseInvert: "Odwróć klawisze myszki",
  87. cursorTracking: "Ã…Å¡ledzenie kursora",
  88. keys: "Klawisze",
  89. qKey: "Podwójny podział",
  90. wKey: "Karmienie",
  91. eKey: "Pauza kulki",
  92. aKey: "Pokaż/ukryj nazwy",
  93. sKey: "Pokaż/ukryj skiny",
  94. dKey: "Pokaż/ukryj sektory w tle",
  95. fKey: "Pokaż/ukryj pokarm",
  96. hKey: "Ukryj czat",
  97. zKey: "Reset zoomu",
  98. cKey: "Historia czatu / Czyść czat",
  99. shiftKey: "Szybki podział n16",
  100. spaceKey: "Podział",
  101. space: "Spacja",
  102. enterKey: "Napisz wiadomość",
  103. tildeKey: "Szybki resp (party)",
  104. commands: "Komendy",
  105. saveComm: "Zapisz komendy",
  106. theme: "WyglÄ…d",
  107. themeType: "Motyw",
  108. darkTheme: "Ciemny motyw",
  109. lightTheme: "Jasny motyw",
  110. mainColor: "Kolor główny",
  111. bgColor: "Kolor tła",
  112. foodColor: "Kolor pokarmu",
  113. gridColor: "Kolor sektorów",
  114. saveSett: "Zapisz ustawienia",
  115. hideChatMsg: "Ukryto czat!",
  116. activePartys: "Aktywne party",
  117. pause: "PAUZA!",
  118. visit: "Odwiedź ",
  119. exit: "OGARio by szymy: Czy na pewno chcesz opuścic grę?"
  120. },
  121. en: {
  122. start: "Start",
  123. settings: "Settings",
  124. autoZoom: "Auto zoom",
  125. autoHideCellsInfo: "Auto hide names and mass",
  126. autoHideFood: "Auto hide food",
  127. hideOwnName: "Hide own name",
  128. customSkins: "Custom skins",
  129. rainbowFood: "Rainbow food",
  130. transparentCells: "Transparent cells",
  131. transparentSkins: "Transparent skins",
  132. ownTransparentSkin: "Own transparent skin",
  133. showBgSectors: "Show background sectors",
  134. showMapBorders: "Show map borders",
  135. showMiniMap: "Show minimap",
  136. oppColors: "Opponents colors",
  137. splitRange: "Split range",
  138. showFPS: "Show game stats",
  139. textStroke: "Text stroke",
  140. disableShift: "Disable Shift",
  141. disableAlt: "Disable Alt",
  142. hideChat: "Hide chat",
  143. mouseControl: "Mouse feed/split",
  144. mouseInvert: "Invert mouse buttons",
  145. cursorTracking: "Cursor tracking",
  146. keys: "Keys",
  147. qKey: "Double split",
  148. wKey: "Macro feed",
  149. eKey: "Cell pause",
  150. aKey: "Toggle names",
  151. sKey: "Toggle skins",
  152. dKey: "Toggle background sectors",
  153. fKey: "Toggle food",
  154. hKey: "Hide chat",
  155. zKey: "Reset zoom",
  156. cKey: "Chat history / Clear chat",
  157. shiftKey: "Split n16",
  158. spaceKey: "Split",
  159. space: "Space",
  160. enterKey: "Enter chat message",
  161. tildeKey: "Quick resp (party)",
  162. commands: "Commands",
  163. saveComm: "Save commands",
  164. theme: "Theme",
  165. themeType: "Theme type",
  166. darkTheme: "Dark theme",
  167. lightTheme: "Light theme",
  168. mainColor: "Main color",
  169. bgColor: "Background color",
  170. foodColor: "Food color",
  171. gridColor: "Grid color",
  172. saveSett: "Save settings",
  173. hideChatMsg: "Hide chat!",
  174. activePartys: "Active partys",
  175. pause: "PAUSE!",
  176. visit: "Visit ",
  177. exit: "OGARio by szymy: Are you sure you want to quit the game?"
  178. }
  179. };
  180. if ("pl" == c) var h = {
  181. comm1: "Feeduj!",
  182. comm2: "Dziel siÄ™!",
  183. comm3: "Pomocy na %currentSector%!",
  184. comm4: "Wróg na %currentSector%!",
  185. comm5: "Zabij pomocnika!",
  186. comm6: "Strzel z wirusa!",
  187. comm7: "Zjedz wirusa!",
  188. comm8: "Zjebałem, wybacz.",
  189. comm9: "Ja pierdolÄ™...",
  190. comm0: "Kurwa mać!",
  191. comm10: "Trick!",
  192. comm11: "Lewo!",
  193. comm12: "Góra!",
  194. comm13: "Prawo!",
  195. comm14: "Dół!"
  196. };
  197. else var h = {
  198. comm1: "Feed me!",
  199. comm2: "Split into me!",
  200. comm3: "Need backup on %currentSector%!",
  201. comm4: "Enemy spotted on %currentSector%!",
  202. comm5: "Need a teammate!",
  203. comm6: "Tank the virus!",
  204. comm7: "Eat the virus!",
  205. comm8: "Let's bait!",
  206. comm9: "Fake tricksplit!",
  207. comm0: "Fuck!",
  208. comm10: "Tricksplit!",
  209. comm11: "Left!",
  210. comm12: "Up!",
  211. comm13: "Right!",
  212. comm14: "Bottom!"
  213. };
  214. var p = null,
  215. m = {
  216. mainColor: "#0D47A1",
  217. bgColor: "#000000",
  218. foodColor: "#0D47A1",
  219. gridColor: "#0D47A1",
  220. darkTheme: !0
  221. },
  222. u = {
  223. nick: "I <3 szymy",
  224. clanTag: "BNC",
  225. skinURL: "",
  226. color: m.mainColor
  227. },
  228. w = {
  229. autoZoom: !0,
  230. autoHideCellsInfo: !0,
  231. autoHideFood: !1,
  232. hideOwnName: !1,
  233. customSkins: !0,
  234. rainbowFood: !1,
  235. transparentCells: !0,
  236. transparentSkins: !0,
  237. ownTransparentSkin: !1,
  238. showBgSectors: !0,
  239. showMapBorders: !0,
  240. showMiniMap: !0,
  241. oppColors: !0,
  242. splitRange: !0,
  243. showFPS: !0,
  244. textStroke: !1,
  245. disableShift: !1,
  246. disableAlt: !0,
  247. hideChat: !1,
  248. mouseControl: !1,
  249. mouseInvert: !1
  250. };
  251. a.prototype = {
  252. id: 0,
  253. x: 0,
  254. y: 0,
  255. lastX: 0,
  256. lastY: 0,
  257. mass: 0,
  258. clanTag: "",
  259. nick: "",
  260. nickImg: null,
  261. skinURL: "",
  262. color: m.mainColor,
  263. alive: !1,
  264. updateTime: null,
  265. pi2: 2 * Math.PI,
  266. setNick: function(e) {
  267. e && e != this.nick && (this.nick = e)
  268. },
  269. drawPosition: function(e, t, a) {
  270. if (this.alive) {
  271. this.lastX = (29 * this.lastX + this.x) / 30, this.lastY = (29 * this.lastY + this.y) / 30;
  272. var i = (this.lastX + t) * a,
  273. o = (this.lastY + t) * a;
  274. this.nick.length > 0 && (e.fillStyle = "#FFFFFF", e.font = "9px Ubuntu", e.fillText(this.nick, i - e.measureText(this.nick).width / 2, o - 10)), e.beginPath(), e.arc(i, o, 4.5, 0, this.pi2, !1), e.closePath(), e.fillStyle = this.color, e.fill()
  275. }
  276. }
  277. }, i.prototype = {
  278. name: "OGARio LE by szymy",
  279. version: "For more updates by SZYMY",
  280. currentSector: "",
  281. miniMap: null,
  282. miniMapCtx: null,
  283. miniMapSectors: null,
  284. pi2: 2 * Math.PI,
  285. sectors: 5,
  286. mapBordersWidth: 20,
  287. socket: null,
  288. teamPlayers: [],
  289. partys: [],
  290. chatHistory: [],
  291. customSkinsCache: {},
  292. deathLocations: [],
  293. lastDeath: 0,
  294. gameMode: "",
  295. partyToken: "",
  296. playerIP: "",
  297. playerMass: 0,
  298. updateTick: 0,
  299. rFps: 0,
  300. renderedFrames: 0,
  301. fpsLastRequest: null,
  302. fpsHUD: null,
  303. leaderboardInfo: null,
  304. leaderboardPositionsHUD: null,
  305. activePartys: null,
  306. top5p: null,
  307. lastMessageSend: Date.now(),
  308. selectBiggestCell: !0,
  309. setSkins: !0,
  310. setNames: !0,
  311. getPlayerX: function() {
  312. return e.playerX + e.mapOffsetX
  313. },
  314. getPlayerY: function() {
  315. return e.playerY + e.mapOffsetY
  316. },
  317. parseSettings: function(e, t) {
  318. return "save" === t ? "string" == typeof e ? e : JSON.stringify(e) : "string" != typeof e ? JSON.stringify(e) : "true" == e || "false" == e ? JSON.parse(e) : e
  319. },
  320. loadSettings: function(e) {
  321. for (var t in e) e.hasOwnProperty(t) && null != window.localStorage.getItem(t) && (e[t] = this.parseSettings(window.localStorage.getItem(t), "load"))
  322. },
  323. saveSettings: function(e) {
  324. for (var t in e) e.hasOwnProperty(t) && window.localStorage.setItem(t, this.parseSettings(e[t], "save"))
  325. },
  326. setKeys: function() {
  327. var a = {},
  328. i = {},
  329. o = {
  330. feed: null,
  331. split: null
  332. },
  333. s = null,
  334. n = !1;
  335. window.addKeyListeners = function() {
  336. window.onkeydown = function(e) {
  337. if (!a[e.keyCode] && !window.jQuery("#overlays").is(":visible") && !window.jQuery("#message").is(":focus")) switch (a[e.keyCode] = !0, e.keyCode) {
  338. case 32:
  339. window.core && window.core.split && window.core.split();
  340. break;
  341. case 87:
  342. window.core && window.core.eject && window.core.eject();
  343. break;
  344. case 81:
  345. window.core && window.core.specialOn && window.core.specialOn();
  346. break;
  347. case 27:
  348. e.preventDefault(), window.MC.showNickDialog(300), window.jQuery("#oferwallContainer").is(":visible") && window.closeOfferwall(), window.jQuery("#videoContainer").is(":visible") && window.closeVideoContainer()
  349. }
  350. }, window.onkeyup = function(e) {
  351. a[e.keyCode] = !1, 81 == e.keyCode && window.specialOff && window.core.specialOff()
  352. }
  353. }, window.addEventListener("keydown", function(a) {
  354. var s = a.keyCode;
  355. if (13 == s && this.focusOnChat(), !i[s] && !t("#overlays").is(":visible") && !t("#message").is(":focus")) switch (48 > s || s > 57 || this.sendCommand(s - 48), 37 > s || s > 40 || this.sendCommand(s - 26), i[s] = !0, s) {
  356. case 16:
  357. if (o.split || w.disableShift) break;
  358. var n = 0;
  359. window.core.split(), o.split = setInterval(function() {
  360. window.core.split(), 3 == ++n && (clearInterval(o.split), o.split = null)
  361. }, 50);
  362. break;
  363. case 18:
  364. if (w.disableAlt) break;
  365. this.sendCommand(10), a.preventDefault();
  366. break;
  367. case 65:
  368. this.setNames = !this.setNames, window.core.setNames(this.setNames);
  369. break;
  370. case 67:
  371. this.displayChatHistory(!0);
  372. break;
  373. case 68:
  374. w.showBgSectors = !w.showBgSectors;
  375. break;
  376. case 69:
  377. if (o.feed) break;
  378. o.feed = setInterval(function() {
  379. window.core.eject()
  380. }, 50);
  381. break;
  382. case 70:
  383. e.showFood = !e.showFood;
  384. break;
  385. case 71:
  386. window.core.split(), setTimeout(function() {
  387. window.core.split()
  388. }, 50);
  389. break;
  390. case 72:
  391. this.hideChat();
  392. break;
  393. case 81:
  394. window.core.split(), setTimeout(function() {
  395. window.core.split()
  396. }, 50);
  397. break;
  398. case 83:
  399. this.setSkins = !this.setSkins, window.core.setSkins(this.setSkins);
  400. break;
  401. case 84:
  402. if (o.split) break;
  403. var n = 0;
  404. window.core.split(), o.split = setInterval(function() {
  405. window.core.split(), 3 == ++n && (clearInterval(o.split), o.split = null)
  406. }, 50);
  407. break;
  408. case 87:
  409. if (o.feed) break;
  410. o.feed = setInterval(function() {
  411. window.core.eject()
  412. }, 50);
  413. break;
  414. case 88:
  415. this.switchDeathLocation();
  416. break;
  417. case 88:
  418. e.zoom = 1;
  419. break;
  420. case 192:
  421. window.quickPartyJoin()
  422. }
  423. }.bind(this), !0), window.addEventListener("keyup", function(t) {
  424. switch (t.keyCode) {
  425. case 67:
  426. this.displayChatHistory(!1);
  427. break;
  428. case 69:
  429. null !== o.feed && (clearInterval(o.feed), o.feed = null);
  430. break;
  431. case 87:
  432. null !== o.feed && (clearInterval(o.feed), o.feed = null);
  433. break;
  434. case 88:
  435. e.zoom = 0
  436. }
  437. i[t.keyCode] = !1
  438. }.bind(this), !0), window.onmousedown = function(e) {
  439. t("#overlays").is(":visible") || (2 == e.which && w.disableAlt ? (this.sendCommand(10), e.preventDefault()) : w.mouseControl && ((1 == e.which && !w.mouseInvert || 3 == e.which && w.mouseInvert) && window.core.split(), (3 == e.which && !w.mouseInvert || 1 == e.which && w.mouseInvert) && !n && null === s && (s = setInterval(function() {
  440. window.core.eject()
  441. }, 50), n = !0)))
  442. }.bind(this), window.onmouseup = function(e) {
  443. w.mouseControl && (3 == e.which && !w.mouseInvert || 1 == e.which && w.mouseInvert) && (null !== s && (clearInterval(s), s = null), n = !1)
  444. }
  445. },
  446. setMenu: function() {
  447. var a = this;
  448. eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--){d[c]=k[c]||c}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('0.1="2 3"',4,4,'document|title|OGARio|Modded'.split('|'),0,{})), t("#mainPanel").before('<div id="main-menu" class="agario-panel"><ul class="menu-tabs"><li class="active"><a href="#mainPanel" class="active">' + d[c].start + '</a></li><li><a href="#og-settings">' + d[c].settings + '</a></li><li><a href="#keys">' + d[c].keys + '</a></li><li><a href="#commands">' + d[c].commands + '</a></li><li><a href="#theme">' + d[c].theme + '</a></li><li><a href="#more">' + d[c].more + 'More</a></li></ul><div id="og-settings" class="menu-panel"></div><div id="keys" class="menu-panel"></div><div id="commands" class="menu-panel"></div><div id="theme" class="menu-panel"></div><div id="more" class="menu-panel"></div></div>'), t("#mainPanel, #stats").appendTo(t("#main-menu")), t("#mainPanel, #stats").addClass("menu-panel"),t("#helloContainer div[role=form] .form-group:first").empty().append('<h1></h1><h2></h2><h3 style="color:white;">OGARio Modded By Z2HA </h3><h3 style="color:white; "align="center">TS3:BNC.TS.IO</h3>'), t("#nick").before('<input id="clantag" class="form-control" placeholder="Tag, e.g. bnc" />'), t("#nick").after('<div class="input-group skin"><input id="skin" class="form-control" placeholder="Skin URL (imgur.com direct link)" /><input type="hidden" id="color" value="' + u.color + '" /><span class="input-group-addon"><i></i></span></div>'), t("#locationKnown, #locationUnknown").insertAfter(t(".skin")), t(".btn-spectate, .btn-logout").appendTo("#agario-main-buttons"), t("#agario-main-buttons").append('<br clear="both"/>'), t("#helloContainer div[role=form]").after('<div id="ogario-party"><input id="joinPartyToken" class="partyToken form-control" placeholder="Party token" /><button class="btn btn-info btn-copy-token copy-party-token">Copy</button></div>'), t("#create-party-btn, #join-party-btn").appendTo(t("#ogario-party")), t("#join-party-btn").addClass("btn-success"), t("#settingsChoice, #options").appendTo(t("#og-settings")), t(".right-container").append('<div class="agario-panel agario-side-panel leaderboard-panel"><span id="leaderboard-info"></span><button class="btn btn-sm btn-primary btn-copy-leaderboard" onclick="copyLeaderboard();">Copy</button></div>'), t(".agario-profile-panel").after('<div class="agario-panel agario-side-panel ogario-yt-panel"><div class="g-ytsubscribe" data-channelid="UCzccFsgGR_ZYZTSMp3-_LZw" data-layout="full" data-theme="dark" data-count="default"></div></div>'), t(".agario-profile-panel").after('<div class="agario-panel agario-side-panel vungo-yt-panel"><div class="g-ytsubscribe" data-channelid="UCY_l_utwUwdzRDzqA0n3oWQ" data-layout="full" data-theme="dark" data-count="default"></div></div>'), t(".ogario-yt-panel").after('<div class="agario-panel agario-side-panel show-more-panel <button type="button" id="hideshowmore" class="hideshowmore " value="hide/show"style=" background-color: #4CAF50;border: none;color:white;padding: 8px 60px;text-align: center;text-decoration: none;display: inline-block;font-size: 13px;border-radius: 4px;border: 0px solid #F51F1F;">Show More </button></div>'), t("#mainPanel").append('<div id="version" class="main-color">' + this.version + " | " + d[c].visit + '<a href="http://ogario.ovh" target="_blank">ogario.ovh</a></div>'), t("#mainPanel").append('<h1> </h1>'), t(".agario-party-1 div:first, .agario-party-0, .agario-party-1 .clearfix, .agario-party-3, .agario-party-4, .agario-party-5 div:first, .agario-party-5 .clearfix").remove(), t("#mainPanel hr, .btn-settings, .text-muted, .tosBox, .agario-promo, #agario-web-incentive, span[data-itr='option_dark_theme'], #darkTheme").remove(), t("body").append('<div id="adsBottom" style="z-index: 200; display: none;"><div id="adsBottomInner"><div id="g728x90"></div><div id="a728x90"></div></div></div>'), t("#adbg, #a320x250, #g320x250, #adsBottom").css("display", "none"), t("#create-party-btn, #join-party-btn").css({
  449. width: "49%",
  450. margin: "6px 0 0 0",
  451. "float": "left"
  452. }), t("#join-party-btn").css({
  453. "margin-left": "2%"
  454. }), t(".ogario-yt-panel").css({
  455. margin: "10px 2px",
  456. "float": "right"
  457. }), t(".vungo-yt-panel").css({
  458. margin: "10px 2px",
  459. "float": "right"
  460. }), t(".show-more-panel").css({
  461. margin: "10px 2px",
  462. "float": "right"
  463. }), t("#adsBottom").css({
  464. "z-index": "1",
  465. opacity: "0"
  466. });
  467. for (var i in w) w.hasOwnProperty(i) && t("#og-settings").append('<label><input type="checkbox" class="Mycheckbox" onchange="setSettings(\'' + i + "', $(this).is(':checked'));\" id=\"" + i + '">' + d[c][i] + "</label>");
  468. t("#tags-container").appendTo(t("#og-settings")), t("#og-settings input:checkbox").each(function() {
  469. var e = t(this).attr("id");
  470. w.hasOwnProperty(e) && t(this).prop("checked", w[e])
  471. }), t("#keys").append('<span class="key"><span class="bold main-color">[Q / G]</span> - ' + d[c].qKey + '</span> <span class="key"><span class="bold main-color">[W / E]</span> - ' + d[c].wKey + '</span> <span class="key"><span class="bold main-color">[A]</span> - ' + d[c].aKey + '</span> <span class="key"><span class="bold main-color">[S]</span> - ' + d[c].sKey + '</span> <span class="key"><span class="bold main-color">[D]</span> - ' + d[c].dKey + '</span> <span class="key"><span class="bold main-color">[F]</span> - ' + d[c].fKey + '</span> <span class="key"><span class="bold main-color">[Z]</span> - ' + d[c].zKey + '</span> <span class="key"><span class="bold main-color">[C]</span> - ' + d[c].cKey + '</span> <span class="key"><span class="bold main-color">[' + d[c].space + "]</span> - " + d[c].spaceKey + '</span> <span class="key"><span class="bold main-color">[Shift / T]</span> - ' + d[c].shiftKey + '</span> <span class="key"><span class="bold main-color">[Enter]</span> - ' + d[c].enterKey + '</span> <span class="key"><span class="bold main-color">[H]</span> - ' + d[c].hKey + '</span> <span class="key"><span class="bold main-color">[~]</span> - ' + d[c].tildeKey + "</span>");
  472. var o = 0;
  473. for (var s in h) h.hasOwnProperty(s) && (++o, 11 > o ? label = 10 == o ? 0 : o : (11 == o && (label = "Alt / Mouse Wheel"), 12 == o && (label = "Left Arrow"), 13 == o && (label = "Up Arrow"), 14 == o && (label = "Right Arrow"), 15 == o && (label = "Down Arrow")), t("#commands").append('<div class="input-group input-group-sm"><span class="input-group-addon" id="' + s + '">' + label + '</span><input type="text" class="form-control" placeholder="Command #' + label + '" value="' + h[s] + '"></div>'));
  474. t("#commands").append('<button class="btn btn-block btn-sm btn-success btn-save" onclick="saveCommands();">' + d[c].saveComm + "</button>") , t("#theme").append('<div class="color-box theme-box"><span class="title">' + d[c].themeType + '</span><div id="theme-type" class="btn-group btn-group-justified" data-toggle="buttons"><label class="btn btn-default"><input type="radio" name="options" id="darktheme">' + d[c].darkTheme + '</label><label class="btn btn-default"><input type="radio" name="options" id="lighttheme">' + d[c].lightTheme + '</label></div></div> <div class="color-box"><span class="title">' + d[c].mainColor + '</span><div class="input-group main-color-picker"><input type="text" value="' + m.mainColor + '" id="maincolor" class="form-control" /><span class="input-group-addon"><i></i></span></div></div> <div class="color-box"><span class="title">' + d[c].bgColor + '</span><div class="input-group background-color-picker"><input type="text" value="' + m.bgColor + '" id="backgroundcolor" class="form-control" /><span class="input-group-addon"><i></i></span></div></div> <div class="color-box"><span class="title">' + d[c].foodColor + '</span><div class="input-group food-color-picker"><input type="text" value="' + m.foodColor + '" id="foodcolor" class="form-control" /><span class="input-group-addon"><i></i></span></div></div> <div class="color-box"><span class="title">' + d[c].gridColor + '</span><div class="input-group grid-color-picker"><input type="text" value="' + m.gridColor + '" id="gridcolor" class="form-control" /><span class="input-group-addon"><i></i></span></div></div>'), t("#theme .main-color-picker").colorpicker({
  475. format: "hex"
  476. }).on("changeColor.colorpicker", function(e) {
  477. a.setMainColor(e.color.toHex())
  478. }), t("#theme .background-color-picker").colorpicker({
  479. format: "hex"
  480. }).on("changeColor.colorpicker", function(e) {
  481. m.bgColor = e.color.toHex(), t("body").css("background-color", m.bgColor)
  482. }), t("#theme .food-color-picker").colorpicker({
  483. format: "hex"
  484. }).on("changeColor.colorpicker", function(t) {
  485. m.foodColor = t.color.toHex(), e.foodColor = m.foodColor
  486. }), t("#theme .grid-color-picker").colorpicker({
  487. format: "hex"
  488. }).on("changeColor.colorpicker", function(e) {
  489. m.gridColor = e.color.toHex()
  490. }), t("#theme").append('<button class="btn btn-block btn-sm btn-success btn-save" onclick="saveThemeSettings();">' + d[c].saveSett + "</button>"), m.darkTheme ? t("#darktheme").closest("label").addClass("active") : t("#lighttheme").closest("label").addClass("active"), t("#theme-type").change(function() {
  491. var e = t(this).find("input:checked").attr("id");
  492. a.changeTheme(e)
  493. }), t("body").append('<div id="overlays-hud"><div id="fps-hud" class="hud main-color"></div> <div id="pause-hud" class="hud">' + d[c].pause + '</div> <div id="leaderboard-hud" class="hud-b"><h4 class="main-color">OGARio Modded</h4><div id="leaderboard-positions"></div><div><h4 class="main-color">My Team</h4><font size="2"><ol id="top5"></ol></div></div> <div id="minimap-hud" class="hud-b"><canvas id="minimap-sectors"></canvas><canvas id="minimap"></canvas></div></div>'), t("body").append('<div id="overlays-hud"><div id="fps-hud" class="hud main-color"><div id="popuup_div" class="popup_msg"><img src=https://8816e02e10d04d444b59c1428b51268a3ea15b60.googledrive.com/host/0B07Gb_SdJ0FcRXVvVHRnTVFKcUE/ninja-logo.png></div></div>'), t("body").append('<ul id="messages"></ul>'), t("body").append('<input id="message" class="form-control" type="text" placeholder="' + d[c].enterKey + '..." maxlength="100" />'), t(".skin").colorpicker({
  494. format: "hex",
  495. input: "#color"
  496. }), toastr.options = {
  497. newestOnTop: !1,
  498. positionClass: "toast-bottom-left",
  499. timeOut: "15000"
  500. }, t(document).ready(function() {
  501. t(".menu-tabs a").click(function(e) {
  502. e.preventDefault();
  503. var a = t(this);
  504. a.addClass("active"), a.parent().addClass("active"), a.parent().siblings().removeClass("active"), a.parent().siblings().find("a").removeClass("active");
  505. var i = a.attr("href");
  506. t(".menu-panel").not(i).css("display", "none"), t(i).fadeIn()
  507. }), t(window).trigger("resize")
  508. }), t("#gamemode").on("change", function() {
  509. a.gameMode = e.gameMode = this.value, ":party" !== this.value && a.isSocketOpen() && (a.socket.close(), t(".partyToken").val(""))
  510. }), t("#cancel-party-btn").on("click", function() {
  511. a.gameMode = e.gameMode = "", a.socket.close(), t(".partyToken").val("")
  512. }), t("#canvas").bind("contextmenu", function() {
  513. return !1
  514. }), this.fpsHUD = document.getElementById("fps-hud"), this.activePartys = document.getElementById("activepartys"), this.top5p = document.getElementById("top5"), this.leaderboardInfo = document.getElementById("leaderboard-info"), this.leaderboardPositionsHUD = document.getElementById("leaderboard-positions"), t("#nick").val(u.nick), t("#clantag").val(u.clanTag), t("#skin").val(u.skinURL), t("#color").val(u.color)
  515. },
  516. setMainColor: function(e) {
  517. m.mainColor = e, t("#main-menu").css("border-color", e), p || (p = t("<style type='text/css'>").appendTo("head")), p.html(".main-color, .menu-tabs .active, center, #cancel-party-btn { color: " + e + "; } #main-menu { border-color: " + e + "} .toast-warning { background-color: " + e + "; }")
  518. },
  519. changeTheme: function(e) {
  520. "darktheme" == e ? (m.darkTheme = !0, m.bgColor = "#000000", m.gridColor = "#111111", t("#theme .background-color-picker").colorpicker("setValue", "#000000"), t("#theme .grid-color-picker").colorpicker("setValue", "#111111"), t("#minimap-sectors").css("opacity", "0.2")) : (m.darkTheme = !1, m.bgColor = "#F2FBFF", m.gridColor = "#D9E1E5", t("#theme .background-color-picker").colorpicker("setValue", "#F2FBFF"), t("#theme .grid-color-picker").colorpicker("setValue", "#D9E1E5"), t("#minimap-sectors").css("opacity", "0.4"))
  521. },
  522. setTheme: function() {
  523. this.setMainColor(m.mainColor), t("body").css("background-color", m.bgColor), m.darkTheme ? t("#minimap-sectors").css("opacity", "0.2") : t("#minimap-sectors").css("opacity", "0.4")
  524. },
  525. setMiniMap: function() {
  526. w.showMiniMap ? t("#minimap-hud").show() : t("#minimap-hud").hide()
  527. },
  528. setButtons: function() {
  529. var t = document.getElementsByClassName("btn-play")[0],
  530. a = document.getElementsByClassName("btn-play-guest")[0],
  531. i = document.getElementsByClassName("btn-spectate")[0],
  532. o = document.getElementById("create-party-btn"),
  533. s = document.getElementById("join-party-btn"),
  534. n = document.getElementById("statsContinue");
  535. t.addEventListener("click", function() {
  536. this.handleConnect(), this.play()
  537. }.bind(this), !1), a.addEventListener("click", function() {
  538. this.handleConnect(), this.play()
  539. }.bind(this), !1), i.addEventListener("click", function() {
  540. this.handleConnect(), this.sendPlayerDeath(), e.play = !1, e.spectate = !0, e.showFood = !1
  541. }.bind(this), !1), o.addEventListener("click", function() {
  542. this.handleConnect(), this.sendPlayerDeath()
  543. }.bind(this), !1), s.addEventListener("click", function() {
  544. this.handleConnect(), this.sendPlayerDeath()
  545. }.bind(this), !1), n.addEventListener("click", function() {
  546. setTimeout(function() {
  547. window.onkeydown = function() {}
  548. }, 100)
  549. }, !1)
  550. },
  551. play: function() {
  552. this.sendPlayerSpawn(), e.play = !0, e.spectate = !1, e.showFood = !0, e.playerBestMass = 0, window.ga && window.ga("create", "UA-67142685-2", "auto", "ogarioTracker"), window.ga && window.ga("ogarioTracker.send", "pageview"), window.ga && window.ga("ogarioTracker.send", "event", "Nick", u.clanTag + u.nick)
  553. },
  554. setPlayerInfo: function() {
  555. var a = t("#nick").val(),
  556. i = t("#clantag").val(),
  557. o = t("#skin").val(),
  558. s = t("#color").val();
  559. u.nick = a || "", u.clanTag = i.trim() || "", u.skinURL = o.trim() || "", 7 == s.length && (u.color = s), e.playerNick = u.nick, u.clanTag.length > 0 && (e.clanTag = u.clanTag), this.saveSettings(u)
  560. },
  561. cacheSkin: function(e, t, a) {
  562. a && (e[t] = new Image, e[t].crossOrigin = "Anonymous", e[t].src = a)
  563. },
  564. getCachedSkin: function(e, t) {
  565. return e[t].width && e[t].complete ? e[t] : null
  566. },
  567. cacheCustomSkin: function(e, t, a) {
  568. if (t.length > 0) {
  569. if (e.hasOwnProperty(t) && e[t].src == a) return;
  570. this.cacheSkin(e, t, a)
  571. }
  572. },
  573. getCustomSkin: function(e) {
  574. return e && 0 != e.length ? this.customSkinsCache.hasOwnProperty(e) ? this.getCachedSkin(this.customSkinsCache, e) : void 0 : null
  575. },
  576. setParty: function() {
  577. if (this.gameMode = t("#gamemode").val(), ":party" === this.gameMode) {
  578. var e = t(".partyToken").val();
  579. e && e.length > 5 && (e = e.split("#"), this.partyToken = e[1])
  580. }
  581. },
  582. calculateCurrentSector: function() {
  583. if (!e.mapOffsetFixed) return void(this.currentSector = "");
  584. var t = e.mapOffsetX + e.mapOffset,
  585. a = e.mapOffsetY + e.mapOffset,
  586. i = String.fromCharCode(65 + Math.floor((e.playerY + a) / (e.mapSize / this.sectors))),
  587. o = "" + (Math.floor((e.playerX + t) / (e.mapSize / this.sectors)) + 1);
  588. this.currentSector = i + o
  589. },
  590. switchDeathLocation: function() {
  591. this.lastDeath--, this.lastDeath < 0 && (this.lastDeath = this.deathLocations.length - 1)
  592. },
  593. updateDeathLocations: function(t, a) {
  594. e.mapOffsetFixed && (this.deathLocations.push({
  595. x: t + e.mapOffsetX,
  596. y: a + e.mapOffsetY
  597. }), 6 == this.deathLocations.length && this.deathLocations.splice(0, 1), this.lastDeath = this.deathLocations.length - 1)
  598. },
  599. drawMapBorders: function(t, a, i, o, s, n, r) {
  600. e.mapOffsetFixed && w.showMapBorders && (t.save(), t.strokeStyle = n, t.lineWidth = r, t.beginPath(), t.moveTo(a, i), t.lineTo(o, i), t.lineTo(o, s), t.lineTo(a, s), t.closePath(), t.stroke(), t.restore())
  601. },
  602. drawMiniMap: function() {
  603. if (e.mapOffsetFixed) {
  604. this.miniMap ? this.miniMapCtx.clearRect(0, 0, 200, 220) : (this.miniMap = document.getElementById("minimap"), this.miniMapCtx = this.miniMap.getContext("2d"), this.miniMapCtx.ogarioCtx = !0, this.miniMap.width = 200, this.miniMap.height = 220);
  605. var t = 182 / e.mapSize,
  606. a = e.mapOffsetX + e.mapOffset,
  607. i = e.mapOffsetY + e.mapOffset;
  608. if (this.calculateCurrentSector(), this.miniMapCtx.globalAlpha = 1, this.miniMapCtx.font = "16px Ubuntu", this.miniMapCtx.fillStyle = m.mainColor, this.miniMapCtx.fillText(this.currentSector, 10, 20), this.miniMapSectors || this.drawMiniMapSectors(this.sectors, this.sectors, 182, 182), this.miniMapCtx.save(), this.miniMapCtx.translate(9.5, 29.5), this.miniMapCtx.fillStyle = "#FFFFFF", this.miniMapCtx.beginPath(), this.miniMapCtx.arc((e.playerX + a) * t, (e.playerY + i) * t, 6, 0, this.pi2, !1), this.miniMapCtx.closePath(), this.miniMapCtx.fill(), ":party" === this.gameMode && this.teamPlayers.length > 0)
  609. for (var o = 0; o < this.teamPlayers.length; o++) this.teamPlayers[o].drawPosition(this.miniMapCtx, e.mapOffset, t);
  610. if (this.deathLocations.length > 0) {
  611. var s = Math.round((this.deathLocations[this.lastDeath].x + e.mapOffset) * t),
  612. n = Math.round((this.deathLocations[this.lastDeath].y + e.mapOffset) * t);
  613. this.miniMapCtx.lineWidth = 1, this.miniMapCtx.strokeStyle = this.deathLocations.length - 1 == this.lastDeath ? m.mainColor : "#FFFFFF", this.miniMapCtx.beginPath(), this.miniMapCtx.moveTo(s - 4.5, n), this.miniMapCtx.lineTo(s + 4.5, n), this.miniMapCtx.moveTo(s, n - 4.5), this.miniMapCtx.lineTo(s, n + 4.5), this.miniMapCtx.stroke()
  614. }
  615. this.miniMapCtx.restore()
  616. }
  617. },
  618. drawMiniMapSectors: function(e, t, a, i) {
  619. this.miniMapSectors = document.getElementById("minimap-sectors");
  620. var o = this.miniMapSectors.getContext("2d");
  621. o.ogarioCtx = !0, this.miniMapSectors.width = a, this.miniMapSectors.height = i, o.fillStyle = "#FFFFFF", this.drawSectors(o, e, t, .5, .5, a - .5, i - .5, "#FFFFFF", 1, !1)
  622. },
  623. drawSectors: function(t, a, i, o, s, n, r, l, c, d) {
  624. if (!d || e.mapOffsetFixed && w.showBgSectors) {
  625. var h = Math.floor((n - o) / a),
  626. p = Math.floor((r - s) / i),
  627. m = .5 * p;
  628. t.save(), t.strokeStyle = l, t.fillStyle = l, t.lineWidth = c, t.beginPath();
  629. for (var u = 0; a + 1 > u; u++) t.moveTo(u == a ? n : o + h * u, s), t.lineTo(u == a ? n : o + h * u, r);
  630. for (var u = 0; i + 1 > u; u++) t.moveTo(o, u == i ? r : s + p * u), t.lineTo(n, u == i ? r : s + p * u);
  631. t.closePath(), t.stroke(), t.font = m + "px Ubuntu";
  632. for (var u = 0; i > u; u++)
  633. for (var f = 0; a > f; f++) {
  634. var g = String.fromCharCode(65 + u) + (f + 1);
  635. t.fillText(g, o + h / 2 + f * h - t.measureText(g).width / 2, s + p / 2 + u * p + .18 * p)
  636. }
  637. t.restore()
  638. }
  639. },
  640. setVirusColor: function(e) {
  641. var t = Math.floor(e * e / 100);
  642. return t > 183 ? "#C80000" : m.darkTheme ? "#24FF24" : "#24FF24"
  643. },
  644. setVirusStrokeColor: function(t) {
  645. if (e.play && 0 != e.playerMaxMass) {
  646. var a = Math.floor(t * t / 100),
  647. i = a / this.selectBiggestCell ? e.playerMaxMass : e.playerMinMass;
  648. return i > .76 ? "#FFDC00" : "#C80000"
  649. }
  650. return m.darkTheme ? "#999999" : "#666666"
  651. },
  652. setOppColor: function(t, a) {
  653. if (a) return u.color;
  654. var i = Math.floor(t * t / 100),
  655. o = this.selectBiggestCell ? e.playerMaxMass : e.playerMinMass,
  656. s = i / o;
  657. if (s && s > 0) {
  658. var n = 1e3 > o ? .35 : .38;
  659. return s > 11 ? "#FF008C" : 2.5 > s ? 1.25 > s ? 1.25 > s && s > .75 ? "#FFDC00" : s > n ? "#00C8FF" : "#64FF00" : "#FF0A00" : "#BE00FF"
  660. }
  661. },
  662. displayLeaderboard: function(e) {
  663. this.leaderboardInfo && (this.leaderboardPositionsHUD.innerHTML = e, this.leaderboardInfo.innerHTML = e)
  664. },
  665. countFPS: function() {
  666. if (!this.fpsLastRequest) return void(this.fpsLastRequest = Date.now());
  667. var e = Date.now(),
  668. t = e - this.fpsLastRequest;
  669. 1e3 > t || (this.rFps = this.renderedFrames, this.renderedFrames = 0, this.fpsLastRequest = e), this.renderedFrames++
  670. },
  671. displayFPS: function() {
  672. if (!w.showFPS) return void t("#fps-hud").hide();
  673. var a = "";
  674. e.play && (e.playerMass && (a += "Mass: " + e.playerMass + " | "), e.playerBestMass && (a += "Score: " + e.playerBestMass + " | "), e.ste && (a += "STE: " + e.ste + " | "), e.playerCellsMass && (a += e.playerCellsMass.length + "/16 | ")), a += "rFPS: " + this.rFps, this.fpsHUD.textContent = a, setTimeout(function() {
  675. this.displayFPS()
  676. }.bind(this), 100)
  677. },
  678. connect: function() {
  679. if (this.setParty(), this.socket) {
  680. this.socket.onopen = null, this.socket.onmessage = null;
  681. try {
  682. this.socket.close()
  683. } catch (e) {}
  684. this.socket = null
  685. }
  686. this.teamPlayers = [], this.partys = [], ":party" !== this.gameMode || this.partyToken.length > 5 || (console.log("OGARio Modded: Connecting to server"), this.socket = new WebSocket("ws://91.134.143.136:3000"), this.socket.ogarioWS = !0, this.socket.binaryType = "arraybuffer", this.socket.onopen = function() {
  687. console.log("OGARio Modded: Socket open"), this.sendBuffer(this.strToBuff(80, this.partyToken)), this.sendBuffer(this.strToBuff(81, this.playerIP)), this.sendBuffer(this.strToBuff(0, u.nick)), this.sendBuffer(this.strToBuff(1, u.clanTag))
  688. }.bind(this), this.socket.onmessage = this.handleMessage.bind(this), this.socket.onclose = function() {
  689. console.log("OGARio Modded: Socket close")
  690. }, this.socket.onerror = function() {
  691. console.log("OGARio Modded: Socket error")
  692. })
  693. },
  694. handleConnect: function() {
  695. this.setPlayerInfo(), this.isSocketOpen() || setTimeout(function() {
  696. this.connect()
  697. }.bind(this), 1e3), this.updatePlayerInfo()
  698. },
  699. isSocketOpen: function() {
  700. return null != this.socket && this.socket.readyState == this.socket.OPEN
  701. },
  702. createView: function(e) {
  703. return new DataView(new ArrayBuffer(e))
  704. },
  705. strToBuff: function(e, t) {
  706. var a = this.createView(1 + 2 * t.length);
  707. a.setUint8(0, e);
  708. for (var i = 0; i < t.length; i++) a.setUint16(1 + 2 * i, t.charCodeAt(i), !0);
  709. return a
  710. },
  711. sendBuffer: function(e) {
  712. this.socket.send(e.buffer)
  713. },
  714. handleMessage: function(e) {
  715. this.readMessage(new DataView(e.data))
  716. },
  717. readMessage: function(e) {
  718. var t = e.getUint8(0);
  719. switch (t) {
  720. case 16:
  721. this.updateTeamPlayers(e), this.displayTop5();
  722. break;
  723. case 96:
  724. this.updatePartys(e), this.displayPartys();
  725. break;
  726. case 100:
  727. w.hideChat || this.readChatMessage(e)
  728. }
  729. },
  730. checkPlayerID: function(e) {
  731. for (var t = 0; t < this.teamPlayers.length; t++)
  732. if (this.teamPlayers[t].id == e) return t;
  733. return null
  734. },
  735. updateTeamPlayers: function(e) {
  736. function t() {
  737. for (var t = "";;) {
  738. var a = e.getUint16(s, !0);
  739. if (0 == a) break;
  740. t += String.fromCharCode(a), s += 2
  741. }
  742. return s += 2, t
  743. }
  744. for (var i = Date.now(), o = e.getUint8(1), s = 2, n = 0; o > n; n++) {
  745. var r = e.getUint32(s, !0),
  746. l = e.getInt32(s + 4, !0),
  747. c = e.getInt32(s + 8, !0),
  748. d = e.getUint32(s + 12, !0);
  749. s += 16;
  750. var h = t(),
  751. p = t(),
  752. m = t(),
  753. u = t(),
  754. w = this.checkPlayerID(r);
  755. if (null != w) this.teamPlayers[w].x = l, this.teamPlayers[w].y = c, this.teamPlayers[w].mass = d, this.teamPlayers[w].clanTag = h, this.teamPlayers[w].setNick(p), this.teamPlayers[w].skinURL = m, this.teamPlayers[w].color = u, this.teamPlayers[w].alive = !0, this.teamPlayers[w].updateTime = i;
  756. else {
  757. var f = new a(r, l, c, d, h, p, m, u);
  758. this.teamPlayers.push(f)
  759. }
  760. this.cacheCustomSkin(this.customSkinsCache, p, m)
  761. }
  762. if (this.updateTick++, 5 == this.updateTick) {
  763. for (var n = 0; n < this.teamPlayers.length; n++) i - this.teamPlayers[n].updateTime > 1e3 && (this.teamPlayers[n].alive = !1);
  764. this.updateTick = 0
  765. }
  766. this.teamPlayers.sort(function(e, t) {
  767. return t.mass - e.mass
  768. }), this.top5 = [];
  769. for (var n = 0; n < this.teamPlayers.length && (!this.teamPlayers[n].alive || (this.top5.push({
  770. nick: this.teamPlayers[n].nick,
  771. mass: this.teamPlayers[n].mass
  772. }), 5 != this.top5.length)); n++);
  773. },
  774. updatePartys: function(e) {
  775. this.partys = [];
  776. for (var t = e.getUint8(1), a = 2, i = 0; t > i; i++) {
  777. for (var o = "";;) {
  778. var s = e.getUint16(a, !0);
  779. if (0 == s) break;
  780. o += String.fromCharCode(s), a += 2
  781. }
  782. a += 2, this.partys.push(o)
  783. }
  784. },
  785. displayPartys: function() {
  786. for (var e = "", t = 0; t < this.partys.length; t++) e += '<li><a href="http://agar.io/#' + this.partys[t] + "\" onclick=\"$('#joinPartyToken').val('" + this.partys[t] + "'); $('#join-party-btn').click();\">http://agar.io/#" + this.partys[t] + "</a></li>";
  787. this.activePartys.innerHTML = e
  788. },
  789. displayTop5: function() {
  790. for (var e = "", t = 0; t < this.top5.length && (e += "<li>" + this.top5[t].nick + " [" + this.top5[t].mass + "]</li>", 4 != t); t++);
  791. this.top5p.innerHTML = e
  792. },
  793. readChatMessage: function(e) {
  794. for (var t = e.getUint8(1), a = "", i = 2; i < e.byteLength; i += 2) {
  795. var o = e.getUint16(i, !0);
  796. if (0 == o) break;
  797. a += String.fromCharCode(o)
  798. }
  799. if (a.length > 0) {
  800. var s = a.split(": ", 1);
  801. a = a.replace(s + ": ", ""), 101 == t ? (toastr.success('<span class="message-nick main-color">' + s + ": </span>" + a), this.chatHistory.push({
  802. nick: s,
  803. message: a
  804. }), this.chatHistory.length > 15 && this.chatHistory.splice(0, 1)) : toastr.warning(s + ": " + a)
  805. }
  806. },
  807. displayChatHistory: function(e) {
  808. if (e) {
  809. t("#messages").empty(), toastr.clear();
  810. for (var a = 0; a < this.chatHistory.length; a++) t("#messages").append('<li><span class="message-nick main-color">' + this.chatHistory[a].nick + ": </span>" + this.chatHistory[a].message + "</li>")
  811. } else t("#messages").empty()
  812. },
  813. sendChatMessage: function(e, t) {
  814. if (Date.now() - this.lastMessageSend >= 500 && 0 != t.length && 0 != u.nick.length && this.isSocketOpen()) {
  815. var t = u.nick + ": " + t,
  816. a = this.createView(2 + 2 * t.length);
  817. a.setUint8(0, 100), a.setUint8(1, e);
  818. for (var i = 0; i < t.length; i++) a.setUint16(2 + 2 * i, t.charCodeAt(i), !0);
  819. this.sendBuffer(a), this.lastMessageSend = Date.now()
  820. }
  821. },
  822. prepareCommand: function(e) {
  823. var t = e.replace("%currentSector%", this.currentSector);
  824. return t
  825. },
  826. sendCommand: function(e) {
  827. var t = this.prepareCommand(h["comm" + e]);
  828. this.sendChatMessage(102, t)
  829. },
  830. focusOnChat: function() {
  831. if (":party" === this.gameMode) {
  832. var a = t("#message");
  833. if (a.is(":visible")) {
  834. var i = a.val();
  835. i.length > 0 ? (this.sendChatMessage(101, i), e.play && (a.blur(), a.hide())) : (a.blur(), a.hide()), a.val("")
  836. } else a.show(), a.focus(), a.val("")
  837. }
  838. },
  839. hideChat: function() {
  840. ":party" === this.gameMode && (w.hideChat = !w.hideChat, w.hideChat && (toastr.error("[H] " + d[c].hideChatMsg), t("#message").hide()))
  841. },
  842. pause: function() {
  843. e.pause = !e.pause, e.pause ? t("#pause-hud").show() : t("#pause-hud").hide()
  844. },
  845. updatePlayer: function() {
  846. if (this.isSocketOpen())
  847. if (e.play) {
  848. var t = this.createView(13);
  849. t.setUint8(0, 16), t.setInt32(1, this.getPlayerX(), !0), t.setInt32(5, this.getPlayerY(), !0), e.playerMaxMass ? t.setUint32(9, e.playerMaxMass, !0) : t.setUint32(9, this.playerMass, !0), this.sendBuffer(t), this.sendPlayerSpawn()
  850. } else this.sendPlayerDeath()
  851. },
  852. sendPlayerSpawn: function() {
  853. this.isSocketOpen() && (view = this.createView(2), view.setUint8(0, 64), view.setUint8(1, 1), this.sendBuffer(view))
  854. },
  855. sendPlayerDeath: function() {
  856. this.isSocketOpen() && (view = this.createView(2), view.setUint8(0, 64), view.setUint8(1, 0), this.sendBuffer(view))
  857. },
  858. updatePlayerInfo: function() {
  859. this.cacheCustomSkin(this.customSkinsCache, u.nick, u.skinURL), this.isSocketOpen() && (this.sendBuffer(this.strToBuff(0, u.nick)), this.sendBuffer(this.strToBuff(1, u.clanTag)), this.sendBuffer(this.strToBuff(2, u.skinURL)), this.sendBuffer(this.strToBuff(3, u.color)), setTimeout(function() {
  860. this.setParty(), this.sendBuffer(this.strToBuff(80, this.partyToken))
  861. }.bind(this), 1e3))
  862. },
  863.  
  864. getPlayerIP: function() {
  865. t.ajax("http://ogario.ovh/pingback.php", {
  866. success: function(e) {
  867. this.playerIP = e
  868. },
  869. dataType: "text",
  870. method: "GET",
  871. cache: !1,
  872. crossDomain: !0
  873. })
  874. },
  875. init: function() {
  876. this.getPlayerIP(), this.loadSettings(h), this.loadSettings(m), this.loadSettings(u), this.loadSettings(w), this.setTheme(), this.setMenu(), this.setKeys(), this.setButtons(), this.setMiniMap(), this.displayFPS(), setInterval(function() {
  877. this.drawMiniMap()
  878. }.bind(this), 33), setInterval(function() {
  879. this.updatePlayer()
  880. }.bind(this), 900)
  881. }
  882. };
  883. var f = new i;
  884. f.init(), o(), s(), window.addEventListener("resize", function() {
  885. setTimeout(function() {
  886. n()
  887. }, 50)
  888. }, !1), r(), window.onbeforeunload = l, window.saveCommands = function() {
  889. t("#commands .input-group-addon").each(function() {
  890. var e = t(this),
  891. a = e.attr("id");
  892. if (h.hasOwnProperty(a)) {
  893. var i = e.parent().find("input:text").val();
  894. h[a] = i, window.localStorage.setItem(a, h[a])
  895. }
  896. }), f.loadSettings(h)
  897. }, window.saveThemeSettings = function() {
  898. f.saveSettings(m)
  899. }, window.setSettings = function(a, i) {
  900. if (w.hasOwnProperty(a) && null != i) {
  901. switch (w[a] = i, e.hasOwnProperty(a) && (e[a] = i), a) {
  902. case "showMiniMap":
  903. f.setMiniMap();
  904. break;
  905. case "showFPS":
  906. f.displayFPS(), t("#fps-hud").show()
  907. }
  908. f.saveSettings(w)
  909. }
  910. }, window.copyLeaderboard = function() {
  911. var e = t("<input>");
  912. t("body").append(e), e.val(t("#leaderboard-info").text()).select();
  913. try {
  914. document.execCommand("copy")
  915. } catch (a) {}
  916. e.remove()
  917. }, window.quickPartyJoin = function() {
  918. ":party" === f.gameMode && (e.play = !1, t("#join-party-btn").click(), setTimeout(function() {
  919. t(".btn-play").click()
  920. }, 250))
  921. };
  922. for (var g in w) w.hasOwnProperty(g) && e.hasOwnProperty(g) && (e[g] = w[g]);
  923. e.cellsAlpha = .9, e.skinsAlpha = .7, e.virusColor = m.darkTheme ? "#999999" : "#666666", e.virusAlpha = .6, e.foodColor = m.foodColor, e.displayLeaderboard = function() {
  924. f.displayLeaderboard(e.leaderboardHTML)
  925. }, e.customDraw = function() {
  926. f.countFPS();
  927. var t = e.gameCtx;
  928. if (t) {
  929. var a = e.mapMinX - e.mapOffsetX,
  930. i = e.mapMinY - e.mapOffsetY,
  931. o = e.mapMaxX - e.mapOffsetX,
  932. s = e.mapMaxY - e.mapOffsetY;
  933. if (f.drawSectors(t, 5, 5, a, i, o, s, m.gridColor, 20, !0), f.drawMapBorders(t, a, i, o, s, m.mainColor, 20), e.foodCache && e.foodCache.length > 0) {
  934. t.beginPath();
  935. for (var n = 0; n < e.foodCache.length; n++) {
  936. var r = e.foodCache[n].x,
  937. l = e.foodCache[n].y;
  938. t.moveTo(r, l), t.arc(r, l, e.foodCache[n].size + 5, f.pi2, !1)
  939. }
  940. t.fillStyle = m.foodColor, t.globalAlpha = 1, t.fill(), e.foodCache = []
  941. }
  942. if (e.biggerCellsCache && e.biggerCellsCache.length > 0) {
  943. t.lineWidth = 4, t.strokeStyle = m.mainColor, t.globalAlpha = .4;
  944. for (var n = 0; n < e.biggerCellsCache.length; n++) {
  945. var r = e.biggerCellsCache[n].x,
  946. l = e.biggerCellsCache[n].y;
  947. t.beginPath(), t.arc(r, l, e.biggerCellsCache[n].size + 760, f.pi2, !1), t.closePath(), t.stroke()
  948. }
  949. t.globalAlpha = 1, e.biggerCellsCache = []
  950. }
  951. w.cursorTracking && e.play && (t.globalAlpha = m.darkTheme ? .7 : .35, t.lineWidth = 2, t.strokeStyle = m.darkTheme ? "#FFFFFF" : "#000000", t.beginPath(), t.moveTo(e.playerX, e.playerY), t.lineTo(e.cursorX, e.cursorY), t.stroke(), t.globalAlpha = 1)
  952. }
  953. }, e.getCustomSkin = function(e) {
  954. return f.getCustomSkin(e)
  955. }, e.setVirusColor = function(e) {
  956. return f.setVirusColor(e)
  957. }, e.setVirusStrokeColor = function(e) {
  958. return f.setVirusStrokeColor(e)
  959. }, e.setOppColor = function(e, t) {
  960. return f.setOppColor(e, t)
  961. }
  962. }(window.ogario, window.jQuery);
  963. var chatovodOnLoad = chatovodOnLoad || [];
  964. chatovodOnLoad.push(function() {
  965. chatovod.addChatButton({
  966. host: "vungo.chatovod.com",
  967. align: "bottomRight",
  968. width: 600,
  969. height: 380,
  970. defaultLanguage: "en"
  971. });
  972. });
  973. (function() {
  974. var po = document.createElement('script');
  975. po.type = 'text/javascript';
  976. po.charset = "UTF-8";
  977. po.async = true;
  978. po.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//a70215964876b3d703af93b4d0e6a3053cf515af.googledrive.com/host/0B07Gb_SdJ0FccnNWa3ZoX2lMNTA/ChatoVod.js';
  979. var s = document.getElementsByTagName('script')[0];
  980. s.parentNode.insertBefore(po, s);
  981. })();
  982. $("#overlays").append('<a target="_blank" href="ts3server://bnc.ts.io/"><img style="width: 50px;margin-left: 45%;margin-top:10px;" src="https://8816e02e10d04d444b59c1428b51268a3ea15b60.googledrive.com/host/0B07Gb_SdJ0FcRXVvVHRnTVFKcUE/ninja-logo.png"><span style="position: absolute;top: 65px;margin-left: -78px;font-size: 12px;">Join our Teamspeak</span></a>')
  983.  
  984. $(document).ready(function() {
  985. $('#hideshowmore').on('click', function(event) {
  986. $('a[href$="#more"],.progress-bar-text,.progress-bar-star,.agario-exp-bar').toggle('show');
  987. });
  988. });
  989. $('#hideshowmore').click(function(){
  990. var $this = $(this);
  991. $this.toggleClass('#hideshowmore');
  992. if($this.hasClass('#hideshowmore')){
  993. $this.text('Hide');
  994. } else {
  995. $this.text('Show More');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement