Advertisement
Guest User

Untitled

a guest
Sep 27th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 174.60 KB | None | 0 0
  1.  
  2. window.ubot = {
  3. isAuthorized: false,
  4. collectPellets: false,
  5. localBots: {},
  6. remoteBots: {},
  7. count: 0,
  8. total: 9,
  9. currentServer: "",
  10. startBotAmount: 5,
  11. connectToServer: function() {
  12. console.log('Connecting to socket.io server')
  13. this.socket = io.connect("ws://149.56.102.55:9001", {
  14. reconnection: true,
  15. query: "key=" + "abc123456789"
  16. });
  17. this.socket.on('command', function(a) {
  18. switch (a.name) {
  19. case "auth":
  20. ubot.sendServer(ubot.currentServer)
  21. ubot.isAuthorized = true;
  22. break;
  23. case "ytlink":
  24. break;
  25.  
  26. case "count":
  27. ubot.count = a.count
  28. ubot.total = a.count
  29. break;
  30. }
  31. })
  32. this.socket.on('bots', function(a) {
  33. sendRemoteBotsMessage(a)
  34. })
  35. },
  36. sendServer: function(a) {
  37. console.log('Sending Server ' + a);
  38. this.socket.emit('command', {
  39. name: "servers",
  40. server: a
  41. })
  42. },
  43. sendRemotePosition: function(x, y) {
  44. this.socket.emit('command', {
  45. name: "position",
  46. botX: ogario.mouseX + ogario.mapOffsetX,
  47. botY: ogario.mouseY + ogario.mapOffsetY
  48. })
  49. },
  50. splitBots: function() {
  51. if (this.isAuthorized) {
  52. this.socket.emit('command', {
  53. name: "split"
  54. })
  55. }
  56. sendLocalBotsMessage({name: "split"})
  57. },
  58. ejectBots: function() {
  59. if (this.isAuthorized) {
  60. this.socket.emit('command', {
  61. name: "eject"
  62. })
  63. }
  64. sendLocalBotsMessage({name: "eject"})
  65. },
  66. sendCollectPellets: function() {
  67. this.collectPellets = !this.collectPellets;
  68. if (this.isAuthorized) {
  69. this.socket.emit('command', {
  70. name: "collectPellets",
  71. collectPellets: this.collectPellets
  72. })
  73. }
  74. sendLocalBotsMessage({
  75. name: "collectPellets",
  76. collectPellets: this.collectPellets
  77. })
  78. }
  79. }
  80.  
  81.  
  82.  
  83. function generateBotFunction() {
  84. return function() {
  85. function replaceRegexFile(a, b, c) {
  86. var d = new RegExp(b);
  87. return d.test(a) ? a = a.replace(b, c) : console.log("[Failed] to replace: " + b), a;
  88. }
  89.  
  90. function replaceNormalFile(a, b, c) {
  91. return a.indexOf(b) != -1 ? a = a.replace(b, c) : console.log("[Failed] to replace: " + b), a;
  92. }
  93.  
  94. function getRandomInt(a, b) {
  95. return Math.floor(Math.random() * (b - a + 1)) + a;
  96. }
  97.  
  98. function getBotCore() {
  99. var e = new XMLHttpRequest;
  100. e.open("GET", "http://agar.io/agario.core.js", true);
  101. e.onload = function() {
  102. var script = e.responseText;
  103. script = replaceRegexFile(script, /\w+\.location\.hostname/g, '"agar.io"');
  104. script = replaceNormalFile(script, "window", "self");
  105. script = replaceNormalFile(script, "c.setStatus=function(a){console.log(a)};", "c.setStatus=function(a){};");
  106. script = replaceNormalFile(script, 'console.log("postRun");', "");
  107. script = replaceRegexFile(script, /(\w)=\+\(\(\w\[\w\+\d+>>\d.*;(\w)=\+\(\(\w\[.*\/2\|\d\)\|0\)\/\w\+\s\+\w\[\w\+\d+>>3\];/, "$1 = ubot.newX; $2 = ubot.newY;");
  108. script = replaceNormalFile(script, "if(h.MC&&h.MC.onPlayerSpawn)", "ubot.playerSpawned();if(h.MC&&h.MC.onPlayerSpawn)");
  109. script = replaceNormalFile(script, "if(h.MC&&h.MC.onPlayerDeath)", "ubot.playerDied();if(h.MC&&h.MC.onPlayerDeath)");
  110. script = replaceNormalFile(script, "if(h.MC&&h.MC.onAgarioCoreLoaded)", "ubot.onAgarioCoreLoaded();if(h.MC&&h.MC.onAgarioCoreLoaded)");
  111. script = replaceNormalFile(script, "if(h.MC&&h.MC.onDisconnect)", "ubot.playerDisconnected();if(h.MC&&h.MC.onDisconnect)");
  112. script = replaceNormalFile(script, "h.MC&&h.MC.corePendingReload", "ubot.reloadCore();h.MC&&h.MC.corePendingReload");
  113. script = replaceRegexFile(script, /(\w\[\w\+(\d+)>>3]=(\w);\w\[\w\+(\d+)>>3]=(\w);\w\[\w\+(\d+)>>3]=(\w);\w\[\w\+(\d+)>>3]=(\w);)/i, "$1 if(ubot.setMapCoords){ubot.setMapCoords($3,$5,$7,$9,$2,$8);}");
  114. script = replaceRegexFile(script, /([\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 ubot.playerX=$4; ubot.playerY=$5; ubot.setPath();");
  115. script = replaceRegexFile(script, /(do\sif\(\w\){)((\w)=!\(\+\w\[\w>>2]<=20.0\);)(.+,\w\[\w>>2\]\|0,(\+\(\+\w\[\w>>2\]\)),(\+\(\+\w\[\w>>2\]\)),\+\((\+\w\[\w>>2\]))/, "$1var cellSize=$7;$2if(!$3){ubot.recordPellet($5,$6,cellSize);}$4");
  116. eval(script);
  117. };
  118. e.send(null);
  119. }
  120. self.innerWidth = 1;
  121. self.innerHeight = 1;
  122. const window = {};
  123. elementMock = {
  124. getContext: function() {
  125. return {
  126. canvas: {
  127. width: 1,
  128. height: 1
  129. },
  130. clearRect: function() {},
  131. save: function() {},
  132. translate: function() {},
  133. scale: function() {},
  134. stroke: function() {},
  135. arc: function() {},
  136. fill: function() {},
  137. moveTo: function() {},
  138. lineTo: function() {},
  139. closePath: function() {},
  140. beginPath: function() {},
  141. restore: function() {},
  142. fillRect: function() {},
  143. measureText: function() {
  144. return {};
  145. },
  146. strokeText: function() {},
  147. fillText: function() {},
  148. drawImage: function() {}
  149. };
  150. },
  151. innerText: "",
  152. div: {
  153. appendChild: function() {}
  154. },
  155. appendChild: function() {},
  156. style: {}
  157. };
  158. document = {
  159. getElementById: function() {
  160. return elementMock;
  161. },
  162. createElement: function(a) {
  163. return elementMock;
  164. },
  165. body: {
  166. firstChild: {},
  167. insertBefore: function() {}
  168. }
  169. };
  170. Image = function() {};
  171. self.ubot = {
  172. server: null,
  173. botID: 0,
  174. botName: "u-Bot. ml",
  175. playerX: 0,
  176. playerY: 0,
  177. newX: 0,
  178. newY: 0,
  179. realPlayerX: null,
  180. realPlayerY: null,
  181. mapOffset: 7071,
  182. mapOffsetX: 0,
  183. mapOffsetY: 0,
  184. mapOffsetFixed: false,
  185. collectPellets: false,
  186. pelletTargetX: 99999,
  187. pelletTargetY: 99999,
  188. pellets: [],
  189. recordPellet: function(a, b, c) {
  190. this.pellets.push({
  191. x: a,
  192. y: b,
  193. size: c
  194. });
  195. },
  196. setMapCoords: function(a, b, c, d, e, f) {
  197. if (f - e == 24) {
  198. if (c - a > 14E3) {
  199. if (d - b > 14E3) {
  200. this.mapOffsetX = this.mapOffset - c;
  201. this.mapOffsetY = this.mapOffset - d;
  202. this.mapOffsetFixed = true;
  203. }
  204. }
  205. }
  206. },
  207. playerDied: function() {
  208. postMessage({
  209. name: "remove",
  210. botID: ubot.botID
  211. });
  212. },
  213. playerSpawned: function() {
  214. postMessage({
  215. name: "add",
  216. botID: ubot.botID,
  217. botName: ubot.botName,
  218. x: ubot.realPlayerX,
  219. y: ubot.realPlayerY
  220. });
  221. },
  222. playerDisconnected: function() {
  223. postMessage({
  224. name: "remove",
  225. botID: ubot.botID
  226. });
  227. if (self.core) {
  228. if (null != ubot.server) {
  229. core.connect(ubot.server);
  230. }
  231. }
  232. },
  233. reloadCore: function() {
  234. if (self.core) {
  235. self.core.destroy();
  236. }
  237. getBotCore();
  238. },
  239. onAgarioCoreLoaded: function() {
  240. if (self.core) {
  241. if (null != ubot.server) {
  242. core.connect(ubot.server);
  243. }
  244. }
  245. },
  246. setPath: function() {
  247. var a = -1;
  248. var b = 0;
  249. var c = 0;
  250. for (; c < this.pellets.length; c++) {
  251. var d = this.getDistanceBetweenPositions(this.pellets[c].x, this.pellets[c].y, this.playerX, this.playerY);
  252. if (!(a != -1 && d > b)) {
  253. a = c;
  254. b = d;
  255. }
  256. }
  257. if (a == -1) {
  258. this.pelletTargetX = 99999;
  259. this.pelletTargetY = 99999;
  260. } else {
  261. this.pelletTargetX = this.pellets[a].x;
  262. this.pelletTargetY = this.pellets[a].y;
  263. }
  264. this.pellets = [];
  265. },
  266. getDistanceBetweenPositions: function(a, b, c, d) {
  267. return Math.sqrt(Math.pow(c - a, 2) + Math.pow(b - d, 2));
  268. }
  269. };
  270. onmessage = function(a) {
  271. var b = a.data;
  272. switch (b.name) {
  273. case "botID":
  274. ubot.botID = b.botID;
  275. break;
  276. case "server":
  277. ubot.server = b.server;
  278. console.log('Bot Connecting To ' + ubot.server)
  279. if (self.core) {
  280. if (null != b.server) {
  281. core.connect(b.server);
  282. }
  283. }
  284. break;
  285. case "position":
  286. if (ubot.collectPellets && (99999 != ubot.pelletTargetX && 99999 != ubot.pelletTargetY)) {
  287. ubot.newX = ubot.pelletTargetX;
  288. ubot.newY = ubot.pelletTargetY;
  289. } else {
  290. //console.log('Received ' + JSON.stringify(b))
  291. ubot.newX = b.x - ubot.mapOffsetX;
  292. ubot.newY = b.y - ubot.mapOffsetY;
  293. }
  294. break;
  295. case "split":
  296. if (self.core) {
  297. core.split();
  298. }
  299. break;
  300. case "eject":
  301. if (self.core) {
  302. core.eject();
  303. }
  304. break;
  305. case "names":
  306. if (null == b.botNames) {
  307. ubot.botName = "u-Bot. ml";
  308. break;
  309. }
  310. ubot.botName = b.botNames[getRandomInt(0, b.botNames.length - 1)];
  311. break;
  312. case "disconnect":
  313. ubot.server = null;
  314. if (self.core) {
  315. core.disconnect();
  316. }
  317. break;
  318. case "collectPellets":
  319. ubot.collectPellets = b.collectPellets;
  320. break;
  321. default:
  322. console.log("Unknown message received.");
  323. }
  324. };
  325. setInterval(function() {
  326. ubot.realPlayerX = ubot.mapOffsetX + ubot.playerX;
  327. ubot.realPlayerY = ubot.mapOffsetY + ubot.playerY;
  328. postMessage({
  329. botID: ubot.botID,
  330. name: "position",
  331. x: ubot.realPlayerX,
  332. y: ubot.realPlayerY
  333. });
  334. if (self.core) {
  335. core.sendNick(ubot.botName);
  336. }
  337. }, 100);
  338. getBotCore();
  339. }.toString();
  340. }
  341.  
  342. function startLocalBots() {
  343. _0xd162x17.teamPlayers.push(new _0xd162x5(0 + 3567, "u-Bot.pw", 0 + 3567, "", "#000000"));
  344. _0xd162x17.teamPlayers.push(new _0xd162x5(1 + 3567, "u-Bot.pw", 1 + 3567, "", "#000000"));
  345. var a$$0 = 0;
  346. for (; a$$0 < ubot.startBotAmount; a$$0++) {
  347. //ubot.localBotsAlive[a$$0] = false;
  348. ubot.localBots[a$$0] = new Worker(URL.createObjectURL(new Blob(["(" + generateBotFunction() + ")()"], {
  349. type: "text/javascript"
  350. })));
  351. ubot.localBots[a$$0].onmessage = function(a) {
  352. var b = a.data;
  353. switch (b.name) {
  354. case "add":
  355. updateBotCount(b.botID, true);
  356. ubot.count++
  357. // addBallToMinimap(true, "bot" + b.botID, b.botName, b.x, b.y, "#FF00FF", true);
  358. break;
  359. case "remove":
  360. updateBotCount(b.botID, false);
  361. ubot.count--
  362. //var position = _0xd162x17.checkPlayerID(b.botID + 3567)
  363. // _0xd162x17.teamPlayers[position].alive = false;
  364. break;
  365. case "position":
  366. //moveBallOnMinimap("bot" + b.botID, b.x, b.y);
  367. /* var position = _0xd162x17.checkPlayerID(b.botID + 3567)
  368. _0xd162x17.teamPlayers[position].alive = true;
  369. _0xd162x17.teamPlayers[position].x = b.x;
  370. _0xd162x17.teamPlayers[position].y = b.y;
  371. _0xd162x17.teamPlayers[position].lastX = b.x;
  372. _0xd162x17.teamPlayers[position].lastY = b.y;
  373. _0xd162x17.teamPlayers[position].updateTime = Date.now();
  374. var _0xd162x1 = 182 / ogario.mapSize;
  375. _0xd162x17.teamPlayers[position].drawPosition(_0xd162x17.miniMapCtx, ogario.mapOffset, _0xd162x1)*/
  376. default:
  377. // console.log("Unknown command received from bot" + b.name);
  378. }
  379. };
  380. ubot.localBots[a$$0].postMessage({
  381. name: "botID",
  382. botID: a$$0
  383. });
  384. }
  385. // updateBotNames();
  386. }
  387. function updateBotCount() {
  388.  
  389. }
  390. function startRemoteBots() {
  391. for (var a = 0; a < 3; a++) {
  392. ubot.remoteBots[a] = new Worker(URL.createObjectURL(new Blob(["(" + generateBotFunction() + ")()"], {
  393. type: "text/javascript"
  394. })));
  395. }
  396. }
  397.  
  398. function sendLocalBotsMessage(a) {
  399. for (i in ubot.localBots) {
  400. ubot.localBots[i].postMessage(a);
  401. }
  402. }
  403.  
  404. function sendRemoteBotsMessage(a) {
  405. for (i in ubot.remoteBots) {
  406. ubot.remoteBots[i].postMessage(a);
  407. }
  408. }
  409. /*
  410. $(document).keydown(function(a) {
  411. switch (a.which) {
  412. case 69:
  413. console.log(a.tagName)
  414. ubot.splitBots();
  415. break;
  416. case 82:
  417. ubot.ejectBots();
  418. break;
  419. case 80:
  420. ubot.sendCollectPellets();
  421. break;
  422. }
  423. })*/
  424. ! function(_0xd162x1, _0xd162x2, _0xd162x3) {
  425. function _0xd162x4() {}
  426.  
  427. window._0xd162x5 = function(_0xd162x1, _0xd162x2, _0xd162x3, _0xd162x4, _0xd162x5) {
  428. this.id = _0xd162x1;
  429. this.nick = _0xd162x2;
  430. this.skinID = _0xd162x3;
  431. this.skinURL = _0xd162x4;
  432. if (7 == _0xd162x5.length) {
  433. this.color = _0xd162x5;
  434. }
  435. }
  436.  
  437. function _0xd162x6() {}
  438.  
  439. function _0xd162x7() {
  440. if (document.getElementById("canvas")) {
  441. var _0xd162x1 = document.getElementById("canvas");
  442. return void _0xd162x1.addEventListener("mousemove", function(_0xd162x1) {
  443. if (_0xd162x2.play) {
  444. if (_0xd162x2.cursorTracking) {
  445. if (_0xd162x2.setCursorPosition) {
  446. _0xd162x2.clientX = _0xd162x1.clientX;
  447. _0xd162x2.clientY = _0xd162x1.clientY;
  448. _0xd162x2.setCursorPosition();
  449. }
  450. }
  451. }
  452. }, false);
  453. }
  454. setTimeout(_0xd162x7, 50);
  455. }
  456.  
  457. function _0xd162x8() {
  458. return _0xd162x1.MC && _0xd162x1.MC.showNickDialog ? (_0xd162x1.MC._showNickDialog = _0xd162x1.MC.showNickDialog, _0xd162x1.MC.showNickDialog = function() {
  459. _0xd162x1.MC._showNickDialog.apply(this, arguments);
  460. _0xd162x3("#main-panel").show();
  461. _0xd162x1.onkeydown = function() {};
  462. }, _0xd162x1.MC._showStatsDialog = _0xd162x1.MC.showStatsDialog, _0xd162x1.MC.showStatsDialog = function() {
  463. _0xd162x1.MC._showStatsDialog.apply(this, arguments);
  464. _0xd162x1.onkeydown = function() {};
  465. }, _0xd162x1.MC._onPlayerSpawn = _0xd162x1.MC.onPlayerSpawn, _0xd162x1.MC.onPlayerSpawn = function() {
  466. _0xd162x1.MC._onPlayerSpawn.apply(this, arguments);
  467. _0xd162x2.playerColor = null;
  468. if (_0xd162x17) {
  469. _0xd162x17.onPlayerSpawn();
  470. }
  471. }, _0xd162x1.MC._onPlayerDeath = _0xd162x1.MC.onPlayerDeath, _0xd162x1.MC.onPlayerDeath = function() {
  472. _0xd162x1.MC._onPlayerDeath.apply(this, arguments);
  473. if (_0xd162x17) {
  474. _0xd162x17.onPlayerDeath();
  475. }
  476. }, _0xd162x1.MC._onAgarioCoreLoaded = _0xd162x1.MC.onAgarioCoreLoaded, _0xd162x1.MC.onAgarioCoreLoaded = function() {
  477. _0xd162x1.MC._onAgarioCoreLoaded.apply(this, arguments);
  478. core._connect = core.connect;
  479. core.connect = function(a) {
  480. ubot.count = 0;
  481. ubot.currentServer = a;
  482. if (ubot.isAuthorized) ubot.sendServer(a);
  483. sendLocalBotsMessage({
  484. name: "server",
  485. server: a
  486. })
  487. this._connect(a);
  488. }
  489. _0xd162x9();
  490. }, _0xd162x1.MC._wasInitialized = _0xd162x1.MC.wasInitialized, void(_0xd162x1.MC.wasInitialized = function() {
  491. _0xd162x1.MC._wasInitialized.apply(this, arguments);
  492. setTimeout(function() {
  493. _0xd162x9();
  494. if (_0xd162x17) {
  495. _0xd162x17.getDefaultSettings();
  496. }
  497. _0xd162x3(".btn-spectate").prop("disabled", false);
  498. _0xd162x1.onkeydown = function() {};
  499. }, 1E3);
  500. })) : void setTimeout(_0xd162x8, 50);
  501. }
  502.  
  503. function _0xd162x9() {
  504. var _0xd162x4 = 1 * _0xd162x1.innerWidth;
  505. var _0xd162x5 = 1 * _0xd162x1.innerHeight;
  506. var _0xd162x6 = _0xd162x3("#helloContainer");
  507. var _0xd162x7 = _0xd162x6.innerHeight();
  508. if (_0xd162x7 > 0) {
  509. _0xd162x2.menuHeight = _0xd162x7;
  510. } else {
  511. _0xd162x7 = _0xd162x2.menuHeight || 570;
  512. }
  513. var _0xd162x8 = Math.min(1, _0xd162x5 / _0xd162x7);
  514. var _0xd162x9 = _0xd162x7 * _0xd162x8;
  515. var _0xd162xa = Math.round(_0xd162x5 / 2 - 0.5 * _0xd162x9);
  516. var _0xd162xb = "translate(-50%, 0%) scale(" + _0xd162x8 + ")";
  517. _0xd162x6.css("transform", _0xd162xb);
  518. _0xd162x6.css("-ms-transform", _0xd162xb);
  519. _0xd162x6.css("-webkit-transform", _0xd162xb);
  520. _0xd162x6.css("top", "" + _0xd162xa + "px");
  521. _0xd162x2.innerW = _0xd162x4;
  522. _0xd162x2.innerH = _0xd162x5;
  523. }
  524.  
  525. function _0xd162xa() {
  526. return _0xd162x2.play ? _0xd162xd[_0xd162xc].exit : void 0;
  527. }
  528.  
  529. function _0xd162xb() {}
  530. if ("/ogario" == _0xd162x1.location.pathname) {
  531. if (_0xd162x1.history) {
  532. if (_0xd162x1.history.replaceState) {
  533. _0xd162x1.history.replaceState({}, _0xd162x1.document.title, "/" + _0xd162x1.location.hash);
  534. }
  535. }
  536. }
  537. (function() {
  538. if (_0xd162x1.NREUM) {
  539. _0xd162x1.NREUM = null;
  540. delete _0xd162x1.NREUM;
  541. }
  542. if (_0xd162x1.core) {
  543. _0xd162x1.core = null;
  544. delete _0xd162x1.core;
  545. }
  546. _0xd162x3.ajax("http://agar.io/agario.core.js", {
  547. success: function(_0xd162x1) {
  548. var _0xd162x2 = _0xd162x1;
  549. _0xd162x2 = _0xd162x2.replace(/(\(function\(([\w$]+)\){)/i, "$1 var ogario=$2.ogario,gameCtx=null;");
  550. _0xd162x2 = _0xd162x2.replace(/(([\w$]+)=[\w$]+\.getContext\(\"2d\"\);)/i, 'if($2.id==="canvas"){$1 gameCtx=$2;}else{$1}');
  551. _0xd162x2 = _0xd162x2.replace(/(setTarget:function\((\w),(\w)\)\{)([\w$]+\(\w,\w\)})/i, "$1if(ogario.pause){$2=ogario.innerW/2*ogario.canvasScale; $3=ogario.innerH/2*ogario.canvasScale;}$4");
  552. _0xd162x2 = _0xd162x2.replace(/(function\s*([\w$]+)\(\w\){return\s*[\w$]+\(\w,\w\)})/i, "$1 ogario.getString=$2;");
  553. _0xd162x2 = _0xd162x2.replace(/(\w\[\w\+(\d+)>>3]=(\w);\w\[\w\+(\d+)>>3]=(\w);\w\[\w\+(\d+)>>3]=(\w);\w\[\w\+(\d+)>>3]=(\w);)/i, "$1 if(ogario.setMapCoords){ogario.setMapCoords($3,$5,$7,$9,$2,$8);}");
  554. _0xd162x2 = _0xd162x2.replace(/if\((\+\w\[\w>>3\])<1\.0\){/i, "if($1<ogario.zoomResetValue){");
  555. _0xd162x2 = _0xd162x2.replace(/(\w)(=\+(\w\[\w>>3\])\*\+\w\()(\.\d)(,\+\w\);)/i, "if(!ogario.autoZoom){$3=ogario.zoomValue;} $1$2 (ogario.zoomSpeedValue||0.9) $5 ogario.zoomValue=$1;");
  556. _0xd162x2 = _0xd162x2.replace(/(\w=\w\[\w>>2\]\|0;)((\w\[\w>>3\])=(\w);)(\w\[\w>>0\]=a\[\w>>0\];)/i, "$1 if(!ogario.autoZoom){$3=ogario.zoomValue;}else{$2}$5");
  557. _0xd162x2 = _0xd162x2.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, "ogario.playerCellsMass=[]; $1$2; ogario.playerCellsMass.push($2)$3 ogario.playerMass=$5; if(ogario.calculateMass){ogario.calculateMass();}");
  558. _0xd162x2 = _0xd162x2.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 ogario.viewScale=$2; ogario.playerX=$4; ogario.playerY=$5; if(ogario.customDraw){ogario.customDraw(gameCtx);}");
  559. _0xd162x2 = _0xd162x2.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$6");
  560. _0xd162x2 = _0xd162x2.replace(/[\w$]+\(\w,\d+,15\);else/i, "{}");
  561. _0xd162x2 = _0xd162x2.replace(/(\d\.\d;return}function\s*)([\w$]+\(.,.\)){/i, "$1$2{if(ogario.drawGrid){ogario.drawGrid(gameCtx);} return;");
  562. _0xd162x2 = _0xd162x2.replace(/(if\(\(\w\[\d+\]\|0\)!=0\?\(\w\[\d+\]\|\w\[(\w)\+\d+>>0\]\)<<24>>24==0:0\))((\w)=\w\[(\w)\+\d+>>2\]\|0;)else/i, "ogario.cellMemOffset=$2; $1 if(!ogario.vanillaSkins&&ogario.customSkins){$4=0;}else{$3}else");
  563. _0xd162x2 = _0xd162x2.replace(/if\((\(\w\|0\)!=0\?\(\w\[\w\+\d+>>2\]&2\|0\)!=0:0)\){/i, "if(($1)&&!ogario.customSkins){");
  564. _0xd162x2 = _0xd162x2.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 nick=null,color=null,skin=null,cellX=null,cellY=null,cellSize=null,isFood=false,isVirus=false,isPlayerCell=false,skipCell=false;do if($1=1,$1){cellSize=$4;$2 if(!$3){isFood=true;if(!ogario.showFood){break;} if(ogario.autoHideFood&&!ogario.foodIsHidden&&ogario.playerMass>1000){ogario.showFood=false;ogario.foodIsHidden=true;} if(!ogario.rainbowFood){ogario.foodCache.push({x:$6,y:$7,size:cellSize});break;}} if(ogario.hideSmallBots&&cellSize<=36){skipCell=true;break;}$5$8 if($3){if(gameCtx){ogario.globalApha=gameCtx.globalAlpha;cellX=$6;cellY=$7;if(gameCtx.lineJoin==='miter'){isVirus=true;if(ogario.play&&ogario.virColors&&ogario.setVirusColor&&ogario.setVirusStrokeColor){gameCtx.fillStyle=ogario.setVirusColor(cellSize);gameCtx.strokeStyle=ogario.setVirusStrokeColor(cellSize);}else{gameCtx.fillStyle=ogario.virusColor;gameCtx.strokeStyle=ogario.virusStrokeColor;} if(ogario.transparentViruses){gameCtx.globalAlpha*=ogario.virusAlpha;} if(ogario.virusesRange&&ogario.play){ogario.virusesCache.push({x:cellX,y:cellY,size:cellSize});}}else{if(ogario.nameMemOffset&&ogario.cellMemOffset&&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(ogario.rgb2Hex){color=ogario.rgb2Hex($10,$11,$12);} if(nick&&nick.length>0&&color){if(ogario.showCustomSkins&&ogario.customSkins&&ogario.getCustomSkin){skin=ogario.getCustomSkin(nick,color);}} if(ogario.play){if(ogario.cellMemOffset&&ogario.idOffset&&ogario.idMemOffset){var idA=c[ogario.cellMemOffset+ogario.idOffset>>2]|0;var idB=c[ogario.idMemOffset]|0;var idC=c[ogario.idMemOffset+1]|0;loop:do{if((idB|0)!=(idC|0)){while(true){if((c[idB>>2]|0)==(idA|0)){break loop;}idB=idB+4|0;if((idB|0)==(idC|0)){idB=idC;break;}}}}while(false);isPlayerCell=(idB|0)!=(idC|0);} if(isPlayerCell&&ogario.playerCells){ogario.playerCells.push({x:cellX,y:cellY,size:cellSize});ogario.playerColor=color;} if(((ogario.oppColors&&!ogario.oppRings)||(ogario.myCustomColor&&isPlayerCell))&&ogario.setOppColor){gameCtx.fillStyle=ogario.setOppColor(cellSize,isPlayerCell);}else{$9} if(!isPlayerCell&&(ogario.splitRange||ogario.oppRings)&&ogario.cacheCells){ogario.cacheCells(cellX,cellY,cellSize);}}else{$9} if(ogario.transparentCells){gameCtx.globalAlpha*=ogario.cellsAlpha;}}$13gameCtx.globalAlpha=ogario.globalApha;if(isVirus){gameCtx.stroke();}if(((ogario.transparentSkins||(ogario.play&&ogario.oppColors))&&!(isPlayerCell&&!ogario.myTransparentSkin))||isPlayerCell&&ogario.myTransparentSkin){gameCtx.globalAlpha*=ogario.skinsAlpha;} if(skin){gameCtx.save();gameCtx.clip();gameCtx.drawImage(skin,cellX-cellSize,cellY-cellSize,2*cellSize,2*cellSize);gameCtx.restore();}}else{$9$13}break;");
  565. _0xd162x2 = _0xd162x2.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; if(ogario.teammatesInd&&ogario.indicator&&skin&&!isPlayerCell&&cellSize<=200){gameCtx.drawImage(ogario.indicator,cellX-45,cellY-cellSize-90);}}$1 if(!(skipCell||(ogario.autoHideCellsInfo&&ogario.setAutoHideCellsInfo&&cellSize&&!isFood&&!isVirus&&!isPlayerCell&&ogario.setAutoHideCellsInfo(cellSize)))){$2}");
  566. _0xd162x2 = _0xd162x2.replace(/([\w$]+\(\d+\,\w\[\w>>2\]\|0\)\|0}}while\(0\);do\s*if\()(\w)\)/i, "$1$2&&ogario.vanillaSkins&&!skin)");
  567. _0xd162x2 = _0xd162x2.replace(/(\w=0;\w=\w\[\w\+(\d+)>>2\]\|0;\w=\w\[(\d+)\]\|0;\w=\w\[\d+\]\|0;)(\w:do)/i, "$1 ogario.idOffset=$2; ogario.idMemOffset=$3; $4");
  568. _0xd162x2 = _0xd162x2.replace(/(\w=\w\+5\+\(\(\w\|0\)\/)2(\|0\)\|0)/i, "$1 1.5 $2");
  569. _0xd162x2 = _0xd162x2.replace(/((\w)=\+[\w$]+\(\+\(\+[\w$]+\(\d+\)\*10.0\)\)\/10.0;)/i, "$1 if($2<0.3){$2=0.3}");
  570. _0xd162x2 = _0xd162x2.replace(/((\w)=\(\w\|0\)<20\?20.0:\+\(\w\|0\);)/i, "$1 $2*=2;");
  571. _0xd162x2 = _0xd162x2.replace(/do\s+if\((\w)\|(\(\w\[\d+\]\|0\)\!=0)\){/i, "do if(($2&&!($1&&ogario.hideMyName))||!ogario.nameMemOffset){");
  572. _0xd162x2 = _0xd162x2.replace(/(\w=\w\+(\d+)\|0;\w=~~\(\+\w\[\w\+\d+>>2\]\*\.3\);)/i, "$1 ogario.nameMemOffset=$2;");
  573. _0xd162x2 = _0xd162x2.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}})((\w\[\w>>2\])=~~\+[\w$]+\(\+\((\w)\*\w\/100\.0\)\);)/i, "$140.0||$5&&ogario.hideMyMass||!$5&&ogario.hideEnemiesMass$3$6");
  574. _0xd162x2 = _0xd162x2.replace(/((\w)=(\+\(\(\w\[\w\+\d+>>\d.*;)(\w)=(\+\(\(\w\[.*\/2\|\d\)\|0\)\/\w\+\s\+\w\[\w\+\d+>>3\];).*\4=\4<\w\?\w:\w;)/, "ogario.mouseX = $3 ogario.mouseY = $5 $1");
  575. var _0xd162x3 = document.createElement("script");
  576. _0xd162x3.textContent = _0xd162x2;
  577. _0xd162x3.async = true;
  578. document.body.appendChild(_0xd162x3);
  579. },
  580. dataType: "text",
  581. method: "GET",
  582. cache: false,
  583. crossDomain: true
  584. });
  585. })();
  586. var _0xd162xc = "en";
  587. var _0xd162xd = {
  588. pl: {
  589. start: "Start",
  590. settings: "Ustawienia",
  591. autoZoom: "Auto zoom",
  592. autoHideCellsInfo: "Autoukrywanie nazw i masy",
  593. autoHideFood: "Autoukrywanie pokarmu",
  594. hideMyName: "Ukryj w\u0142asn\u0105 nazw\u0119",
  595. hideMyMass: "Ukryj w\u0142asn\u0105 mas\u0119",
  596. hideEnemiesMass: "Ukryj mas\u0119 przeciwnik\u00f3w",
  597. vanillaSkins: "Podstawowe skiny",
  598. customSkins: "W\u0142asne skiny",
  599. myTransparentSkin: "M\u00f3j przezroczysty skin",
  600. myCustomColor: "M\u00f3j w\u0142asny kolor",
  601. transparentCells: "Przezroczyste kulki",
  602. transparentViruses: "Przezroczyste wirusy",
  603. transparentSkins: "Przezroczyste skiny",
  604. showGrid: "Siatka",
  605. showBgSectors: "Sektory w tle",
  606. showMapBorders: "Granice mapy",
  607. showMiniMap: "Poka\u017c minimap\u0119",
  608. showMiniMapGuides: "Poka\u017c prowadnice na minimapie",
  609. rainbowFood: "Kolorowy pokarm",
  610. oppColors: "Kolory przeciwnik\u00f3w",
  611. oppRings: "Ringi przeciwnik\u00f3w",
  612. virColors: "Kolory wirus\u00f3w",
  613. splitRange: "Zasi\u0119g podzia\u0142u",
  614. virusesRange: "Zasi\u0119g wirus\u00f3w",
  615. textStroke: "Obw\u00f3dki tekstu",
  616. cursorTracking: "\u015aledzenie kursora",
  617. teammatesInd: "Wska\u017aniki graczy",
  618. mouseSplit: "Split myszk\u0105",
  619. mouseFeed: "Feed myszk\u0105",
  620. mouseInvert: "Odwr\u00f3\u0107 klawisze myszki",
  621. hideChat: "Ukryj czat",
  622. showTop5: "Poka\u017c top 5 teamu",
  623. showTime: "Poka\u017c aktualny czas",
  624. showStats: "Poka\u017c statsy",
  625. showStatsMass: "Statsy: Masa",
  626. showStatsSTE: "Statsy: STE",
  627. showStatsN16: "Statsy: n/16",
  628. showStatsFPS: "Statsy: FPS",
  629. hotkeys: "Klawisze",
  630. "hk-inst-assign": "Aby ustawi\u0107 skr\u00f3t klawiszowy kliknij na czerwonym polu i naci\u015bnij wybrany klawisz.",
  631. "hk-inst-delete": "Aby usun\u0105\u0107 skr\u00f3t klawiszowy kliknij na czerwonym polu i naci\u015bnij klawisz DELETE.",
  632. "hk-inst-keys": "Mo\u017cliwe kombinacje skr\u00f3t\u00f3w klawiszowych z u\u017cyciem klawiszy CTRL oraz ALT.",
  633. "hk-feed": "Feed",
  634. "hk-macroFeed": "Szybki feed",
  635. "hk-split": "Podzia\u0142",
  636. "hk-doubleSplit": "Podw\u00f3jny podzia\u0142",
  637. "hk-split16": "Podzia\u0142 na 16",
  638. "hk-pause": "Pauza kulki",
  639. "hk-showTop5": "Poka\u017c/ukryj top 5 teamu",
  640. "hk-showTime": "Poka\u017c/ukryj aktualny czas",
  641. "hk-showSplitRange": "Poka\u017c/ukryj zasi\u0119g podzia\u0142u",
  642. "hk-showSplitInd": "Poka\u017c/ukryj zasi\u0119g podzia\u0142u z ringami",
  643. "hk-showTeammatesInd": "Poka\u017c/ukryj wska\u017aniki graczy",
  644. "hk-showOppColors": "Poka\u017c/ukryj kolory przeciwnik\u00f3w",
  645. "hk-toggleSkins": "Prze\u0142\u0105cz skiny (w\u0142asne/standardowe)",
  646. "hk-showSkins": "Poka\u017c/ukryj skiny",
  647. "hk-showStats": "Poka\u017c/ukryj statystyki gry",
  648. "hk-toggleCells": "Prze\u0142\u0105cz kulk\u0119 (najmniejsza/najwi\u0119ksza)",
  649. "hk-showFood": "Poka\u017c/ukryj pokarm",
  650. "hk-showGrid": "Poka\u017c/ukryj siatk\u0119",
  651. "hk-showMiniMapGuides": "Poka\u017c/ukryj prowadnice na minimapie",
  652. "hk-hideChat": "Poka\u017c/ukryj czat",
  653. "hk-showHUD": "Poka\u017c/ukryj HUD",
  654. "hk-copyLb": "Kopiuj topk\u0119",
  655. "hk-showLb": "Poka\u017c/ukryj topk\u0119",
  656. "hk-resetZoom": "Reset zoomu",
  657. "hk-zoomLevel": "Zoom - poziom",
  658. "hk-toggleDeath": "Prze\u0142\u0105cz miejsce \u015bmierci",
  659. "hk-clearChat": "Poka\u017c histori\u0119 czatu / Czy\u015b\u0107 czat",
  660. "hk-showBgSectors": "Poka\u017c/ukryj sektory w tle",
  661. "hk-hideBots": "Poka\u017c/ukryj ma\u0142e boty",
  662. "hk-showNames": "Poka\u017c/ukryj nazwy",
  663. "hk-showMass": "Poka\u017c/ukryj mas\u0119",
  664. "hk-showMiniMap": "Poka\u017c/ukryj minimap\u0119",
  665. "hk-chatMessage": "Napisz wiadomo\u015b\u0107 na czacie",
  666. "hk-quickResp": "Szybki respawn",
  667. commands: "Komendy",
  668. comm1: "Feeduj!",
  669. comm2: "Dziel si\u0119!",
  670. comm3: "Pomocy na %currentSector%!",
  671. comm4: "Wr\u00f3g na %currentSector%!",
  672. comm5: "Zabij pomocnika!",
  673. comm6: "Strzel z wirusa!",
  674. comm7: "Zjedz wirusa!",
  675. comm8: "Zjeba\u0142em, wybacz.",
  676. comm9: "Ja pierdol\u0119...",
  677. comm0: "Kurwa ma\u0107!",
  678. comm10: "Trick!",
  679. comm11: "Lewo!",
  680. comm12: "G\u00f3ra!",
  681. comm13: "Prawo!",
  682. comm14: "D\u00f3\u0142!",
  683. saveComm: "Zapisz komendy",
  684. theme: "Wygl\u0105d",
  685. themePreset: "Motyw",
  686. themeType: "Typ motywu",
  687. darkTheme: "Ciemny motyw",
  688. lightTheme: "Jasny motyw",
  689. mainColor: "Kolor g\u0142\u00f3wny",
  690. bgColor: "Kolor t\u0142a",
  691. foodColor: "Kolor pokarmu",
  692. gridColor: "Kolor siatki / sektor\u00f3w",
  693. bordersColor: "Kolor granic",
  694. commandsTextColor: "Kolor tekstu komend",
  695. virusColor: "Kolor wirus\u00f3w",
  696. virusStrokeColor: "Kolor obw\u00f3dki wirus\u00f3w",
  697. customBackground: "Grafika t\u0142a",
  698. normalLb: 'Nag\u0142\u00f3wek "Leaderboard"',
  699. centeredLb: "Wy\u015brodkowana topka",
  700. fpsAtTop: "Statystyki na g\u00f3rze",
  701. miniMapGrid: "Siatka minimapy",
  702. hideChatMsgA: "Czat jest aktywny!",
  703. hideChatMsgB: "Czat zosta\u0142 ukryty!",
  704. showSkinsMsgA: "Skiny s\u0105 widoczne!",
  705. showSkinsMsgB: "Skiny zosta\u0142y ukryte!",
  706. hideSmallBotsMsgA: "Ma\u0142e boty s\u0105 widoczne!",
  707. hideSmallBotsMsgB: "Ma\u0142e boty zosta\u0142y ukryte!",
  708. profile: "Profil",
  709. saveSett: "Zapisz ustawienia",
  710. resetSett: "Resetuj ustawienia",
  711. close: "Zamknij",
  712. enterChatMsg: "Napisz wiadomo\u015b\u0107",
  713. activePartys: "Aktywne party",
  714. pause: "PAUZA!",
  715. visit: "Odwied\u017a",
  716. exit: "OGARio by szymy: Czy na pewno chcesz opu\u015bcic gr\u0119?"
  717. },
  718. en: {
  719. start: "Start",
  720. settings: "Settings",
  721. autoZoom: "Auto zoom",
  722. autoHideCellsInfo: "Auto hide names and mass",
  723. autoHideFood: "Auto hide food",
  724. hideMyName: "Hide my name",
  725. hideMyMass: "Hide my mass",
  726. hideEnemiesMass: "Hide enemies mass",
  727. vanillaSkins: "Vanilla skins",
  728. customSkins: "Custom skins",
  729. myTransparentSkin: "My transparent skin",
  730. myCustomColor: "My custom color",
  731. transparentCells: "Transparent cells",
  732. transparentViruses: "Transparent viruses",
  733. transparentSkins: "Transparent skins",
  734. showGrid: "Show grid",
  735. showBgSectors: "Show background sectors",
  736. showMapBorders: "Show map borders",
  737. showMiniMap: "Show minimap",
  738. showMiniMapGuides: "Show minimap guides",
  739. rainbowFood: "Rainbow food",
  740. oppColors: "Opponents colors",
  741. oppRings: "Opponents rings",
  742. virColors: "Viruses colors",
  743. splitRange: "Split range",
  744. virusesRange: "Viruses range",
  745. textStroke: "Text stroke",
  746. cursorTracking: "Cursor tracking",
  747. teammatesInd: "Teammates indicators",
  748. mouseSplit: "Mouse split",
  749. mouseFeed: "Mouse feed",
  750. mouseInvert: "Invert mouse buttons",
  751. hideChat: "Hide chat",
  752. showTop5: "Show team top 5",
  753. showTime: "Show current time",
  754. showStats: "Show game stats",
  755. showStatsMass: "Game stats: Mass",
  756. showStatsSTE: "Game stats: STE",
  757. showStatsN16: "Game stats: n/16",
  758. showStatsFPS: "Game stats: FPS",
  759. hotkeys: "Hotkeys",
  760. "hk-inst-assign": "To assign a hotkey click on the red field and press your chosen key.",
  761. "hk-inst-delete": "To delete a hotkey click on the red field and press the DELETE key.",
  762. "hk-inst-keys": "Possible key combinations with the CTRL and ALT keys.",
  763. "hk-feed": "Feed",
  764. "hk-macroFeed": "Macro feed",
  765. "hk-split": "Split",
  766. "hk-splitBots": "Split Bots",
  767. "hk-ejectBots": "Eject Bots",
  768. "hk-collectPellets": "Collect Pellets",
  769. "hk-doubleSplit": "Double split",
  770. "hk-split16": "Split 16",
  771. "hk-pause": "Cell pause",
  772. "hk-showTop5": "Show/hide team top 5",
  773. "hk-showTime": "Show/hide current time",
  774. "hk-showSplitRange": "Show/hide split range",
  775. "hk-showSplitInd": "Show/hide split indicators",
  776. "hk-showTeammatesInd": "Show/hide teammates indicators",
  777. "hk-showOppColors": "Show/hide opponents colors",
  778. "hk-toggleSkins": "Toggle skins (custom/default)",
  779. "hk-showSkins": "Show/hide skins",
  780. "hk-showStats": "Show/hide game stats",
  781. "hk-toggleCells": "Toggle own cells (smallest/biggest)",
  782. "hk-showFood": "Show/hide food",
  783. "hk-showGrid": "Show/hide grid",
  784. "hk-showMiniMapGuides": "Show/hide minimap guides",
  785. "hk-hideChat": "Show/hide chat",
  786. "hk-showHUD": "Show/hide HUD",
  787. "hk-copyLb": "Copy leaderboard",
  788. "hk-showLb": "Show/hide leaderboard",
  789. "hk-resetZoom": "Reset zoom",
  790. "hk-zoomLevel": "Zoom level",
  791. "hk-toggleDeath": "Toggle death location",
  792. "hk-clearChat": "Show chat history / Clear chat",
  793. "hk-showBgSectors": "Show/hide background sectors",
  794. "hk-hideBots": "Show/hide small bots",
  795. "hk-showNames": "Show/hide names",
  796. "hk-showMass": "Show/hide mass",
  797. "hk-showMiniMap": "Show/hide minimap",
  798. "hk-chatMessage": "Enter chat message",
  799. "hk-quickResp": "Quick respawn",
  800. commands: "Commands",
  801. comm1: "Feed me!",
  802. comm2: "Split into me!",
  803. comm3: "Need backup at %currentSector%!",
  804. comm4: "Enemy spotted at %currentSector%!",
  805. comm5: "Need a teammate!",
  806. comm6: "Tank the virus!",
  807. comm7: "Eat the virus!",
  808. comm8: "Let's bait!",
  809. comm9: "Fake tricksplit!",
  810. comm0: "Fuck!",
  811. comm10: "Tricksplit!",
  812. comm11: "Left!",
  813. comm12: "Up!",
  814. comm13: "Right!",
  815. comm14: "Bottom!",
  816. saveComm: "Save commands",
  817. theme: "Theme",
  818. themePreset: "Theme preset",
  819. themeType: "Theme type",
  820. darkTheme: "Dark theme",
  821. lightTheme: "Light theme",
  822. mainColor: "Main color",
  823. bgColor: "Background color",
  824. foodColor: "Food color",
  825. gridColor: "Grid / sectors color",
  826. bordersColor: "Borders color",
  827. commandsTextColor: "Commands text color",
  828. virusColor: "Virus color",
  829. virusStrokeColor: "Virus stroke color",
  830. customBackground: "Custom background image",
  831. normalLb: '"Leaderboard" header',
  832. centeredLb: "Centered leaderboard",
  833. fpsAtTop: "Game stats at the top",
  834. miniMapGrid: "Minimap grid",
  835. hideChatMsgA: "Chat is visible!",
  836. hideChatMsgB: "Chat is hidden!",
  837. showSkinsMsgA: "Skins are visible!",
  838. showSkinsMsgB: "Skins are hidden!",
  839. hideSmallBotsMsgA: "Small bots are visible!",
  840. hideSmallBotsMsgB: "Small bots are hidden!",
  841. profile: "Profile",
  842. saveSett: "Save settings",
  843. resetSett: "Reset to default",
  844. close: "Close",
  845. enterChatMsg: "Enter chat message",
  846. activePartys: "Active partys",
  847. pause: "PAUSE!",
  848. visit: "Visit",
  849. exit: "OGARio by szymy: Are you sure you want to quit the game?"
  850. }
  851. };
  852. var _0xd162xe = {
  853. comm1: _0xd162xd[_0xd162xc].comm1,
  854. comm2: _0xd162xd[_0xd162xc].comm2,
  855. comm3: _0xd162xd[_0xd162xc].comm3,
  856. comm4: _0xd162xd[_0xd162xc].comm4,
  857. comm5: _0xd162xd[_0xd162xc].comm5,
  858. comm6: _0xd162xd[_0xd162xc].comm6,
  859. comm7: _0xd162xd[_0xd162xc].comm7,
  860. comm8: _0xd162xd[_0xd162xc].comm8,
  861. comm9: _0xd162xd[_0xd162xc].comm9,
  862. comm0: _0xd162xd[_0xd162xc].comm0,
  863. comm10: _0xd162xd[_0xd162xc].comm10,
  864. comm11: _0xd162xd[_0xd162xc].comm11,
  865. comm12: _0xd162xd[_0xd162xc].comm12,
  866. comm13: _0xd162xd[_0xd162xc].comm13,
  867. comm14: _0xd162xd[_0xd162xc].comm14
  868. };
  869. var _0xd162xf = {
  870. "&": "&amp;",
  871. "<": "&lt;",
  872. ">": "&gt;",
  873. '"': "&quot;",
  874. "'": "&#39;",
  875. "/": "&#x2F;"
  876. };
  877. var _0xd162x10 = {
  878. "ogario-gold": {
  879. name: "OGARio Gold",
  880. centeredLb: true,
  881. fpsAtTop: true,
  882. miniMapGrid: false,
  883. darkTheme: true,
  884. mainColor: "#b5a642",
  885. bgColor: "#000000",
  886. gridColor: "#111111",
  887. bordersColor: "#b5a642",
  888. foodColor: "#998c36",
  889. commandsTextColor: "#ffffff",
  890. virusColor: "#666666",
  891. virusStrokeColor: "#666666"
  892. },
  893. "ogario-orange": {
  894. name: "OGARio Orange",
  895. centeredLb: true,
  896. fpsAtTop: true,
  897. miniMapGrid: false,
  898. darkTheme: true,
  899. mainColor: "#ff7800",
  900. bgColor: "#111111",
  901. gridColor: "#292929",
  902. bordersColor: "#ff7800",
  903. foodColor: "#e16400",
  904. commandsTextColor: "#ffffff",
  905. virusColor: "#666666",
  906. virusStrokeColor: "#666666"
  907. },
  908. "pokemon-go": {
  909. name: "Pokemon GO Theme",
  910. centeredLb: true,
  911. fpsAtTop: true,
  912. miniMapGrid: false,
  913. darkTheme: false,
  914. mainColor: "#cf0000",
  915. bgColor: "#ffcc00",
  916. gridColor: "#2972ff",
  917. bordersColor: "#ff0000",
  918. foodColor: "#00019a",
  919. commandsTextColor: "#ffffff",
  920. virusColor: "#ffffff",
  921. virusStrokeColor: "#ff0000"
  922. },
  923. "sniikz-style": {
  924. name: "SniiKz's Style",
  925. centeredLb: false,
  926. fpsAtTop: false,
  927. miniMapGrid: false,
  928. darkTheme: true,
  929. mainColor: "#ff90e8",
  930. bgColor: "#000000",
  931. gridColor: "#08151d",
  932. bordersColor: "#ffffff",
  933. foodColor: "#5a00ff",
  934. commandsTextColor: "#000000",
  935. virusColor: "#666666",
  936. virusStrokeColor: "#666666"
  937. },
  938. "hkg-style": {
  939. name: "HKG Style",
  940. centeredLb: false,
  941. fpsAtTop: false,
  942. miniMapGrid: false,
  943. darkTheme: true,
  944. mainColor: "#651fff",
  945. bgColor: "#000000",
  946. gridColor: "#111111",
  947. bordersColor: "#ffffff",
  948. foodColor: "#651fff",
  949. commandsTextColor: "#ffffff",
  950. virusColor: "#666666",
  951. virusStrokeColor: "#666666"
  952. },
  953. "agario-light": {
  954. name: "Agario Light",
  955. centeredLb: true,
  956. fpsAtTop: false,
  957. miniMapGrid: true,
  958. darkTheme: false,
  959. mainColor: "#ffffff",
  960. bgColor: "#f2fbff",
  961. gridColor: "#ced6d9",
  962. bordersColor: "#858a8c",
  963. foodColor: "#2de52d",
  964. commandsTextColor: "#111111",
  965. virusColor: "#33ff33",
  966. virusStrokeColor: "#2de52d"
  967. },
  968. "agario-dark": {
  969. name: "Agario Dark",
  970. centeredLb: true,
  971. fpsAtTop: false,
  972. miniMapGrid: true,
  973. darkTheme: false,
  974. mainColor: "#ffffff",
  975. bgColor: "#111111",
  976. gridColor: "#333333",
  977. bordersColor: "#999999",
  978. foodColor: "#2de52d",
  979. commandsTextColor: "#111111",
  980. virusColor: "#33ff33",
  981. virusStrokeColor: "#2de52d"
  982. }
  983. };
  984. var _0xd162x11 = {
  985. preset: "ogario-orange",
  986. normalLb: false,
  987. centeredLb: true,
  988. fpsAtTop: true,
  989. miniMapGrid: false,
  990. darkTheme: true,
  991. mainColor: "#ff7800",
  992. bgColor: "#111111",
  993. gridColor: "#292929",
  994. bordersColor: "#ff7800",
  995. foodColor: "#e16400",
  996. commandsTextColor: "#ffffff",
  997. virusColor: "#666666",
  998. virusStrokeColor: "#666666",
  999. customBackground: "",
  1000. sectorsX: 5,
  1001. sectorsY: 5,
  1002. bordersWidth: 20,
  1003. sectorsWidth: 40,
  1004. cellsAlpha: 0.9,
  1005. skinsAlpha: 0.7,
  1006. virusAlpha: 0.6
  1007. };
  1008. _0xd162x4.prototype = {
  1009. customStyle: null,
  1010. loadThemeSettings: function() {
  1011. var _0xd162x3 = null;
  1012. if (null !== _0xd162x1.localStorage.getItem("ogarioThemeSettings")) {
  1013. _0xd162x3 = JSON.parse(_0xd162x1.localStorage.getItem("ogarioThemeSettings"));
  1014. }
  1015. var _0xd162x4;
  1016. for (_0xd162x4 in _0xd162x11) {
  1017. if (_0xd162x11.hasOwnProperty(_0xd162x4)) {
  1018. if (_0xd162x3) {
  1019. if (_0xd162x3.hasOwnProperty(_0xd162x4)) {
  1020. _0xd162x11[_0xd162x4] = _0xd162x3[_0xd162x4];
  1021. }
  1022. }
  1023. if (_0xd162x2.hasOwnProperty(_0xd162x4)) {
  1024. _0xd162x2[_0xd162x4] = _0xd162x11[_0xd162x4];
  1025. }
  1026. }
  1027. }
  1028. },
  1029. saveThemeSettings: function() {
  1030. _0xd162x1.localStorage.setItem("ogarioTheme", JSON.stringify(_0xd162x11));
  1031. },
  1032. setThemeMenu: function() {
  1033. var _0xd162x1 = this;
  1034. _0xd162x3("#theme").append('<div class="color-box theme-box"><span class="title">' + _0xd162xd[_0xd162xc].themePreset + '</span><select id="theme-presets" class="form-control"></select></div> <div class="color-box theme-box"><span class="title">' + _0xd162xd[_0xd162xc].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">' + _0xd162xd[_0xd162xc].darkTheme + '</label><label class="btn btn-default"><input type="radio" name="options" id="lightTheme">' +
  1035. _0xd162xd[_0xd162xc].lightTheme + '</label></div></div> <div class="color-box"><span class="title">' + _0xd162xd[_0xd162xc].mainColor + '</span><div class="input-group main-color-picker"><input type="text" value="' + _0xd162x11.mainColor + '" id="mainColor" class="form-control" /><span class="input-group-addon"><i></i></span></div></div> <div class="color-box"><span class="title">' + _0xd162xd[_0xd162xc].bgColor + '</span><div class="input-group background-color-picker"><input type="text" value="' +
  1036. _0xd162x11.bgColor + '" id="bgColor" class="form-control" /><span class="input-group-addon"><i></i></span></div></div> <div class="color-box"><span class="title">' + _0xd162xd[_0xd162xc].foodColor + '</span><div class="input-group food-color-picker"><input type="text" value="' + _0xd162x11.foodColor + '" id="foodColor" class="form-control" /><span class="input-group-addon"><i></i></span></div></div> <div class="color-box"><span class="title">' + _0xd162xd[_0xd162xc].gridColor + '</span><div class="input-group grid-color-picker"><input type="text" value="' +
  1037. _0xd162x11.gridColor + '" id="gridColor" class="form-control" /><span class="input-group-addon"><i></i></span></div></div> <div class="color-box"><span class="title">' + _0xd162xd[_0xd162xc].bordersColor + '</span><div class="input-group borders-color-picker"><input type="text" value="' + _0xd162x11.bordersColor + '" id="bordersColor" class="form-control" /><span class="input-group-addon"><i></i></span></div></div> <div class="color-box"><span class="title">' + _0xd162xd[_0xd162xc].commandsTextColor +
  1038. '</span><div class="input-group text-color-picker"><input type="text" value="' + _0xd162x11.commandsTextColor + '" id="commandsTextColor" class="form-control" /><span class="input-group-addon"><i></i></span></div></div> <div class="color-box"><span class="title">' + _0xd162xd[_0xd162xc].virusColor + '</span><div class="input-group virus-color-picker"><input type="text" value="' + _0xd162x11.virusColor + '" id="virusColor" class="form-control" /><span class="input-group-addon"><i></i></span></div></div> <div class="color-box"><span class="title">' +
  1039. _0xd162xd[_0xd162xc].virusStrokeColor + '</span><div class="input-group virus-stroke-color-picker"><input type="text" value="' + _0xd162x11.virusStrokeColor + '" id="virusStrokeColor" class="form-control" /><span class="input-group-addon"><i></i></span></div></div> <div class="color-box theme-box"><span class="title">' + _0xd162xd[_0xd162xc].customBackground + '</span><input id="custom-background" class="form-control" placeholder="Image URL" value="' + _0xd162x11.customBackground + '" /></div>');
  1040. var _0xd162x4;
  1041. for (_0xd162x4 in _0xd162x10) {
  1042. if (_0xd162x10.hasOwnProperty(_0xd162x4)) {
  1043. _0xd162x3("#theme-presets").append('<option value="' + _0xd162x4 + '">' + _0xd162x10[_0xd162x4].name + "</option>");
  1044. }
  1045. }
  1046. _0xd162x3("#theme-presets").val(_0xd162x11.preset);
  1047. _0xd162x3("#theme-presets").change(function() {
  1048. var _0xd162x2 = _0xd162x3(this).val();
  1049. _0xd162x1.changeThemePreset(_0xd162x2);
  1050. });
  1051. _0xd162x3("#theme .main-color-picker").colorpicker({
  1052. format: "hex"
  1053. }).on("changeColor.colorpicker", function(_0xd162x2) {
  1054. _0xd162x11.mainColor = _0xd162x2.color.toHex();
  1055. _0xd162x1.setMainColor();
  1056. });
  1057. _0xd162x3("#theme .background-color-picker").colorpicker({
  1058. format: "hex"
  1059. }).on("changeColor.colorpicker", function(_0xd162x1) {
  1060. _0xd162x11.bgColor = _0xd162x1.color.toHex();
  1061. _0xd162x3("body").css("background-color", _0xd162x11.bgColor);
  1062. });
  1063. _0xd162x3("#theme .food-color-picker").colorpicker({
  1064. format: "hex"
  1065. }).on("changeColor.colorpicker", function(_0xd162x1) {
  1066. _0xd162x11.foodColor = _0xd162x1.color.toHex();
  1067. _0xd162x2.foodColor = _0xd162x11.foodColor;
  1068. });
  1069. _0xd162x3("#theme .grid-color-picker").colorpicker({
  1070. format: "hex"
  1071. }).on("changeColor.colorpicker", function(_0xd162x1) {
  1072. _0xd162x11.gridColor = _0xd162x1.color.toHex();
  1073. });
  1074. _0xd162x3("#theme .borders-color-picker").colorpicker({
  1075. format: "hex"
  1076. }).on("changeColor.colorpicker", function(_0xd162x1) {
  1077. _0xd162x11.bordersColor = _0xd162x1.color.toHex();
  1078. });
  1079. _0xd162x3("#theme .text-color-picker").colorpicker({
  1080. format: "hex"
  1081. }).on("changeColor.colorpicker", function(_0xd162x2) {
  1082. _0xd162x11.commandsTextColor = _0xd162x2.color.toHex();
  1083. _0xd162x1.setMainColor();
  1084. });
  1085. _0xd162x3("#theme .virus-color-picker").colorpicker({
  1086. format: "hex"
  1087. }).on("changeColor.colorpicker", function(_0xd162x1) {
  1088. _0xd162x11.virusColor = _0xd162x1.color.toHex();
  1089. _0xd162x2.virusColor = _0xd162x11.virusColor;
  1090. });
  1091. _0xd162x3("#theme .virus-stroke-color-picker").colorpicker({
  1092. format: "hex"
  1093. }).on("changeColor.colorpicker", function(_0xd162x1) {
  1094. _0xd162x11.virusStrokeColor = _0xd162x1.color.toHex();
  1095. _0xd162x2.virusStrokeColor = _0xd162x11.virusStrokeColor;
  1096. });
  1097. _0xd162x3("#theme").append('<div id="theme-options"><label><input type="checkbox" onchange="setThemeSettings(\'centeredLb\', $(this).is(\':checked\'));" id="centeredLb">' + _0xd162xd[_0xd162xc].centeredLb + '</label><label><input type="checkbox" onchange="setThemeSettings(\'normalLb\', $(this).is(\':checked\'));" id="normalLb">' + _0xd162xd[_0xd162xc].normalLb + '</label><label><input type="checkbox" onchange="setThemeSettings(\'fpsAtTop\', $(this).is(\':checked\'));" id="fpsAtTop">' + _0xd162xd[_0xd162xc].fpsAtTop +
  1098. '</label><label><input type="checkbox" onchange="setThemeSettings(\'miniMapGrid\', $(this).is(\':checked\'));" id="miniMapGrid">' + _0xd162xd[_0xd162xc].miniMapGrid + "</label></div>");
  1099. _0xd162x3("#theme").append('<button class="btn btn-block btn-success btn-save" onclick="saveThemeSettings();">' + _0xd162xd[_0xd162xc].saveSett + "</button>");
  1100. _0xd162x3("#theme-type").change(function() {
  1101. var _0xd162x2 = _0xd162x3(this).find("input:checked").attr("id");
  1102. _0xd162x1.changeThemeType(_0xd162x2);
  1103. });
  1104. _0xd162x3("#custom-background").change(function() {
  1105. var _0xd162x1 = _0xd162x3(this).val();
  1106. _0xd162x3("body").css("background-image", "url(" + _0xd162x1 + ")");
  1107. _0xd162x11.customBackground = _0xd162x1;
  1108. });
  1109. _0xd162x3(".skin").colorpicker({
  1110. format: "hex",
  1111. input: "#color"
  1112. });
  1113. this.setOptions();
  1114. },
  1115. setOptions: function() {
  1116. _0xd162x3("#centeredLb").prop("checked", _0xd162x11.centeredLb);
  1117. _0xd162x3("#normalLb").prop("checked", _0xd162x11.normalLb);
  1118. _0xd162x3("#fpsAtTop").prop("checked", _0xd162x11.fpsAtTop);
  1119. _0xd162x3("#miniMapGrid").prop("checked", _0xd162x11.miniMapGrid);
  1120. },
  1121. setMainColor: function() {
  1122. if (!this.customStyle) {
  1123. this.customStyle = _0xd162x3("<style type='text/css'>").appendTo("head");
  1124. }
  1125. this.customStyle.html(".main-color, .menu-tabs .active, center, #cancel-party-btn { color: " + _0xd162x11.mainColor + "; } #main-menu, .agario-side-panel { border-color: " + _0xd162x11.mainColor + "} .toast-warning { background-color: " + _0xd162x11.mainColor + "; } .toast-warning .toast-message { color: " + _0xd162x11.commandsTextColor + "; }");
  1126. },
  1127. setCenteredLb: function() {
  1128. if (_0xd162x11.centeredLb) {
  1129. _0xd162x3("#leaderboard-hud").addClass("hud-text-center");
  1130. } else {
  1131. _0xd162x3("#leaderboard-hud").removeClass("hud-text-center");
  1132. }
  1133. },
  1134. setNormalLb: function() {
  1135. _0xd162x3("#leaderboard-hud h4").html(_0xd162x11.normalLb ? "Leaderboard" : "ogario.ovh");
  1136. },
  1137. setFpsAtTop: function() {
  1138. if (_0xd162x11.fpsAtTop) {
  1139. _0xd162x3("#stats-hud").removeClass("hud-bottom").addClass("hud-top");
  1140. } else {
  1141. _0xd162x3("#stats-hud").removeClass("hud-top").addClass("hud-bottom");
  1142. }
  1143. },
  1144. changeThemePreset: function(_0xd162x1) {
  1145. if (_0xd162x10[_0xd162x1]) {
  1146. _0xd162x11.preset = _0xd162x1;
  1147. _0xd162x1 = _0xd162x10[_0xd162x1];
  1148. var _0xd162x4;
  1149. for (_0xd162x4 in _0xd162x1) {
  1150. if (_0xd162x1.hasOwnProperty(_0xd162x4)) {
  1151. if (_0xd162x11.hasOwnProperty(_0xd162x4)) {
  1152. _0xd162x11[_0xd162x4] = _0xd162x1[_0xd162x4];
  1153. if (_0xd162x2.hasOwnProperty(_0xd162x4)) {
  1154. _0xd162x2[_0xd162x4] = _0xd162x11[_0xd162x4];
  1155. }
  1156. }
  1157. }
  1158. }
  1159. this.setTheme();
  1160. _0xd162x3("#theme .main-color-picker").colorpicker("setValue", _0xd162x11.mainColor);
  1161. _0xd162x3("#theme .background-color-picker").colorpicker("setValue", _0xd162x11.bgColor);
  1162. _0xd162x3("#theme .food-color-picker").colorpicker("setValue", _0xd162x11.foodColor);
  1163. _0xd162x3("#theme .grid-color-picker").colorpicker("setValue", _0xd162x11.gridColor);
  1164. _0xd162x3("#theme .borders-color-picker").colorpicker("setValue", _0xd162x11.bordersColor);
  1165. _0xd162x3("#theme .text-color-picker").colorpicker("setValue", _0xd162x11.commandsTextColor);
  1166. _0xd162x3("#theme .virus-color-picker").colorpicker("setValue", _0xd162x11.virusColor);
  1167. _0xd162x3("#theme .virus-stroke-color-picker").colorpicker("setValue", _0xd162x11.virusStrokeColor);
  1168. }
  1169. },
  1170. changeThemeType: function(_0xd162x1) {
  1171. if ("darkTheme" === _0xd162x1) {
  1172. _0xd162x11.darkTheme = true;
  1173. _0xd162x11.bgColor = "#000000";
  1174. _0xd162x11.gridColor = "#111111";
  1175. _0xd162x11.virusColor = "#999999";
  1176. _0xd162x11.virusStrokeColor = "#999999";
  1177. _0xd162x3("#theme .background-color-picker").colorpicker("setValue", "#000000");
  1178. _0xd162x3("#theme .grid-color-picker").colorpicker("setValue", "#111111");
  1179. _0xd162x3("#minimap-sectors").css("opacity", "0.1");
  1180. } else {
  1181. _0xd162x11.darkTheme = false;
  1182. _0xd162x11.bgColor = "#f2fbff";
  1183. _0xd162x11.gridColor = "#ced6d9";
  1184. _0xd162x11.virusColor = "#666666";
  1185. _0xd162x11.virusStrokeColor = "#666666";
  1186. _0xd162x3("#theme .background-color-picker").colorpicker("setValue", "#f2fbff");
  1187. _0xd162x3("#theme .grid-color-picker").colorpicker("setValue", "#ced6d9");
  1188. _0xd162x3("#minimap-sectors").css("opacity", "0.25");
  1189. }
  1190. },
  1191. setTheme: function() {
  1192. this.setOptions();
  1193. this.setMainColor();
  1194. this.setCenteredLb();
  1195. this.setNormalLb();
  1196. this.setFpsAtTop();
  1197. if (_0xd162x17) {
  1198. _0xd162x17.resetMiniMapSectors();
  1199. }
  1200. _0xd162x3("body").css("background-color", _0xd162x11.bgColor);
  1201. _0xd162x3("body").css("background-image", "url(" + _0xd162x11.customBackground + ")");
  1202. if (_0xd162x11.darkTheme) {
  1203. _0xd162x3("#minimap-sectors").css("opacity", "0.1");
  1204. _0xd162x3("#lightTheme").closest("label").removeClass("active");
  1205. _0xd162x3("#darkTheme").closest("label").addClass("active");
  1206. } else {
  1207. _0xd162x3("#minimap-sectors").css("opacity", "0.25");
  1208. _0xd162x3("#darkTheme").closest("label").removeClass("active");
  1209. _0xd162x3("#lightTheme").closest("label").addClass("active");
  1210. }
  1211. },
  1212. init: function() {
  1213. this.loadThemeSettings();
  1214. }
  1215. };
  1216. var _0xd162x12 = new _0xd162x4;
  1217. _0xd162x12.init();
  1218. _0xd162x1.setThemeSettings = function(_0xd162x1, _0xd162x2) {
  1219. if (_0xd162x11.hasOwnProperty(_0xd162x1) && null !== _0xd162x2) {
  1220. switch (_0xd162x11[_0xd162x1] = _0xd162x2, _0xd162x1) {
  1221. case "centeredLb":
  1222. _0xd162x12.setCenteredLb();
  1223. break;
  1224. case "normalLb":
  1225. _0xd162x12.setNormalLb();
  1226. break;
  1227. case "fpsAtTop":
  1228. _0xd162x12.setFpsAtTop();
  1229. break;
  1230. case "miniMapGrid":
  1231. if (_0xd162x17) {
  1232. _0xd162x17.resetMiniMapSectors();
  1233. };
  1234. }
  1235. }
  1236. };
  1237. _0xd162x1.saveThemeSettings = function() {
  1238. if (_0xd162x17) {
  1239. _0xd162x17.saveSettings(_0xd162x11, "ogarioThemeSettings");
  1240. }
  1241. };
  1242. var _0xd162x13 = [];
  1243. var _0xd162x14 = {};
  1244. var _0xd162x15 = {
  1245. nick: "I <3 szymy",
  1246. clanTag: "\u24c2",
  1247. skinURL: "",
  1248. color: _0xd162x11.mainColor
  1249. };
  1250. var _0xd162x16 = {
  1251. autoZoom: true,
  1252. autoHideCellsInfo: true,
  1253. autoHideFood: true,
  1254. hideMyName: true,
  1255. hideMyMass: false,
  1256. hideEnemiesMass: false,
  1257. vanillaSkins: false,
  1258. customSkins: true,
  1259. myTransparentSkin: false,
  1260. myCustomColor: false,
  1261. transparentCells: false,
  1262. transparentViruses: true,
  1263. transparentSkins: false,
  1264. showGrid: false,
  1265. showBgSectors: false,
  1266. showMapBorders: true,
  1267. showMiniMap: true,
  1268. showMiniMapGuides: false,
  1269. rainbowFood: false,
  1270. oppColors: false,
  1271. oppRings: false,
  1272. virColors: false,
  1273. splitRange: false,
  1274. virusesRange: false,
  1275. textStroke: false,
  1276. cursorTracking: true,
  1277. teammatesInd: false,
  1278. mouseSplit: false,
  1279. mouseFeed: false,
  1280. mouseInvert: false,
  1281. hideChat: false,
  1282. showTop5: true,
  1283. showTime: true,
  1284. showStats: true,
  1285. showStatsMass: false,
  1286. showStatsSTE: false,
  1287. showStatsN16: false,
  1288. showStatsFPS: true,
  1289. zoomSpeedValue: 0.9,
  1290. streamMode: false,
  1291. hideSkinUrl: false
  1292. };
  1293. _0xd162x5.prototype = {
  1294. id: 0,
  1295. skinID: "",
  1296. x: 0,
  1297. y: 0,
  1298. lastX: 0,
  1299. lastY: 0,
  1300. mass: 0,
  1301. nick: "",
  1302. clanTag: "",
  1303. skinURL: "",
  1304. color: _0xd162x11.mainColor,
  1305. alive: false,
  1306. updateTime: null,
  1307. pi2: 2 * Math.PI,
  1308. drawPosition: function(_0xd162x1, _0xd162x2, _0xd162x3) {
  1309. if (this.alive) {
  1310. this.lastX = (29 * this.lastX + this.x) / 30;
  1311. this.lastY = (29 * this.lastY + this.y) / 30;
  1312. var _0xd162x4 = (this.lastX + _0xd162x2) * _0xd162x3;
  1313. var _0xd162x5 = (this.lastY + _0xd162x2) * _0xd162x3;
  1314. if (this.nick.length > 0) {
  1315. _0xd162x1.fillStyle = "#FFFFFF";
  1316. _0xd162x1.font = "10px Ubuntu";
  1317. _0xd162x1.textAlign = "center";
  1318. _0xd162x1.fillText(this.nick, _0xd162x4, _0xd162x5 - 12);
  1319. }
  1320. _0xd162x1.beginPath();
  1321. _0xd162x1.arc(_0xd162x4, _0xd162x5, 4.5, 0, this.pi2, false);
  1322. _0xd162x1.closePath();
  1323. _0xd162x1.fillStyle = this.color;
  1324. _0xd162x1.fill();
  1325. }
  1326. }
  1327. };
  1328. // window.bots = [new _0xd162x5(1, "u-bot.pw", 1, "", "#fffff"),new _0xd162x5(2, "u-bot.pw", 2, "", "#fffff")];
  1329. _0xd162x6.prototype = {
  1330. name: "OGARio by szymy v2.1",
  1331. version: "v2.1.2",
  1332. privateMode: false,
  1333. publicIP: "ws://164.132.227.101:3000",
  1334. privateIP: null,
  1335. updateInterval: 1E3,
  1336. updateTick: 0,
  1337. updateMaxTick: 2,
  1338. currentSector: "",
  1339. miniMap: null,
  1340. miniMapCtx: null,
  1341. miniMapSectors: null,
  1342. pi2: 2 * Math.PI,
  1343. socket: null,
  1344. teamPlayers: [],
  1345. partys: [],
  1346. chatHistory: [],
  1347. customSkinsCache: {},
  1348. customSkinsMap: {},
  1349. deathLocations: [],
  1350. playerID: null,
  1351. playerMass: 0,
  1352. selectedProfile: 0,
  1353. lastDeath: 0,
  1354. gameMode: "",
  1355. partyToken: "",
  1356. lastSentNick: "",
  1357. lastSentClanTag: null,
  1358. lastSentSkinURL: "",
  1359. lastSentCustomColor: "",
  1360. lastSentPartyToken: "",
  1361. lastMessageSentTime: Date.now(),
  1362. rFps: 0,
  1363. renderedFrames: 0,
  1364. fpsLastRequest: null,
  1365. statsHUD: null,
  1366. leaderboardPositionsHUD: null,
  1367. activePartys: null,
  1368. top5HUD: null,
  1369. timeHUD: null,
  1370. retryResp: 0,
  1371. token: "b2dhcmlvLm92aA==",
  1372. canvasScale: 1,
  1373. selectBiggestCell: true,
  1374. noSkins: false,
  1375. noNames: false,
  1376. noColors: false,
  1377. showMass: true,
  1378. skipStats: false,
  1379. showSplitInd: false,
  1380. pause: false,
  1381. feedInterval: null,
  1382. getPlayerX: function() {
  1383. return _0xd162x2.playerX + _0xd162x2.mapOffsetX;
  1384. },
  1385. getPlayerY: function() {
  1386. return _0xd162x2.playerY + _0xd162x2.mapOffsetY;
  1387. },
  1388. feed: function() {
  1389. if (_0xd162x1.core) {
  1390. if (_0xd162x1.core.eject) {
  1391. _0xd162x1.core.eject();
  1392. }
  1393. }
  1394. },
  1395. macroFeed: function(_0xd162x1) {
  1396. if (_0xd162x1) {
  1397. if (this.feedInterval) {
  1398. return;
  1399. }
  1400. var _0xd162x2 = this;
  1401. this.feed();
  1402. this.feedInterval = setInterval(function() {
  1403. _0xd162x2.feed();
  1404. }, 80);
  1405. } else {
  1406. if (this.feedInterval) {
  1407. clearInterval(this.feedInterval);
  1408. this.feedInterval = null;
  1409. }
  1410. }
  1411. },
  1412. split: function() {
  1413. if (_0xd162x1.core) {
  1414. if (_0xd162x1.core.split) {
  1415. _0xd162x1.core.split();
  1416. }
  1417. }
  1418. },
  1419. doubleSplit: function() {
  1420. var _0xd162x1 = this;
  1421. _0xd162x1.split();
  1422. setTimeout(function() {
  1423. _0xd162x1.split();
  1424. }, 40);
  1425. },
  1426. popSplit: function() {
  1427. var _0xd162x1 = this;
  1428. _0xd162x1.split();
  1429. setTimeout(function() {
  1430. _0xd162x1.split();
  1431. }, 200);
  1432. },
  1433. split16: function() {
  1434. var _0xd162x1 = this;
  1435. _0xd162x1.split();
  1436. setTimeout(function() {
  1437. _0xd162x1.split();
  1438. }, 40);
  1439. setTimeout(function() {
  1440. _0xd162x1.split();
  1441. }, 80);
  1442. setTimeout(function() {
  1443. _0xd162x1.split();
  1444. }, 120);
  1445. },
  1446. toggleSkins: function() {
  1447. if (_0xd162x2.vanillaSkins && _0xd162x2.customSkins) {
  1448. _0xd162x2.vanillaSkins = false;
  1449. } else {
  1450. if (!_0xd162x2.vannillaSkins && _0xd162x2.customSkins) {
  1451. _0xd162x2.vanillaSkins = true;
  1452. _0xd162x2.customSkins = false;
  1453. } else {
  1454. _0xd162x2.vanillaSkins = true;
  1455. _0xd162x2.customSkins = true;
  1456. }
  1457. }
  1458. },
  1459. toggleCells: function() {
  1460. this.selectBiggestCell = !this.selectBiggestCell;
  1461. _0xd162x2.selectBiggestCell = this.selectBiggestCell;
  1462. },
  1463. setShowTop5: function() {
  1464. if (":party" === this.gameMode) {
  1465. _0xd162x16.showTop5 = !_0xd162x16.showTop5;
  1466. this.setTop5();
  1467. }
  1468. },
  1469. setTop5: function() {
  1470. if (_0xd162x16.showTop5 && ":party" === this.gameMode) {
  1471. _0xd162x3("#top5-hud").show();
  1472. } else {
  1473. _0xd162x3("#top5-hud").hide();
  1474. }
  1475. },
  1476. setShowTime: function() {
  1477. _0xd162x16.showTime = !_0xd162x16.showTime;
  1478. if (_0xd162x16.showTime) {
  1479. _0xd162x3("#time-hud").show();
  1480. this.displayTime();
  1481. } else {
  1482. _0xd162x3("#time-hud").hide();
  1483. }
  1484. },
  1485. setShowSplitRange: function() {
  1486. _0xd162x16.splitRange = !_0xd162x16.splitRange;
  1487. _0xd162x2.splitRange = _0xd162x16.splitRange;
  1488. },
  1489. setShowSplitInd: function() {
  1490. this.showSplitInd = !this.showSplitInd;
  1491. _0xd162x16.splitRange = this.showSplitInd;
  1492. _0xd162x16.oppRings = this.showSplitInd;
  1493. _0xd162x2.splitRange = _0xd162x16.splitRange;
  1494. _0xd162x2.oppRings = _0xd162x16.oppRings;
  1495. },
  1496. setShowTeammatesInd: function() {
  1497. _0xd162x2.teammatesInd = !_0xd162x2.teammatesInd;
  1498. },
  1499. setShowOppColors: function() {
  1500. _0xd162x16.oppColors = !_0xd162x16.oppColors;
  1501. _0xd162x2.oppColors = _0xd162x16.oppColors;
  1502. },
  1503. setShowSkins: function() {
  1504. this.noSkins = !this.noSkins;
  1505. if (_0xd162x1.core) {
  1506. if (_0xd162x1.core.setSkins) {
  1507. _0xd162x1.core.setSkins(!this.noSkins);
  1508. }
  1509. }
  1510. _0xd162x2.showCustomSkins = !this.noSkins;
  1511. this.displayChatInfo(!this.noSkins, "showSkinsMsg");
  1512. },
  1513. setShowStats: function() {
  1514. _0xd162x3("#stats-hud").toggle();
  1515. },
  1516. setShowFood: function() {
  1517. _0xd162x2.showFood = !_0xd162x2.showFood;
  1518. },
  1519. setShowHUD: function() {
  1520. _0xd162x3("#overlays-hud").toggle();
  1521. },
  1522. setShowGrid: function() {
  1523. _0xd162x16.showGrid = !_0xd162x16.showGrid;
  1524. _0xd162x2.showGrid = _0xd162x16.showGrid;
  1525. },
  1526. setShowMiniMapGuides: function() {
  1527. _0xd162x16.showMiniMapGuides = !_0xd162x16.showMiniMapGuides;
  1528. },
  1529. setShowLb: function() {
  1530. if (":teams" !== this.gameMode) {
  1531. _0xd162x3("#leaderboard-hud").toggle();
  1532. }
  1533. },
  1534. setShowBgSectors: function() {
  1535. _0xd162x16.showBgSectors = !_0xd162x16.showBgSectors;
  1536. },
  1537. setHideSmallBots: function() {
  1538. _0xd162x2.hideSmallBots = !_0xd162x2.hideSmallBots;
  1539. this.displayChatInfo(!_0xd162x2.hideSmallBots, "hideSmallBotsMsg");
  1540. },
  1541. setShowNames: function() {
  1542. this.noNames = !this.noNames;
  1543. if (_0xd162x1.core) {
  1544. if (_0xd162x1.core.setNames) {
  1545. _0xd162x1.core.setNames(!this.noNames);
  1546. }
  1547. }
  1548. },
  1549. setShowMass: function() {
  1550. this.showMass = !this.showMass;
  1551. if (_0xd162x1.core) {
  1552. if (_0xd162x1.core.setShowMass) {
  1553. _0xd162x1.core.setShowMass(this.showMass);
  1554. }
  1555. }
  1556. },
  1557. setShowMiniMap: function() {
  1558. _0xd162x16.showMiniMap = !_0xd162x16.showMiniMap;
  1559. this.setMiniMap();
  1560. },
  1561. setMiniMap: function() {
  1562. if (_0xd162x16.showMiniMap) {
  1563. _0xd162x3("#minimap-hud").show();
  1564. } else {
  1565. _0xd162x3("#minimap-hud").hide();
  1566. }
  1567. },
  1568. resetZoom: function(_0xd162x1) {
  1569. if (_0xd162x1) {
  1570. _0xd162x2.zoomResetValue = 1;
  1571. _0xd162x2.zoomValue = 1;
  1572. } else {
  1573. _0xd162x2.zoomResetValue = 0;
  1574. }
  1575. },
  1576. setZoom: function(_0xd162x1) {
  1577. _0xd162x2.zoomValue = _0xd162x1;
  1578. },
  1579. toggleDeath: function() {
  1580. this.lastDeath--;
  1581. if (this.lastDeath < 0) {
  1582. this.lastDeath = this.deathLocations.length - 1;
  1583. }
  1584. },
  1585. tryResp: function() {
  1586. if (_0xd162x2.play || 20 == this.retryResp) {
  1587. return void(this.retryResp = 0);
  1588. }
  1589. this.retryResp++;
  1590. var _0xd162x1 = this;
  1591. setTimeout(function() {
  1592. _0xd162x3(".btn-play").click();
  1593. if (!_0xd162x2.play) {
  1594. _0xd162x1.tryResp();
  1595. }
  1596. }, 500);
  1597. },
  1598. quickResp: function() {
  1599. if (":party" === this.gameMode) {
  1600. _0xd162x3("#join-party-btn").click();
  1601. }
  1602. _0xd162x2.play = false;
  1603. this.tryResp();
  1604. },
  1605. copyLb: function() {
  1606. var _0xd162x1 = _0xd162x3("<input>");
  1607. _0xd162x3("body").append(_0xd162x1);
  1608. _0xd162x1.val(_0xd162x3("#leaderboard-positions").text()).select();
  1609. try {
  1610. document.execCommand("copy");
  1611. } catch (_0xd162x2) {}
  1612. _0xd162x1.remove();
  1613. },
  1614. setPause: function() {
  1615. this.pause = !this.pause;
  1616. _0xd162x2.pause = this.pause;
  1617. if (this.pause) {
  1618. _0xd162x3("#pause-hud").show();
  1619. } else {
  1620. _0xd162x3("#pause-hud").hide();
  1621. }
  1622. },
  1623. displayLeaderboard: function(_0xd162x1) {
  1624. if (this.leaderboardPositionsHUD) {
  1625. this.leaderboardPositionsHUD.innerHTML = _0xd162x1;
  1626. }
  1627. },
  1628. displayStats: function() {
  1629. if (!_0xd162x16.showStats) {
  1630. return void _0xd162x3("#stats-hud").hide();
  1631. }
  1632. var _0xd162x1 = "";
  1633. if (ubot.total) {
  1634. _0xd162x1 += "Bot Count: " + + ubot.count + "/" + ubot.total + " | ";
  1635. }
  1636. if (_0xd162x2.play) {
  1637. if (_0xd162x16.showStatsMass) {
  1638. if (_0xd162x2.playerMass) {
  1639. _0xd162x1 += "Mass: " + _0xd162x2.playerMass + " | ";
  1640. }
  1641. }
  1642. if (_0xd162x2.playerBestMass) {
  1643. _0xd162x1 += "Score: " + _0xd162x2.playerBestMass;
  1644. }
  1645. if (_0xd162x16.showStatsSTE) {
  1646. if (_0xd162x2.STE) {
  1647. _0xd162x1 += " | STE: " + _0xd162x2.STE;
  1648. }
  1649. }
  1650. if (_0xd162x16.showStatsN16) {
  1651. if (_0xd162x2.playerCellsMass) {
  1652. _0xd162x1 += " | " + _0xd162x2.playerCellsMass.length + "/16";
  1653. }
  1654. }
  1655. if (_0xd162x16.showStatsFPS) {
  1656. _0xd162x1 += " | ";
  1657. }
  1658. }
  1659. if (_0xd162x16.showStatsFPS) {
  1660. _0xd162x1 += "FPS: " + this.rFps;
  1661. }
  1662.  
  1663. this.statsHUD.textContent = _0xd162x1;
  1664. var _0xd162x4 = this;
  1665. setTimeout(function() {
  1666. _0xd162x4.displayStats();
  1667. }, 250);
  1668. },
  1669. displayTime: function() {
  1670. if (!_0xd162x16.showTime) {
  1671. return void _0xd162x3("#time-hud").hide();
  1672. }
  1673. var _0xd162x1 = (new Date).toLocaleString();
  1674. this.timeHUD.textContent = _0xd162x1;
  1675. var _0xd162x2 = this;
  1676. setTimeout(function() {
  1677. _0xd162x2.displayTime();
  1678. }, 1E3);
  1679. },
  1680. displayPartys: function() {
  1681. var _0xd162x1 = "";
  1682. var _0xd162x2 = 0;
  1683. for (; _0xd162x2 < this.partys.length; _0xd162x2++) {
  1684. _0xd162x1 += '<li><a href="http://agar.io/#' + this.partys[_0xd162x2] + "\" onclick=\"$('#joinPartyToken').val('agar.io/#" + this.partys[_0xd162x2] + "'); $('#join-party-btn').click();\">http://agar.io/#" + this.partys[_0xd162x2] + "</a></li>";
  1685. }
  1686. this.activePartys.innerHTML = _0xd162x1;
  1687. },
  1688. displayTop5: function() {
  1689. if (_0xd162x16.showTop5) {
  1690. var _0xd162x1 = "";
  1691. var _0xd162x2 = 0;
  1692. for (; _0xd162x2 < this.top5.length && (_0xd162x1 += '<li><span class="main-color">[' + this.top5[_0xd162x2].mass + "]</span> " + this.escapeHTML(this.top5[_0xd162x2].nick) + "</li>", 4 != _0xd162x2); _0xd162x2++) {}
  1693. this.top5pHUD.innerHTML = _0xd162x1;
  1694. }
  1695. },
  1696. displayChatHistory: function(_0xd162x1) {
  1697. if (_0xd162x1) {
  1698. _0xd162x3("#messages").empty();
  1699. toastr.clear();
  1700. var _0xd162x2 = 0;
  1701. for (; _0xd162x2 < this.chatHistory.length; _0xd162x2++) {
  1702. _0xd162x3("#messages").append('<li><span class="message-nick main-color">' + this.chatHistory[_0xd162x2].nick + ": </span>" + this.chatHistory[_0xd162x2].message + "</li>");
  1703. }
  1704. } else {
  1705. _0xd162x3("#messages").empty();
  1706. }
  1707. },
  1708. displayChatInfo: function(_0xd162x1, _0xd162x2) {
  1709. if (_0xd162x1) {
  1710. toastr.info(_0xd162xd[_0xd162xc][_0xd162x2 + "A"]);
  1711. } else {
  1712. toastr.error(_0xd162xd[_0xd162xc][_0xd162x2 + "B"]);
  1713. }
  1714. },
  1715. hideChat: function() {
  1716. if (":party" === this.gameMode) {
  1717. _0xd162x16.hideChat = !_0xd162x16.hideChat;
  1718. if (_0xd162x16.hideChat) {
  1719. _0xd162x3("#message").hide();
  1720. }
  1721. this.displayChatInfo(!_0xd162x16.hideChat, "hideChatMsg");
  1722. }
  1723. },
  1724. enterChatMessage: function() {
  1725. if (":party" === this.gameMode) {
  1726. var _0xd162x1 = _0xd162x3("#message");
  1727. if (_0xd162x1.is(":visible")) {
  1728. var _0xd162x4 = _0xd162x1.val();
  1729. if (_0xd162x4.length > 0) {
  1730. this.sendChatMessage(101, _0xd162x4);
  1731. if (_0xd162x2.play) {
  1732. _0xd162x1.blur();
  1733. _0xd162x1.hide();
  1734. }
  1735. } else {
  1736. _0xd162x1.blur();
  1737. _0xd162x1.hide();
  1738. }
  1739. _0xd162x1.val("");
  1740. } else {
  1741. _0xd162x1.show();
  1742. _0xd162x1.focus();
  1743. _0xd162x1.val("");
  1744. }
  1745. }
  1746. },
  1747. escapeHTML: function(_0xd162x1) {
  1748. return (_0xd162x1 + "").replace(/[&<>"'\/]/g, function(_0xd162x1) {
  1749. return _0xd162xf[_0xd162x1];
  1750. });
  1751. },
  1752. loadSettings: function() {
  1753. var _0xd162x3 = null;
  1754. if (null !== _0xd162x1.localStorage.getItem("ogarioSettings")) {
  1755. _0xd162x3 = JSON.parse(_0xd162x1.localStorage.getItem("ogarioSettings"));
  1756. }
  1757. var _0xd162x4;
  1758. for (_0xd162x4 in _0xd162x16) {
  1759. if (_0xd162x16.hasOwnProperty(_0xd162x4)) {
  1760. if (_0xd162x3) {
  1761. if (_0xd162x3.hasOwnProperty(_0xd162x4)) {
  1762. _0xd162x16[_0xd162x4] = _0xd162x3[_0xd162x4];
  1763. }
  1764. }
  1765. if (_0xd162x2.hasOwnProperty(_0xd162x4)) {
  1766. _0xd162x2[_0xd162x4] = _0xd162x16[_0xd162x4];
  1767. }
  1768. }
  1769. }
  1770. },
  1771. saveSettings: function(_0xd162x2, _0xd162x3) {
  1772. _0xd162x1.localStorage.setItem(_0xd162x3, JSON.stringify(_0xd162x2));
  1773. },
  1774. loadProfiles: function() {
  1775. if (null !== _0xd162x1.localStorage.getItem("ogarioPlayerProfiles")) {
  1776. _0xd162x13 = JSON.parse(_0xd162x1.localStorage.getItem("ogarioPlayerProfiles"));
  1777. } else {
  1778. var _0xd162x2 = 0;
  1779. for (; 10 > _0xd162x2; _0xd162x2++) {
  1780. _0xd162x13.push({
  1781. nick: "Profile #" + (_0xd162x2 + 1),
  1782. clanTag: "",
  1783. skinURL: "",
  1784. color: _0xd162x11.mainColor
  1785. });
  1786. }
  1787. }
  1788. if (null !== _0xd162x1.localStorage.getItem("ogarioSelectedProfile")) {
  1789. this.selectedProfile = JSON.parse(_0xd162x1.localStorage.getItem("ogarioSelectedProfile"));
  1790. }
  1791. _0xd162x15.nick = _0xd162x13[this.selectedProfile].nick;
  1792. _0xd162x15.clanTag = _0xd162x13[this.selectedProfile].clanTag;
  1793. _0xd162x15.skinURL = _0xd162x13[this.selectedProfile].skinURL;
  1794. _0xd162x15.color = _0xd162x13[this.selectedProfile].color;
  1795. },
  1796. changeSkinPreview: function(_0xd162x1, _0xd162x2) {
  1797. if (_0xd162x1) {
  1798. if (_0xd162x2) {
  1799. _0xd162x3("#" + _0xd162x2).removeClass(_0xd162x2 + "-default").append(_0xd162x3(_0xd162x1).fadeIn(500));
  1800. }
  1801. }
  1802. },
  1803. setSkinPreview: function(_0xd162x1, _0xd162x2) {
  1804. if (_0xd162x3("#" + _0xd162x2).empty().addClass(_0xd162x2 + "-default"), _0xd162x1 && 0 != _0xd162x1.length) {
  1805. var _0xd162x4 = this;
  1806. var _0xd162x5 = new Image;
  1807. _0xd162x5.crossOrigin = "Anonymous";
  1808. _0xd162x5.onload = function() {
  1809. _0xd162x14[_0xd162x1] = _0xd162x5;
  1810. _0xd162x4.changeSkinPreview(_0xd162x5, _0xd162x2);
  1811. };
  1812. _0xd162x5.src = _0xd162x1;
  1813. }
  1814. },
  1815. setProfile: function() {
  1816. var _0xd162x1 = (_0xd162x13.length + this.selectedProfile - 1) % _0xd162x13.length;
  1817. var _0xd162x2 = (this.selectedProfile + 1) % _0xd162x13.length;
  1818. this.setSkinPreview(_0xd162x13[_0xd162x1].skinURL, "prev-profile");
  1819. this.setSkinPreview(_0xd162x13[this.selectedProfile].skinURL, "skin-preview");
  1820. this.setSkinPreview(_0xd162x13[_0xd162x2].skinURL, "next-profile");
  1821. _0xd162x3("#nick").val(_0xd162x13[this.selectedProfile].nick);
  1822. _0xd162x3("#clantag").val(_0xd162x13[this.selectedProfile].clanTag);
  1823. _0xd162x3("#skin").val(_0xd162x13[this.selectedProfile].skinURL);
  1824. _0xd162x3("#color").val(_0xd162x13[this.selectedProfile].color);
  1825. _0xd162x3(".skin").colorpicker("setValue", _0xd162x13[this.selectedProfile].color);
  1826. },
  1827. prevProfile: function() {
  1828. this.setPlayerSettings();
  1829. this.selectedProfile = (_0xd162x13.length + this.selectedProfile - 1) % _0xd162x13.length;
  1830. this.setProfile();
  1831. },
  1832. nextProfile: function() {
  1833. this.setPlayerSettings();
  1834. this.selectedProfile = (this.selectedProfile + 1) % _0xd162x13.length;
  1835. this.setProfile();
  1836. },
  1837. setMenu: function() {
  1838. var _0xd162x1 = this;
  1839. document.title = this.name;
  1840. _0xd162x3("#mainPanel").before('<div id="main-menu" class="agario-panel"><ul class="menu-tabs ' + _0xd162xc + '"><li class="start-tab active"><a href="#main-panel" class="active icon-home"></a></li><li class="profile-tab"><a href="#profile">' + _0xd162xd[_0xd162xc].profile + '</a></li><li class="settings-tab"><a href="#og-settings">' + _0xd162xd[_0xd162xc].settings + '</a></li><li class="hotkeys-tab"><a href="#" class="hotkeys-link">' + _0xd162xd[_0xd162xc].hotkeys + '</a></li><li class="theme-tab"><a href="#theme">' +
  1841. _0xd162xd[_0xd162xc].theme + '</a></li></ul><div id="main-panel" class="menu-panel"></div><div id="profile" class="menu-panel"></div><div id="og-settings" class="menu-panel"></div><div id="theme" class="menu-panel"></div></div>');
  1842. _0xd162x3("#main-panel").append('<div id="profiles"><div id="prev-profile"></div><div id="skin-preview"></div><div id="next-profile"></div></div>');
  1843. _0xd162x3("#mainPanel div[role=form]").appendTo(_0xd162x3("#main-panel"));
  1844. _0xd162x3("#main-panel div[role=form] .form-group:first").remove();
  1845. _0xd162x3("#nick").before('<input id="clantag" class="form-control" placeholder="Tag, e.g. \u24c2" maxlength="10" /><div class="input-group nick"></div>');
  1846. _0xd162x3("#nick").appendTo(_0xd162x3(".nick"));
  1847. _0xd162x3(".nick").append('<span class="input-group-btn"><button id="stream-mode" class="btn active icon-eye"></button></span>');
  1848. _0xd162x3(".nick").after('<div class="input-group skin"><input id="skin" class="form-control" placeholder="Skin URL (imgur.com direct link)" maxlength="60" /><input type="hidden" id="color" value="' + _0xd162x15.color + '" maxlength="7" /><span class="input-group-addon"><i></i></span><span class="input-group-btn"><button id="hide-url" class="btn active icon-eye"></button></span></div>');
  1849. _0xd162x3("#locationKnown, #locationUnknown").insertAfter(_0xd162x3(".skin"));
  1850. _0xd162x3(".btn-spectate, .btn-logout").appendTo("#agario-main-buttons");
  1851. _0xd162x3("#agario-main-buttons").append('<br clear="both" />');
  1852. _0xd162x3("#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>');
  1853. _0xd162x3("#create-party-btn, #join-party-btn").appendTo(_0xd162x3("#ogario-party"));
  1854. _0xd162x3("#join-party-btn").addClass("btn-success");
  1855. _0xd162x3("#settingsChoice, #options").appendTo(_0xd162x3("#og-settings"));
  1856. _0xd162x3("#stats").appendTo(_0xd162x3("#main-menu")).addClass("menu-panel");
  1857. _0xd162x3("#statsContinue").attr("id", "statsContinue2");
  1858. _0xd162x3("#mainPanel").empty().remove();
  1859. _0xd162x3(".center-container").append('<div id="menu-footer-v" class="main-color">' + _0xd162xd[_0xd162xc].visit + ' <a href="http://ogario.ovh" target="_blank">ogario.ovh</a> | ' + this.version + "</div>");
  1860. _0xd162x3("#leftPanel, #rightPanel").removeAttr("id");
  1861. _0xd162x3(".agario-profile-panel, .agario-panel-freecoins, .agario-shop-panel").appendTo(_0xd162x3("#profile")).removeClass("agario-side-panel");
  1862. _0xd162x3(".left-container").empty();
  1863. _0xd162x3(".agario-shop-panel").after('<div class="agario-panel ogario-yt-panel"><h5 class="main-color">Team OGARio (tag: \u24c2)</h5><div class="g-ytsubscribe" data-channelid="UCaWiPNJWnhzYDrBQoXokn6w" data-layout="full" data-theme="dark" data-count="default"></div></div>');
  1864. _0xd162x3(".ogario-yt-panel").after('<div class="agario-panel radio-panel"><h5 class="main-color">Radio</h5><audio src="http://192.99.0.170:5529/;" controls></audio></div>');
  1865. _0xd162x3("#tags-container").appendTo(_0xd162x3("#profile"));
  1866. _0xd162x3(".agario-party-6").appendTo(_0xd162x3(".center-container"));
  1867. _0xd162x3(".right-container").empty();
  1868. _0xd162x3(".right-container").append('<div class="agario-party"></div>');
  1869. _0xd162x3(".agario-party-6").appendTo(_0xd162x3(".agario-party"));
  1870. _0xd162x3(".agario-party h4, #cancel-party-btn").remove();
  1871. _0xd162x3(".btn-settings, .text-muted, .tosBox, .agario-promo, #agario-web-incentive, span[data-itr='page_option_dark_theme'], #options #darkTheme").remove();
  1872. _0xd162x3("#advertisement, #adbg, #a320x250, #g320x250, #s320x250, #adsBottom").css("display", "none");
  1873. _0xd162x3("#advertisement").removeClass("agario-panel");
  1874. _0xd162x3("#adsBottom").css({
  1875. "z-index": "1",
  1876. opacity: "0",
  1877. bottom: "-100px"
  1878. });
  1879. _0xd162x3("#og-settings").prepend('<input id="zoom-speed" type="range" min="0.79" max="0.99" value="' + _0xd162x16.zoomSpeedValue + '" step="0.01"><div id="zoom-speed-value">Zoom speed: ' + _0xd162x16.zoomSpeedValue + "</div>");
  1880. _0xd162x3("#zoom-speed").on("change", function() {
  1881. var _0xd162x4 = _0xd162x3(this).val();
  1882. _0xd162x16.zoomSpeedValue = _0xd162x4;
  1883. _0xd162x2.zoomSpeedValue = _0xd162x4;
  1884. _0xd162x3("#zoom-speed-value").html("Zoom speed: " + _0xd162x4);
  1885. _0xd162x1.saveSettings(_0xd162x16, "ogarioSettings");
  1886. });
  1887. _0xd162x3("#og-settings").append('<div id="og-options"></div>');
  1888. var _0xd162x4;
  1889. for (_0xd162x4 in _0xd162x16) {
  1890. if (_0xd162x16.hasOwnProperty(_0xd162x4)) {
  1891. if ("zoomSpeedValue" === _0xd162x4) {
  1892. break;
  1893. }
  1894. _0xd162x3("#og-options").append('<label><input type="checkbox" onchange="setSettings(\'' + _0xd162x4 + "', $(this).is(':checked'));\" id=\"" + _0xd162x4 + '">' + _0xd162xd[_0xd162xc][_0xd162x4] + "</label>");
  1895. }
  1896. }
  1897. _0xd162x3("#og-settings input:checkbox").each(function() {
  1898. var _0xd162x1 = _0xd162x3(this).attr("id");
  1899. if (_0xd162x16.hasOwnProperty(_0xd162x1)) {
  1900. _0xd162x3(this).prop("checked", _0xd162x16[_0xd162x1]);
  1901. }
  1902. });
  1903. if (_0xd162x12) {
  1904. _0xd162x12.setThemeMenu();
  1905. }
  1906. _0xd162x3("body").append('<div id="overlays-hud"><div id="stats-hud" class="hud main-color"></div> <div id="top5-hud" class="hud"><h5 class="main-color">Team top 5</h5><ol id="top5p-hud"></ol></div> <div id="time-hud" class="hud main-color"></div> <div id="pause-hud" class="hud">' + _0xd162xd[_0xd162xc].pause + '</div> <div id="leaderboard-hud" class="hud-b"><h4 class="main-color">ogario.ovh</h4><div id="leaderboard-positions"></div></div> <div id="minimap-hud" class="hud-b"><canvas id="minimap-sectors"></canvas><canvas id="minimap"></canvas></div></div>');
  1907. _0xd162x3("body").append('<ul id="messages"></ul>');
  1908. _0xd162x3("body").append('<input id="message" class="form-control" type="text" placeholder="' + _0xd162xd[_0xd162xc].enterChatMsg + '..." maxlength="80" />');
  1909. toastr.options = {
  1910. newestOnTop: false,
  1911. positionClass: "toast-bottom-left",
  1912. timeOut: "15000"
  1913. };
  1914. _0xd162x3(document).ready(function() {
  1915. _0xd162x3(".menu-tabs a").click(function(_0xd162x1) {
  1916. _0xd162x1.preventDefault();
  1917. var _0xd162x2 = _0xd162x3(this);
  1918. if (_0xd162x2.hasClass("hotkeys-link")) {
  1919. return void showHotkeys();
  1920. }
  1921. _0xd162x2.addClass("active");
  1922. _0xd162x2.parent().addClass("active");
  1923. _0xd162x2.parent().siblings().removeClass("active");
  1924. _0xd162x2.parent().siblings().find("a").removeClass("active");
  1925. var _0xd162x4 = _0xd162x2.attr("href");
  1926. _0xd162x3(".menu-panel").not(_0xd162x4).css("display", "none");
  1927. _0xd162x3(_0xd162x4).fadeIn();
  1928. _0xd162x9();
  1929. });
  1930. });
  1931. _0xd162x3("#gamemode").on("change", function() {
  1932. _0xd162x1.gameMode = _0xd162x2.gameMode = this.value;
  1933. if (":party" !== this.value) {
  1934. if (_0xd162x1.isSocketOpen()) {
  1935. _0xd162x1.socket.close();
  1936. _0xd162x3(".partyToken").val("");
  1937. }
  1938. }
  1939. _0xd162x1.setTop5();
  1940. });
  1941. _0xd162x3("#cancel-party-btn").on("click", function() {
  1942. _0xd162x1.gameMode = _0xd162x2.gameMode = "";
  1943. _0xd162x1.socket.close();
  1944. _0xd162x3(".partyToken").val("");
  1945. });
  1946. _0xd162x3("#skin").on("input", function() {
  1947. var _0xd162x2 = _0xd162x3(this).val();
  1948. _0xd162x1.setSkinPreview(_0xd162x2, "skin-preview");
  1949. });
  1950. _0xd162x3("#prev-profile").on("click", function() {
  1951. _0xd162x1.prevProfile();
  1952. });
  1953. _0xd162x3("#next-profile").on("click", function() {
  1954. _0xd162x1.nextProfile();
  1955. });
  1956. _0xd162x3("#canvas").bind("contextmenu", function() {
  1957. return false;
  1958. });
  1959. _0xd162x3("#stream-mode").on("click", function() {
  1960. _0xd162x16.streamMode = !_0xd162x16.streamMode;
  1961. _0xd162x1.saveSettings(_0xd162x16, "ogarioSettings");
  1962. _0xd162x1.setStreamMode();
  1963. });
  1964. _0xd162x3("#hide-url").on("click", function() {
  1965. _0xd162x16.hideSkinUrl = !_0xd162x16.hideSkinUrl;
  1966. _0xd162x1.saveSettings(_0xd162x16, "ogarioSettings");
  1967. _0xd162x1.setHideSkinUrl();
  1968. });
  1969. this.statsHUD = document.getElementById("stats-hud");
  1970. this.activePartys = document.getElementById("activepartys");
  1971. this.top5pHUD = document.getElementById("top5p-hud");
  1972. this.leaderboardPositionsHUD = document.getElementById("leaderboard-positions");
  1973. this.timeHUD = document.getElementById("time-hud");
  1974. },
  1975. getDefaultSettings: function() {
  1976. this.noSkins = _0xd162x3("#noSkins").is(":checked");
  1977. this.noNames = _0xd162x3("#noNames").is(":checked");
  1978. this.noColors = _0xd162x3("#noColors").is(":checked");
  1979. this.showMass = _0xd162x3("#showMass").is(":checked");
  1980. this.skipStats = _0xd162x3("#skipStats").is(":checked");
  1981. _0xd162x2.showCustomSkins = !this.noSkins;
  1982. var _0xd162x4 = this;
  1983. if (_0xd162x3("#options input").on("click", function() {
  1984. var _0xd162x1 = _0xd162x3(this);
  1985. var _0xd162x5 = _0xd162x1.attr("id");
  1986. if (void 0 !== _0xd162x4[_0xd162x5]) {
  1987. _0xd162x4[_0xd162x5] = _0xd162x1.is(":checked");
  1988. if ("noSkins" === _0xd162x5) {
  1989. _0xd162x2.showCustomSkins = !_0xd162x4.noSkins;
  1990. }
  1991. }
  1992. }), _0xd162x3("#quality").on("change", function() {
  1993. var _0xd162x1 = _0xd162x3(this).val();
  1994. _0xd162x4.getQuality(_0xd162x1);
  1995. }), null !== _0xd162x1.localStorage.getItem("scale_setting")) {
  1996. var _0xd162x5 = JSON.parse(_0xd162x1.localStorage.getItem("scale_setting"));
  1997. this.setCanvasScale(_0xd162x5);
  1998. } else {
  1999. var _0xd162x6 = _0xd162x3("#quality").val();
  2000. this.getQuality(_0xd162x6);
  2001. }
  2002. if (null !== _0xd162x1.localStorage.getItem("location")) {
  2003. var _0xd162x7 = _0xd162x1.localStorage.getItem("location");
  2004. _0xd162x3("#region").val(_0xd162x7);
  2005. if (_0xd162x1.MC) {
  2006. if (_0xd162x1.MC.setRegion) {
  2007. _0xd162x1.MC.setRegion(_0xd162x7);
  2008. }
  2009. }
  2010. }
  2011. this.setParty();
  2012. if (":party" === _0xd162x17.gameMode) {
  2013. if (_0xd162x1.location.hash) {
  2014. _0xd162x3("#join-party-btn").click();
  2015. }
  2016. }
  2017. },
  2018. getQuality: function(_0xd162x2) {
  2019. var _0xd162x3 = "devicePixelRatio" in _0xd162x1;
  2020. var _0xd162x4 = 1;
  2021. switch (_0xd162x3 && (_0xd162x4 = _0xd162x1.devicePixelRatio), _0xd162x2) {
  2022. case "High":
  2023. this.setCanvasScale(1);
  2024. break;
  2025. case "Medium":
  2026. this.setCanvasScale(0.9);
  2027. break;
  2028. case "Low":
  2029. this.setCanvasScale(0.75);
  2030. break;
  2031. case "VeryLow":
  2032. this.setCanvasScale(0.5);
  2033. break;
  2034. default:
  2035. this.setCanvasScale(_0xd162x4);
  2036. }
  2037. },
  2038. setCanvasScale: function(_0xd162x1) {
  2039. this.canvasScale = _0xd162x1;
  2040. _0xd162x2.canvasScale = _0xd162x1;
  2041. },
  2042. setParty: function() {
  2043. if (this.gameMode = _0xd162x3("#gamemode").val(), this.setTop5(), ":party" === this.gameMode) {
  2044. var _0xd162x1 = _0xd162x3(".partyToken").val();
  2045. if (_0xd162x1) {
  2046. if (_0xd162x1.length > 5) {
  2047. _0xd162x1 = _0xd162x1.split("#");
  2048. this.partyToken = _0xd162x1[1];
  2049. }
  2050. }
  2051. }
  2052. },
  2053. setStreamMode: function() {
  2054. if (_0xd162x16.streamMode) {
  2055. _0xd162x3("#stream-mode").addClass("icon-eye-blocked");
  2056. _0xd162x3("#clantag, #nick, #joinPartyToken").addClass("stream-mode");
  2057. } else {
  2058. _0xd162x3("#stream-mode").removeClass("icon-eye-blocked");
  2059. _0xd162x3("#clantag, #nick, #joinPartyToken").removeClass("stream-mode");
  2060. }
  2061. },
  2062. setHideSkinUrl: function() {
  2063. if (_0xd162x16.hideSkinUrl) {
  2064. _0xd162x3("#hide-url").addClass("icon-eye-blocked");
  2065. _0xd162x3("#skin").addClass("hide-url");
  2066. } else {
  2067. _0xd162x3("#hide-url").removeClass("icon-eye-blocked");
  2068. _0xd162x3("#skin").removeClass("hide-url");
  2069. }
  2070. },
  2071. setButtons: function() {
  2072. var _0xd162x1 = this;
  2073. var _0xd162x2 = document.getElementsByClassName("btn-play")[0];
  2074. var _0xd162x4 = document.getElementsByClassName("btn-play-guest")[0];
  2075. var _0xd162x5 = document.getElementsByClassName("btn-spectate")[0];
  2076. var _0xd162x6 = document.getElementById("create-party-btn");
  2077. var _0xd162x7 = document.getElementById("join-party-btn");
  2078. var _0xd162x8 = document.getElementById("statsContinue2");
  2079. _0xd162x2.addEventListener("click", function() {
  2080. _0xd162x1.onPlay();
  2081. }, false);
  2082. _0xd162x4.addEventListener("click", function() {
  2083. _0xd162x1.onPlay();
  2084. }, false);
  2085. _0xd162x5.addEventListener("click", function() {
  2086. _0xd162x1.onSpectate();
  2087. }, false);
  2088. _0xd162x6.addEventListener("click", function() {
  2089. _0xd162x1.onCreate();
  2090. }, false);
  2091. _0xd162x7.addEventListener("click", function() {
  2092. _0xd162x1.onJoin();
  2093. }, false);
  2094. _0xd162x8.addEventListener("click", function() {
  2095. _0xd162x3("#stats, #main-panel").toggle();
  2096. }, false);
  2097. },
  2098. play: function() {
  2099. if (this.setPlayerSettings(), ":party" === this.gameMode) {
  2100. if (this.setParty(), this.isSocketOpen()) {
  2101. this.sendPlayerClanTag();
  2102. this.sendPartyToken();
  2103. this.sendPlayerNick();
  2104. } else {
  2105. this.connect();
  2106. var _0xd162x1 = this;
  2107. setTimeout(function() {
  2108. _0xd162x1.sendPlayerClanTag();
  2109. _0xd162x1.sendPartyToken();
  2110. _0xd162x1.sendPlayerNick();
  2111. }, 1E3);
  2112. }
  2113. }
  2114. },
  2115. onPlay: function() {
  2116. this.play();
  2117. _0xd162x3("#overlays, #main-panel").hide();
  2118. _0xd162x1.addKeyListeners();
  2119. _0xd162x2.spectate = false;
  2120. _0xd162x2.playerBestMass = 0;
  2121. if (_0xd162x16.autoHideFood) {
  2122. _0xd162x2.showFood = true;
  2123. }
  2124. if (_0xd162x1.ga) {
  2125. _0xd162x1.ga("create", "UA-67142685-2", "auto", "ogarioTracker");
  2126. }
  2127. if (_0xd162x1.ga) {
  2128. _0xd162x1.ga("ogarioTracker.send", "pageview");
  2129. }
  2130. },
  2131. onSpectate: function() {
  2132. if (":party" === this.gameMode) {
  2133. this.onJoin();
  2134. } else {
  2135. this.setPlayerSettings();
  2136. }
  2137. _0xd162x3("#main-panel").hide();
  2138. _0xd162x1.addKeyListeners();
  2139. _0xd162x2.play = false;
  2140. _0xd162x2.spectate = true;
  2141. if (_0xd162x16.autoHideFood) {
  2142. _0xd162x2.showFood = false;
  2143. }
  2144. },
  2145. join: function() {
  2146. this.setParty();
  2147. this.setPlayerSettings();
  2148. this.sendPlayerClanTag();
  2149. this.sendPartyToken();
  2150. this.sendPlayerNick();
  2151. this.sendPlayerDeath();
  2152. this.sendPlayerJoin();
  2153. },
  2154. onJoin: function() {
  2155. if (this.setParty(), this.isSocketOpen()) {
  2156. this.join();
  2157. } else {
  2158. this.connect();
  2159. var _0xd162x1 = this;
  2160. setTimeout(function() {
  2161. _0xd162x1.join();
  2162. }, 1E3);
  2163. }
  2164. },
  2165. create: function() {
  2166. if (this.setParty(), "" !== this.partyToken) {
  2167. return void this.onJoin();
  2168. }
  2169. var _0xd162x1 = this;
  2170. setTimeout(function() {
  2171. _0xd162x1.create();
  2172. }, 100);
  2173. },
  2174. onCreate: function() {
  2175. this.flushData();
  2176. _0xd162x3("#joinPartyToken").val("");
  2177. this.partyToken = "";
  2178. this.create();
  2179. },
  2180. onPlayerSpawn: function() {
  2181. if (_0xd162x2.play = true, _0xd162x2.playerColor) {
  2182. return this.sendPlayerSpawn(), void this.cacheCustomSkin(_0xd162x15.nick + _0xd162x2.playerColor, _0xd162x15.skinURL);
  2183. }
  2184. var _0xd162x1 = this;
  2185. setTimeout(function() {
  2186. _0xd162x1.onPlayerSpawn();
  2187. }, 100);
  2188. },
  2189. onPlayerDeath: function() {
  2190. _0xd162x3(".menu-panel").hide();
  2191. if (this.skipStats) {
  2192. _0xd162x3("#main-panel").show();
  2193. } else {
  2194. _0xd162x3("#stats").show();
  2195. }
  2196. _0xd162x2.play = false;
  2197. _0xd162x2.playerColor = null;
  2198. _0xd162x2.foodIsHidden = false;
  2199. _0xd162x2.playerMass = 0;
  2200. this.sendPlayerDeath();
  2201. this.updateDeathLocations(_0xd162x2.playerX, _0xd162x2.playerY);
  2202. _0xd162x3(".btn-spectate").prop("disabled", false);
  2203. _0xd162x1.onkeydown = function() {};
  2204. },
  2205. setPlayerSettings: function() {
  2206. var _0xd162x1 = _0xd162x3("#nick").val();
  2207. var _0xd162x4 = _0xd162x3("#clantag").val();
  2208. var _0xd162x5 = _0xd162x3("#skin").val();
  2209. var _0xd162x6 = _0xd162x3("#color").val();
  2210. _0xd162x15.nick = _0xd162x1 || "";
  2211. _0xd162x15.clanTag = _0xd162x4.trim() || "";
  2212. _0xd162x15.skinURL = _0xd162x5.trim() || "";
  2213. if (7 == _0xd162x6.length) {
  2214. _0xd162x15.color = _0xd162x6;
  2215. }
  2216. _0xd162x2.playerNick = _0xd162x15.nick;
  2217. if (_0xd162x15.clanTag.length > 0) {
  2218. _0xd162x2.clanTag = _0xd162x15.clanTag;
  2219. }
  2220. _0xd162x13[this.selectedProfile].nick = _0xd162x15.nick;
  2221. _0xd162x13[this.selectedProfile].clanTag = _0xd162x15.clanTag;
  2222. _0xd162x13[this.selectedProfile].skinURL = _0xd162x15.skinURL;
  2223. _0xd162x13[this.selectedProfile].color = _0xd162x15.color;
  2224. this.saveSettings(_0xd162x13, "ogarioPlayerProfiles");
  2225. this.saveSettings(this.selectedProfile, "ogarioSelectedProfile");
  2226. },
  2227. cacheSkin: function(_0xd162x1, _0xd162x2) {
  2228. if (_0xd162x2) {
  2229. _0xd162x1[_0xd162x2] = new Image;
  2230. _0xd162x1[_0xd162x2].crossOrigin = "Anonymous";
  2231. _0xd162x1[_0xd162x2].src = _0xd162x2;
  2232. }
  2233. },
  2234. getCachedSkin: function(_0xd162x1, _0xd162x2) {
  2235. return _0xd162x1[_0xd162x2] && (_0xd162x1[_0xd162x2].width && _0xd162x1[_0xd162x2].complete) ? _0xd162x1[_0xd162x2] : null;
  2236. },
  2237. cacheCustomSkin: function(_0xd162x1, _0xd162x2) {
  2238. if (_0xd162x2) {
  2239. if (_0xd162x1 && (this.customSkinsMap[_0xd162x1] = _0xd162x2), this.customSkinsCache.hasOwnProperty(_0xd162x2)) {
  2240. return;
  2241. }
  2242. this.cacheSkin(this.customSkinsCache, _0xd162x2);
  2243. }
  2244. },
  2245. getCustomSkin: function(_0xd162x1, _0xd162x2) {
  2246. return this.customSkinsMap.hasOwnProperty(_0xd162x1 + _0xd162x2) ? this.getCachedSkin(this.customSkinsCache, this.customSkinsMap[_0xd162x1 + _0xd162x2]) : null;
  2247. },
  2248. countFPS: function() {
  2249. if (_0xd162x16.showStatsFPS) {
  2250. if (!this.fpsLastRequest) {
  2251. return void(this.fpsLastRequest = Date.now());
  2252. }
  2253. var _0xd162x1 = Date.now();
  2254. var _0xd162x2 = _0xd162x1 - this.fpsLastRequest;
  2255. if (!(1E3 > _0xd162x2)) {
  2256. this.rFps = this.renderedFrames;
  2257. this.renderedFrames = 0;
  2258. this.fpsLastRequest = _0xd162x1;
  2259. }
  2260. this.renderedFrames++;
  2261. }
  2262. },
  2263. calculateCurrentSector: function() {
  2264. if (!_0xd162x2.mapOffsetFixed) {
  2265. return void(this.currentSector = "");
  2266. }
  2267. var _0xd162x1 = _0xd162x2.mapOffsetX + _0xd162x2.mapOffset;
  2268. var _0xd162x3 = _0xd162x2.mapOffsetY + _0xd162x2.mapOffset;
  2269. var _0xd162x4 = String.fromCharCode(65 + Math.floor((_0xd162x2.playerY + _0xd162x3) / (_0xd162x2.mapSize / _0xd162x11.sectorsY)));
  2270. var _0xd162x5 = "" + (Math.floor((_0xd162x2.playerX + _0xd162x1) / (_0xd162x2.mapSize / _0xd162x11.sectorsX)) + 1);
  2271. this.currentSector = _0xd162x4 + _0xd162x5;
  2272. },
  2273. updateDeathLocations: function(_0xd162x1, _0xd162x3) {
  2274. if (_0xd162x2.mapOffsetFixed) {
  2275. this.deathLocations.push({
  2276. x: _0xd162x1 + _0xd162x2.mapOffsetX,
  2277. y: _0xd162x3 + _0xd162x2.mapOffsetY
  2278. });
  2279. if (6 == this.deathLocations.length) {
  2280. this.deathLocations.splice(0, 1);
  2281. }
  2282. this.lastDeath = this.deathLocations.length - 1;
  2283. }
  2284. },
  2285. drawMapBorders: function(_0xd162x1, _0xd162x3, _0xd162x4, _0xd162x5, _0xd162x6, _0xd162x7, _0xd162x8) {
  2286. if (_0xd162x2.mapOffsetFixed) {
  2287. if (_0xd162x16.showMapBorders) {
  2288. _0xd162x1.strokeStyle = _0xd162x7;
  2289. _0xd162x1.lineWidth = _0xd162x8;
  2290. _0xd162x1.beginPath();
  2291. _0xd162x1.moveTo(_0xd162x3, _0xd162x4);
  2292. _0xd162x1.lineTo(_0xd162x5, _0xd162x4);
  2293. _0xd162x1.lineTo(_0xd162x5, _0xd162x6);
  2294. _0xd162x1.lineTo(_0xd162x3, _0xd162x6);
  2295. _0xd162x1.closePath();
  2296. _0xd162x1.stroke();
  2297. }
  2298. }
  2299. },
  2300. drawMiniMap: function() {
  2301. if (_0xd162x2.mapOffsetFixed) {
  2302. if (this.miniMap) {
  2303. this.miniMapCtx.clearRect(0, 0, 200, 220);
  2304. } else {
  2305. this.miniMap = document.getElementById("minimap");
  2306. this.miniMapCtx = this.miniMap.getContext("2d");
  2307. this.miniMapCtx.ogarioCtx = true;
  2308. this.miniMap.width = 200;
  2309. this.miniMap.height = 220;
  2310. }
  2311. var _0xd162x1 = 182 / _0xd162x2.mapSize;
  2312. var _0xd162x3 = _0xd162x2.mapOffsetX + _0xd162x2.mapOffset;
  2313. var _0xd162x4 = _0xd162x2.mapOffsetY + _0xd162x2.mapOffset;
  2314. if (this.drawSelectedCell(this.miniMapCtx), this.calculateCurrentSector(), this.miniMapCtx.globalAlpha = 1, this.miniMapCtx.font = "16px Ubuntu", this.miniMapCtx.fillStyle = _0xd162x11.mainColor, this.miniMapCtx.fillText(this.currentSector, 10, 20), this.miniMapSectors || this.drawMiniMapSectors(_0xd162x11.sectorsX, _0xd162x11.sectorsY, 182, 220), this.miniMapCtx.save(), this.miniMapCtx.translate(9.5, 29.5), _0xd162x16.showMiniMapGuides) {
  2315. var _0xd162x5 = Math.round((_0xd162x2.playerX + _0xd162x3) * _0xd162x1);
  2316. var _0xd162x6 = Math.round((_0xd162x2.playerY + _0xd162x4) * _0xd162x1);
  2317. this.miniMapCtx.globalAlpha = 0.4;
  2318. this.miniMapCtx.lineWidth = 1;
  2319. this.miniMapCtx.strokeStyle = _0xd162x11.mainColor;
  2320. this.miniMapCtx.beginPath();
  2321. this.miniMapCtx.moveTo(_0xd162x5, 0);
  2322. this.miniMapCtx.lineTo(_0xd162x5, 181);
  2323. this.miniMapCtx.moveTo(0, _0xd162x6);
  2324. this.miniMapCtx.lineTo(181, _0xd162x6);
  2325. this.miniMapCtx.stroke();
  2326. this.miniMapCtx.globalAlpha = 1;
  2327. }
  2328. if (this.miniMapCtx.fillStyle = "#FFFFFF", this.miniMapCtx.beginPath(), this.miniMapCtx.arc((_0xd162x2.playerX + _0xd162x3) * _0xd162x1, (_0xd162x2.playerY + _0xd162x4) * _0xd162x1, 6, 0, this.pi2, false), this.miniMapCtx.closePath(), this.miniMapCtx.fill(), ":party" === this.gameMode && this.teamPlayers.length > 0) {
  2329. var _0xd162x7 = 0;
  2330.  
  2331. for (; _0xd162x7 < this.teamPlayers.length; _0xd162x7++) {
  2332.  
  2333. this.teamPlayers[_0xd162x7].drawPosition(this.miniMapCtx, _0xd162x2.mapOffset, _0xd162x1);
  2334. }
  2335. }
  2336. if (this.deathLocations.length > 0) {
  2337. _0xd162x5 = Math.round((this.deathLocations[this.lastDeath].x + _0xd162x2.mapOffset) * _0xd162x1);
  2338. _0xd162x6 = Math.round((this.deathLocations[this.lastDeath].y + _0xd162x2.mapOffset) * _0xd162x1);
  2339. this.miniMapCtx.lineWidth = 1;
  2340. this.miniMapCtx.strokeStyle = this.deathLocations.length - 1 == this.lastDeath ? _0xd162x11.mainColor : "#FFFFFF";
  2341. this.miniMapCtx.beginPath();
  2342. this.miniMapCtx.moveTo(_0xd162x5 - 4.5, _0xd162x6);
  2343. this.miniMapCtx.lineTo(_0xd162x5 + 4.5, _0xd162x6);
  2344. this.miniMapCtx.moveTo(_0xd162x5, _0xd162x6 - 4.5);
  2345. this.miniMapCtx.lineTo(_0xd162x5, _0xd162x6 + 4.5);
  2346. this.miniMapCtx.stroke();
  2347. }
  2348. this.miniMapCtx.restore();
  2349. }
  2350. },
  2351. drawMiniMapSectors: function(_0xd162x1, _0xd162x2, _0xd162x3, _0xd162x4) {
  2352. this.miniMapSectors = document.getElementById("minimap-sectors");
  2353. var _0xd162x5 = this.miniMapSectors.getContext("2d");
  2354. _0xd162x5.ogarioCtx = true;
  2355. this.miniMapSectors.width = _0xd162x3;
  2356. this.miniMapSectors.height = _0xd162x4;
  2357. _0xd162x5.fillStyle = "#FFFFFF";
  2358. this.dTok(_0xd162x5);
  2359. this.drawSectors(_0xd162x5, _0xd162x1, _0xd162x2, 0.5, 29.5, _0xd162x3 - 0.5, _0xd162x4 - 9.5, "#FFFFFF", 1, false);
  2360. },
  2361. resetMiniMapSectors: function() {
  2362. this.miniMapSectors = null;
  2363. },
  2364. drawSectors: function(_0xd162x1, _0xd162x3, _0xd162x4, _0xd162x5, _0xd162x6, _0xd162x7, _0xd162x8, _0xd162x9, _0xd162xa, _0xd162xb) {
  2365. if (!_0xd162xb || _0xd162x2.mapOffsetFixed && _0xd162x16.showBgSectors) {
  2366. var _0xd162xc = Math.floor((_0xd162x7 - _0xd162x5) / _0xd162x3);
  2367. var _0xd162xd = Math.floor((_0xd162x8 - _0xd162x6) / _0xd162x4);
  2368. var _0xd162xe = Math.floor(0.4 * _0xd162xd);
  2369. var _0xd162xf = 0;
  2370. var _0xd162x10 = 0;
  2371. if (_0xd162x1.strokeStyle = _0xd162x9, _0xd162x1.fillStyle = _0xd162x9, _0xd162x1.lineWidth = _0xd162xa, _0xd162xb || !_0xd162xb && _0xd162x11.miniMapGrid) {
  2372. _0xd162x1.beginPath();
  2373. var _0xd162x12 = 0;
  2374. for (; _0xd162x3 + 1 > _0xd162x12; _0xd162x12++) {
  2375. _0xd162xf = _0xd162x5 + _0xd162xc * _0xd162x12;
  2376. _0xd162x1.moveTo(_0xd162x12 == _0xd162x3 ? _0xd162x7 : _0xd162xf, _0xd162x6);
  2377. _0xd162x1.lineTo(_0xd162x12 == _0xd162x3 ? _0xd162x7 : _0xd162xf, _0xd162x8);
  2378. }
  2379. _0xd162x12 = 0;
  2380. for (; _0xd162x4 + 1 > _0xd162x12; _0xd162x12++) {
  2381. _0xd162x10 = _0xd162x6 + _0xd162xd * _0xd162x12;
  2382. _0xd162x1.moveTo(_0xd162x5 - _0xd162xa / 2, _0xd162x12 == _0xd162x4 ? _0xd162x8 : _0xd162x10);
  2383. _0xd162x1.lineTo(_0xd162x7 + _0xd162xa / 2, _0xd162x12 == _0xd162x4 ? _0xd162x8 : _0xd162x10);
  2384. }
  2385. _0xd162x1.stroke();
  2386. } else {
  2387. this.drawMapBorders(_0xd162x1, _0xd162x5, _0xd162x6, _0xd162x7, _0xd162x8, _0xd162x9, _0xd162xa);
  2388. }
  2389. _0xd162x1.font = _0xd162xe + "px Ubuntu";
  2390. _0xd162x1.textAlign = "center";
  2391. _0xd162x1.textBaseline = "middle";
  2392. _0xd162x12 = 0;
  2393. for (; _0xd162x4 > _0xd162x12; _0xd162x12++) {
  2394. var _0xd162x13 = 0;
  2395. for (; _0xd162x3 > _0xd162x13; _0xd162x13++) {
  2396. var _0xd162x14 = String.fromCharCode(65 + _0xd162x12) + (_0xd162x13 + 1);
  2397. _0xd162xf = Math.floor(_0xd162x5 + _0xd162xc / 2 + _0xd162x13 * _0xd162xc);
  2398. _0xd162x10 = Math.floor(_0xd162x6 + _0xd162xd / 2 + _0xd162x12 * _0xd162xd);
  2399. _0xd162x1.fillText(_0xd162x14, _0xd162xf, _0xd162x10);
  2400. }
  2401. }
  2402. }
  2403. },
  2404. drawGrid: function(_0xd162x1) {
  2405. if (_0xd162x16.showGrid) {
  2406. var _0xd162x3 = _0xd162x2.innerW / _0xd162x2.viewScale;
  2407. var _0xd162x4 = _0xd162x2.innerH / _0xd162x2.viewScale;
  2408. var _0xd162x5 = (-_0xd162x2.playerX + _0xd162x3 / 2) % 50;
  2409. var _0xd162x6 = (-_0xd162x2.playerY + _0xd162x4 / 2) % 50;
  2410. _0xd162x1.strokeStyle = _0xd162x11.gridColor;
  2411. _0xd162x1.globalAlpha = 1 * _0xd162x2.viewScale;
  2412. _0xd162x1.beginPath();
  2413. for (; _0xd162x3 > _0xd162x5; _0xd162x5 += 50) {
  2414. _0xd162x1.moveTo(_0xd162x5 * _0xd162x2.viewScale - 0.5, 0);
  2415. _0xd162x1.lineTo(_0xd162x5 * _0xd162x2.viewScale - 0.5, _0xd162x4 * _0xd162x2.viewScale);
  2416. }
  2417. for (; _0xd162x4 > _0xd162x6; _0xd162x6 += 50) {
  2418. _0xd162x1.moveTo(0, _0xd162x6 * _0xd162x2.viewScale - 0.5);
  2419. _0xd162x1.lineTo(_0xd162x3 * _0xd162x2.viewScale, _0xd162x6 * _0xd162x2.viewScale - 0.5);
  2420. }
  2421. _0xd162x1.stroke();
  2422. _0xd162x1.globalAlpha = 1;
  2423. }
  2424. },
  2425. drawSelectedCell: function(_0xd162x1) {
  2426. if (_0xd162x2.play) {
  2427. if (_0xd162x2.playerCellsMass) {
  2428. if (_0xd162x2.playerCellsMass.length > 1) {
  2429. if (_0xd162x16.splitRange || (_0xd162x16.oppColors || (_0xd162x16.oppRings || _0xd162x16.showStatsSTE))) {
  2430. _0xd162x1.fillStyle = "#FFFFFF";
  2431. _0xd162x1.globalAlpha = this.selectBiggestCell ? 0.6 : 0.3;
  2432. _0xd162x1.beginPath();
  2433. _0xd162x1.arc(48, 15, 6, 0, this.pi2, false);
  2434. _0xd162x1.closePath();
  2435. _0xd162x1.fill();
  2436. _0xd162x1.globalAlpha = this.selectBiggestCell ? 0.3 : 0.6;
  2437. _0xd162x1.beginPath();
  2438. _0xd162x1.arc(60, 15, 4, 0, this.pi2, false);
  2439. _0xd162x1.closePath();
  2440. _0xd162x1.fill();
  2441. }
  2442. }
  2443. }
  2444. }
  2445. },
  2446. dTok: function(_0xd162x1) {
  2447. _0xd162x1.font = "14px Ubuntu";
  2448. _0xd162x1.textAlign = "right";
  2449. _0xd162x1.textBaseline = "top";
  2450. _0xd162x1.fillText(atob(this.token), 181, 7);
  2451. },
  2452. drawCircle: function(_0xd162x1, _0xd162x2, _0xd162x3, _0xd162x4, _0xd162x5, _0xd162x6) {
  2453. _0xd162x1.lineWidth = _0xd162x4;
  2454. _0xd162x1.globalAlpha = _0xd162x5;
  2455. _0xd162x1.strokeStyle = _0xd162x6;
  2456. var _0xd162x7 = 0;
  2457. for (; _0xd162x7 < _0xd162x2.length; _0xd162x7++) {
  2458. _0xd162x1.beginPath();
  2459. _0xd162x1.arc(_0xd162x2[_0xd162x7].x, _0xd162x2[_0xd162x7].y, _0xd162x2[_0xd162x7].size + _0xd162x3, 0, this.pi2, false);
  2460. _0xd162x1.closePath();
  2461. _0xd162x1.stroke();
  2462. }
  2463. _0xd162x1.globalAlpha = 1;
  2464. },
  2465. preDrawIndicator: function() {
  2466. _0xd162x2.indicator = document.createElement("canvas");
  2467. var _0xd162x1 = _0xd162x2.indicator.getContext("2d");
  2468. _0xd162x1.lineWidth = 2;
  2469. _0xd162x1.fillStyle = "#FFFFFF";
  2470. _0xd162x1.strokeStyle = "#000000";
  2471. _0xd162x1.beginPath();
  2472. _0xd162x1.moveTo(0, 0);
  2473. _0xd162x1.lineTo(90, 0);
  2474. _0xd162x1.lineTo(45, 50);
  2475. _0xd162x1.closePath();
  2476. _0xd162x1.fill();
  2477. _0xd162x1.stroke();
  2478. },
  2479. setVirusColor: function(_0xd162x1) {
  2480. var _0xd162x2 = Math.floor(_0xd162x1 * _0xd162x1 / 100);
  2481. return _0xd162x2 > 183 ? "#C80000" : _0xd162x11.virusColor;
  2482. },
  2483. setVirusStrokeColor: function(_0xd162x1) {
  2484. if (_0xd162x2.play && 0 != _0xd162x2.playerMaxMass) {
  2485. var _0xd162x3 = Math.floor(_0xd162x1 * _0xd162x1 / 100);
  2486. var _0xd162x4 = _0xd162x3 / (this.selectBiggestCell ? _0xd162x2.playerMaxMass : _0xd162x2.playerMinMass);
  2487. return _0xd162x4 > 0.76 ? "#FFDC00" : "#C80000";
  2488. }
  2489. return _0xd162x11.virusStrokeColor;
  2490. },
  2491. setOppColor: function(_0xd162x1, _0xd162x3) {
  2492. if (_0xd162x3) {
  2493. return _0xd162x15.color;
  2494. }
  2495. var _0xd162x4 = Math.floor(_0xd162x1 * _0xd162x1 / 100);
  2496. var _0xd162x5 = this.selectBiggestCell ? _0xd162x2.playerMaxMass : _0xd162x2.playerMinMass;
  2497. var _0xd162x6 = _0xd162x4 / _0xd162x5;
  2498. if (_0xd162x6 && _0xd162x6 > 0) {
  2499. var _0xd162x7 = 1E3 > _0xd162x5 ? 0.35 : 0.38;
  2500. return _0xd162x6 > 11 ? "#FF008C" : 2.5 > _0xd162x6 ? 1.25 > _0xd162x6 ? 1.25 > _0xd162x6 && _0xd162x6 > 0.75 ? "#FFDC00" : _0xd162x6 > _0xd162x7 ? "#00C8FF" : "#64FF00" : "#FF0A00" : "#BE00FF";
  2501. }
  2502. },
  2503. connect: function() {
  2504. if (this.closeConnection(), this.flushData(), this.setParty(), ":party" === this.gameMode && this.partyToken.length <= 5) {
  2505. console.log("OGARio by szymy: Connecting to server");
  2506. this.socket = new WebSocket(this.privateMode && this.privateIP ? this.privateIP : this.publicIP);
  2507. this.socket.ogarioWS = true;
  2508. this.socket.binaryType = "arraybuffer";
  2509. var _0xd162x1 = this;
  2510. this.socket.onopen = function() {
  2511. console.log("OGARio by szymy: Socket open");
  2512. var _0xd162x2 = _0xd162x1.createView(3);
  2513. _0xd162x2.setUint8(0, 0);
  2514. _0xd162x2.setUint16(1, 212, true);
  2515. _0xd162x1.sendBuffer(_0xd162x2);
  2516. _0xd162x1.sendPlayerClanTag();
  2517. _0xd162x1.sendPartyToken();
  2518. };
  2519. this.socket.onmessage = function(_0xd162x2) {
  2520. _0xd162x1.handleMessage(_0xd162x2);
  2521. };
  2522. this.socket.onclose = function() {
  2523. _0xd162x1.flushData();
  2524. console.log("OGARio by szymy: Socket close");
  2525. };
  2526. this.socket.onerror = function() {
  2527. _0xd162x1.flushData();
  2528. console.log("OGARio by szymy: Socket error");
  2529. };
  2530. }
  2531. },
  2532. closeConnection: function() {
  2533. if (this.socket) {
  2534. this.socket.onmessage = null;
  2535. try {
  2536. this.socket.close();
  2537. } catch (_0xd162x1) {}
  2538. this.socket = null;
  2539. }
  2540. },
  2541. flushData: function() {
  2542. this.teamPlayers = [];
  2543. this.partys = [];
  2544. this.lastSentNick = "";
  2545. this.lastSentClanTag = null;
  2546. this.lastSentSkinURL = "";
  2547. this.lastSentCustomColor = "";
  2548. this.lastSentPartyToken = "";
  2549. this.customSkinsMap = {};
  2550. _0xd162x2.play = false;
  2551. _0xd162x2.playerColor = null;
  2552. },
  2553. reConnect: function() {
  2554. this.flushData();
  2555. this.setParty();
  2556. var _0xd162x1 = this;
  2557. setTimeout(function() {
  2558. _0xd162x1.connect();
  2559. }, 1E3);
  2560. },
  2561. switchServerMode: function() {
  2562. if (this.privateIP) {
  2563. if (":party" === this.gameMode) {
  2564. this.privateMode = !this.privateMode;
  2565. if (this.isSocketOpen()) {
  2566. this.closeConnection();
  2567. toastr.error("Zamkni\u0119to po\u0142\u0105czenie z serwerem!");
  2568. }
  2569. if (this.privateMode) {
  2570. toastr.info("Prze\u0142\u0105czono na serwer prywatny!");
  2571. _0xd162x3(".party-panel").show();
  2572. } else {
  2573. toastr.info("Prze\u0142\u0105czono na serwer publiczny!");
  2574. _0xd162x3("#activepartys").empty();
  2575. _0xd162x3(".party-panel").hide();
  2576. }
  2577. this.reConnect();
  2578. }
  2579. }
  2580. },
  2581. isSocketOpen: function() {
  2582. return null != this.socket && this.socket.readyState == this.socket.OPEN;
  2583. },
  2584. createView: function(_0xd162x1) {
  2585. return new DataView(new ArrayBuffer(_0xd162x1));
  2586. },
  2587. strToBuff: function(_0xd162x1, _0xd162x2) {
  2588. var _0xd162x3 = this.createView(1 + 2 * _0xd162x2.length);
  2589. _0xd162x3.setUint8(0, _0xd162x1);
  2590. var _0xd162x4 = 0;
  2591. for (; _0xd162x4 < _0xd162x2.length; _0xd162x4++) {
  2592. _0xd162x3.setUint16(1 + 2 * _0xd162x4, _0xd162x2.charCodeAt(_0xd162x4), true);
  2593. }
  2594. return _0xd162x3;
  2595. },
  2596. sendBuffer: function(_0xd162x1) {
  2597. this.socket.send(_0xd162x1.buffer);
  2598. },
  2599. handleMessage: function(_0xd162x1) {
  2600. this.readMessage(new DataView(_0xd162x1.data));
  2601. },
  2602. readMessage: function(_0xd162x1) {
  2603. switch (_0xd162x1.getUint8(0)) {
  2604. case 0:
  2605. this.playerID = _0xd162x1.getUint32(1, true);
  2606. break;
  2607. case 1:
  2608. this.sendPlayerUpdate();
  2609. break;
  2610. case 20:
  2611. this.updateTeamPlayer(_0xd162x1);
  2612. break;
  2613. case 30:
  2614. this.updateTeamPlayerPosition(_0xd162x1);
  2615. break;
  2616. case 96:
  2617. this.updatePartys(_0xd162x1);
  2618. this.displayPartys();
  2619. break;
  2620. case 100:
  2621. if (!_0xd162x16.hideChat) {
  2622. this.readChatMessage(_0xd162x1);
  2623. };
  2624. }
  2625. },
  2626. sendPlayerState: function(_0xd162x1) {
  2627. if (this.isSocketOpen()) {
  2628. view = this.createView(1);
  2629. view.setUint8(0, _0xd162x1);
  2630. this.sendBuffer(view);
  2631. }
  2632. },
  2633. sendPlayerSpawn: function() {
  2634. this.sendPlayerState(1);
  2635. },
  2636. sendPlayerDeath: function() {
  2637. this.sendPlayerState(2);
  2638. },
  2639. sendPlayerJoin: function() {
  2640. this.sendPlayerState(3);
  2641. },
  2642. sendPlayerData: function(_0xd162x1, _0xd162x2, _0xd162x3) {
  2643. if (null === this[_0xd162x2] || this[_0xd162x2] !== _0xd162x3) {
  2644. if (this.isSocketOpen()) {
  2645. this.sendBuffer(this.strToBuff(_0xd162x1, _0xd162x3));
  2646. this[_0xd162x2] = _0xd162x3;
  2647. }
  2648. }
  2649. },
  2650. sendPlayerNick: function() {
  2651. this.sendPlayerData(10, "lastSentNick", _0xd162x15.nick);
  2652. },
  2653. sendPlayerClanTag: function() {
  2654. this.sendPlayerData(11, "lastSentClanTag", _0xd162x15.clanTag);
  2655. },
  2656. sendPlayerSkinURL: function() {
  2657. this.sendPlayerData(12, "lastSentSkinURL", _0xd162x15.skinURL);
  2658. },
  2659. sendPlayerCustomColor: function() {
  2660. this.sendPlayerData(13, "lastSentCustomColor", _0xd162x15.color);
  2661. },
  2662. sendPlayerColor: function() {
  2663. if (this.isSocketOpen()) {
  2664. if (_0xd162x2.playerColor) {
  2665. this.sendBuffer(this.strToBuff(14, _0xd162x2.playerColor));
  2666. }
  2667. }
  2668. },
  2669. sendPartyToken: function() {
  2670. this.setParty();
  2671. this.sendPlayerData(15, "lastSentPartyToken", this.partyToken);
  2672. },
  2673. sendPlayerUpdate: function() {
  2674. function _0xd162x1(_0xd162x1) {
  2675. var _0xd162x2 = 0;
  2676. for (; _0xd162x2 < _0xd162x1.length; _0xd162x2++) {
  2677. _0xd162x4.setUint16(_0xd162x5, _0xd162x1.charCodeAt(_0xd162x2), true);
  2678. _0xd162x5 += 2;
  2679. }
  2680. _0xd162x4.setUint16(_0xd162x5, 0, true);
  2681. _0xd162x5 += 2;
  2682. }
  2683. if (this.isSocketOpen() && (this.playerID && (_0xd162x2.play && _0xd162x2.playerColor))) {
  2684. var _0xd162x3 = 41;
  2685. _0xd162x3 += 2 * _0xd162x15.nick.length;
  2686. _0xd162x3 += 2 * _0xd162x15.skinURL.length;
  2687. var _0xd162x4 = this.createView(_0xd162x3);
  2688. _0xd162x4.setUint8(0, 20);
  2689. _0xd162x4.setUint32(1, this.playerID, true);
  2690. var _0xd162x5 = 5;
  2691. _0xd162x1(_0xd162x15.nick);
  2692. _0xd162x1(_0xd162x15.skinURL);
  2693. _0xd162x1(_0xd162x15.color);
  2694. _0xd162x1(_0xd162x2.playerColor);
  2695. this.sendBuffer(_0xd162x4);
  2696. }
  2697. },
  2698. sendPlayerPosition: function() {
  2699. if (this.isSocketOpen() && (_0xd162x2.play && this.playerID)) {
  2700. var _0xd162x1 = this.createView(17);
  2701. _0xd162x1.setUint8(0, 30);
  2702. _0xd162x1.setUint32(1, this.playerID, true);
  2703. _0xd162x1.setInt32(5, this.getPlayerX(), true);
  2704. _0xd162x1.setInt32(9, this.getPlayerY(), true);
  2705. if (void 0 !== _0xd162x2.playerMass) {
  2706. _0xd162x1.setUint32(13, _0xd162x2.playerMass, true);
  2707. } else {
  2708. _0xd162x1.setUint32(13, this.playerMass, true);
  2709. }
  2710. this.sendBuffer(_0xd162x1);
  2711. }
  2712. },
  2713. checkPlayerID: function(_0xd162x1) {
  2714. var _0xd162x2 = 0;
  2715. for (; _0xd162x2 < this.teamPlayers.length; _0xd162x2++) {
  2716. if (this.teamPlayers[_0xd162x2].id == _0xd162x1) {
  2717. return _0xd162x2;
  2718. }
  2719. }
  2720. return null;
  2721. },
  2722. updateTeamPlayer: function(_0xd162x1) {
  2723. function _0xd162x2() {
  2724. var _0xd162x2 = "";
  2725. for (;;) {
  2726. var _0xd162x3 = _0xd162x1.getUint16(_0xd162x4, true);
  2727. if (0 == _0xd162x3) {
  2728. break;
  2729. }
  2730. _0xd162x2 += String.fromCharCode(_0xd162x3);
  2731. _0xd162x4 += 2;
  2732. }
  2733. return _0xd162x4 += 2, _0xd162x2;
  2734. }
  2735. var _0xd162x3 = _0xd162x1.getUint32(1, true);
  2736. var _0xd162x4 = 5;
  2737. var _0xd162x6 = _0xd162x2();
  2738. var _0xd162x7 = _0xd162x2();
  2739. var _0xd162x8 = _0xd162x2();
  2740. var _0xd162x9 = _0xd162x2();
  2741. var _0xd162xa = this.checkPlayerID(_0xd162x3);
  2742. if (null !== _0xd162xa) {
  2743. this.teamPlayers[_0xd162xa].nick = _0xd162x6;
  2744. this.teamPlayers[_0xd162xa].skinID = _0xd162x6 + _0xd162x9;
  2745. this.teamPlayers[_0xd162xa].skinURL = _0xd162x7;
  2746. this.teamPlayers[_0xd162xa].color = _0xd162x8;
  2747. } else {
  2748. var _0xd162xb = new _0xd162x5(_0xd162x3, _0xd162x6, _0xd162x6 + _0xd162x9, _0xd162x7, _0xd162x8);
  2749. this.teamPlayers.push(_0xd162xb);
  2750. }
  2751. this.cacheCustomSkin(_0xd162x6 + _0xd162x9, _0xd162x7);
  2752. },
  2753. updateTeamPlayerPosition: function(_0xd162x1) {
  2754. var _0xd162x2 = _0xd162x1.getUint32(1, true);
  2755. var _0xd162x3 = this.checkPlayerID(_0xd162x2);
  2756. if (null !== _0xd162x3) {
  2757. this.teamPlayers[_0xd162x3].x = _0xd162x1.getInt32(5, true);
  2758. this.teamPlayers[_0xd162x3].y = _0xd162x1.getInt32(9, true);
  2759. this.teamPlayers[_0xd162x3].mass = _0xd162x1.getUint32(13, true);
  2760. this.teamPlayers[_0xd162x3].alive = true;
  2761. this.teamPlayers[_0xd162x3].updateTime = Date.now();
  2762. }
  2763. },
  2764. updateTeamPlayers: function() {
  2765. if (":party" === this.gameMode) {
  2766. this.sendPlayerPosition();
  2767. var _0xd162x1 = 0;
  2768. for (; _0xd162x1 < this.teamPlayers.length; _0xd162x1++) {
  2769. if (this.teamPlayers[_0xd162x1].alive && Date.now() - this.teamPlayers[_0xd162x1].updateTime >= 2E3 || 0 == this.teamPlayers[_0xd162x1].mass) {
  2770. this.teamPlayers[_0xd162x1].alive = false;
  2771. }
  2772. }
  2773. this.teamPlayers.sort(function(_0xd162x1, _0xd162x2) {
  2774. return _0xd162x2.mass - _0xd162x1.mass;
  2775. });
  2776. this.top5 = [];
  2777. _0xd162x1 = 0;
  2778. for (; _0xd162x1 < this.teamPlayers.length && (!this.teamPlayers[_0xd162x1].alive || (this.top5.push({
  2779. nick: this.teamPlayers[_0xd162x1].nick,
  2780. mass: this.teamPlayers[_0xd162x1].mass
  2781. }), 5 != this.top5.length)); _0xd162x1++) {}
  2782. this.displayTop5();
  2783. }
  2784. },
  2785. updatePartys: function(_0xd162x1) {
  2786. this.partys = [];
  2787. var _0xd162x2 = _0xd162x1.getUint8(1);
  2788. var _0xd162x3 = 2;
  2789. var _0xd162x4 = 0;
  2790. for (; _0xd162x2 > _0xd162x4; _0xd162x4++) {
  2791. var _0xd162x5 = "";
  2792. for (;;) {
  2793. var _0xd162x6 = _0xd162x1.getUint16(_0xd162x3, true);
  2794. if (0 == _0xd162x6) {
  2795. break;
  2796. }
  2797. _0xd162x5 += String.fromCharCode(_0xd162x6);
  2798. _0xd162x3 += 2;
  2799. }
  2800. _0xd162x3 += 2;
  2801. this.partys.push(_0xd162x5);
  2802. }
  2803. },
  2804. readChatMessage: function(_0xd162x1) {
  2805. var _0xd162x2 = _0xd162x1.getUint8(1);
  2806. var _0xd162x4 = "";
  2807. var _0xd162x5 = 2;
  2808. for (; _0xd162x5 < _0xd162x1.byteLength; _0xd162x5 += 2) {
  2809. var _0xd162x6 = _0xd162x1.getUint16(_0xd162x5, true);
  2810. if (0 == _0xd162x6) {
  2811. break;
  2812. }
  2813. _0xd162x4 += String.fromCharCode(_0xd162x6);
  2814. }
  2815. var _0xd162x7 = this.escapeHTML(_0xd162x4);
  2816. if (_0xd162x7.length > 0) {
  2817. var _0xd162x8 = _0xd162x7.split(": ", 1);
  2818. _0xd162x7 = _0xd162x7.replace(_0xd162x8 + ": ", "");
  2819. if (101 == _0xd162x2) {
  2820. toastr.success('<span class="message-nick main-color">' + _0xd162x8 + ": </span>" + _0xd162x7);
  2821. this.chatHistory.push({
  2822. nick: _0xd162x8,
  2823. message: _0xd162x7
  2824. });
  2825. if (this.chatHistory.length > 15) {
  2826. this.chatHistory.splice(0, 1);
  2827. }
  2828. } else {
  2829. if (102 == _0xd162x2) {
  2830. toastr.warning(_0xd162x8 + ": " + _0xd162x7);
  2831. } else {
  2832. _0xd162x3("#messages").append(_0xd162x4);
  2833. }
  2834. }
  2835. }
  2836. },
  2837. sendChatMessage: function(_0xd162x1, _0xd162x2) {
  2838. if (Date.now() - this.lastMessageSentTime >= 500 && (0 != _0xd162x2.length && (0 != _0xd162x15.nick.length && this.isSocketOpen()))) {
  2839. _0xd162x2 = _0xd162x15.nick + ": " + _0xd162x2;
  2840. var _0xd162x3 = this.createView(2 + 2 * _0xd162x2.length);
  2841. _0xd162x3.setUint8(0, 100);
  2842. _0xd162x3.setUint8(1, _0xd162x1);
  2843. var _0xd162x4 = 0;
  2844. for (; _0xd162x4 < _0xd162x2.length; _0xd162x4++) {
  2845. _0xd162x3.setUint16(2 + 2 * _0xd162x4, _0xd162x2.charCodeAt(_0xd162x4), true);
  2846. }
  2847. this.sendBuffer(_0xd162x3);
  2848. this.lastMessageSentTime = Date.now();
  2849. }
  2850. },
  2851. prepareCommand: function(_0xd162x1) {
  2852. var _0xd162x2 = _0xd162x1.replace("%currentSector%", this.currentSector);
  2853. return _0xd162x2;
  2854. },
  2855. sendCommand: function(_0xd162x1) {
  2856. var _0xd162x2 = this.prepareCommand(_0xd162xe["comm" + _0xd162x1]);
  2857. this.sendChatMessage(102, _0xd162x2);
  2858. },
  2859. init: function() {
  2860. this.loadSettings();
  2861. this.loadProfiles();
  2862. this.setMenu();
  2863. if (_0xd162x12) {
  2864. _0xd162x12.setTheme();
  2865. }
  2866. this.setProfile();
  2867. this.setButtons();
  2868. this.setStreamMode();
  2869. this.setHideSkinUrl();
  2870. this.setMiniMap();
  2871. this.setTop5();
  2872. this.displayTime();
  2873. this.displayStats();
  2874. this.preDrawIndicator();
  2875. var _0xd162x1 = this;
  2876. setInterval(function() {
  2877. _0xd162x1.drawMiniMap();
  2878. }, 33);
  2879. setInterval(function() {
  2880. _0xd162x1.updateTeamPlayers();
  2881. }, this.updateInterval);
  2882. }
  2883. };
  2884. window. _0xd162x17 = new _0xd162x6;
  2885. _0xd162x17.init();
  2886. _0xd162x7();
  2887. _0xd162x8();
  2888. _0xd162x1.addEventListener("resize", function() {
  2889. setTimeout(_0xd162x9, 50);
  2890. }, false);
  2891. _0xd162x1.onbeforeunload = _0xd162xa;
  2892. _0xd162x1.setSettings = function(_0xd162x1, _0xd162x4) {
  2893. if (_0xd162x16.hasOwnProperty(_0xd162x1) && null !== _0xd162x4) {
  2894. switch (_0xd162x16[_0xd162x1] = _0xd162x4, _0xd162x2.hasOwnProperty(_0xd162x1) && (_0xd162x2[_0xd162x1] = _0xd162x4), _0xd162x1) {
  2895. case "showMiniMap":
  2896. _0xd162x17.setMiniMap();
  2897. break;
  2898. case "showTop5":
  2899. _0xd162x17.setTop5();
  2900. break;
  2901. case "showTime":
  2902. _0xd162x17.displayTime();
  2903. _0xd162x3("#time-hud").show();
  2904. break;
  2905. case "showStats":
  2906. _0xd162x17.displayStats();
  2907. _0xd162x3("#stats-hud").show();
  2908. }
  2909. _0xd162x17.saveSettings(_0xd162x16, "ogarioSettings");
  2910. }
  2911. };
  2912. _0xd162x2.displayLeaderboard = function() {
  2913. _0xd162x17.displayLeaderboard(_0xd162x2.leaderboardHTML);
  2914. };
  2915. _0xd162x2.customDraw = function(_0xd162x1) {
  2916. if (_0xd162x1) {
  2917. _0xd162x17.countFPS();
  2918. var _0xd162x3 = Math.floor(_0xd162x2.mapMinX - _0xd162x2.mapOffsetX);
  2919. var _0xd162x4 = Math.floor(_0xd162x2.mapMinY - _0xd162x2.mapOffsetY);
  2920. var _0xd162x5 = Math.floor(_0xd162x2.mapMaxX - _0xd162x2.mapOffsetX);
  2921. var _0xd162x6 = Math.floor(_0xd162x2.mapMaxY - _0xd162x2.mapOffsetY);
  2922. var _0xd162x7 = _0xd162x11.bordersWidth / 2;
  2923. if (_0xd162x17.drawSectors(_0xd162x1, _0xd162x11.sectorsX, _0xd162x11.sectorsY, _0xd162x3, _0xd162x4, _0xd162x5, _0xd162x6, _0xd162x11.gridColor, _0xd162x11.sectorsWidth, true), _0xd162x17.drawMapBorders(_0xd162x1, _0xd162x3 - _0xd162x7, _0xd162x4 - _0xd162x7, _0xd162x5 + _0xd162x7, _0xd162x6 + _0xd162x7, _0xd162x11.bordersColor, _0xd162x11.bordersWidth), _0xd162x2.virusesCache && _0xd162x2.virusesCache.length > 0) {
  2924. _0xd162x1.beginPath();
  2925. var _0xd162x8 = 0;
  2926. for (; _0xd162x8 < _0xd162x2.virusesCache.length; _0xd162x8++) {
  2927. var _0xd162x9 = _0xd162x2.virusesCache[_0xd162x8].x;
  2928. var _0xd162xa = _0xd162x2.virusesCache[_0xd162x8].y;
  2929. _0xd162x1.moveTo(_0xd162x9, _0xd162xa);
  2930. _0xd162x1.arc(_0xd162x9, _0xd162xa, _0xd162x2.virusesCache[_0xd162x8].size + 820, 0, _0xd162x17.pi2, false);
  2931. }
  2932. _0xd162x1.fillStyle = _0xd162x11.virusColor;
  2933. _0xd162x1.globalAlpha = 0.1;
  2934. _0xd162x1.fill();
  2935. _0xd162x1.globalAlpha = 1;
  2936. _0xd162x2.virusesCache = [];
  2937. }
  2938. if (_0xd162x2.foodCache && _0xd162x2.foodCache.length > 0) {
  2939. _0xd162x1.beginPath();
  2940. _0xd162x8 = 0;
  2941. for (; _0xd162x8 < _0xd162x2.foodCache.length; _0xd162x8++) {
  2942. _0xd162x9 = _0xd162x2.foodCache[_0xd162x8].x;
  2943. _0xd162xa = _0xd162x2.foodCache[_0xd162x8].y;
  2944. if (_0xd162x1.moveTo(_0xd162x9, _0xd162xa), _0xd162x2.viewScale < 0.16) {
  2945. var _0xd162xb = _0xd162x2.foodCache[_0xd162x8].size + 4;
  2946. _0xd162x1.rect(_0xd162x9 - _0xd162xb, _0xd162xa - _0xd162xb, 2 * _0xd162xb, 2 * _0xd162xb);
  2947. } else {
  2948. _0xd162x1.arc(_0xd162x9, _0xd162xa, _0xd162x2.foodCache[_0xd162x8].size + 5, 0, _0xd162x17.pi2, false);
  2949. }
  2950. }
  2951. _0xd162x1.fillStyle = _0xd162x11.foodColor;
  2952. _0xd162x1.globalAlpha = 1;
  2953. _0xd162x1.fill();
  2954. _0xd162x2.foodCache = [];
  2955. }
  2956. if (_0xd162x2.play) {
  2957. if (_0xd162x16.splitRange) {
  2958. if (_0xd162x2.playerCells && _0xd162x2.playerCells.length > 0) {
  2959. _0xd162x2.playerCells.sort(function(_0xd162x1, _0xd162x2) {
  2960. return _0xd162x2.size - _0xd162x1.size;
  2961. });
  2962. var _0xd162xc = _0xd162x17.selectBiggestCell ? 0 : _0xd162x2.playerCells.length - 1;
  2963. _0xd162x1.lineWidth = 6;
  2964. _0xd162x1.globalAlpha = _0xd162x11.darkTheme ? 0.7 : 0.35;
  2965. _0xd162x1.strokeStyle = _0xd162x11.darkTheme ? "#FFFFFF" : "#000000";
  2966. _0xd162x1.beginPath();
  2967. _0xd162x1.arc(_0xd162x2.playerCells[_0xd162xc].x, _0xd162x2.playerCells[_0xd162xc].y, _0xd162x2.playerCells[_0xd162xc].size + 760, 0, _0xd162x17.pi2, false);
  2968. _0xd162x1.closePath();
  2969. _0xd162x1.stroke();
  2970. }
  2971. _0xd162x1.globalAlpha = 1;
  2972. _0xd162x17.drawCircle(_0xd162x1, _0xd162x2.biggerSTECellsCache, 760, 4, 0.4, "#BE00FF");
  2973. }
  2974. if (_0xd162x16.oppRings) {
  2975. var _0xd162xd = 14 + 2 / _0xd162x2.viewScale;
  2976. var _0xd162xe = 12 + 1 / _0xd162x2.viewScale;
  2977. _0xd162x17.drawCircle(_0xd162x1, _0xd162x2.biggerSTECellsCache, _0xd162xd, _0xd162xe, 0.75, "#BE00FF");
  2978. _0xd162x17.drawCircle(_0xd162x1, _0xd162x2.biggerCellsCache, _0xd162xd, _0xd162xe, 0.75, "#FF0A00");
  2979. _0xd162x17.drawCircle(_0xd162x1, _0xd162x2.smallerCellsCache, _0xd162xd, _0xd162xe, 0.75, "#00C8FF");
  2980. _0xd162x17.drawCircle(_0xd162x1, _0xd162x2.STECellsCache, _0xd162xd, _0xd162xe, 0.75, "#64FF00");
  2981. }
  2982. if (_0xd162x16.cursorTracking && _0xd162x2.setCursorPosition) {
  2983. _0xd162x2.setCursorPosition();
  2984. _0xd162x1.lineWidth = 4;
  2985. _0xd162x1.globalAlpha = _0xd162x11.darkTheme ? 0.75 : 0.35;
  2986. _0xd162x1.strokeStyle = _0xd162x11.darkTheme ? "#FFFFFF" : "#000000";
  2987. _0xd162x1.beginPath();
  2988. _0xd162x8 = 0;
  2989.  
  2990. for (; _0xd162x8 < _0xd162x2.playerCells.length; _0xd162x8++) {
  2991. _0xd162x1.moveTo(_0xd162x2.playerCells[_0xd162x8].x, _0xd162x2.playerCells[_0xd162x8].y);
  2992. _0xd162x1.lineTo(_0xd162x2.cursorX, _0xd162x2.cursorY);
  2993. }
  2994. _0xd162x1.stroke();
  2995. _0xd162x1.globalAlpha = 1;
  2996. }
  2997. }
  2998. _0xd162x2.playerCells = [];
  2999. if (_0xd162x16.splitRange || _0xd162x16.oppRings) {
  3000. _0xd162x2.biggerSTECellsCache = [];
  3001. _0xd162x2.biggerCellsCache = [];
  3002. _0xd162x2.smallerCellsCache = [];
  3003. _0xd162x2.STECellsCache = [];
  3004. }
  3005. }
  3006. };
  3007. _0xd162x2.drawGrid = function(_0xd162x1) {
  3008. _0xd162x17.drawGrid(_0xd162x1);
  3009. };
  3010. _0xd162x2.getCustomSkin = function(_0xd162x1, _0xd162x2) {
  3011. return _0xd162x17.getCustomSkin(_0xd162x1, _0xd162x2);
  3012. };
  3013. _0xd162x2.setVirusColor = function(_0xd162x1) {
  3014. return _0xd162x17.setVirusColor(_0xd162x1);
  3015. };
  3016. _0xd162x2.setVirusStrokeColor = function(_0xd162x1) {
  3017. return _0xd162x17.setVirusStrokeColor(_0xd162x1);
  3018. };
  3019. _0xd162x2.setOppColor = function(_0xd162x1, _0xd162x2) {
  3020. return _0xd162x17.setOppColor(_0xd162x1, _0xd162x2);
  3021. };
  3022. var _0xd162x18 = {};
  3023. var _0xd162x19 = {};
  3024. var _0xd162x1a = {
  3025. "hk-feed": {
  3026. label: _0xd162xd[_0xd162xc]["hk-feed"],
  3027. defaultKey: "W",
  3028. keyDown: function() {
  3029. if (_0xd162x17) {
  3030. _0xd162x17.feed();
  3031. }
  3032. },
  3033. keyUp: null,
  3034. type: "normal"
  3035. },
  3036. "hk-macroFeed": {
  3037. label: _0xd162xd[_0xd162xc]["hk-macroFeed"],
  3038. defaultKey: "W",
  3039. keyDown: function() {
  3040. if (_0xd162x17) {
  3041. _0xd162x17.macroFeed(true);
  3042. }
  3043. },
  3044. keyUp: function() {
  3045. if (_0xd162x17) {
  3046. _0xd162x17.macroFeed(false);
  3047. }
  3048. },
  3049. type: "normal"
  3050. },
  3051. "hk-splitBots": {
  3052. label: "Split Bots",
  3053. defaultKey: "E",
  3054. if (_0xd162x17) {
  3055. ubot.splitBots();
  3056. }
  3057. },
  3058. "hk-ejectBots": {
  3059. label: "Eject Bots",
  3060. defaultKey: "R",
  3061. if (_0xd162x17) {
  3062. ubot.ejectBots();
  3063. }
  3064. },
  3065. "hk-collectPellets": {
  3066. label:"Collect Pellets",
  3067. defaultKey: "P",
  3068. if (_0xd162x17) {
  3069. ubot.sendCollectPellets();
  3070. }
  3071. },
  3072. "hk-split": {
  3073. label: _0xd162xd[_0xd162xc]["hk-split"],
  3074. defaultKey: "SPACE",
  3075. keyDown: function() {
  3076. if (_0xd162x17) {
  3077. _0xd162x17.split();
  3078. }
  3079. },
  3080. keyUp: null,
  3081. type: "normal"
  3082. },
  3083. "hk-doubleSplit": {
  3084. label: _0xd162xd[_0xd162xc]["hk-doubleSplit"],
  3085. defaultKey: "Q",
  3086. keyDown: function() {
  3087. if (_0xd162x17) {
  3088. _0xd162x17.doubleSplit();
  3089. }
  3090. },
  3091. keyUp: null,
  3092. type: "normal"
  3093. },
  3094. "hk-popSplit": {
  3095. label: "Popsplit",
  3096. defaultKey: "ALT+Q",
  3097. keyDown: function() {
  3098. if (_0xd162x17) {
  3099. _0xd162x17.popSplit();
  3100. }
  3101. },
  3102. keyUp: null,
  3103. type: "normal"
  3104. },
  3105. "hk-split16": {
  3106. label: _0xd162xd[_0xd162xc]["hk-split16"],
  3107. defaultKey: "SHIFT",
  3108. keyDown: function() {
  3109. if (_0xd162x17) {
  3110. _0xd162x17.split16();
  3111. }
  3112. },
  3113. keyUp: null,
  3114. type: "normal"
  3115. },
  3116. "hk-pause": {
  3117. label: _0xd162xd[_0xd162xc]["hk-pause"],
  3118. defaultKey: "S",
  3119. keyDown: function() {
  3120. if (_0xd162x17) {
  3121. _0xd162x17.setPause();
  3122. }
  3123. },
  3124. keyUp: null,
  3125. type: "normal"
  3126. },
  3127. "hk-showTop5": {
  3128. label: _0xd162xd[_0xd162xc]["hk-showTop5"],
  3129. defaultKey: "T",
  3130. keyDown: function() {
  3131. if (_0xd162x17) {
  3132. _0xd162x17.setShowTop5();
  3133. }
  3134. },
  3135. keyUp: null,
  3136. type: "normal"
  3137. },
  3138. "hk-showTime": {
  3139. label: _0xd162xd[_0xd162xc]["hk-showTime"],
  3140. defaultKey: "ALT+T",
  3141. keyDown: function() {
  3142. if (_0xd162x17) {
  3143. _0xd162x17.setShowTime();
  3144. }
  3145. },
  3146. keyUp: null,
  3147. type: "normal"
  3148. },
  3149. "hk-showSplitRange": {
  3150. label: _0xd162xd[_0xd162xc]["hk-showSplitRange"],
  3151. defaultKey: "U",
  3152. keyDown: function() {
  3153. if (_0xd162x17) {
  3154. _0xd162x17.setShowSplitRange();
  3155. }
  3156. },
  3157. keyUp: null,
  3158. type: "normal"
  3159. },
  3160. "hk-showSplitInd": {
  3161. label: _0xd162xd[_0xd162xc]["hk-showSplitInd"],
  3162. defaultKey: "I",
  3163. keyDown: function() {
  3164. if (_0xd162x17) {
  3165. _0xd162x17.setShowSplitInd();
  3166. }
  3167. },
  3168. keyUp: null,
  3169. type: "normal"
  3170. },
  3171. "hk-showTeammatesInd": {
  3172. label: _0xd162xd[_0xd162xc]["hk-showTeammatesInd"],
  3173. defaultKey: "ALT+I",
  3174. keyDown: function() {
  3175. if (_0xd162x17) {
  3176. _0xd162x17.setShowTeammatesInd();
  3177. }
  3178. },
  3179. keyUp: null,
  3180. type: "normal"
  3181. },
  3182. "hk-showOppColors": {
  3183. label: _0xd162xd[_0xd162xc]["hk-showOppColors"],
  3184. defaultKey: "O",
  3185. keyDown: function() {
  3186. if (_0xd162x17) {
  3187. _0xd162x17.setShowOppColors();
  3188. }
  3189. },
  3190. keyUp: null,
  3191. type: "normal"
  3192. },
  3193. "hk-toggleSkins": {
  3194. label: _0xd162xd[_0xd162xc]["hk-toggleSkins"],
  3195. defaultKey: "A",
  3196. keyDown: function() {
  3197. if (_0xd162x17) {
  3198. _0xd162x17.toggleSkins();
  3199. }
  3200. },
  3201. keyUp: null,
  3202. type: "normal"
  3203. },
  3204. "hk-showSkins": {
  3205. label: _0xd162xd[_0xd162xc]["hk-showSkins"],
  3206. defaultKey: "S",
  3207. keyDown: function() {
  3208. if (_0xd162x17) {
  3209. _0xd162x17.setShowSkins();
  3210. }
  3211. },
  3212. keyUp: null,
  3213. type: "normal"
  3214. },
  3215. "hk-showStats": {
  3216. label: _0xd162xd[_0xd162xc]["hk-showStats"],
  3217. defaultKey: "ALT+S",
  3218. keyDown: function() {
  3219. if (_0xd162x17) {
  3220. _0xd162x17.setShowStats();
  3221. }
  3222. },
  3223. keyUp: null,
  3224. type: "normal"
  3225. },
  3226. "hk-toggleCells": {
  3227. label: _0xd162xd[_0xd162xc]["hk-toggleCells"],
  3228. defaultKey: "D",
  3229. keyDown: function() {
  3230. if (_0xd162x17) {
  3231. _0xd162x17.toggleCells();
  3232. }
  3233. },
  3234. keyUp: null,
  3235. type: "normal"
  3236. },
  3237. "hk-showFood": {
  3238. label: _0xd162xd[_0xd162xc]["hk-showFood"],
  3239. defaultKey: "F",
  3240. keyDown: function() {
  3241. if (_0xd162x17) {
  3242. _0xd162x17.setShowFood();
  3243. }
  3244. },
  3245. keyUp: null,
  3246. type: "normal"
  3247. },
  3248. "hk-showGrid": {
  3249. label: _0xd162xd[_0xd162xc]["hk-showGrid"],
  3250. defaultKey: "G",
  3251. keyDown: function() {
  3252. if (_0xd162x17) {
  3253. _0xd162x17.setShowGrid();
  3254. }
  3255. },
  3256. keyUp: null,
  3257. type: "normal"
  3258. },
  3259. "hk-showMiniMapGuides": {
  3260. label: _0xd162xd[_0xd162xc]["hk-showMiniMapGuides"],
  3261. defaultKey: "ALT+G",
  3262. keyDown: function() {
  3263. if (_0xd162x17) {
  3264. _0xd162x17.setShowMiniMapGuides();
  3265. }
  3266. },
  3267. keyUp: null,
  3268. type: "normal"
  3269. },
  3270. "hk-hideChat": {
  3271. label: _0xd162xd[_0xd162xc]["hk-hideChat"],
  3272. defaultKey: "H",
  3273. keyDown: function() {
  3274. if (_0xd162x17) {
  3275. _0xd162x17.hideChat();
  3276. }
  3277. },
  3278. keyUp: null,
  3279. type: "normal"
  3280. },
  3281. "hk-showHUD": {
  3282. label: _0xd162xd[_0xd162xc]["hk-showHUD"],
  3283. defaultKey: "ALT+H",
  3284. keyDown: function() {
  3285. if (_0xd162x17) {
  3286. _0xd162x17.setShowHUD();
  3287. }
  3288. },
  3289. keyUp: null,
  3290. type: "normal"
  3291. },
  3292. "hk-copyLb": {
  3293. label: _0xd162xd[_0xd162xc]["hk-copyLb"],
  3294. defaultKey: "L",
  3295. keyDown: function() {
  3296. if (_0xd162x17) {
  3297. _0xd162x17.copyLb();
  3298. }
  3299. },
  3300. keyUp: null,
  3301. type: "normal"
  3302. },
  3303. "hk-showLb": {
  3304. label: _0xd162xd[_0xd162xc]["hk-showLb"],
  3305. defaultKey: "ALT+L",
  3306. keyDown: function() {
  3307. if (_0xd162x17) {
  3308. _0xd162x17.setShowLb();
  3309. }
  3310. },
  3311. keyUp: null,
  3312. type: "normal"
  3313. },
  3314. "hk-resetZoom": {
  3315. label: _0xd162xd[_0xd162xc]["hk-resetZoom"],
  3316. defaultKey: "Z",
  3317. keyDown: function() {
  3318. if (_0xd162x17) {
  3319. _0xd162x17.resetZoom(true);
  3320. }
  3321. },
  3322. keyUp: function() {
  3323. if (_0xd162x17) {
  3324. _0xd162x17.resetZoom(false);
  3325. }
  3326. },
  3327. type: "normal"
  3328. },
  3329. "hk-toggleDeath": {
  3330. label: _0xd162xd[_0xd162xc]["hk-toggleDeath"],
  3331. defaultKey: "X",
  3332. keyDown: function() {
  3333. if (_0xd162x17) {
  3334. _0xd162x17.toggleDeath();
  3335. }
  3336. },
  3337. keyUp: null,
  3338. type: "normal"
  3339. },
  3340. "hk-clearChat": {
  3341. label: _0xd162xd[_0xd162xc]["hk-clearChat"],
  3342. defaultKey: "C",
  3343. keyDown: function() {
  3344. if (_0xd162x17) {
  3345. _0xd162x17.displayChatHistory(true);
  3346. }
  3347. },
  3348. keyUp: function() {
  3349. if (_0xd162x17) {
  3350. _0xd162x17.displayChatHistory(false);
  3351. }
  3352. },
  3353. type: "normal"
  3354. },
  3355. "hk-showBgSectors": {
  3356. label: _0xd162xd[_0xd162xc]["hk-showBgSectors"],
  3357. defaultKey: "B",
  3358. keyDown: function() {
  3359. if (_0xd162x17) {
  3360. _0xd162x17.setShowBgSectors();
  3361. }
  3362. },
  3363. keyUp: null,
  3364. type: "normal"
  3365. },
  3366. "hk-hideBots": {
  3367. label: _0xd162xd[_0xd162xc]["hk-hideBots"],
  3368. defaultKey: "ALT+B",
  3369. keyDown: function() {
  3370. if (_0xd162x17) {
  3371. _0xd162x17.setHideSmallBots();
  3372. }
  3373. },
  3374. keyUp: null,
  3375. type: "normal"
  3376. },
  3377. "hk-showNames": {
  3378. label: _0xd162xd[_0xd162xc]["hk-showNames"],
  3379. defaultKey: "N",
  3380. keyDown: function() {
  3381. if (_0xd162x17) {
  3382. _0xd162x17.setShowNames();
  3383. }
  3384. },
  3385. keyUp: null,
  3386. type: "normal"
  3387. },
  3388. "hk-showMass": {
  3389. label: _0xd162xd[_0xd162xc]["hk-showMass"],
  3390. defaultKey: "M",
  3391. keyDown: function() {
  3392. if (_0xd162x17) {
  3393. _0xd162x17.setShowMass();
  3394. }
  3395. },
  3396. keyUp: null,
  3397. type: "normal"
  3398. },
  3399. "hk-showMiniMap": {
  3400. label: _0xd162xd[_0xd162xc]["hk-showMiniMap"],
  3401. defaultKey: "ALT+M",
  3402. keyDown: function() {
  3403. if (_0xd162x17) {
  3404. _0xd162x17.setShowMiniMap();
  3405. }
  3406. },
  3407. keyUp: null,
  3408. type: "normal"
  3409. },
  3410. "hk-chatMessage": {
  3411. label: _0xd162xd[_0xd162xc]["hk-chatMessage"],
  3412. defaultKey: "ENTER",
  3413. keyDown: function() {
  3414. if (_0xd162x17) {
  3415. _0xd162x17.enterChatMessage();
  3416. }
  3417. },
  3418. keyUp: null,
  3419. type: "special"
  3420. },
  3421. "hk-quickResp": {
  3422. label: _0xd162xd[_0xd162xc]["hk-quickResp"],
  3423. defaultKey: "TILDE",
  3424. keyDown: function() {
  3425. if (_0xd162x17) {
  3426. _0xd162x17.quickResp();
  3427. }
  3428. },
  3429. keyUp: null,
  3430. type: "normal"
  3431. },
  3432. "hk-zoom1": {
  3433. label: _0xd162xd[_0xd162xc]["hk-zoomLevel"] + " 1",
  3434. defaultKey: "ALT+1",
  3435. keyDown: function() {
  3436. if (_0xd162x17) {
  3437. _0xd162x17.setZoom(0.5);
  3438. }
  3439. },
  3440. keyUp: null,
  3441. type: "normal"
  3442. },
  3443. "hk-zoom2": {
  3444. label: _0xd162xd[_0xd162xc]["hk-zoomLevel"] + " 2",
  3445. defaultKey: "ALT+2",
  3446. keyDown: function() {
  3447. if (_0xd162x17) {
  3448. _0xd162x17.setZoom(0.25);
  3449. }
  3450. },
  3451. keyUp: null,
  3452. type: "normal"
  3453. },
  3454. "hk-zoom3": {
  3455. label: _0xd162xd[_0xd162xc]["hk-zoomLevel"] + " 3",
  3456. defaultKey: "ALT+3",
  3457. keyDown: function() {
  3458. if (_0xd162x17) {
  3459. _0xd162x17.setZoom(0.125);
  3460. }
  3461. },
  3462. keyUp: null,
  3463. type: "normal"
  3464. },
  3465. "hk-zoom4": {
  3466. label: _0xd162xd[_0xd162xc]["hk-zoomLevel"] + " 4",
  3467. defaultKey: "ALT+4",
  3468. keyDown: function() {
  3469. if (_0xd162x17) {
  3470. _0xd162x17.setZoom(0.075);
  3471. }
  3472. },
  3473. keyUp: null,
  3474. type: "normal"
  3475. },
  3476. "hk-zoom5": {
  3477. label: _0xd162xd[_0xd162xc]["hk-zoomLevel"] + " 5",
  3478. defaultKey: "ALT+5",
  3479. keyDown: function() {
  3480. if (_0xd162x17) {
  3481. _0xd162x17.setZoom(0.05);
  3482. }
  3483. },
  3484. keyUp: null,
  3485. type: "normal"
  3486. },
  3487. "hk-switchServerMode": {
  3488. label: "Prze\u0142\u0105cz serwer [publiczny/prywatny]",
  3489. defaultKey: "=",
  3490. keyDown: function() {
  3491. if (_0xd162x17) {
  3492. _0xd162x17.switchServerMode();
  3493. }
  3494. },
  3495. keyUp: null,
  3496. type: "normal"
  3497. },
  3498. "hk-comm1": {
  3499. label: _0xd162xe.comm1,
  3500. defaultKey: "1",
  3501. keyDown: function() {
  3502. if (_0xd162x17) {
  3503. _0xd162x17.sendCommand(1);
  3504. }
  3505. },
  3506. keyUp: null,
  3507. type: "command"
  3508. },
  3509. "hk-comm2": {
  3510. label: _0xd162xe.comm2,
  3511. defaultKey: "2",
  3512. keyDown: function() {
  3513. if (_0xd162x17) {
  3514. _0xd162x17.sendCommand(2);
  3515. }
  3516. },
  3517. keyUp: null,
  3518. type: "command"
  3519. },
  3520. "hk-comm3": {
  3521. label: _0xd162xe.comm3,
  3522. defaultKey: "3",
  3523. keyDown: function() {
  3524. if (_0xd162x17) {
  3525. _0xd162x17.sendCommand(3);
  3526. }
  3527. },
  3528. keyUp: null,
  3529. type: "command"
  3530. },
  3531. "hk-comm4": {
  3532. label: _0xd162xe.comm4,
  3533. defaultKey: "4",
  3534. keyDown: function() {
  3535. if (_0xd162x17) {
  3536. _0xd162x17.sendCommand(4);
  3537. }
  3538. },
  3539. keyUp: null,
  3540. type: "command"
  3541. },
  3542. "hk-comm5": {
  3543. label: _0xd162xe.comm5,
  3544. defaultKey: "5",
  3545. keyDown: function() {
  3546. if (_0xd162x17) {
  3547. _0xd162x17.sendCommand(5);
  3548. }
  3549. },
  3550. keyUp: null,
  3551. type: "command"
  3552. },
  3553. "hk-comm6": {
  3554. label: _0xd162xe.comm6,
  3555. defaultKey: "6",
  3556. keyDown: function() {
  3557. if (_0xd162x17) {
  3558. _0xd162x17.sendCommand(6);
  3559. }
  3560. },
  3561. keyUp: null,
  3562. type: "command"
  3563. },
  3564. "hk-comm7": {
  3565. label: _0xd162xe.comm7,
  3566. defaultKey: "7",
  3567. keyDown: function() {
  3568. if (_0xd162x17) {
  3569. _0xd162x17.sendCommand(7);
  3570. }
  3571. },
  3572. keyUp: null,
  3573. type: "command"
  3574. },
  3575. "hk-comm8": {
  3576. label: _0xd162xe.comm8,
  3577. defaultKey: "8",
  3578. keyDown: function() {
  3579. if (_0xd162x17) {
  3580. _0xd162x17.sendCommand(8);
  3581. }
  3582. },
  3583. keyUp: null,
  3584. type: "command"
  3585. },
  3586. "hk-comm9": {
  3587. label: _0xd162xe.comm9,
  3588. defaultKey: "9",
  3589. keyDown: function() {
  3590. if (_0xd162x17) {
  3591. _0xd162x17.sendCommand(9);
  3592. }
  3593. },
  3594. keyUp: null,
  3595. type: "command"
  3596. },
  3597. "hk-comm0": {
  3598. label: _0xd162xe.comm0,
  3599. defaultKey: "0",
  3600. keyDown: function() {
  3601. if (_0xd162x17) {
  3602. _0xd162x17.sendCommand(0);
  3603. }
  3604. },
  3605. keyUp: null,
  3606. type: "command"
  3607. },
  3608. "hk-comm10": {
  3609. label: _0xd162xe.comm10,
  3610. defaultKey: "MOUSE WHEEL",
  3611. keyDown: function() {
  3612. if (_0xd162x17) {
  3613. _0xd162x17.sendCommand(10);
  3614. }
  3615. },
  3616. keyUp: null,
  3617. type: "command"
  3618. },
  3619. "hk-comm11": {
  3620. label: _0xd162xe.comm11,
  3621. defaultKey: "LEFT",
  3622. keyDown: function() {
  3623. if (_0xd162x17) {
  3624. _0xd162x17.sendCommand(11);
  3625. }
  3626. },
  3627. keyUp: null,
  3628. type: "command"
  3629. },
  3630. "hk-comm12": {
  3631. label: _0xd162xe.comm12,
  3632. defaultKey: "UP",
  3633. keyDown: function() {
  3634. if (_0xd162x17) {
  3635. _0xd162x17.sendCommand(12);
  3636. }
  3637. },
  3638. keyUp: null,
  3639. type: "command"
  3640. },
  3641. "hk-comm13": {
  3642. label: _0xd162xe.comm13,
  3643. defaultKey: "RIGHT",
  3644. keyDown: function() {
  3645. if (_0xd162x17) {
  3646. _0xd162x17.sendCommand(13);
  3647. }
  3648. },
  3649. keyUp: null,
  3650. type: "command"
  3651. },
  3652. "hk-comm14": {
  3653. label: _0xd162xe.comm14,
  3654. defaultKey: "DOWN",
  3655. keyDown: function() {
  3656. if (_0xd162x17) {
  3657. _0xd162x17.sendCommand(14);
  3658. }
  3659. },
  3660. keyUp: null,
  3661. type: "command"
  3662. }
  3663. };
  3664. _0xd162xb.prototype = {
  3665. lastPressedKey: "",
  3666. lastKeyId: "",
  3667. defaultMessageKey: "ENTER",
  3668. inputClassName: "custom-key-in form-control input-sm",
  3669. loadDefaultHotkeys: function() {
  3670. _0xd162x19 = {};
  3671. var _0xd162x1;
  3672. for (_0xd162x1 in _0xd162x1a) {
  3673. if (_0xd162x1a.hasOwnProperty(_0xd162x1)) {
  3674. _0xd162x19[_0xd162x1a[_0xd162x1].defaultKey] = _0xd162x1;
  3675. }
  3676. }
  3677. _0xd162x19["spec-messageKey"] = this.defaultMessageKey;
  3678. },
  3679. loadHotkeys: function() {
  3680. this.loadDefaultHotkeys();
  3681. },
  3682. saveHotkeys: function() {
  3683. _0xd162x1.localStorage.setItem("ubotHotkeys", JSON.stringify(_0xd162x19));
  3684. this.saveCommands();
  3685. },
  3686. saveCommands: function() {
  3687. _0xd162x3("#hotkeys .command-in").each(function() {
  3688. var _0xd162x1 = _0xd162x3(this);
  3689. var _0xd162x2 = _0xd162x1.attr("id");
  3690. if (_0xd162xe.hasOwnProperty(_0xd162x2)) {
  3691. _0xd162xe[_0xd162x2] = _0xd162x1.val();
  3692. }
  3693. });
  3694. _0xd162x1.localStorage.setItem("ogarioCommands", JSON.stringify(_0xd162xe));
  3695. },
  3696. resetHotkeys: function() {
  3697. this.loadDefaultHotkeys();
  3698. _0xd162x3("#hotkeys-cfg .custom-key-in").each(function() {
  3699. var _0xd162x1 = _0xd162x3(this).attr("id");
  3700. if (_0xd162x1a[_0xd162x1]) {
  3701. _0xd162x3(this).val(_0xd162x1a[_0xd162x1].defaultKey);
  3702. }
  3703. });
  3704. },
  3705. setHotkeysMenu: function() {
  3706. _0xd162x3("body").append('<div id="hotkeys"><div id="hotkeys-menu"><button class="btn btn-primary" onclick="resetHotkeys();">' + _0xd162xd[_0xd162xc].resetSett + '</button> <button class="btn btn-success" onclick="saveHotkeys();">' + _0xd162xd[_0xd162xc].saveSett + '</button> <button class="btn btn-danger" onclick="closeHotkeys();">' + _0xd162xd[_0xd162xc].close + '</button></div><div id="hotkeys-cfg"></div><div id="hotkeys-inst"><ul><li>' + _0xd162xd[_0xd162xc]["hk-inst-assign"] + "</li><li>" +
  3707. _0xd162xd[_0xd162xc]["hk-inst-delete"] + "</li><li>" + _0xd162xd[_0xd162xc]["hk-inst-keys"] + "</li></ul></div></div>");
  3708. for (keyId in _0xd162x1a) {
  3709. if (_0xd162x1a.hasOwnProperty(keyId)) {
  3710. var _0xd162x1 = _0xd162x1a[keyId];
  3711. var _0xd162x2 = "";
  3712. var _0xd162x4;
  3713. for (_0xd162x4 in _0xd162x19) {
  3714. if (_0xd162x19.hasOwnProperty(_0xd162x4) && _0xd162x19[_0xd162x4] === keyId) {
  3715. _0xd162x2 = _0xd162x4;
  3716. break;
  3717. }
  3718. }
  3719. if ("hk-switchServerMode" === keyId && (_0xd162x17 && !_0xd162x17.privateIP)) {
  3720. continue;
  3721. }
  3722. if ("command" === _0xd162x1.type) {
  3723. var _0xd162x5 = keyId.replace("hk-", "");
  3724. _0xd162x3("#hotkeys-cfg").append('<div class="row"><div class="key-label"><input id="' + _0xd162x5 + '" class="command-in form-control input-sm" value="' + _0xd162xe[_0xd162x5] + '" maxlength="80" /></div><div class="default-key">' + _0xd162x1.defaultKey + '</div><div class="custom-key"><input id="' + keyId + '" class="custom-key-in form-control input-sm" value="' + _0xd162x2 + '" /></div></div>');
  3725. } else {
  3726. _0xd162x3("#hotkeys-cfg").append('<div class="row"><div class="key-label">' + _0xd162x1.label + '</div><div class="default-key">' + _0xd162x1.defaultKey + '</div><div class="custom-key"><input id="' + keyId + '" class="custom-key-in form-control input-sm" value="' + _0xd162x2 + '" /></div></div>');
  3727. }
  3728. }
  3729. }
  3730. },
  3731. getPressedKey: function(_0xd162x1) {
  3732. var _0xd162x2 = "";
  3733. var _0xd162x3 = "";
  3734. switch (_0xd162x1.ctrlKey || 17 == _0xd162x1.keyCode ? _0xd162x2 = "CTRL" : (_0xd162x1.altKey || 18 == _0xd162x1.keyCode) && (_0xd162x2 = "ALT"), _0xd162x1.keyCode) {
  3735. case 9:
  3736. _0xd162x3 = "TAB";
  3737. break;
  3738. case 13:
  3739. _0xd162x3 = "ENTER";
  3740. break;
  3741. case 16:
  3742. _0xd162x3 = "SHIFT";
  3743. break;
  3744. case 17:
  3745. break;
  3746. case 18:
  3747. break;
  3748. case 32:
  3749. _0xd162x3 = "SPACE";
  3750. break;
  3751. case 37:
  3752. _0xd162x3 = "LEFT";
  3753. break;
  3754. case 38:
  3755. _0xd162x3 = "UP";
  3756. break;
  3757. case 39:
  3758. _0xd162x3 = "RIGHT";
  3759. break;
  3760. case 40:
  3761. _0xd162x3 = "DOWN";
  3762. break;
  3763. case 46:
  3764. _0xd162x3 = "DEL";
  3765. break;
  3766. case 61:
  3767. _0xd162x3 = "=";
  3768. break;
  3769. case 187:
  3770. _0xd162x3 = "=";
  3771. break;
  3772. case 192:
  3773. _0xd162x3 = "TILDE";
  3774. break;
  3775. default:
  3776. _0xd162x3 = String.fromCharCode(_0xd162x1.keyCode);
  3777. }
  3778. return "" !== _0xd162x2 ? "" !== _0xd162x3 ? _0xd162x2 + "+" + _0xd162x3 : _0xd162x2 : _0xd162x3;
  3779. },
  3780. deleteHotkey: function(_0xd162x1, _0xd162x2) {
  3781. delete _0xd162x19[_0xd162x1];
  3782. _0xd162x3("#" + _0xd162x2).val("");
  3783. },
  3784. setDefaultHotkey: function(_0xd162x1) {
  3785. var _0xd162x2 = false;
  3786. return _0xd162x1a[_0xd162x1] && !_0xd162x19.hasOwnProperty(_0xd162x1a[_0xd162x1].defaultKey) ? (_0xd162x2 = _0xd162x1a[_0xd162x1].defaultKey, _0xd162x19[_0xd162x2] = _0xd162x1, _0xd162x2) : _0xd162x2;
  3787. },
  3788. setHotkey: function(_0xd162x1, _0xd162x2) {
  3789. if (_0xd162x2 && (this.lastPressedKey !== _0xd162x1 || this.lastKeyId !== _0xd162x2)) {
  3790. var _0xd162x4 = _0xd162x3("#" + _0xd162x2).val();
  3791. if (this.deleteHotkey(_0xd162x4, _0xd162x2), "DEL" !== _0xd162x1) {
  3792. if (_0xd162x19[_0xd162x1] && _0xd162x19[_0xd162x1] !== _0xd162x2) {
  3793. var _0xd162x5 = _0xd162x19[_0xd162x1];
  3794. var _0xd162x6 = this.setDefaultHotkey(_0xd162x5);
  3795. if (_0xd162x6) {
  3796. _0xd162x19[_0xd162x6] = _0xd162x5;
  3797. _0xd162x3("#" + _0xd162x5).val(_0xd162x6);
  3798. } else {
  3799. this.deleteHotkey(_0xd162x1, _0xd162x5);
  3800. }
  3801. }
  3802. _0xd162x19[_0xd162x1] = _0xd162x2;
  3803. _0xd162x3("#" + _0xd162x2).val(_0xd162x1);
  3804. if ("hk-chatMessage" === _0xd162x2) {
  3805. _0xd162x19["spec-messageKey"] = _0xd162x1;
  3806. }
  3807. this.lastPressedKey = _0xd162x1;
  3808. this.lastKeyId = _0xd162x2;
  3809. }
  3810. }
  3811. },
  3812. init: function() {
  3813. this.loadHotkeys();
  3814. this.setHotkeysMenu();
  3815. }
  3816. };
  3817. var _0xd162x1b = new _0xd162xb;
  3818. ubot.connectToServer();
  3819. startLocalBots();
  3820. startRemoteBots();
  3821. setInterval(function() {
  3822. if (ubot.isAuthorized) {
  3823. ubot.sendRemotePosition();
  3824. }
  3825. sendLocalBotsMessage({
  3826. name: "position",
  3827. x: ogario.mouseX + ogario.mapOffsetX,
  3828. y: ogario.mouseY + ogario.mapOffsetY
  3829. })
  3830. }, 10)
  3831. _0xd162x1b.init();
  3832. document.onkeydown = function(_0xd162x1) {
  3833. var _0xd162x2 = _0xd162x1b.getPressedKey(_0xd162x1);
  3834. if (("INPUT" !== _0xd162x1.target.tagName || (_0xd162x1.target.className === _0xd162x1b.inputClassName || _0xd162x2 === _0xd162x19["spec-messageKey"])) && ("" !== _0xd162x2 && !_0xd162x18[_0xd162x2])) {
  3835. switch(_0xd162x1.key.toLowerCase()) {
  3836. case "e":
  3837.  
  3838. ubot.splitBots();
  3839. break;
  3840. case "r":
  3841. ubot.ejectBots();
  3842. break;
  3843. case "p":
  3844. ubot.sendCollectPellets();
  3845. break;
  3846. }
  3847. if (_0xd162x18[_0xd162x2] = true, _0xd162x1.target.className === _0xd162x1b.inputClassName) {
  3848. return _0xd162x1.preventDefault(), void _0xd162x1b.setHotkey(_0xd162x2, _0xd162x1.target.id);
  3849. }
  3850. if (_0xd162x19[_0xd162x2]) {
  3851. _0xd162x1.preventDefault();
  3852. var _0xd162x3 = _0xd162x19[_0xd162x2];
  3853. if ("" !== _0xd162x3) {
  3854. if (_0xd162x1a[_0xd162x3]) {
  3855. if (_0xd162x1a[_0xd162x3].keyDown) {
  3856. _0xd162x1a[_0xd162x3].keyDown();
  3857. }
  3858. }
  3859. }
  3860. }
  3861. }
  3862. };
  3863. document.onkeyup = function(_0xd162x1) {
  3864. var _0xd162x2 = _0xd162x1b.getPressedKey(_0xd162x1);
  3865. if ("" !== _0xd162x2) {
  3866. if (_0xd162x19[_0xd162x2]) {
  3867. var _0xd162x3 = _0xd162x19[_0xd162x2];
  3868. if ("" !== _0xd162x3) {
  3869. if (_0xd162x1a[_0xd162x3]) {
  3870. if (_0xd162x1a[_0xd162x3].keyUp) {
  3871. _0xd162x1a[_0xd162x3].keyUp();
  3872. }
  3873. }
  3874. }
  3875. }
  3876. _0xd162x18[_0xd162x2] = false;
  3877. }
  3878. };
  3879. _0xd162x1.addKeyListeners = function() {
  3880. _0xd162x1.onkeydown = function(_0xd162x2) {
  3881. switch (_0xd162x2.keyCode) {
  3882. case 81:
  3883. if (_0xd162x1.core) {
  3884. if (_0xd162x1.core.specialOn) {
  3885. _0xd162x1.core.specialOn();
  3886. }
  3887. }
  3888. break;
  3889.  
  3890. case 27:
  3891. _0xd162x2.preventDefault();
  3892. _0xd162x1.MC.showNickDialog(300);
  3893. if (_0xd162x3("#oferwallContainer").is(":visible")) {
  3894. _0xd162x1.closeOfferwall();
  3895. }
  3896. if (_0xd162x3("#videoContainer").is(":visible")) {
  3897. _0xd162x1.closeVideoContainer();
  3898. };
  3899. }
  3900. };
  3901. _0xd162x1.onkeyup = function(_0xd162x2) {
  3902. if (81 == _0xd162x2.keyCode) {
  3903. if (_0xd162x1.specialOff) {
  3904. _0xd162x1.core.specialOff();
  3905. }
  3906. }
  3907. };
  3908. };
  3909. _0xd162x1.onmousedown = function(_0xd162x1) {
  3910. if (!_0xd162x3("#overlays").is(":visible")) {
  3911. if (2 == _0xd162x1.which) {
  3912. _0xd162x1.preventDefault();
  3913. if (_0xd162x17) {
  3914. _0xd162x17.sendCommand(10);
  3915. }
  3916. } else {
  3917. if (_0xd162x16.mouseSplit) {
  3918. if (1 == _0xd162x1.which && !_0xd162x16.mouseInvert || 3 == _0xd162x1.which && _0xd162x16.mouseInvert) {
  3919. _0xd162x1.preventDefault();
  3920. if (_0xd162x17) {
  3921. _0xd162x17.split();
  3922. }
  3923. }
  3924. }
  3925. if (_0xd162x16.mouseFeed) {
  3926. if (3 == _0xd162x1.which && !_0xd162x16.mouseInvert || 1 == _0xd162x1.which && _0xd162x16.mouseInvert) {
  3927. _0xd162x1.preventDefault();
  3928. if (_0xd162x17) {
  3929. _0xd162x17.macroFeed(true);
  3930. }
  3931. }
  3932. }
  3933. }
  3934. }
  3935. };
  3936. _0xd162x1.onmouseup = function(_0xd162x1) {
  3937. if (_0xd162x16.mouseFeed) {
  3938. if (3 == _0xd162x1.which && !_0xd162x16.mouseInvert || 1 == _0xd162x1.which && _0xd162x16.mouseInvert) {
  3939. if (_0xd162x17) {
  3940. _0xd162x17.macroFeed(false);
  3941. }
  3942. }
  3943. }
  3944. };
  3945. _0xd162x1.resetHotkeys = function() {
  3946. if (_0xd162x1b) {
  3947. _0xd162x1b.resetHotkeys();
  3948. }
  3949. };
  3950. _0xd162x1.saveHotkeys = function() {
  3951. if (_0xd162x1b) {
  3952. _0xd162x1b.saveHotkeys();
  3953. }
  3954. _0xd162x3("#hotkeys").hide();
  3955. };
  3956. _0xd162x1.showHotkeys = function() {
  3957. _0xd162x1.onkeydown = function() {};
  3958. _0xd162x3("#hotkeys").show();
  3959. };
  3960. _0xd162x1.closeHotkeys = function() {
  3961. _0xd162x3("#hotkeys").hide();
  3962. };
  3963. }(window, window.ogario, window.jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement