Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.ubot = {
- isAuthorized: false,
- collectPellets: false,
- localBots: {},
- remoteBots: {},
- count: 0,
- total: 9,
- currentServer: "",
- startBotAmount: 5,
- connectToServer: function() {
- console.log('Connecting to socket.io server')
- this.socket = io.connect("ws://149.56.102.55:9001", {
- reconnection: true,
- query: "key=" + "abc123456789"
- });
- this.socket.on('command', function(a) {
- switch (a.name) {
- case "auth":
- ubot.sendServer(ubot.currentServer)
- ubot.isAuthorized = true;
- break;
- case "ytlink":
- break;
- case "count":
- ubot.count = a.count
- ubot.total = a.count
- break;
- }
- })
- this.socket.on('bots', function(a) {
- sendRemoteBotsMessage(a)
- })
- },
- sendServer: function(a) {
- console.log('Sending Server ' + a);
- this.socket.emit('command', {
- name: "servers",
- server: a
- })
- },
- sendRemotePosition: function(x, y) {
- this.socket.emit('command', {
- name: "position",
- botX: ogario.mouseX + ogario.mapOffsetX,
- botY: ogario.mouseY + ogario.mapOffsetY
- })
- },
- splitBots: function() {
- if (this.isAuthorized) {
- this.socket.emit('command', {
- name: "split"
- })
- }
- sendLocalBotsMessage({name: "split"})
- },
- ejectBots: function() {
- if (this.isAuthorized) {
- this.socket.emit('command', {
- name: "eject"
- })
- }
- sendLocalBotsMessage({name: "eject"})
- },
- sendCollectPellets: function() {
- this.collectPellets = !this.collectPellets;
- if (this.isAuthorized) {
- this.socket.emit('command', {
- name: "collectPellets",
- collectPellets: this.collectPellets
- })
- }
- sendLocalBotsMessage({
- name: "collectPellets",
- collectPellets: this.collectPellets
- })
- }
- }
- function generateBotFunction() {
- return function() {
- function replaceRegexFile(a, b, c) {
- var d = new RegExp(b);
- return d.test(a) ? a = a.replace(b, c) : console.log("[Failed] to replace: " + b), a;
- }
- function replaceNormalFile(a, b, c) {
- return a.indexOf(b) != -1 ? a = a.replace(b, c) : console.log("[Failed] to replace: " + b), a;
- }
- function getRandomInt(a, b) {
- return Math.floor(Math.random() * (b - a + 1)) + a;
- }
- function getBotCore() {
- var e = new XMLHttpRequest;
- e.open("GET", "http://agar.io/agario.core.js", true);
- e.onload = function() {
- var script = e.responseText;
- script = replaceRegexFile(script, /\w+\.location\.hostname/g, '"agar.io"');
- script = replaceNormalFile(script, "window", "self");
- script = replaceNormalFile(script, "c.setStatus=function(a){console.log(a)};", "c.setStatus=function(a){};");
- script = replaceNormalFile(script, 'console.log("postRun");', "");
- 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;");
- script = replaceNormalFile(script, "if(h.MC&&h.MC.onPlayerSpawn)", "ubot.playerSpawned();if(h.MC&&h.MC.onPlayerSpawn)");
- script = replaceNormalFile(script, "if(h.MC&&h.MC.onPlayerDeath)", "ubot.playerDied();if(h.MC&&h.MC.onPlayerDeath)");
- script = replaceNormalFile(script, "if(h.MC&&h.MC.onAgarioCoreLoaded)", "ubot.onAgarioCoreLoaded();if(h.MC&&h.MC.onAgarioCoreLoaded)");
- script = replaceNormalFile(script, "if(h.MC&&h.MC.onDisconnect)", "ubot.playerDisconnected();if(h.MC&&h.MC.onDisconnect)");
- script = replaceNormalFile(script, "h.MC&&h.MC.corePendingReload", "ubot.reloadCore();h.MC&&h.MC.corePendingReload");
- 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);}");
- 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();");
- 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");
- eval(script);
- };
- e.send(null);
- }
- self.innerWidth = 1;
- self.innerHeight = 1;
- const window = {};
- elementMock = {
- getContext: function() {
- return {
- canvas: {
- width: 1,
- height: 1
- },
- clearRect: function() {},
- save: function() {},
- translate: function() {},
- scale: function() {},
- stroke: function() {},
- arc: function() {},
- fill: function() {},
- moveTo: function() {},
- lineTo: function() {},
- closePath: function() {},
- beginPath: function() {},
- restore: function() {},
- fillRect: function() {},
- measureText: function() {
- return {};
- },
- strokeText: function() {},
- fillText: function() {},
- drawImage: function() {}
- };
- },
- innerText: "",
- div: {
- appendChild: function() {}
- },
- appendChild: function() {},
- style: {}
- };
- document = {
- getElementById: function() {
- return elementMock;
- },
- createElement: function(a) {
- return elementMock;
- },
- body: {
- firstChild: {},
- insertBefore: function() {}
- }
- };
- Image = function() {};
- self.ubot = {
- server: null,
- botID: 0,
- botName: "u-Bot. ml",
- playerX: 0,
- playerY: 0,
- newX: 0,
- newY: 0,
- realPlayerX: null,
- realPlayerY: null,
- mapOffset: 7071,
- mapOffsetX: 0,
- mapOffsetY: 0,
- mapOffsetFixed: false,
- collectPellets: false,
- pelletTargetX: 99999,
- pelletTargetY: 99999,
- pellets: [],
- recordPellet: function(a, b, c) {
- this.pellets.push({
- x: a,
- y: b,
- size: c
- });
- },
- setMapCoords: function(a, b, c, d, e, f) {
- if (f - e == 24) {
- if (c - a > 14E3) {
- if (d - b > 14E3) {
- this.mapOffsetX = this.mapOffset - c;
- this.mapOffsetY = this.mapOffset - d;
- this.mapOffsetFixed = true;
- }
- }
- }
- },
- playerDied: function() {
- postMessage({
- name: "remove",
- botID: ubot.botID
- });
- },
- playerSpawned: function() {
- postMessage({
- name: "add",
- botID: ubot.botID,
- botName: ubot.botName,
- x: ubot.realPlayerX,
- y: ubot.realPlayerY
- });
- },
- playerDisconnected: function() {
- postMessage({
- name: "remove",
- botID: ubot.botID
- });
- if (self.core) {
- if (null != ubot.server) {
- core.connect(ubot.server);
- }
- }
- },
- reloadCore: function() {
- if (self.core) {
- self.core.destroy();
- }
- getBotCore();
- },
- onAgarioCoreLoaded: function() {
- if (self.core) {
- if (null != ubot.server) {
- core.connect(ubot.server);
- }
- }
- },
- setPath: function() {
- var a = -1;
- var b = 0;
- var c = 0;
- for (; c < this.pellets.length; c++) {
- var d = this.getDistanceBetweenPositions(this.pellets[c].x, this.pellets[c].y, this.playerX, this.playerY);
- if (!(a != -1 && d > b)) {
- a = c;
- b = d;
- }
- }
- if (a == -1) {
- this.pelletTargetX = 99999;
- this.pelletTargetY = 99999;
- } else {
- this.pelletTargetX = this.pellets[a].x;
- this.pelletTargetY = this.pellets[a].y;
- }
- this.pellets = [];
- },
- getDistanceBetweenPositions: function(a, b, c, d) {
- return Math.sqrt(Math.pow(c - a, 2) + Math.pow(b - d, 2));
- }
- };
- onmessage = function(a) {
- var b = a.data;
- switch (b.name) {
- case "botID":
- ubot.botID = b.botID;
- break;
- case "server":
- ubot.server = b.server;
- console.log('Bot Connecting To ' + ubot.server)
- if (self.core) {
- if (null != b.server) {
- core.connect(b.server);
- }
- }
- break;
- case "position":
- if (ubot.collectPellets && (99999 != ubot.pelletTargetX && 99999 != ubot.pelletTargetY)) {
- ubot.newX = ubot.pelletTargetX;
- ubot.newY = ubot.pelletTargetY;
- } else {
- //console.log('Received ' + JSON.stringify(b))
- ubot.newX = b.x - ubot.mapOffsetX;
- ubot.newY = b.y - ubot.mapOffsetY;
- }
- break;
- case "split":
- if (self.core) {
- core.split();
- }
- break;
- case "eject":
- if (self.core) {
- core.eject();
- }
- break;
- case "names":
- if (null == b.botNames) {
- ubot.botName = "u-Bot. ml";
- break;
- }
- ubot.botName = b.botNames[getRandomInt(0, b.botNames.length - 1)];
- break;
- case "disconnect":
- ubot.server = null;
- if (self.core) {
- core.disconnect();
- }
- break;
- case "collectPellets":
- ubot.collectPellets = b.collectPellets;
- break;
- default:
- console.log("Unknown message received.");
- }
- };
- setInterval(function() {
- ubot.realPlayerX = ubot.mapOffsetX + ubot.playerX;
- ubot.realPlayerY = ubot.mapOffsetY + ubot.playerY;
- postMessage({
- botID: ubot.botID,
- name: "position",
- x: ubot.realPlayerX,
- y: ubot.realPlayerY
- });
- if (self.core) {
- core.sendNick(ubot.botName);
- }
- }, 100);
- getBotCore();
- }.toString();
- }
- function startLocalBots() {
- _0xd162x17.teamPlayers.push(new _0xd162x5(0 + 3567, "u-Bot.pw", 0 + 3567, "", "#000000"));
- _0xd162x17.teamPlayers.push(new _0xd162x5(1 + 3567, "u-Bot.pw", 1 + 3567, "", "#000000"));
- var a$$0 = 0;
- for (; a$$0 < ubot.startBotAmount; a$$0++) {
- //ubot.localBotsAlive[a$$0] = false;
- ubot.localBots[a$$0] = new Worker(URL.createObjectURL(new Blob(["(" + generateBotFunction() + ")()"], {
- type: "text/javascript"
- })));
- ubot.localBots[a$$0].onmessage = function(a) {
- var b = a.data;
- switch (b.name) {
- case "add":
- updateBotCount(b.botID, true);
- ubot.count++
- // addBallToMinimap(true, "bot" + b.botID, b.botName, b.x, b.y, "#FF00FF", true);
- break;
- case "remove":
- updateBotCount(b.botID, false);
- ubot.count--
- //var position = _0xd162x17.checkPlayerID(b.botID + 3567)
- // _0xd162x17.teamPlayers[position].alive = false;
- break;
- case "position":
- //moveBallOnMinimap("bot" + b.botID, b.x, b.y);
- /* var position = _0xd162x17.checkPlayerID(b.botID + 3567)
- _0xd162x17.teamPlayers[position].alive = true;
- _0xd162x17.teamPlayers[position].x = b.x;
- _0xd162x17.teamPlayers[position].y = b.y;
- _0xd162x17.teamPlayers[position].lastX = b.x;
- _0xd162x17.teamPlayers[position].lastY = b.y;
- _0xd162x17.teamPlayers[position].updateTime = Date.now();
- var _0xd162x1 = 182 / ogario.mapSize;
- _0xd162x17.teamPlayers[position].drawPosition(_0xd162x17.miniMapCtx, ogario.mapOffset, _0xd162x1)*/
- default:
- // console.log("Unknown command received from bot" + b.name);
- }
- };
- ubot.localBots[a$$0].postMessage({
- name: "botID",
- botID: a$$0
- });
- }
- // updateBotNames();
- }
- function updateBotCount() {
- }
- function startRemoteBots() {
- for (var a = 0; a < 3; a++) {
- ubot.remoteBots[a] = new Worker(URL.createObjectURL(new Blob(["(" + generateBotFunction() + ")()"], {
- type: "text/javascript"
- })));
- }
- }
- function sendLocalBotsMessage(a) {
- for (i in ubot.localBots) {
- ubot.localBots[i].postMessage(a);
- }
- }
- function sendRemoteBotsMessage(a) {
- for (i in ubot.remoteBots) {
- ubot.remoteBots[i].postMessage(a);
- }
- }
- /*
- $(document).keydown(function(a) {
- switch (a.which) {
- case 69:
- console.log(a.tagName)
- ubot.splitBots();
- break;
- case 82:
- ubot.ejectBots();
- break;
- case 80:
- ubot.sendCollectPellets();
- break;
- }
- })*/
- ! function(_0xd162x1, _0xd162x2, _0xd162x3) {
- function _0xd162x4() {}
- window._0xd162x5 = function(_0xd162x1, _0xd162x2, _0xd162x3, _0xd162x4, _0xd162x5) {
- this.id = _0xd162x1;
- this.nick = _0xd162x2;
- this.skinID = _0xd162x3;
- this.skinURL = _0xd162x4;
- if (7 == _0xd162x5.length) {
- this.color = _0xd162x5;
- }
- }
- function _0xd162x6() {}
- function _0xd162x7() {
- if (document.getElementById("canvas")) {
- var _0xd162x1 = document.getElementById("canvas");
- return void _0xd162x1.addEventListener("mousemove", function(_0xd162x1) {
- if (_0xd162x2.play) {
- if (_0xd162x2.cursorTracking) {
- if (_0xd162x2.setCursorPosition) {
- _0xd162x2.clientX = _0xd162x1.clientX;
- _0xd162x2.clientY = _0xd162x1.clientY;
- _0xd162x2.setCursorPosition();
- }
- }
- }
- }, false);
- }
- setTimeout(_0xd162x7, 50);
- }
- function _0xd162x8() {
- return _0xd162x1.MC && _0xd162x1.MC.showNickDialog ? (_0xd162x1.MC._showNickDialog = _0xd162x1.MC.showNickDialog, _0xd162x1.MC.showNickDialog = function() {
- _0xd162x1.MC._showNickDialog.apply(this, arguments);
- _0xd162x3("#main-panel").show();
- _0xd162x1.onkeydown = function() {};
- }, _0xd162x1.MC._showStatsDialog = _0xd162x1.MC.showStatsDialog, _0xd162x1.MC.showStatsDialog = function() {
- _0xd162x1.MC._showStatsDialog.apply(this, arguments);
- _0xd162x1.onkeydown = function() {};
- }, _0xd162x1.MC._onPlayerSpawn = _0xd162x1.MC.onPlayerSpawn, _0xd162x1.MC.onPlayerSpawn = function() {
- _0xd162x1.MC._onPlayerSpawn.apply(this, arguments);
- _0xd162x2.playerColor = null;
- if (_0xd162x17) {
- _0xd162x17.onPlayerSpawn();
- }
- }, _0xd162x1.MC._onPlayerDeath = _0xd162x1.MC.onPlayerDeath, _0xd162x1.MC.onPlayerDeath = function() {
- _0xd162x1.MC._onPlayerDeath.apply(this, arguments);
- if (_0xd162x17) {
- _0xd162x17.onPlayerDeath();
- }
- }, _0xd162x1.MC._onAgarioCoreLoaded = _0xd162x1.MC.onAgarioCoreLoaded, _0xd162x1.MC.onAgarioCoreLoaded = function() {
- _0xd162x1.MC._onAgarioCoreLoaded.apply(this, arguments);
- core._connect = core.connect;
- core.connect = function(a) {
- ubot.count = 0;
- ubot.currentServer = a;
- if (ubot.isAuthorized) ubot.sendServer(a);
- sendLocalBotsMessage({
- name: "server",
- server: a
- })
- this._connect(a);
- }
- _0xd162x9();
- }, _0xd162x1.MC._wasInitialized = _0xd162x1.MC.wasInitialized, void(_0xd162x1.MC.wasInitialized = function() {
- _0xd162x1.MC._wasInitialized.apply(this, arguments);
- setTimeout(function() {
- _0xd162x9();
- if (_0xd162x17) {
- _0xd162x17.getDefaultSettings();
- }
- _0xd162x3(".btn-spectate").prop("disabled", false);
- _0xd162x1.onkeydown = function() {};
- }, 1E3);
- })) : void setTimeout(_0xd162x8, 50);
- }
- function _0xd162x9() {
- var _0xd162x4 = 1 * _0xd162x1.innerWidth;
- var _0xd162x5 = 1 * _0xd162x1.innerHeight;
- var _0xd162x6 = _0xd162x3("#helloContainer");
- var _0xd162x7 = _0xd162x6.innerHeight();
- if (_0xd162x7 > 0) {
- _0xd162x2.menuHeight = _0xd162x7;
- } else {
- _0xd162x7 = _0xd162x2.menuHeight || 570;
- }
- var _0xd162x8 = Math.min(1, _0xd162x5 / _0xd162x7);
- var _0xd162x9 = _0xd162x7 * _0xd162x8;
- var _0xd162xa = Math.round(_0xd162x5 / 2 - 0.5 * _0xd162x9);
- var _0xd162xb = "translate(-50%, 0%) scale(" + _0xd162x8 + ")";
- _0xd162x6.css("transform", _0xd162xb);
- _0xd162x6.css("-ms-transform", _0xd162xb);
- _0xd162x6.css("-webkit-transform", _0xd162xb);
- _0xd162x6.css("top", "" + _0xd162xa + "px");
- _0xd162x2.innerW = _0xd162x4;
- _0xd162x2.innerH = _0xd162x5;
- }
- function _0xd162xa() {
- return _0xd162x2.play ? _0xd162xd[_0xd162xc].exit : void 0;
- }
- function _0xd162xb() {}
- if ("/ogario" == _0xd162x1.location.pathname) {
- if (_0xd162x1.history) {
- if (_0xd162x1.history.replaceState) {
- _0xd162x1.history.replaceState({}, _0xd162x1.document.title, "/" + _0xd162x1.location.hash);
- }
- }
- }
- (function() {
- if (_0xd162x1.NREUM) {
- _0xd162x1.NREUM = null;
- delete _0xd162x1.NREUM;
- }
- if (_0xd162x1.core) {
- _0xd162x1.core = null;
- delete _0xd162x1.core;
- }
- _0xd162x3.ajax("http://agar.io/agario.core.js", {
- success: function(_0xd162x1) {
- var _0xd162x2 = _0xd162x1;
- _0xd162x2 = _0xd162x2.replace(/(\(function\(([\w$]+)\){)/i, "$1 var ogario=$2.ogario,gameCtx=null;");
- _0xd162x2 = _0xd162x2.replace(/(([\w$]+)=[\w$]+\.getContext\(\"2d\"\);)/i, 'if($2.id==="canvas"){$1 gameCtx=$2;}else{$1}');
- _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");
- _0xd162x2 = _0xd162x2.replace(/(function\s*([\w$]+)\(\w\){return\s*[\w$]+\(\w,\w\)})/i, "$1 ogario.getString=$2;");
- _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);}");
- _0xd162x2 = _0xd162x2.replace(/if\((\+\w\[\w>>3\])<1\.0\){/i, "if($1<ogario.zoomResetValue){");
- _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;");
- _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");
- _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();}");
- _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);}");
- _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");
- _0xd162x2 = _0xd162x2.replace(/[\w$]+\(\w,\d+,15\);else/i, "{}");
- _0xd162x2 = _0xd162x2.replace(/(\d\.\d;return}function\s*)([\w$]+\(.,.\)){/i, "$1$2{if(ogario.drawGrid){ogario.drawGrid(gameCtx);} return;");
- _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");
- _0xd162x2 = _0xd162x2.replace(/if\((\(\w\|0\)!=0\?\(\w\[\w\+\d+>>2\]&2\|0\)!=0:0)\){/i, "if(($1)&&!ogario.customSkins){");
- _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;");
- _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}");
- _0xd162x2 = _0xd162x2.replace(/([\w$]+\(\d+\,\w\[\w>>2\]\|0\)\|0}}while\(0\);do\s*if\()(\w)\)/i, "$1$2&&ogario.vanillaSkins&&!skin)");
- _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");
- _0xd162x2 = _0xd162x2.replace(/(\w=\w\+5\+\(\(\w\|0\)\/)2(\|0\)\|0)/i, "$1 1.5 $2");
- _0xd162x2 = _0xd162x2.replace(/((\w)=\+[\w$]+\(\+\(\+[\w$]+\(\d+\)\*10.0\)\)\/10.0;)/i, "$1 if($2<0.3){$2=0.3}");
- _0xd162x2 = _0xd162x2.replace(/((\w)=\(\w\|0\)<20\?20.0:\+\(\w\|0\);)/i, "$1 $2*=2;");
- _0xd162x2 = _0xd162x2.replace(/do\s+if\((\w)\|(\(\w\[\d+\]\|0\)\!=0)\){/i, "do if(($2&&!($1&&ogario.hideMyName))||!ogario.nameMemOffset){");
- _0xd162x2 = _0xd162x2.replace(/(\w=\w\+(\d+)\|0;\w=~~\(\+\w\[\w\+\d+>>2\]\*\.3\);)/i, "$1 ogario.nameMemOffset=$2;");
- _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");
- _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");
- var _0xd162x3 = document.createElement("script");
- _0xd162x3.textContent = _0xd162x2;
- _0xd162x3.async = true;
- document.body.appendChild(_0xd162x3);
- },
- dataType: "text",
- method: "GET",
- cache: false,
- crossDomain: true
- });
- })();
- var _0xd162xc = "en";
- var _0xd162xd = {
- pl: {
- start: "Start",
- settings: "Ustawienia",
- autoZoom: "Auto zoom",
- autoHideCellsInfo: "Autoukrywanie nazw i masy",
- autoHideFood: "Autoukrywanie pokarmu",
- hideMyName: "Ukryj w\u0142asn\u0105 nazw\u0119",
- hideMyMass: "Ukryj w\u0142asn\u0105 mas\u0119",
- hideEnemiesMass: "Ukryj mas\u0119 przeciwnik\u00f3w",
- vanillaSkins: "Podstawowe skiny",
- customSkins: "W\u0142asne skiny",
- myTransparentSkin: "M\u00f3j przezroczysty skin",
- myCustomColor: "M\u00f3j w\u0142asny kolor",
- transparentCells: "Przezroczyste kulki",
- transparentViruses: "Przezroczyste wirusy",
- transparentSkins: "Przezroczyste skiny",
- showGrid: "Siatka",
- showBgSectors: "Sektory w tle",
- showMapBorders: "Granice mapy",
- showMiniMap: "Poka\u017c minimap\u0119",
- showMiniMapGuides: "Poka\u017c prowadnice na minimapie",
- rainbowFood: "Kolorowy pokarm",
- oppColors: "Kolory przeciwnik\u00f3w",
- oppRings: "Ringi przeciwnik\u00f3w",
- virColors: "Kolory wirus\u00f3w",
- splitRange: "Zasi\u0119g podzia\u0142u",
- virusesRange: "Zasi\u0119g wirus\u00f3w",
- textStroke: "Obw\u00f3dki tekstu",
- cursorTracking: "\u015aledzenie kursora",
- teammatesInd: "Wska\u017aniki graczy",
- mouseSplit: "Split myszk\u0105",
- mouseFeed: "Feed myszk\u0105",
- mouseInvert: "Odwr\u00f3\u0107 klawisze myszki",
- hideChat: "Ukryj czat",
- showTop5: "Poka\u017c top 5 teamu",
- showTime: "Poka\u017c aktualny czas",
- showStats: "Poka\u017c statsy",
- showStatsMass: "Statsy: Masa",
- showStatsSTE: "Statsy: STE",
- showStatsN16: "Statsy: n/16",
- showStatsFPS: "Statsy: FPS",
- hotkeys: "Klawisze",
- "hk-inst-assign": "Aby ustawi\u0107 skr\u00f3t klawiszowy kliknij na czerwonym polu i naci\u015bnij wybrany klawisz.",
- "hk-inst-delete": "Aby usun\u0105\u0107 skr\u00f3t klawiszowy kliknij na czerwonym polu i naci\u015bnij klawisz DELETE.",
- "hk-inst-keys": "Mo\u017cliwe kombinacje skr\u00f3t\u00f3w klawiszowych z u\u017cyciem klawiszy CTRL oraz ALT.",
- "hk-feed": "Feed",
- "hk-macroFeed": "Szybki feed",
- "hk-split": "Podzia\u0142",
- "hk-doubleSplit": "Podw\u00f3jny podzia\u0142",
- "hk-split16": "Podzia\u0142 na 16",
- "hk-pause": "Pauza kulki",
- "hk-showTop5": "Poka\u017c/ukryj top 5 teamu",
- "hk-showTime": "Poka\u017c/ukryj aktualny czas",
- "hk-showSplitRange": "Poka\u017c/ukryj zasi\u0119g podzia\u0142u",
- "hk-showSplitInd": "Poka\u017c/ukryj zasi\u0119g podzia\u0142u z ringami",
- "hk-showTeammatesInd": "Poka\u017c/ukryj wska\u017aniki graczy",
- "hk-showOppColors": "Poka\u017c/ukryj kolory przeciwnik\u00f3w",
- "hk-toggleSkins": "Prze\u0142\u0105cz skiny (w\u0142asne/standardowe)",
- "hk-showSkins": "Poka\u017c/ukryj skiny",
- "hk-showStats": "Poka\u017c/ukryj statystyki gry",
- "hk-toggleCells": "Prze\u0142\u0105cz kulk\u0119 (najmniejsza/najwi\u0119ksza)",
- "hk-showFood": "Poka\u017c/ukryj pokarm",
- "hk-showGrid": "Poka\u017c/ukryj siatk\u0119",
- "hk-showMiniMapGuides": "Poka\u017c/ukryj prowadnice na minimapie",
- "hk-hideChat": "Poka\u017c/ukryj czat",
- "hk-showHUD": "Poka\u017c/ukryj HUD",
- "hk-copyLb": "Kopiuj topk\u0119",
- "hk-showLb": "Poka\u017c/ukryj topk\u0119",
- "hk-resetZoom": "Reset zoomu",
- "hk-zoomLevel": "Zoom - poziom",
- "hk-toggleDeath": "Prze\u0142\u0105cz miejsce \u015bmierci",
- "hk-clearChat": "Poka\u017c histori\u0119 czatu / Czy\u015b\u0107 czat",
- "hk-showBgSectors": "Poka\u017c/ukryj sektory w tle",
- "hk-hideBots": "Poka\u017c/ukryj ma\u0142e boty",
- "hk-showNames": "Poka\u017c/ukryj nazwy",
- "hk-showMass": "Poka\u017c/ukryj mas\u0119",
- "hk-showMiniMap": "Poka\u017c/ukryj minimap\u0119",
- "hk-chatMessage": "Napisz wiadomo\u015b\u0107 na czacie",
- "hk-quickResp": "Szybki respawn",
- commands: "Komendy",
- comm1: "Feeduj!",
- comm2: "Dziel si\u0119!",
- comm3: "Pomocy na %currentSector%!",
- comm4: "Wr\u00f3g na %currentSector%!",
- comm5: "Zabij pomocnika!",
- comm6: "Strzel z wirusa!",
- comm7: "Zjedz wirusa!",
- comm8: "Zjeba\u0142em, wybacz.",
- comm9: "Ja pierdol\u0119...",
- comm0: "Kurwa ma\u0107!",
- comm10: "Trick!",
- comm11: "Lewo!",
- comm12: "G\u00f3ra!",
- comm13: "Prawo!",
- comm14: "D\u00f3\u0142!",
- saveComm: "Zapisz komendy",
- theme: "Wygl\u0105d",
- themePreset: "Motyw",
- themeType: "Typ motywu",
- darkTheme: "Ciemny motyw",
- lightTheme: "Jasny motyw",
- mainColor: "Kolor g\u0142\u00f3wny",
- bgColor: "Kolor t\u0142a",
- foodColor: "Kolor pokarmu",
- gridColor: "Kolor siatki / sektor\u00f3w",
- bordersColor: "Kolor granic",
- commandsTextColor: "Kolor tekstu komend",
- virusColor: "Kolor wirus\u00f3w",
- virusStrokeColor: "Kolor obw\u00f3dki wirus\u00f3w",
- customBackground: "Grafika t\u0142a",
- normalLb: 'Nag\u0142\u00f3wek "Leaderboard"',
- centeredLb: "Wy\u015brodkowana topka",
- fpsAtTop: "Statystyki na g\u00f3rze",
- miniMapGrid: "Siatka minimapy",
- hideChatMsgA: "Czat jest aktywny!",
- hideChatMsgB: "Czat zosta\u0142 ukryty!",
- showSkinsMsgA: "Skiny s\u0105 widoczne!",
- showSkinsMsgB: "Skiny zosta\u0142y ukryte!",
- hideSmallBotsMsgA: "Ma\u0142e boty s\u0105 widoczne!",
- hideSmallBotsMsgB: "Ma\u0142e boty zosta\u0142y ukryte!",
- profile: "Profil",
- saveSett: "Zapisz ustawienia",
- resetSett: "Resetuj ustawienia",
- close: "Zamknij",
- enterChatMsg: "Napisz wiadomo\u015b\u0107",
- activePartys: "Aktywne party",
- pause: "PAUZA!",
- visit: "Odwied\u017a",
- exit: "OGARio by szymy: Czy na pewno chcesz opu\u015bcic gr\u0119?"
- },
- en: {
- start: "Start",
- settings: "Settings",
- autoZoom: "Auto zoom",
- autoHideCellsInfo: "Auto hide names and mass",
- autoHideFood: "Auto hide food",
- hideMyName: "Hide my name",
- hideMyMass: "Hide my mass",
- hideEnemiesMass: "Hide enemies mass",
- vanillaSkins: "Vanilla skins",
- customSkins: "Custom skins",
- myTransparentSkin: "My transparent skin",
- myCustomColor: "My custom color",
- transparentCells: "Transparent cells",
- transparentViruses: "Transparent viruses",
- transparentSkins: "Transparent skins",
- showGrid: "Show grid",
- showBgSectors: "Show background sectors",
- showMapBorders: "Show map borders",
- showMiniMap: "Show minimap",
- showMiniMapGuides: "Show minimap guides",
- rainbowFood: "Rainbow food",
- oppColors: "Opponents colors",
- oppRings: "Opponents rings",
- virColors: "Viruses colors",
- splitRange: "Split range",
- virusesRange: "Viruses range",
- textStroke: "Text stroke",
- cursorTracking: "Cursor tracking",
- teammatesInd: "Teammates indicators",
- mouseSplit: "Mouse split",
- mouseFeed: "Mouse feed",
- mouseInvert: "Invert mouse buttons",
- hideChat: "Hide chat",
- showTop5: "Show team top 5",
- showTime: "Show current time",
- showStats: "Show game stats",
- showStatsMass: "Game stats: Mass",
- showStatsSTE: "Game stats: STE",
- showStatsN16: "Game stats: n/16",
- showStatsFPS: "Game stats: FPS",
- hotkeys: "Hotkeys",
- "hk-inst-assign": "To assign a hotkey click on the red field and press your chosen key.",
- "hk-inst-delete": "To delete a hotkey click on the red field and press the DELETE key.",
- "hk-inst-keys": "Possible key combinations with the CTRL and ALT keys.",
- "hk-feed": "Feed",
- "hk-macroFeed": "Macro feed",
- "hk-split": "Split",
- "hk-splitBots": "Split Bots",
- "hk-ejectBots": "Eject Bots",
- "hk-collectPellets": "Collect Pellets",
- "hk-doubleSplit": "Double split",
- "hk-split16": "Split 16",
- "hk-pause": "Cell pause",
- "hk-showTop5": "Show/hide team top 5",
- "hk-showTime": "Show/hide current time",
- "hk-showSplitRange": "Show/hide split range",
- "hk-showSplitInd": "Show/hide split indicators",
- "hk-showTeammatesInd": "Show/hide teammates indicators",
- "hk-showOppColors": "Show/hide opponents colors",
- "hk-toggleSkins": "Toggle skins (custom/default)",
- "hk-showSkins": "Show/hide skins",
- "hk-showStats": "Show/hide game stats",
- "hk-toggleCells": "Toggle own cells (smallest/biggest)",
- "hk-showFood": "Show/hide food",
- "hk-showGrid": "Show/hide grid",
- "hk-showMiniMapGuides": "Show/hide minimap guides",
- "hk-hideChat": "Show/hide chat",
- "hk-showHUD": "Show/hide HUD",
- "hk-copyLb": "Copy leaderboard",
- "hk-showLb": "Show/hide leaderboard",
- "hk-resetZoom": "Reset zoom",
- "hk-zoomLevel": "Zoom level",
- "hk-toggleDeath": "Toggle death location",
- "hk-clearChat": "Show chat history / Clear chat",
- "hk-showBgSectors": "Show/hide background sectors",
- "hk-hideBots": "Show/hide small bots",
- "hk-showNames": "Show/hide names",
- "hk-showMass": "Show/hide mass",
- "hk-showMiniMap": "Show/hide minimap",
- "hk-chatMessage": "Enter chat message",
- "hk-quickResp": "Quick respawn",
- commands: "Commands",
- comm1: "Feed me!",
- comm2: "Split into me!",
- comm3: "Need backup at %currentSector%!",
- comm4: "Enemy spotted at %currentSector%!",
- comm5: "Need a teammate!",
- comm6: "Tank the virus!",
- comm7: "Eat the virus!",
- comm8: "Let's bait!",
- comm9: "Fake tricksplit!",
- comm0: "Fuck!",
- comm10: "Tricksplit!",
- comm11: "Left!",
- comm12: "Up!",
- comm13: "Right!",
- comm14: "Bottom!",
- saveComm: "Save commands",
- theme: "Theme",
- themePreset: "Theme preset",
- themeType: "Theme type",
- darkTheme: "Dark theme",
- lightTheme: "Light theme",
- mainColor: "Main color",
- bgColor: "Background color",
- foodColor: "Food color",
- gridColor: "Grid / sectors color",
- bordersColor: "Borders color",
- commandsTextColor: "Commands text color",
- virusColor: "Virus color",
- virusStrokeColor: "Virus stroke color",
- customBackground: "Custom background image",
- normalLb: '"Leaderboard" header',
- centeredLb: "Centered leaderboard",
- fpsAtTop: "Game stats at the top",
- miniMapGrid: "Minimap grid",
- hideChatMsgA: "Chat is visible!",
- hideChatMsgB: "Chat is hidden!",
- showSkinsMsgA: "Skins are visible!",
- showSkinsMsgB: "Skins are hidden!",
- hideSmallBotsMsgA: "Small bots are visible!",
- hideSmallBotsMsgB: "Small bots are hidden!",
- profile: "Profile",
- saveSett: "Save settings",
- resetSett: "Reset to default",
- close: "Close",
- enterChatMsg: "Enter chat message",
- activePartys: "Active partys",
- pause: "PAUSE!",
- visit: "Visit",
- exit: "OGARio by szymy: Are you sure you want to quit the game?"
- }
- };
- var _0xd162xe = {
- comm1: _0xd162xd[_0xd162xc].comm1,
- comm2: _0xd162xd[_0xd162xc].comm2,
- comm3: _0xd162xd[_0xd162xc].comm3,
- comm4: _0xd162xd[_0xd162xc].comm4,
- comm5: _0xd162xd[_0xd162xc].comm5,
- comm6: _0xd162xd[_0xd162xc].comm6,
- comm7: _0xd162xd[_0xd162xc].comm7,
- comm8: _0xd162xd[_0xd162xc].comm8,
- comm9: _0xd162xd[_0xd162xc].comm9,
- comm0: _0xd162xd[_0xd162xc].comm0,
- comm10: _0xd162xd[_0xd162xc].comm10,
- comm11: _0xd162xd[_0xd162xc].comm11,
- comm12: _0xd162xd[_0xd162xc].comm12,
- comm13: _0xd162xd[_0xd162xc].comm13,
- comm14: _0xd162xd[_0xd162xc].comm14
- };
- var _0xd162xf = {
- "&": "&",
- "<": "<",
- ">": ">",
- '"': """,
- "'": "'",
- "/": "/"
- };
- var _0xd162x10 = {
- "ogario-gold": {
- name: "OGARio Gold",
- centeredLb: true,
- fpsAtTop: true,
- miniMapGrid: false,
- darkTheme: true,
- mainColor: "#b5a642",
- bgColor: "#000000",
- gridColor: "#111111",
- bordersColor: "#b5a642",
- foodColor: "#998c36",
- commandsTextColor: "#ffffff",
- virusColor: "#666666",
- virusStrokeColor: "#666666"
- },
- "ogario-orange": {
- name: "OGARio Orange",
- centeredLb: true,
- fpsAtTop: true,
- miniMapGrid: false,
- darkTheme: true,
- mainColor: "#ff7800",
- bgColor: "#111111",
- gridColor: "#292929",
- bordersColor: "#ff7800",
- foodColor: "#e16400",
- commandsTextColor: "#ffffff",
- virusColor: "#666666",
- virusStrokeColor: "#666666"
- },
- "pokemon-go": {
- name: "Pokemon GO Theme",
- centeredLb: true,
- fpsAtTop: true,
- miniMapGrid: false,
- darkTheme: false,
- mainColor: "#cf0000",
- bgColor: "#ffcc00",
- gridColor: "#2972ff",
- bordersColor: "#ff0000",
- foodColor: "#00019a",
- commandsTextColor: "#ffffff",
- virusColor: "#ffffff",
- virusStrokeColor: "#ff0000"
- },
- "sniikz-style": {
- name: "SniiKz's Style",
- centeredLb: false,
- fpsAtTop: false,
- miniMapGrid: false,
- darkTheme: true,
- mainColor: "#ff90e8",
- bgColor: "#000000",
- gridColor: "#08151d",
- bordersColor: "#ffffff",
- foodColor: "#5a00ff",
- commandsTextColor: "#000000",
- virusColor: "#666666",
- virusStrokeColor: "#666666"
- },
- "hkg-style": {
- name: "HKG Style",
- centeredLb: false,
- fpsAtTop: false,
- miniMapGrid: false,
- darkTheme: true,
- mainColor: "#651fff",
- bgColor: "#000000",
- gridColor: "#111111",
- bordersColor: "#ffffff",
- foodColor: "#651fff",
- commandsTextColor: "#ffffff",
- virusColor: "#666666",
- virusStrokeColor: "#666666"
- },
- "agario-light": {
- name: "Agario Light",
- centeredLb: true,
- fpsAtTop: false,
- miniMapGrid: true,
- darkTheme: false,
- mainColor: "#ffffff",
- bgColor: "#f2fbff",
- gridColor: "#ced6d9",
- bordersColor: "#858a8c",
- foodColor: "#2de52d",
- commandsTextColor: "#111111",
- virusColor: "#33ff33",
- virusStrokeColor: "#2de52d"
- },
- "agario-dark": {
- name: "Agario Dark",
- centeredLb: true,
- fpsAtTop: false,
- miniMapGrid: true,
- darkTheme: false,
- mainColor: "#ffffff",
- bgColor: "#111111",
- gridColor: "#333333",
- bordersColor: "#999999",
- foodColor: "#2de52d",
- commandsTextColor: "#111111",
- virusColor: "#33ff33",
- virusStrokeColor: "#2de52d"
- }
- };
- var _0xd162x11 = {
- preset: "ogario-orange",
- normalLb: false,
- centeredLb: true,
- fpsAtTop: true,
- miniMapGrid: false,
- darkTheme: true,
- mainColor: "#ff7800",
- bgColor: "#111111",
- gridColor: "#292929",
- bordersColor: "#ff7800",
- foodColor: "#e16400",
- commandsTextColor: "#ffffff",
- virusColor: "#666666",
- virusStrokeColor: "#666666",
- customBackground: "",
- sectorsX: 5,
- sectorsY: 5,
- bordersWidth: 20,
- sectorsWidth: 40,
- cellsAlpha: 0.9,
- skinsAlpha: 0.7,
- virusAlpha: 0.6
- };
- _0xd162x4.prototype = {
- customStyle: null,
- loadThemeSettings: function() {
- var _0xd162x3 = null;
- if (null !== _0xd162x1.localStorage.getItem("ogarioThemeSettings")) {
- _0xd162x3 = JSON.parse(_0xd162x1.localStorage.getItem("ogarioThemeSettings"));
- }
- var _0xd162x4;
- for (_0xd162x4 in _0xd162x11) {
- if (_0xd162x11.hasOwnProperty(_0xd162x4)) {
- if (_0xd162x3) {
- if (_0xd162x3.hasOwnProperty(_0xd162x4)) {
- _0xd162x11[_0xd162x4] = _0xd162x3[_0xd162x4];
- }
- }
- if (_0xd162x2.hasOwnProperty(_0xd162x4)) {
- _0xd162x2[_0xd162x4] = _0xd162x11[_0xd162x4];
- }
- }
- }
- },
- saveThemeSettings: function() {
- _0xd162x1.localStorage.setItem("ogarioTheme", JSON.stringify(_0xd162x11));
- },
- setThemeMenu: function() {
- var _0xd162x1 = this;
- _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">' +
- _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="' +
- _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="' +
- _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 +
- '</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">' +
- _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>');
- var _0xd162x4;
- for (_0xd162x4 in _0xd162x10) {
- if (_0xd162x10.hasOwnProperty(_0xd162x4)) {
- _0xd162x3("#theme-presets").append('<option value="' + _0xd162x4 + '">' + _0xd162x10[_0xd162x4].name + "</option>");
- }
- }
- _0xd162x3("#theme-presets").val(_0xd162x11.preset);
- _0xd162x3("#theme-presets").change(function() {
- var _0xd162x2 = _0xd162x3(this).val();
- _0xd162x1.changeThemePreset(_0xd162x2);
- });
- _0xd162x3("#theme .main-color-picker").colorpicker({
- format: "hex"
- }).on("changeColor.colorpicker", function(_0xd162x2) {
- _0xd162x11.mainColor = _0xd162x2.color.toHex();
- _0xd162x1.setMainColor();
- });
- _0xd162x3("#theme .background-color-picker").colorpicker({
- format: "hex"
- }).on("changeColor.colorpicker", function(_0xd162x1) {
- _0xd162x11.bgColor = _0xd162x1.color.toHex();
- _0xd162x3("body").css("background-color", _0xd162x11.bgColor);
- });
- _0xd162x3("#theme .food-color-picker").colorpicker({
- format: "hex"
- }).on("changeColor.colorpicker", function(_0xd162x1) {
- _0xd162x11.foodColor = _0xd162x1.color.toHex();
- _0xd162x2.foodColor = _0xd162x11.foodColor;
- });
- _0xd162x3("#theme .grid-color-picker").colorpicker({
- format: "hex"
- }).on("changeColor.colorpicker", function(_0xd162x1) {
- _0xd162x11.gridColor = _0xd162x1.color.toHex();
- });
- _0xd162x3("#theme .borders-color-picker").colorpicker({
- format: "hex"
- }).on("changeColor.colorpicker", function(_0xd162x1) {
- _0xd162x11.bordersColor = _0xd162x1.color.toHex();
- });
- _0xd162x3("#theme .text-color-picker").colorpicker({
- format: "hex"
- }).on("changeColor.colorpicker", function(_0xd162x2) {
- _0xd162x11.commandsTextColor = _0xd162x2.color.toHex();
- _0xd162x1.setMainColor();
- });
- _0xd162x3("#theme .virus-color-picker").colorpicker({
- format: "hex"
- }).on("changeColor.colorpicker", function(_0xd162x1) {
- _0xd162x11.virusColor = _0xd162x1.color.toHex();
- _0xd162x2.virusColor = _0xd162x11.virusColor;
- });
- _0xd162x3("#theme .virus-stroke-color-picker").colorpicker({
- format: "hex"
- }).on("changeColor.colorpicker", function(_0xd162x1) {
- _0xd162x11.virusStrokeColor = _0xd162x1.color.toHex();
- _0xd162x2.virusStrokeColor = _0xd162x11.virusStrokeColor;
- });
- _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 +
- '</label><label><input type="checkbox" onchange="setThemeSettings(\'miniMapGrid\', $(this).is(\':checked\'));" id="miniMapGrid">' + _0xd162xd[_0xd162xc].miniMapGrid + "</label></div>");
- _0xd162x3("#theme").append('<button class="btn btn-block btn-success btn-save" onclick="saveThemeSettings();">' + _0xd162xd[_0xd162xc].saveSett + "</button>");
- _0xd162x3("#theme-type").change(function() {
- var _0xd162x2 = _0xd162x3(this).find("input:checked").attr("id");
- _0xd162x1.changeThemeType(_0xd162x2);
- });
- _0xd162x3("#custom-background").change(function() {
- var _0xd162x1 = _0xd162x3(this).val();
- _0xd162x3("body").css("background-image", "url(" + _0xd162x1 + ")");
- _0xd162x11.customBackground = _0xd162x1;
- });
- _0xd162x3(".skin").colorpicker({
- format: "hex",
- input: "#color"
- });
- this.setOptions();
- },
- setOptions: function() {
- _0xd162x3("#centeredLb").prop("checked", _0xd162x11.centeredLb);
- _0xd162x3("#normalLb").prop("checked", _0xd162x11.normalLb);
- _0xd162x3("#fpsAtTop").prop("checked", _0xd162x11.fpsAtTop);
- _0xd162x3("#miniMapGrid").prop("checked", _0xd162x11.miniMapGrid);
- },
- setMainColor: function() {
- if (!this.customStyle) {
- this.customStyle = _0xd162x3("<style type='text/css'>").appendTo("head");
- }
- 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 + "; }");
- },
- setCenteredLb: function() {
- if (_0xd162x11.centeredLb) {
- _0xd162x3("#leaderboard-hud").addClass("hud-text-center");
- } else {
- _0xd162x3("#leaderboard-hud").removeClass("hud-text-center");
- }
- },
- setNormalLb: function() {
- _0xd162x3("#leaderboard-hud h4").html(_0xd162x11.normalLb ? "Leaderboard" : "ogario.ovh");
- },
- setFpsAtTop: function() {
- if (_0xd162x11.fpsAtTop) {
- _0xd162x3("#stats-hud").removeClass("hud-bottom").addClass("hud-top");
- } else {
- _0xd162x3("#stats-hud").removeClass("hud-top").addClass("hud-bottom");
- }
- },
- changeThemePreset: function(_0xd162x1) {
- if (_0xd162x10[_0xd162x1]) {
- _0xd162x11.preset = _0xd162x1;
- _0xd162x1 = _0xd162x10[_0xd162x1];
- var _0xd162x4;
- for (_0xd162x4 in _0xd162x1) {
- if (_0xd162x1.hasOwnProperty(_0xd162x4)) {
- if (_0xd162x11.hasOwnProperty(_0xd162x4)) {
- _0xd162x11[_0xd162x4] = _0xd162x1[_0xd162x4];
- if (_0xd162x2.hasOwnProperty(_0xd162x4)) {
- _0xd162x2[_0xd162x4] = _0xd162x11[_0xd162x4];
- }
- }
- }
- }
- this.setTheme();
- _0xd162x3("#theme .main-color-picker").colorpicker("setValue", _0xd162x11.mainColor);
- _0xd162x3("#theme .background-color-picker").colorpicker("setValue", _0xd162x11.bgColor);
- _0xd162x3("#theme .food-color-picker").colorpicker("setValue", _0xd162x11.foodColor);
- _0xd162x3("#theme .grid-color-picker").colorpicker("setValue", _0xd162x11.gridColor);
- _0xd162x3("#theme .borders-color-picker").colorpicker("setValue", _0xd162x11.bordersColor);
- _0xd162x3("#theme .text-color-picker").colorpicker("setValue", _0xd162x11.commandsTextColor);
- _0xd162x3("#theme .virus-color-picker").colorpicker("setValue", _0xd162x11.virusColor);
- _0xd162x3("#theme .virus-stroke-color-picker").colorpicker("setValue", _0xd162x11.virusStrokeColor);
- }
- },
- changeThemeType: function(_0xd162x1) {
- if ("darkTheme" === _0xd162x1) {
- _0xd162x11.darkTheme = true;
- _0xd162x11.bgColor = "#000000";
- _0xd162x11.gridColor = "#111111";
- _0xd162x11.virusColor = "#999999";
- _0xd162x11.virusStrokeColor = "#999999";
- _0xd162x3("#theme .background-color-picker").colorpicker("setValue", "#000000");
- _0xd162x3("#theme .grid-color-picker").colorpicker("setValue", "#111111");
- _0xd162x3("#minimap-sectors").css("opacity", "0.1");
- } else {
- _0xd162x11.darkTheme = false;
- _0xd162x11.bgColor = "#f2fbff";
- _0xd162x11.gridColor = "#ced6d9";
- _0xd162x11.virusColor = "#666666";
- _0xd162x11.virusStrokeColor = "#666666";
- _0xd162x3("#theme .background-color-picker").colorpicker("setValue", "#f2fbff");
- _0xd162x3("#theme .grid-color-picker").colorpicker("setValue", "#ced6d9");
- _0xd162x3("#minimap-sectors").css("opacity", "0.25");
- }
- },
- setTheme: function() {
- this.setOptions();
- this.setMainColor();
- this.setCenteredLb();
- this.setNormalLb();
- this.setFpsAtTop();
- if (_0xd162x17) {
- _0xd162x17.resetMiniMapSectors();
- }
- _0xd162x3("body").css("background-color", _0xd162x11.bgColor);
- _0xd162x3("body").css("background-image", "url(" + _0xd162x11.customBackground + ")");
- if (_0xd162x11.darkTheme) {
- _0xd162x3("#minimap-sectors").css("opacity", "0.1");
- _0xd162x3("#lightTheme").closest("label").removeClass("active");
- _0xd162x3("#darkTheme").closest("label").addClass("active");
- } else {
- _0xd162x3("#minimap-sectors").css("opacity", "0.25");
- _0xd162x3("#darkTheme").closest("label").removeClass("active");
- _0xd162x3("#lightTheme").closest("label").addClass("active");
- }
- },
- init: function() {
- this.loadThemeSettings();
- }
- };
- var _0xd162x12 = new _0xd162x4;
- _0xd162x12.init();
- _0xd162x1.setThemeSettings = function(_0xd162x1, _0xd162x2) {
- if (_0xd162x11.hasOwnProperty(_0xd162x1) && null !== _0xd162x2) {
- switch (_0xd162x11[_0xd162x1] = _0xd162x2, _0xd162x1) {
- case "centeredLb":
- _0xd162x12.setCenteredLb();
- break;
- case "normalLb":
- _0xd162x12.setNormalLb();
- break;
- case "fpsAtTop":
- _0xd162x12.setFpsAtTop();
- break;
- case "miniMapGrid":
- if (_0xd162x17) {
- _0xd162x17.resetMiniMapSectors();
- };
- }
- }
- };
- _0xd162x1.saveThemeSettings = function() {
- if (_0xd162x17) {
- _0xd162x17.saveSettings(_0xd162x11, "ogarioThemeSettings");
- }
- };
- var _0xd162x13 = [];
- var _0xd162x14 = {};
- var _0xd162x15 = {
- nick: "I <3 szymy",
- clanTag: "\u24c2",
- skinURL: "",
- color: _0xd162x11.mainColor
- };
- var _0xd162x16 = {
- autoZoom: true,
- autoHideCellsInfo: true,
- autoHideFood: true,
- hideMyName: true,
- hideMyMass: false,
- hideEnemiesMass: false,
- vanillaSkins: false,
- customSkins: true,
- myTransparentSkin: false,
- myCustomColor: false,
- transparentCells: false,
- transparentViruses: true,
- transparentSkins: false,
- showGrid: false,
- showBgSectors: false,
- showMapBorders: true,
- showMiniMap: true,
- showMiniMapGuides: false,
- rainbowFood: false,
- oppColors: false,
- oppRings: false,
- virColors: false,
- splitRange: false,
- virusesRange: false,
- textStroke: false,
- cursorTracking: true,
- teammatesInd: false,
- mouseSplit: false,
- mouseFeed: false,
- mouseInvert: false,
- hideChat: false,
- showTop5: true,
- showTime: true,
- showStats: true,
- showStatsMass: false,
- showStatsSTE: false,
- showStatsN16: false,
- showStatsFPS: true,
- zoomSpeedValue: 0.9,
- streamMode: false,
- hideSkinUrl: false
- };
- _0xd162x5.prototype = {
- id: 0,
- skinID: "",
- x: 0,
- y: 0,
- lastX: 0,
- lastY: 0,
- mass: 0,
- nick: "",
- clanTag: "",
- skinURL: "",
- color: _0xd162x11.mainColor,
- alive: false,
- updateTime: null,
- pi2: 2 * Math.PI,
- drawPosition: function(_0xd162x1, _0xd162x2, _0xd162x3) {
- if (this.alive) {
- this.lastX = (29 * this.lastX + this.x) / 30;
- this.lastY = (29 * this.lastY + this.y) / 30;
- var _0xd162x4 = (this.lastX + _0xd162x2) * _0xd162x3;
- var _0xd162x5 = (this.lastY + _0xd162x2) * _0xd162x3;
- if (this.nick.length > 0) {
- _0xd162x1.fillStyle = "#FFFFFF";
- _0xd162x1.font = "10px Ubuntu";
- _0xd162x1.textAlign = "center";
- _0xd162x1.fillText(this.nick, _0xd162x4, _0xd162x5 - 12);
- }
- _0xd162x1.beginPath();
- _0xd162x1.arc(_0xd162x4, _0xd162x5, 4.5, 0, this.pi2, false);
- _0xd162x1.closePath();
- _0xd162x1.fillStyle = this.color;
- _0xd162x1.fill();
- }
- }
- };
- // window.bots = [new _0xd162x5(1, "u-bot.pw", 1, "", "#fffff"),new _0xd162x5(2, "u-bot.pw", 2, "", "#fffff")];
- _0xd162x6.prototype = {
- name: "OGARio by szymy v2.1",
- version: "v2.1.2",
- privateMode: false,
- publicIP: "ws://164.132.227.101:3000",
- privateIP: null,
- updateInterval: 1E3,
- updateTick: 0,
- updateMaxTick: 2,
- currentSector: "",
- miniMap: null,
- miniMapCtx: null,
- miniMapSectors: null,
- pi2: 2 * Math.PI,
- socket: null,
- teamPlayers: [],
- partys: [],
- chatHistory: [],
- customSkinsCache: {},
- customSkinsMap: {},
- deathLocations: [],
- playerID: null,
- playerMass: 0,
- selectedProfile: 0,
- lastDeath: 0,
- gameMode: "",
- partyToken: "",
- lastSentNick: "",
- lastSentClanTag: null,
- lastSentSkinURL: "",
- lastSentCustomColor: "",
- lastSentPartyToken: "",
- lastMessageSentTime: Date.now(),
- rFps: 0,
- renderedFrames: 0,
- fpsLastRequest: null,
- statsHUD: null,
- leaderboardPositionsHUD: null,
- activePartys: null,
- top5HUD: null,
- timeHUD: null,
- retryResp: 0,
- token: "b2dhcmlvLm92aA==",
- canvasScale: 1,
- selectBiggestCell: true,
- noSkins: false,
- noNames: false,
- noColors: false,
- showMass: true,
- skipStats: false,
- showSplitInd: false,
- pause: false,
- feedInterval: null,
- getPlayerX: function() {
- return _0xd162x2.playerX + _0xd162x2.mapOffsetX;
- },
- getPlayerY: function() {
- return _0xd162x2.playerY + _0xd162x2.mapOffsetY;
- },
- feed: function() {
- if (_0xd162x1.core) {
- if (_0xd162x1.core.eject) {
- _0xd162x1.core.eject();
- }
- }
- },
- macroFeed: function(_0xd162x1) {
- if (_0xd162x1) {
- if (this.feedInterval) {
- return;
- }
- var _0xd162x2 = this;
- this.feed();
- this.feedInterval = setInterval(function() {
- _0xd162x2.feed();
- }, 80);
- } else {
- if (this.feedInterval) {
- clearInterval(this.feedInterval);
- this.feedInterval = null;
- }
- }
- },
- split: function() {
- if (_0xd162x1.core) {
- if (_0xd162x1.core.split) {
- _0xd162x1.core.split();
- }
- }
- },
- doubleSplit: function() {
- var _0xd162x1 = this;
- _0xd162x1.split();
- setTimeout(function() {
- _0xd162x1.split();
- }, 40);
- },
- popSplit: function() {
- var _0xd162x1 = this;
- _0xd162x1.split();
- setTimeout(function() {
- _0xd162x1.split();
- }, 200);
- },
- split16: function() {
- var _0xd162x1 = this;
- _0xd162x1.split();
- setTimeout(function() {
- _0xd162x1.split();
- }, 40);
- setTimeout(function() {
- _0xd162x1.split();
- }, 80);
- setTimeout(function() {
- _0xd162x1.split();
- }, 120);
- },
- toggleSkins: function() {
- if (_0xd162x2.vanillaSkins && _0xd162x2.customSkins) {
- _0xd162x2.vanillaSkins = false;
- } else {
- if (!_0xd162x2.vannillaSkins && _0xd162x2.customSkins) {
- _0xd162x2.vanillaSkins = true;
- _0xd162x2.customSkins = false;
- } else {
- _0xd162x2.vanillaSkins = true;
- _0xd162x2.customSkins = true;
- }
- }
- },
- toggleCells: function() {
- this.selectBiggestCell = !this.selectBiggestCell;
- _0xd162x2.selectBiggestCell = this.selectBiggestCell;
- },
- setShowTop5: function() {
- if (":party" === this.gameMode) {
- _0xd162x16.showTop5 = !_0xd162x16.showTop5;
- this.setTop5();
- }
- },
- setTop5: function() {
- if (_0xd162x16.showTop5 && ":party" === this.gameMode) {
- _0xd162x3("#top5-hud").show();
- } else {
- _0xd162x3("#top5-hud").hide();
- }
- },
- setShowTime: function() {
- _0xd162x16.showTime = !_0xd162x16.showTime;
- if (_0xd162x16.showTime) {
- _0xd162x3("#time-hud").show();
- this.displayTime();
- } else {
- _0xd162x3("#time-hud").hide();
- }
- },
- setShowSplitRange: function() {
- _0xd162x16.splitRange = !_0xd162x16.splitRange;
- _0xd162x2.splitRange = _0xd162x16.splitRange;
- },
- setShowSplitInd: function() {
- this.showSplitInd = !this.showSplitInd;
- _0xd162x16.splitRange = this.showSplitInd;
- _0xd162x16.oppRings = this.showSplitInd;
- _0xd162x2.splitRange = _0xd162x16.splitRange;
- _0xd162x2.oppRings = _0xd162x16.oppRings;
- },
- setShowTeammatesInd: function() {
- _0xd162x2.teammatesInd = !_0xd162x2.teammatesInd;
- },
- setShowOppColors: function() {
- _0xd162x16.oppColors = !_0xd162x16.oppColors;
- _0xd162x2.oppColors = _0xd162x16.oppColors;
- },
- setShowSkins: function() {
- this.noSkins = !this.noSkins;
- if (_0xd162x1.core) {
- if (_0xd162x1.core.setSkins) {
- _0xd162x1.core.setSkins(!this.noSkins);
- }
- }
- _0xd162x2.showCustomSkins = !this.noSkins;
- this.displayChatInfo(!this.noSkins, "showSkinsMsg");
- },
- setShowStats: function() {
- _0xd162x3("#stats-hud").toggle();
- },
- setShowFood: function() {
- _0xd162x2.showFood = !_0xd162x2.showFood;
- },
- setShowHUD: function() {
- _0xd162x3("#overlays-hud").toggle();
- },
- setShowGrid: function() {
- _0xd162x16.showGrid = !_0xd162x16.showGrid;
- _0xd162x2.showGrid = _0xd162x16.showGrid;
- },
- setShowMiniMapGuides: function() {
- _0xd162x16.showMiniMapGuides = !_0xd162x16.showMiniMapGuides;
- },
- setShowLb: function() {
- if (":teams" !== this.gameMode) {
- _0xd162x3("#leaderboard-hud").toggle();
- }
- },
- setShowBgSectors: function() {
- _0xd162x16.showBgSectors = !_0xd162x16.showBgSectors;
- },
- setHideSmallBots: function() {
- _0xd162x2.hideSmallBots = !_0xd162x2.hideSmallBots;
- this.displayChatInfo(!_0xd162x2.hideSmallBots, "hideSmallBotsMsg");
- },
- setShowNames: function() {
- this.noNames = !this.noNames;
- if (_0xd162x1.core) {
- if (_0xd162x1.core.setNames) {
- _0xd162x1.core.setNames(!this.noNames);
- }
- }
- },
- setShowMass: function() {
- this.showMass = !this.showMass;
- if (_0xd162x1.core) {
- if (_0xd162x1.core.setShowMass) {
- _0xd162x1.core.setShowMass(this.showMass);
- }
- }
- },
- setShowMiniMap: function() {
- _0xd162x16.showMiniMap = !_0xd162x16.showMiniMap;
- this.setMiniMap();
- },
- setMiniMap: function() {
- if (_0xd162x16.showMiniMap) {
- _0xd162x3("#minimap-hud").show();
- } else {
- _0xd162x3("#minimap-hud").hide();
- }
- },
- resetZoom: function(_0xd162x1) {
- if (_0xd162x1) {
- _0xd162x2.zoomResetValue = 1;
- _0xd162x2.zoomValue = 1;
- } else {
- _0xd162x2.zoomResetValue = 0;
- }
- },
- setZoom: function(_0xd162x1) {
- _0xd162x2.zoomValue = _0xd162x1;
- },
- toggleDeath: function() {
- this.lastDeath--;
- if (this.lastDeath < 0) {
- this.lastDeath = this.deathLocations.length - 1;
- }
- },
- tryResp: function() {
- if (_0xd162x2.play || 20 == this.retryResp) {
- return void(this.retryResp = 0);
- }
- this.retryResp++;
- var _0xd162x1 = this;
- setTimeout(function() {
- _0xd162x3(".btn-play").click();
- if (!_0xd162x2.play) {
- _0xd162x1.tryResp();
- }
- }, 500);
- },
- quickResp: function() {
- if (":party" === this.gameMode) {
- _0xd162x3("#join-party-btn").click();
- }
- _0xd162x2.play = false;
- this.tryResp();
- },
- copyLb: function() {
- var _0xd162x1 = _0xd162x3("<input>");
- _0xd162x3("body").append(_0xd162x1);
- _0xd162x1.val(_0xd162x3("#leaderboard-positions").text()).select();
- try {
- document.execCommand("copy");
- } catch (_0xd162x2) {}
- _0xd162x1.remove();
- },
- setPause: function() {
- this.pause = !this.pause;
- _0xd162x2.pause = this.pause;
- if (this.pause) {
- _0xd162x3("#pause-hud").show();
- } else {
- _0xd162x3("#pause-hud").hide();
- }
- },
- displayLeaderboard: function(_0xd162x1) {
- if (this.leaderboardPositionsHUD) {
- this.leaderboardPositionsHUD.innerHTML = _0xd162x1;
- }
- },
- displayStats: function() {
- if (!_0xd162x16.showStats) {
- return void _0xd162x3("#stats-hud").hide();
- }
- var _0xd162x1 = "";
- if (ubot.total) {
- _0xd162x1 += "Bot Count: " + + ubot.count + "/" + ubot.total + " | ";
- }
- if (_0xd162x2.play) {
- if (_0xd162x16.showStatsMass) {
- if (_0xd162x2.playerMass) {
- _0xd162x1 += "Mass: " + _0xd162x2.playerMass + " | ";
- }
- }
- if (_0xd162x2.playerBestMass) {
- _0xd162x1 += "Score: " + _0xd162x2.playerBestMass;
- }
- if (_0xd162x16.showStatsSTE) {
- if (_0xd162x2.STE) {
- _0xd162x1 += " | STE: " + _0xd162x2.STE;
- }
- }
- if (_0xd162x16.showStatsN16) {
- if (_0xd162x2.playerCellsMass) {
- _0xd162x1 += " | " + _0xd162x2.playerCellsMass.length + "/16";
- }
- }
- if (_0xd162x16.showStatsFPS) {
- _0xd162x1 += " | ";
- }
- }
- if (_0xd162x16.showStatsFPS) {
- _0xd162x1 += "FPS: " + this.rFps;
- }
- this.statsHUD.textContent = _0xd162x1;
- var _0xd162x4 = this;
- setTimeout(function() {
- _0xd162x4.displayStats();
- }, 250);
- },
- displayTime: function() {
- if (!_0xd162x16.showTime) {
- return void _0xd162x3("#time-hud").hide();
- }
- var _0xd162x1 = (new Date).toLocaleString();
- this.timeHUD.textContent = _0xd162x1;
- var _0xd162x2 = this;
- setTimeout(function() {
- _0xd162x2.displayTime();
- }, 1E3);
- },
- displayPartys: function() {
- var _0xd162x1 = "";
- var _0xd162x2 = 0;
- for (; _0xd162x2 < this.partys.length; _0xd162x2++) {
- _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>";
- }
- this.activePartys.innerHTML = _0xd162x1;
- },
- displayTop5: function() {
- if (_0xd162x16.showTop5) {
- var _0xd162x1 = "";
- var _0xd162x2 = 0;
- 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++) {}
- this.top5pHUD.innerHTML = _0xd162x1;
- }
- },
- displayChatHistory: function(_0xd162x1) {
- if (_0xd162x1) {
- _0xd162x3("#messages").empty();
- toastr.clear();
- var _0xd162x2 = 0;
- for (; _0xd162x2 < this.chatHistory.length; _0xd162x2++) {
- _0xd162x3("#messages").append('<li><span class="message-nick main-color">' + this.chatHistory[_0xd162x2].nick + ": </span>" + this.chatHistory[_0xd162x2].message + "</li>");
- }
- } else {
- _0xd162x3("#messages").empty();
- }
- },
- displayChatInfo: function(_0xd162x1, _0xd162x2) {
- if (_0xd162x1) {
- toastr.info(_0xd162xd[_0xd162xc][_0xd162x2 + "A"]);
- } else {
- toastr.error(_0xd162xd[_0xd162xc][_0xd162x2 + "B"]);
- }
- },
- hideChat: function() {
- if (":party" === this.gameMode) {
- _0xd162x16.hideChat = !_0xd162x16.hideChat;
- if (_0xd162x16.hideChat) {
- _0xd162x3("#message").hide();
- }
- this.displayChatInfo(!_0xd162x16.hideChat, "hideChatMsg");
- }
- },
- enterChatMessage: function() {
- if (":party" === this.gameMode) {
- var _0xd162x1 = _0xd162x3("#message");
- if (_0xd162x1.is(":visible")) {
- var _0xd162x4 = _0xd162x1.val();
- if (_0xd162x4.length > 0) {
- this.sendChatMessage(101, _0xd162x4);
- if (_0xd162x2.play) {
- _0xd162x1.blur();
- _0xd162x1.hide();
- }
- } else {
- _0xd162x1.blur();
- _0xd162x1.hide();
- }
- _0xd162x1.val("");
- } else {
- _0xd162x1.show();
- _0xd162x1.focus();
- _0xd162x1.val("");
- }
- }
- },
- escapeHTML: function(_0xd162x1) {
- return (_0xd162x1 + "").replace(/[&<>"'\/]/g, function(_0xd162x1) {
- return _0xd162xf[_0xd162x1];
- });
- },
- loadSettings: function() {
- var _0xd162x3 = null;
- if (null !== _0xd162x1.localStorage.getItem("ogarioSettings")) {
- _0xd162x3 = JSON.parse(_0xd162x1.localStorage.getItem("ogarioSettings"));
- }
- var _0xd162x4;
- for (_0xd162x4 in _0xd162x16) {
- if (_0xd162x16.hasOwnProperty(_0xd162x4)) {
- if (_0xd162x3) {
- if (_0xd162x3.hasOwnProperty(_0xd162x4)) {
- _0xd162x16[_0xd162x4] = _0xd162x3[_0xd162x4];
- }
- }
- if (_0xd162x2.hasOwnProperty(_0xd162x4)) {
- _0xd162x2[_0xd162x4] = _0xd162x16[_0xd162x4];
- }
- }
- }
- },
- saveSettings: function(_0xd162x2, _0xd162x3) {
- _0xd162x1.localStorage.setItem(_0xd162x3, JSON.stringify(_0xd162x2));
- },
- loadProfiles: function() {
- if (null !== _0xd162x1.localStorage.getItem("ogarioPlayerProfiles")) {
- _0xd162x13 = JSON.parse(_0xd162x1.localStorage.getItem("ogarioPlayerProfiles"));
- } else {
- var _0xd162x2 = 0;
- for (; 10 > _0xd162x2; _0xd162x2++) {
- _0xd162x13.push({
- nick: "Profile #" + (_0xd162x2 + 1),
- clanTag: "",
- skinURL: "",
- color: _0xd162x11.mainColor
- });
- }
- }
- if (null !== _0xd162x1.localStorage.getItem("ogarioSelectedProfile")) {
- this.selectedProfile = JSON.parse(_0xd162x1.localStorage.getItem("ogarioSelectedProfile"));
- }
- _0xd162x15.nick = _0xd162x13[this.selectedProfile].nick;
- _0xd162x15.clanTag = _0xd162x13[this.selectedProfile].clanTag;
- _0xd162x15.skinURL = _0xd162x13[this.selectedProfile].skinURL;
- _0xd162x15.color = _0xd162x13[this.selectedProfile].color;
- },
- changeSkinPreview: function(_0xd162x1, _0xd162x2) {
- if (_0xd162x1) {
- if (_0xd162x2) {
- _0xd162x3("#" + _0xd162x2).removeClass(_0xd162x2 + "-default").append(_0xd162x3(_0xd162x1).fadeIn(500));
- }
- }
- },
- setSkinPreview: function(_0xd162x1, _0xd162x2) {
- if (_0xd162x3("#" + _0xd162x2).empty().addClass(_0xd162x2 + "-default"), _0xd162x1 && 0 != _0xd162x1.length) {
- var _0xd162x4 = this;
- var _0xd162x5 = new Image;
- _0xd162x5.crossOrigin = "Anonymous";
- _0xd162x5.onload = function() {
- _0xd162x14[_0xd162x1] = _0xd162x5;
- _0xd162x4.changeSkinPreview(_0xd162x5, _0xd162x2);
- };
- _0xd162x5.src = _0xd162x1;
- }
- },
- setProfile: function() {
- var _0xd162x1 = (_0xd162x13.length + this.selectedProfile - 1) % _0xd162x13.length;
- var _0xd162x2 = (this.selectedProfile + 1) % _0xd162x13.length;
- this.setSkinPreview(_0xd162x13[_0xd162x1].skinURL, "prev-profile");
- this.setSkinPreview(_0xd162x13[this.selectedProfile].skinURL, "skin-preview");
- this.setSkinPreview(_0xd162x13[_0xd162x2].skinURL, "next-profile");
- _0xd162x3("#nick").val(_0xd162x13[this.selectedProfile].nick);
- _0xd162x3("#clantag").val(_0xd162x13[this.selectedProfile].clanTag);
- _0xd162x3("#skin").val(_0xd162x13[this.selectedProfile].skinURL);
- _0xd162x3("#color").val(_0xd162x13[this.selectedProfile].color);
- _0xd162x3(".skin").colorpicker("setValue", _0xd162x13[this.selectedProfile].color);
- },
- prevProfile: function() {
- this.setPlayerSettings();
- this.selectedProfile = (_0xd162x13.length + this.selectedProfile - 1) % _0xd162x13.length;
- this.setProfile();
- },
- nextProfile: function() {
- this.setPlayerSettings();
- this.selectedProfile = (this.selectedProfile + 1) % _0xd162x13.length;
- this.setProfile();
- },
- setMenu: function() {
- var _0xd162x1 = this;
- document.title = this.name;
- _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">' +
- _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>');
- _0xd162x3("#main-panel").append('<div id="profiles"><div id="prev-profile"></div><div id="skin-preview"></div><div id="next-profile"></div></div>');
- _0xd162x3("#mainPanel div[role=form]").appendTo(_0xd162x3("#main-panel"));
- _0xd162x3("#main-panel div[role=form] .form-group:first").remove();
- _0xd162x3("#nick").before('<input id="clantag" class="form-control" placeholder="Tag, e.g. \u24c2" maxlength="10" /><div class="input-group nick"></div>');
- _0xd162x3("#nick").appendTo(_0xd162x3(".nick"));
- _0xd162x3(".nick").append('<span class="input-group-btn"><button id="stream-mode" class="btn active icon-eye"></button></span>');
- _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>');
- _0xd162x3("#locationKnown, #locationUnknown").insertAfter(_0xd162x3(".skin"));
- _0xd162x3(".btn-spectate, .btn-logout").appendTo("#agario-main-buttons");
- _0xd162x3("#agario-main-buttons").append('<br clear="both" />');
- _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>');
- _0xd162x3("#create-party-btn, #join-party-btn").appendTo(_0xd162x3("#ogario-party"));
- _0xd162x3("#join-party-btn").addClass("btn-success");
- _0xd162x3("#settingsChoice, #options").appendTo(_0xd162x3("#og-settings"));
- _0xd162x3("#stats").appendTo(_0xd162x3("#main-menu")).addClass("menu-panel");
- _0xd162x3("#statsContinue").attr("id", "statsContinue2");
- _0xd162x3("#mainPanel").empty().remove();
- _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>");
- _0xd162x3("#leftPanel, #rightPanel").removeAttr("id");
- _0xd162x3(".agario-profile-panel, .agario-panel-freecoins, .agario-shop-panel").appendTo(_0xd162x3("#profile")).removeClass("agario-side-panel");
- _0xd162x3(".left-container").empty();
- _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>');
- _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>');
- _0xd162x3("#tags-container").appendTo(_0xd162x3("#profile"));
- _0xd162x3(".agario-party-6").appendTo(_0xd162x3(".center-container"));
- _0xd162x3(".right-container").empty();
- _0xd162x3(".right-container").append('<div class="agario-party"></div>');
- _0xd162x3(".agario-party-6").appendTo(_0xd162x3(".agario-party"));
- _0xd162x3(".agario-party h4, #cancel-party-btn").remove();
- _0xd162x3(".btn-settings, .text-muted, .tosBox, .agario-promo, #agario-web-incentive, span[data-itr='page_option_dark_theme'], #options #darkTheme").remove();
- _0xd162x3("#advertisement, #adbg, #a320x250, #g320x250, #s320x250, #adsBottom").css("display", "none");
- _0xd162x3("#advertisement").removeClass("agario-panel");
- _0xd162x3("#adsBottom").css({
- "z-index": "1",
- opacity: "0",
- bottom: "-100px"
- });
- _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>");
- _0xd162x3("#zoom-speed").on("change", function() {
- var _0xd162x4 = _0xd162x3(this).val();
- _0xd162x16.zoomSpeedValue = _0xd162x4;
- _0xd162x2.zoomSpeedValue = _0xd162x4;
- _0xd162x3("#zoom-speed-value").html("Zoom speed: " + _0xd162x4);
- _0xd162x1.saveSettings(_0xd162x16, "ogarioSettings");
- });
- _0xd162x3("#og-settings").append('<div id="og-options"></div>');
- var _0xd162x4;
- for (_0xd162x4 in _0xd162x16) {
- if (_0xd162x16.hasOwnProperty(_0xd162x4)) {
- if ("zoomSpeedValue" === _0xd162x4) {
- break;
- }
- _0xd162x3("#og-options").append('<label><input type="checkbox" onchange="setSettings(\'' + _0xd162x4 + "', $(this).is(':checked'));\" id=\"" + _0xd162x4 + '">' + _0xd162xd[_0xd162xc][_0xd162x4] + "</label>");
- }
- }
- _0xd162x3("#og-settings input:checkbox").each(function() {
- var _0xd162x1 = _0xd162x3(this).attr("id");
- if (_0xd162x16.hasOwnProperty(_0xd162x1)) {
- _0xd162x3(this).prop("checked", _0xd162x16[_0xd162x1]);
- }
- });
- if (_0xd162x12) {
- _0xd162x12.setThemeMenu();
- }
- _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>');
- _0xd162x3("body").append('<ul id="messages"></ul>');
- _0xd162x3("body").append('<input id="message" class="form-control" type="text" placeholder="' + _0xd162xd[_0xd162xc].enterChatMsg + '..." maxlength="80" />');
- toastr.options = {
- newestOnTop: false,
- positionClass: "toast-bottom-left",
- timeOut: "15000"
- };
- _0xd162x3(document).ready(function() {
- _0xd162x3(".menu-tabs a").click(function(_0xd162x1) {
- _0xd162x1.preventDefault();
- var _0xd162x2 = _0xd162x3(this);
- if (_0xd162x2.hasClass("hotkeys-link")) {
- return void showHotkeys();
- }
- _0xd162x2.addClass("active");
- _0xd162x2.parent().addClass("active");
- _0xd162x2.parent().siblings().removeClass("active");
- _0xd162x2.parent().siblings().find("a").removeClass("active");
- var _0xd162x4 = _0xd162x2.attr("href");
- _0xd162x3(".menu-panel").not(_0xd162x4).css("display", "none");
- _0xd162x3(_0xd162x4).fadeIn();
- _0xd162x9();
- });
- });
- _0xd162x3("#gamemode").on("change", function() {
- _0xd162x1.gameMode = _0xd162x2.gameMode = this.value;
- if (":party" !== this.value) {
- if (_0xd162x1.isSocketOpen()) {
- _0xd162x1.socket.close();
- _0xd162x3(".partyToken").val("");
- }
- }
- _0xd162x1.setTop5();
- });
- _0xd162x3("#cancel-party-btn").on("click", function() {
- _0xd162x1.gameMode = _0xd162x2.gameMode = "";
- _0xd162x1.socket.close();
- _0xd162x3(".partyToken").val("");
- });
- _0xd162x3("#skin").on("input", function() {
- var _0xd162x2 = _0xd162x3(this).val();
- _0xd162x1.setSkinPreview(_0xd162x2, "skin-preview");
- });
- _0xd162x3("#prev-profile").on("click", function() {
- _0xd162x1.prevProfile();
- });
- _0xd162x3("#next-profile").on("click", function() {
- _0xd162x1.nextProfile();
- });
- _0xd162x3("#canvas").bind("contextmenu", function() {
- return false;
- });
- _0xd162x3("#stream-mode").on("click", function() {
- _0xd162x16.streamMode = !_0xd162x16.streamMode;
- _0xd162x1.saveSettings(_0xd162x16, "ogarioSettings");
- _0xd162x1.setStreamMode();
- });
- _0xd162x3("#hide-url").on("click", function() {
- _0xd162x16.hideSkinUrl = !_0xd162x16.hideSkinUrl;
- _0xd162x1.saveSettings(_0xd162x16, "ogarioSettings");
- _0xd162x1.setHideSkinUrl();
- });
- this.statsHUD = document.getElementById("stats-hud");
- this.activePartys = document.getElementById("activepartys");
- this.top5pHUD = document.getElementById("top5p-hud");
- this.leaderboardPositionsHUD = document.getElementById("leaderboard-positions");
- this.timeHUD = document.getElementById("time-hud");
- },
- getDefaultSettings: function() {
- this.noSkins = _0xd162x3("#noSkins").is(":checked");
- this.noNames = _0xd162x3("#noNames").is(":checked");
- this.noColors = _0xd162x3("#noColors").is(":checked");
- this.showMass = _0xd162x3("#showMass").is(":checked");
- this.skipStats = _0xd162x3("#skipStats").is(":checked");
- _0xd162x2.showCustomSkins = !this.noSkins;
- var _0xd162x4 = this;
- if (_0xd162x3("#options input").on("click", function() {
- var _0xd162x1 = _0xd162x3(this);
- var _0xd162x5 = _0xd162x1.attr("id");
- if (void 0 !== _0xd162x4[_0xd162x5]) {
- _0xd162x4[_0xd162x5] = _0xd162x1.is(":checked");
- if ("noSkins" === _0xd162x5) {
- _0xd162x2.showCustomSkins = !_0xd162x4.noSkins;
- }
- }
- }), _0xd162x3("#quality").on("change", function() {
- var _0xd162x1 = _0xd162x3(this).val();
- _0xd162x4.getQuality(_0xd162x1);
- }), null !== _0xd162x1.localStorage.getItem("scale_setting")) {
- var _0xd162x5 = JSON.parse(_0xd162x1.localStorage.getItem("scale_setting"));
- this.setCanvasScale(_0xd162x5);
- } else {
- var _0xd162x6 = _0xd162x3("#quality").val();
- this.getQuality(_0xd162x6);
- }
- if (null !== _0xd162x1.localStorage.getItem("location")) {
- var _0xd162x7 = _0xd162x1.localStorage.getItem("location");
- _0xd162x3("#region").val(_0xd162x7);
- if (_0xd162x1.MC) {
- if (_0xd162x1.MC.setRegion) {
- _0xd162x1.MC.setRegion(_0xd162x7);
- }
- }
- }
- this.setParty();
- if (":party" === _0xd162x17.gameMode) {
- if (_0xd162x1.location.hash) {
- _0xd162x3("#join-party-btn").click();
- }
- }
- },
- getQuality: function(_0xd162x2) {
- var _0xd162x3 = "devicePixelRatio" in _0xd162x1;
- var _0xd162x4 = 1;
- switch (_0xd162x3 && (_0xd162x4 = _0xd162x1.devicePixelRatio), _0xd162x2) {
- case "High":
- this.setCanvasScale(1);
- break;
- case "Medium":
- this.setCanvasScale(0.9);
- break;
- case "Low":
- this.setCanvasScale(0.75);
- break;
- case "VeryLow":
- this.setCanvasScale(0.5);
- break;
- default:
- this.setCanvasScale(_0xd162x4);
- }
- },
- setCanvasScale: function(_0xd162x1) {
- this.canvasScale = _0xd162x1;
- _0xd162x2.canvasScale = _0xd162x1;
- },
- setParty: function() {
- if (this.gameMode = _0xd162x3("#gamemode").val(), this.setTop5(), ":party" === this.gameMode) {
- var _0xd162x1 = _0xd162x3(".partyToken").val();
- if (_0xd162x1) {
- if (_0xd162x1.length > 5) {
- _0xd162x1 = _0xd162x1.split("#");
- this.partyToken = _0xd162x1[1];
- }
- }
- }
- },
- setStreamMode: function() {
- if (_0xd162x16.streamMode) {
- _0xd162x3("#stream-mode").addClass("icon-eye-blocked");
- _0xd162x3("#clantag, #nick, #joinPartyToken").addClass("stream-mode");
- } else {
- _0xd162x3("#stream-mode").removeClass("icon-eye-blocked");
- _0xd162x3("#clantag, #nick, #joinPartyToken").removeClass("stream-mode");
- }
- },
- setHideSkinUrl: function() {
- if (_0xd162x16.hideSkinUrl) {
- _0xd162x3("#hide-url").addClass("icon-eye-blocked");
- _0xd162x3("#skin").addClass("hide-url");
- } else {
- _0xd162x3("#hide-url").removeClass("icon-eye-blocked");
- _0xd162x3("#skin").removeClass("hide-url");
- }
- },
- setButtons: function() {
- var _0xd162x1 = this;
- var _0xd162x2 = document.getElementsByClassName("btn-play")[0];
- var _0xd162x4 = document.getElementsByClassName("btn-play-guest")[0];
- var _0xd162x5 = document.getElementsByClassName("btn-spectate")[0];
- var _0xd162x6 = document.getElementById("create-party-btn");
- var _0xd162x7 = document.getElementById("join-party-btn");
- var _0xd162x8 = document.getElementById("statsContinue2");
- _0xd162x2.addEventListener("click", function() {
- _0xd162x1.onPlay();
- }, false);
- _0xd162x4.addEventListener("click", function() {
- _0xd162x1.onPlay();
- }, false);
- _0xd162x5.addEventListener("click", function() {
- _0xd162x1.onSpectate();
- }, false);
- _0xd162x6.addEventListener("click", function() {
- _0xd162x1.onCreate();
- }, false);
- _0xd162x7.addEventListener("click", function() {
- _0xd162x1.onJoin();
- }, false);
- _0xd162x8.addEventListener("click", function() {
- _0xd162x3("#stats, #main-panel").toggle();
- }, false);
- },
- play: function() {
- if (this.setPlayerSettings(), ":party" === this.gameMode) {
- if (this.setParty(), this.isSocketOpen()) {
- this.sendPlayerClanTag();
- this.sendPartyToken();
- this.sendPlayerNick();
- } else {
- this.connect();
- var _0xd162x1 = this;
- setTimeout(function() {
- _0xd162x1.sendPlayerClanTag();
- _0xd162x1.sendPartyToken();
- _0xd162x1.sendPlayerNick();
- }, 1E3);
- }
- }
- },
- onPlay: function() {
- this.play();
- _0xd162x3("#overlays, #main-panel").hide();
- _0xd162x1.addKeyListeners();
- _0xd162x2.spectate = false;
- _0xd162x2.playerBestMass = 0;
- if (_0xd162x16.autoHideFood) {
- _0xd162x2.showFood = true;
- }
- if (_0xd162x1.ga) {
- _0xd162x1.ga("create", "UA-67142685-2", "auto", "ogarioTracker");
- }
- if (_0xd162x1.ga) {
- _0xd162x1.ga("ogarioTracker.send", "pageview");
- }
- },
- onSpectate: function() {
- if (":party" === this.gameMode) {
- this.onJoin();
- } else {
- this.setPlayerSettings();
- }
- _0xd162x3("#main-panel").hide();
- _0xd162x1.addKeyListeners();
- _0xd162x2.play = false;
- _0xd162x2.spectate = true;
- if (_0xd162x16.autoHideFood) {
- _0xd162x2.showFood = false;
- }
- },
- join: function() {
- this.setParty();
- this.setPlayerSettings();
- this.sendPlayerClanTag();
- this.sendPartyToken();
- this.sendPlayerNick();
- this.sendPlayerDeath();
- this.sendPlayerJoin();
- },
- onJoin: function() {
- if (this.setParty(), this.isSocketOpen()) {
- this.join();
- } else {
- this.connect();
- var _0xd162x1 = this;
- setTimeout(function() {
- _0xd162x1.join();
- }, 1E3);
- }
- },
- create: function() {
- if (this.setParty(), "" !== this.partyToken) {
- return void this.onJoin();
- }
- var _0xd162x1 = this;
- setTimeout(function() {
- _0xd162x1.create();
- }, 100);
- },
- onCreate: function() {
- this.flushData();
- _0xd162x3("#joinPartyToken").val("");
- this.partyToken = "";
- this.create();
- },
- onPlayerSpawn: function() {
- if (_0xd162x2.play = true, _0xd162x2.playerColor) {
- return this.sendPlayerSpawn(), void this.cacheCustomSkin(_0xd162x15.nick + _0xd162x2.playerColor, _0xd162x15.skinURL);
- }
- var _0xd162x1 = this;
- setTimeout(function() {
- _0xd162x1.onPlayerSpawn();
- }, 100);
- },
- onPlayerDeath: function() {
- _0xd162x3(".menu-panel").hide();
- if (this.skipStats) {
- _0xd162x3("#main-panel").show();
- } else {
- _0xd162x3("#stats").show();
- }
- _0xd162x2.play = false;
- _0xd162x2.playerColor = null;
- _0xd162x2.foodIsHidden = false;
- _0xd162x2.playerMass = 0;
- this.sendPlayerDeath();
- this.updateDeathLocations(_0xd162x2.playerX, _0xd162x2.playerY);
- _0xd162x3(".btn-spectate").prop("disabled", false);
- _0xd162x1.onkeydown = function() {};
- },
- setPlayerSettings: function() {
- var _0xd162x1 = _0xd162x3("#nick").val();
- var _0xd162x4 = _0xd162x3("#clantag").val();
- var _0xd162x5 = _0xd162x3("#skin").val();
- var _0xd162x6 = _0xd162x3("#color").val();
- _0xd162x15.nick = _0xd162x1 || "";
- _0xd162x15.clanTag = _0xd162x4.trim() || "";
- _0xd162x15.skinURL = _0xd162x5.trim() || "";
- if (7 == _0xd162x6.length) {
- _0xd162x15.color = _0xd162x6;
- }
- _0xd162x2.playerNick = _0xd162x15.nick;
- if (_0xd162x15.clanTag.length > 0) {
- _0xd162x2.clanTag = _0xd162x15.clanTag;
- }
- _0xd162x13[this.selectedProfile].nick = _0xd162x15.nick;
- _0xd162x13[this.selectedProfile].clanTag = _0xd162x15.clanTag;
- _0xd162x13[this.selectedProfile].skinURL = _0xd162x15.skinURL;
- _0xd162x13[this.selectedProfile].color = _0xd162x15.color;
- this.saveSettings(_0xd162x13, "ogarioPlayerProfiles");
- this.saveSettings(this.selectedProfile, "ogarioSelectedProfile");
- },
- cacheSkin: function(_0xd162x1, _0xd162x2) {
- if (_0xd162x2) {
- _0xd162x1[_0xd162x2] = new Image;
- _0xd162x1[_0xd162x2].crossOrigin = "Anonymous";
- _0xd162x1[_0xd162x2].src = _0xd162x2;
- }
- },
- getCachedSkin: function(_0xd162x1, _0xd162x2) {
- return _0xd162x1[_0xd162x2] && (_0xd162x1[_0xd162x2].width && _0xd162x1[_0xd162x2].complete) ? _0xd162x1[_0xd162x2] : null;
- },
- cacheCustomSkin: function(_0xd162x1, _0xd162x2) {
- if (_0xd162x2) {
- if (_0xd162x1 && (this.customSkinsMap[_0xd162x1] = _0xd162x2), this.customSkinsCache.hasOwnProperty(_0xd162x2)) {
- return;
- }
- this.cacheSkin(this.customSkinsCache, _0xd162x2);
- }
- },
- getCustomSkin: function(_0xd162x1, _0xd162x2) {
- return this.customSkinsMap.hasOwnProperty(_0xd162x1 + _0xd162x2) ? this.getCachedSkin(this.customSkinsCache, this.customSkinsMap[_0xd162x1 + _0xd162x2]) : null;
- },
- countFPS: function() {
- if (_0xd162x16.showStatsFPS) {
- if (!this.fpsLastRequest) {
- return void(this.fpsLastRequest = Date.now());
- }
- var _0xd162x1 = Date.now();
- var _0xd162x2 = _0xd162x1 - this.fpsLastRequest;
- if (!(1E3 > _0xd162x2)) {
- this.rFps = this.renderedFrames;
- this.renderedFrames = 0;
- this.fpsLastRequest = _0xd162x1;
- }
- this.renderedFrames++;
- }
- },
- calculateCurrentSector: function() {
- if (!_0xd162x2.mapOffsetFixed) {
- return void(this.currentSector = "");
- }
- var _0xd162x1 = _0xd162x2.mapOffsetX + _0xd162x2.mapOffset;
- var _0xd162x3 = _0xd162x2.mapOffsetY + _0xd162x2.mapOffset;
- var _0xd162x4 = String.fromCharCode(65 + Math.floor((_0xd162x2.playerY + _0xd162x3) / (_0xd162x2.mapSize / _0xd162x11.sectorsY)));
- var _0xd162x5 = "" + (Math.floor((_0xd162x2.playerX + _0xd162x1) / (_0xd162x2.mapSize / _0xd162x11.sectorsX)) + 1);
- this.currentSector = _0xd162x4 + _0xd162x5;
- },
- updateDeathLocations: function(_0xd162x1, _0xd162x3) {
- if (_0xd162x2.mapOffsetFixed) {
- this.deathLocations.push({
- x: _0xd162x1 + _0xd162x2.mapOffsetX,
- y: _0xd162x3 + _0xd162x2.mapOffsetY
- });
- if (6 == this.deathLocations.length) {
- this.deathLocations.splice(0, 1);
- }
- this.lastDeath = this.deathLocations.length - 1;
- }
- },
- drawMapBorders: function(_0xd162x1, _0xd162x3, _0xd162x4, _0xd162x5, _0xd162x6, _0xd162x7, _0xd162x8) {
- if (_0xd162x2.mapOffsetFixed) {
- if (_0xd162x16.showMapBorders) {
- _0xd162x1.strokeStyle = _0xd162x7;
- _0xd162x1.lineWidth = _0xd162x8;
- _0xd162x1.beginPath();
- _0xd162x1.moveTo(_0xd162x3, _0xd162x4);
- _0xd162x1.lineTo(_0xd162x5, _0xd162x4);
- _0xd162x1.lineTo(_0xd162x5, _0xd162x6);
- _0xd162x1.lineTo(_0xd162x3, _0xd162x6);
- _0xd162x1.closePath();
- _0xd162x1.stroke();
- }
- }
- },
- drawMiniMap: function() {
- if (_0xd162x2.mapOffsetFixed) {
- if (this.miniMap) {
- this.miniMapCtx.clearRect(0, 0, 200, 220);
- } else {
- this.miniMap = document.getElementById("minimap");
- this.miniMapCtx = this.miniMap.getContext("2d");
- this.miniMapCtx.ogarioCtx = true;
- this.miniMap.width = 200;
- this.miniMap.height = 220;
- }
- var _0xd162x1 = 182 / _0xd162x2.mapSize;
- var _0xd162x3 = _0xd162x2.mapOffsetX + _0xd162x2.mapOffset;
- var _0xd162x4 = _0xd162x2.mapOffsetY + _0xd162x2.mapOffset;
- 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) {
- var _0xd162x5 = Math.round((_0xd162x2.playerX + _0xd162x3) * _0xd162x1);
- var _0xd162x6 = Math.round((_0xd162x2.playerY + _0xd162x4) * _0xd162x1);
- this.miniMapCtx.globalAlpha = 0.4;
- this.miniMapCtx.lineWidth = 1;
- this.miniMapCtx.strokeStyle = _0xd162x11.mainColor;
- this.miniMapCtx.beginPath();
- this.miniMapCtx.moveTo(_0xd162x5, 0);
- this.miniMapCtx.lineTo(_0xd162x5, 181);
- this.miniMapCtx.moveTo(0, _0xd162x6);
- this.miniMapCtx.lineTo(181, _0xd162x6);
- this.miniMapCtx.stroke();
- this.miniMapCtx.globalAlpha = 1;
- }
- 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) {
- var _0xd162x7 = 0;
- for (; _0xd162x7 < this.teamPlayers.length; _0xd162x7++) {
- this.teamPlayers[_0xd162x7].drawPosition(this.miniMapCtx, _0xd162x2.mapOffset, _0xd162x1);
- }
- }
- if (this.deathLocations.length > 0) {
- _0xd162x5 = Math.round((this.deathLocations[this.lastDeath].x + _0xd162x2.mapOffset) * _0xd162x1);
- _0xd162x6 = Math.round((this.deathLocations[this.lastDeath].y + _0xd162x2.mapOffset) * _0xd162x1);
- this.miniMapCtx.lineWidth = 1;
- this.miniMapCtx.strokeStyle = this.deathLocations.length - 1 == this.lastDeath ? _0xd162x11.mainColor : "#FFFFFF";
- this.miniMapCtx.beginPath();
- this.miniMapCtx.moveTo(_0xd162x5 - 4.5, _0xd162x6);
- this.miniMapCtx.lineTo(_0xd162x5 + 4.5, _0xd162x6);
- this.miniMapCtx.moveTo(_0xd162x5, _0xd162x6 - 4.5);
- this.miniMapCtx.lineTo(_0xd162x5, _0xd162x6 + 4.5);
- this.miniMapCtx.stroke();
- }
- this.miniMapCtx.restore();
- }
- },
- drawMiniMapSectors: function(_0xd162x1, _0xd162x2, _0xd162x3, _0xd162x4) {
- this.miniMapSectors = document.getElementById("minimap-sectors");
- var _0xd162x5 = this.miniMapSectors.getContext("2d");
- _0xd162x5.ogarioCtx = true;
- this.miniMapSectors.width = _0xd162x3;
- this.miniMapSectors.height = _0xd162x4;
- _0xd162x5.fillStyle = "#FFFFFF";
- this.dTok(_0xd162x5);
- this.drawSectors(_0xd162x5, _0xd162x1, _0xd162x2, 0.5, 29.5, _0xd162x3 - 0.5, _0xd162x4 - 9.5, "#FFFFFF", 1, false);
- },
- resetMiniMapSectors: function() {
- this.miniMapSectors = null;
- },
- drawSectors: function(_0xd162x1, _0xd162x3, _0xd162x4, _0xd162x5, _0xd162x6, _0xd162x7, _0xd162x8, _0xd162x9, _0xd162xa, _0xd162xb) {
- if (!_0xd162xb || _0xd162x2.mapOffsetFixed && _0xd162x16.showBgSectors) {
- var _0xd162xc = Math.floor((_0xd162x7 - _0xd162x5) / _0xd162x3);
- var _0xd162xd = Math.floor((_0xd162x8 - _0xd162x6) / _0xd162x4);
- var _0xd162xe = Math.floor(0.4 * _0xd162xd);
- var _0xd162xf = 0;
- var _0xd162x10 = 0;
- if (_0xd162x1.strokeStyle = _0xd162x9, _0xd162x1.fillStyle = _0xd162x9, _0xd162x1.lineWidth = _0xd162xa, _0xd162xb || !_0xd162xb && _0xd162x11.miniMapGrid) {
- _0xd162x1.beginPath();
- var _0xd162x12 = 0;
- for (; _0xd162x3 + 1 > _0xd162x12; _0xd162x12++) {
- _0xd162xf = _0xd162x5 + _0xd162xc * _0xd162x12;
- _0xd162x1.moveTo(_0xd162x12 == _0xd162x3 ? _0xd162x7 : _0xd162xf, _0xd162x6);
- _0xd162x1.lineTo(_0xd162x12 == _0xd162x3 ? _0xd162x7 : _0xd162xf, _0xd162x8);
- }
- _0xd162x12 = 0;
- for (; _0xd162x4 + 1 > _0xd162x12; _0xd162x12++) {
- _0xd162x10 = _0xd162x6 + _0xd162xd * _0xd162x12;
- _0xd162x1.moveTo(_0xd162x5 - _0xd162xa / 2, _0xd162x12 == _0xd162x4 ? _0xd162x8 : _0xd162x10);
- _0xd162x1.lineTo(_0xd162x7 + _0xd162xa / 2, _0xd162x12 == _0xd162x4 ? _0xd162x8 : _0xd162x10);
- }
- _0xd162x1.stroke();
- } else {
- this.drawMapBorders(_0xd162x1, _0xd162x5, _0xd162x6, _0xd162x7, _0xd162x8, _0xd162x9, _0xd162xa);
- }
- _0xd162x1.font = _0xd162xe + "px Ubuntu";
- _0xd162x1.textAlign = "center";
- _0xd162x1.textBaseline = "middle";
- _0xd162x12 = 0;
- for (; _0xd162x4 > _0xd162x12; _0xd162x12++) {
- var _0xd162x13 = 0;
- for (; _0xd162x3 > _0xd162x13; _0xd162x13++) {
- var _0xd162x14 = String.fromCharCode(65 + _0xd162x12) + (_0xd162x13 + 1);
- _0xd162xf = Math.floor(_0xd162x5 + _0xd162xc / 2 + _0xd162x13 * _0xd162xc);
- _0xd162x10 = Math.floor(_0xd162x6 + _0xd162xd / 2 + _0xd162x12 * _0xd162xd);
- _0xd162x1.fillText(_0xd162x14, _0xd162xf, _0xd162x10);
- }
- }
- }
- },
- drawGrid: function(_0xd162x1) {
- if (_0xd162x16.showGrid) {
- var _0xd162x3 = _0xd162x2.innerW / _0xd162x2.viewScale;
- var _0xd162x4 = _0xd162x2.innerH / _0xd162x2.viewScale;
- var _0xd162x5 = (-_0xd162x2.playerX + _0xd162x3 / 2) % 50;
- var _0xd162x6 = (-_0xd162x2.playerY + _0xd162x4 / 2) % 50;
- _0xd162x1.strokeStyle = _0xd162x11.gridColor;
- _0xd162x1.globalAlpha = 1 * _0xd162x2.viewScale;
- _0xd162x1.beginPath();
- for (; _0xd162x3 > _0xd162x5; _0xd162x5 += 50) {
- _0xd162x1.moveTo(_0xd162x5 * _0xd162x2.viewScale - 0.5, 0);
- _0xd162x1.lineTo(_0xd162x5 * _0xd162x2.viewScale - 0.5, _0xd162x4 * _0xd162x2.viewScale);
- }
- for (; _0xd162x4 > _0xd162x6; _0xd162x6 += 50) {
- _0xd162x1.moveTo(0, _0xd162x6 * _0xd162x2.viewScale - 0.5);
- _0xd162x1.lineTo(_0xd162x3 * _0xd162x2.viewScale, _0xd162x6 * _0xd162x2.viewScale - 0.5);
- }
- _0xd162x1.stroke();
- _0xd162x1.globalAlpha = 1;
- }
- },
- drawSelectedCell: function(_0xd162x1) {
- if (_0xd162x2.play) {
- if (_0xd162x2.playerCellsMass) {
- if (_0xd162x2.playerCellsMass.length > 1) {
- if (_0xd162x16.splitRange || (_0xd162x16.oppColors || (_0xd162x16.oppRings || _0xd162x16.showStatsSTE))) {
- _0xd162x1.fillStyle = "#FFFFFF";
- _0xd162x1.globalAlpha = this.selectBiggestCell ? 0.6 : 0.3;
- _0xd162x1.beginPath();
- _0xd162x1.arc(48, 15, 6, 0, this.pi2, false);
- _0xd162x1.closePath();
- _0xd162x1.fill();
- _0xd162x1.globalAlpha = this.selectBiggestCell ? 0.3 : 0.6;
- _0xd162x1.beginPath();
- _0xd162x1.arc(60, 15, 4, 0, this.pi2, false);
- _0xd162x1.closePath();
- _0xd162x1.fill();
- }
- }
- }
- }
- },
- dTok: function(_0xd162x1) {
- _0xd162x1.font = "14px Ubuntu";
- _0xd162x1.textAlign = "right";
- _0xd162x1.textBaseline = "top";
- _0xd162x1.fillText(atob(this.token), 181, 7);
- },
- drawCircle: function(_0xd162x1, _0xd162x2, _0xd162x3, _0xd162x4, _0xd162x5, _0xd162x6) {
- _0xd162x1.lineWidth = _0xd162x4;
- _0xd162x1.globalAlpha = _0xd162x5;
- _0xd162x1.strokeStyle = _0xd162x6;
- var _0xd162x7 = 0;
- for (; _0xd162x7 < _0xd162x2.length; _0xd162x7++) {
- _0xd162x1.beginPath();
- _0xd162x1.arc(_0xd162x2[_0xd162x7].x, _0xd162x2[_0xd162x7].y, _0xd162x2[_0xd162x7].size + _0xd162x3, 0, this.pi2, false);
- _0xd162x1.closePath();
- _0xd162x1.stroke();
- }
- _0xd162x1.globalAlpha = 1;
- },
- preDrawIndicator: function() {
- _0xd162x2.indicator = document.createElement("canvas");
- var _0xd162x1 = _0xd162x2.indicator.getContext("2d");
- _0xd162x1.lineWidth = 2;
- _0xd162x1.fillStyle = "#FFFFFF";
- _0xd162x1.strokeStyle = "#000000";
- _0xd162x1.beginPath();
- _0xd162x1.moveTo(0, 0);
- _0xd162x1.lineTo(90, 0);
- _0xd162x1.lineTo(45, 50);
- _0xd162x1.closePath();
- _0xd162x1.fill();
- _0xd162x1.stroke();
- },
- setVirusColor: function(_0xd162x1) {
- var _0xd162x2 = Math.floor(_0xd162x1 * _0xd162x1 / 100);
- return _0xd162x2 > 183 ? "#C80000" : _0xd162x11.virusColor;
- },
- setVirusStrokeColor: function(_0xd162x1) {
- if (_0xd162x2.play && 0 != _0xd162x2.playerMaxMass) {
- var _0xd162x3 = Math.floor(_0xd162x1 * _0xd162x1 / 100);
- var _0xd162x4 = _0xd162x3 / (this.selectBiggestCell ? _0xd162x2.playerMaxMass : _0xd162x2.playerMinMass);
- return _0xd162x4 > 0.76 ? "#FFDC00" : "#C80000";
- }
- return _0xd162x11.virusStrokeColor;
- },
- setOppColor: function(_0xd162x1, _0xd162x3) {
- if (_0xd162x3) {
- return _0xd162x15.color;
- }
- var _0xd162x4 = Math.floor(_0xd162x1 * _0xd162x1 / 100);
- var _0xd162x5 = this.selectBiggestCell ? _0xd162x2.playerMaxMass : _0xd162x2.playerMinMass;
- var _0xd162x6 = _0xd162x4 / _0xd162x5;
- if (_0xd162x6 && _0xd162x6 > 0) {
- var _0xd162x7 = 1E3 > _0xd162x5 ? 0.35 : 0.38;
- return _0xd162x6 > 11 ? "#FF008C" : 2.5 > _0xd162x6 ? 1.25 > _0xd162x6 ? 1.25 > _0xd162x6 && _0xd162x6 > 0.75 ? "#FFDC00" : _0xd162x6 > _0xd162x7 ? "#00C8FF" : "#64FF00" : "#FF0A00" : "#BE00FF";
- }
- },
- connect: function() {
- if (this.closeConnection(), this.flushData(), this.setParty(), ":party" === this.gameMode && this.partyToken.length <= 5) {
- console.log("OGARio by szymy: Connecting to server");
- this.socket = new WebSocket(this.privateMode && this.privateIP ? this.privateIP : this.publicIP);
- this.socket.ogarioWS = true;
- this.socket.binaryType = "arraybuffer";
- var _0xd162x1 = this;
- this.socket.onopen = function() {
- console.log("OGARio by szymy: Socket open");
- var _0xd162x2 = _0xd162x1.createView(3);
- _0xd162x2.setUint8(0, 0);
- _0xd162x2.setUint16(1, 212, true);
- _0xd162x1.sendBuffer(_0xd162x2);
- _0xd162x1.sendPlayerClanTag();
- _0xd162x1.sendPartyToken();
- };
- this.socket.onmessage = function(_0xd162x2) {
- _0xd162x1.handleMessage(_0xd162x2);
- };
- this.socket.onclose = function() {
- _0xd162x1.flushData();
- console.log("OGARio by szymy: Socket close");
- };
- this.socket.onerror = function() {
- _0xd162x1.flushData();
- console.log("OGARio by szymy: Socket error");
- };
- }
- },
- closeConnection: function() {
- if (this.socket) {
- this.socket.onmessage = null;
- try {
- this.socket.close();
- } catch (_0xd162x1) {}
- this.socket = null;
- }
- },
- flushData: function() {
- this.teamPlayers = [];
- this.partys = [];
- this.lastSentNick = "";
- this.lastSentClanTag = null;
- this.lastSentSkinURL = "";
- this.lastSentCustomColor = "";
- this.lastSentPartyToken = "";
- this.customSkinsMap = {};
- _0xd162x2.play = false;
- _0xd162x2.playerColor = null;
- },
- reConnect: function() {
- this.flushData();
- this.setParty();
- var _0xd162x1 = this;
- setTimeout(function() {
- _0xd162x1.connect();
- }, 1E3);
- },
- switchServerMode: function() {
- if (this.privateIP) {
- if (":party" === this.gameMode) {
- this.privateMode = !this.privateMode;
- if (this.isSocketOpen()) {
- this.closeConnection();
- toastr.error("Zamkni\u0119to po\u0142\u0105czenie z serwerem!");
- }
- if (this.privateMode) {
- toastr.info("Prze\u0142\u0105czono na serwer prywatny!");
- _0xd162x3(".party-panel").show();
- } else {
- toastr.info("Prze\u0142\u0105czono na serwer publiczny!");
- _0xd162x3("#activepartys").empty();
- _0xd162x3(".party-panel").hide();
- }
- this.reConnect();
- }
- }
- },
- isSocketOpen: function() {
- return null != this.socket && this.socket.readyState == this.socket.OPEN;
- },
- createView: function(_0xd162x1) {
- return new DataView(new ArrayBuffer(_0xd162x1));
- },
- strToBuff: function(_0xd162x1, _0xd162x2) {
- var _0xd162x3 = this.createView(1 + 2 * _0xd162x2.length);
- _0xd162x3.setUint8(0, _0xd162x1);
- var _0xd162x4 = 0;
- for (; _0xd162x4 < _0xd162x2.length; _0xd162x4++) {
- _0xd162x3.setUint16(1 + 2 * _0xd162x4, _0xd162x2.charCodeAt(_0xd162x4), true);
- }
- return _0xd162x3;
- },
- sendBuffer: function(_0xd162x1) {
- this.socket.send(_0xd162x1.buffer);
- },
- handleMessage: function(_0xd162x1) {
- this.readMessage(new DataView(_0xd162x1.data));
- },
- readMessage: function(_0xd162x1) {
- switch (_0xd162x1.getUint8(0)) {
- case 0:
- this.playerID = _0xd162x1.getUint32(1, true);
- break;
- case 1:
- this.sendPlayerUpdate();
- break;
- case 20:
- this.updateTeamPlayer(_0xd162x1);
- break;
- case 30:
- this.updateTeamPlayerPosition(_0xd162x1);
- break;
- case 96:
- this.updatePartys(_0xd162x1);
- this.displayPartys();
- break;
- case 100:
- if (!_0xd162x16.hideChat) {
- this.readChatMessage(_0xd162x1);
- };
- }
- },
- sendPlayerState: function(_0xd162x1) {
- if (this.isSocketOpen()) {
- view = this.createView(1);
- view.setUint8(0, _0xd162x1);
- this.sendBuffer(view);
- }
- },
- sendPlayerSpawn: function() {
- this.sendPlayerState(1);
- },
- sendPlayerDeath: function() {
- this.sendPlayerState(2);
- },
- sendPlayerJoin: function() {
- this.sendPlayerState(3);
- },
- sendPlayerData: function(_0xd162x1, _0xd162x2, _0xd162x3) {
- if (null === this[_0xd162x2] || this[_0xd162x2] !== _0xd162x3) {
- if (this.isSocketOpen()) {
- this.sendBuffer(this.strToBuff(_0xd162x1, _0xd162x3));
- this[_0xd162x2] = _0xd162x3;
- }
- }
- },
- sendPlayerNick: function() {
- this.sendPlayerData(10, "lastSentNick", _0xd162x15.nick);
- },
- sendPlayerClanTag: function() {
- this.sendPlayerData(11, "lastSentClanTag", _0xd162x15.clanTag);
- },
- sendPlayerSkinURL: function() {
- this.sendPlayerData(12, "lastSentSkinURL", _0xd162x15.skinURL);
- },
- sendPlayerCustomColor: function() {
- this.sendPlayerData(13, "lastSentCustomColor", _0xd162x15.color);
- },
- sendPlayerColor: function() {
- if (this.isSocketOpen()) {
- if (_0xd162x2.playerColor) {
- this.sendBuffer(this.strToBuff(14, _0xd162x2.playerColor));
- }
- }
- },
- sendPartyToken: function() {
- this.setParty();
- this.sendPlayerData(15, "lastSentPartyToken", this.partyToken);
- },
- sendPlayerUpdate: function() {
- function _0xd162x1(_0xd162x1) {
- var _0xd162x2 = 0;
- for (; _0xd162x2 < _0xd162x1.length; _0xd162x2++) {
- _0xd162x4.setUint16(_0xd162x5, _0xd162x1.charCodeAt(_0xd162x2), true);
- _0xd162x5 += 2;
- }
- _0xd162x4.setUint16(_0xd162x5, 0, true);
- _0xd162x5 += 2;
- }
- if (this.isSocketOpen() && (this.playerID && (_0xd162x2.play && _0xd162x2.playerColor))) {
- var _0xd162x3 = 41;
- _0xd162x3 += 2 * _0xd162x15.nick.length;
- _0xd162x3 += 2 * _0xd162x15.skinURL.length;
- var _0xd162x4 = this.createView(_0xd162x3);
- _0xd162x4.setUint8(0, 20);
- _0xd162x4.setUint32(1, this.playerID, true);
- var _0xd162x5 = 5;
- _0xd162x1(_0xd162x15.nick);
- _0xd162x1(_0xd162x15.skinURL);
- _0xd162x1(_0xd162x15.color);
- _0xd162x1(_0xd162x2.playerColor);
- this.sendBuffer(_0xd162x4);
- }
- },
- sendPlayerPosition: function() {
- if (this.isSocketOpen() && (_0xd162x2.play && this.playerID)) {
- var _0xd162x1 = this.createView(17);
- _0xd162x1.setUint8(0, 30);
- _0xd162x1.setUint32(1, this.playerID, true);
- _0xd162x1.setInt32(5, this.getPlayerX(), true);
- _0xd162x1.setInt32(9, this.getPlayerY(), true);
- if (void 0 !== _0xd162x2.playerMass) {
- _0xd162x1.setUint32(13, _0xd162x2.playerMass, true);
- } else {
- _0xd162x1.setUint32(13, this.playerMass, true);
- }
- this.sendBuffer(_0xd162x1);
- }
- },
- checkPlayerID: function(_0xd162x1) {
- var _0xd162x2 = 0;
- for (; _0xd162x2 < this.teamPlayers.length; _0xd162x2++) {
- if (this.teamPlayers[_0xd162x2].id == _0xd162x1) {
- return _0xd162x2;
- }
- }
- return null;
- },
- updateTeamPlayer: function(_0xd162x1) {
- function _0xd162x2() {
- var _0xd162x2 = "";
- for (;;) {
- var _0xd162x3 = _0xd162x1.getUint16(_0xd162x4, true);
- if (0 == _0xd162x3) {
- break;
- }
- _0xd162x2 += String.fromCharCode(_0xd162x3);
- _0xd162x4 += 2;
- }
- return _0xd162x4 += 2, _0xd162x2;
- }
- var _0xd162x3 = _0xd162x1.getUint32(1, true);
- var _0xd162x4 = 5;
- var _0xd162x6 = _0xd162x2();
- var _0xd162x7 = _0xd162x2();
- var _0xd162x8 = _0xd162x2();
- var _0xd162x9 = _0xd162x2();
- var _0xd162xa = this.checkPlayerID(_0xd162x3);
- if (null !== _0xd162xa) {
- this.teamPlayers[_0xd162xa].nick = _0xd162x6;
- this.teamPlayers[_0xd162xa].skinID = _0xd162x6 + _0xd162x9;
- this.teamPlayers[_0xd162xa].skinURL = _0xd162x7;
- this.teamPlayers[_0xd162xa].color = _0xd162x8;
- } else {
- var _0xd162xb = new _0xd162x5(_0xd162x3, _0xd162x6, _0xd162x6 + _0xd162x9, _0xd162x7, _0xd162x8);
- this.teamPlayers.push(_0xd162xb);
- }
- this.cacheCustomSkin(_0xd162x6 + _0xd162x9, _0xd162x7);
- },
- updateTeamPlayerPosition: function(_0xd162x1) {
- var _0xd162x2 = _0xd162x1.getUint32(1, true);
- var _0xd162x3 = this.checkPlayerID(_0xd162x2);
- if (null !== _0xd162x3) {
- this.teamPlayers[_0xd162x3].x = _0xd162x1.getInt32(5, true);
- this.teamPlayers[_0xd162x3].y = _0xd162x1.getInt32(9, true);
- this.teamPlayers[_0xd162x3].mass = _0xd162x1.getUint32(13, true);
- this.teamPlayers[_0xd162x3].alive = true;
- this.teamPlayers[_0xd162x3].updateTime = Date.now();
- }
- },
- updateTeamPlayers: function() {
- if (":party" === this.gameMode) {
- this.sendPlayerPosition();
- var _0xd162x1 = 0;
- for (; _0xd162x1 < this.teamPlayers.length; _0xd162x1++) {
- if (this.teamPlayers[_0xd162x1].alive && Date.now() - this.teamPlayers[_0xd162x1].updateTime >= 2E3 || 0 == this.teamPlayers[_0xd162x1].mass) {
- this.teamPlayers[_0xd162x1].alive = false;
- }
- }
- this.teamPlayers.sort(function(_0xd162x1, _0xd162x2) {
- return _0xd162x2.mass - _0xd162x1.mass;
- });
- this.top5 = [];
- _0xd162x1 = 0;
- for (; _0xd162x1 < this.teamPlayers.length && (!this.teamPlayers[_0xd162x1].alive || (this.top5.push({
- nick: this.teamPlayers[_0xd162x1].nick,
- mass: this.teamPlayers[_0xd162x1].mass
- }), 5 != this.top5.length)); _0xd162x1++) {}
- this.displayTop5();
- }
- },
- updatePartys: function(_0xd162x1) {
- this.partys = [];
- var _0xd162x2 = _0xd162x1.getUint8(1);
- var _0xd162x3 = 2;
- var _0xd162x4 = 0;
- for (; _0xd162x2 > _0xd162x4; _0xd162x4++) {
- var _0xd162x5 = "";
- for (;;) {
- var _0xd162x6 = _0xd162x1.getUint16(_0xd162x3, true);
- if (0 == _0xd162x6) {
- break;
- }
- _0xd162x5 += String.fromCharCode(_0xd162x6);
- _0xd162x3 += 2;
- }
- _0xd162x3 += 2;
- this.partys.push(_0xd162x5);
- }
- },
- readChatMessage: function(_0xd162x1) {
- var _0xd162x2 = _0xd162x1.getUint8(1);
- var _0xd162x4 = "";
- var _0xd162x5 = 2;
- for (; _0xd162x5 < _0xd162x1.byteLength; _0xd162x5 += 2) {
- var _0xd162x6 = _0xd162x1.getUint16(_0xd162x5, true);
- if (0 == _0xd162x6) {
- break;
- }
- _0xd162x4 += String.fromCharCode(_0xd162x6);
- }
- var _0xd162x7 = this.escapeHTML(_0xd162x4);
- if (_0xd162x7.length > 0) {
- var _0xd162x8 = _0xd162x7.split(": ", 1);
- _0xd162x7 = _0xd162x7.replace(_0xd162x8 + ": ", "");
- if (101 == _0xd162x2) {
- toastr.success('<span class="message-nick main-color">' + _0xd162x8 + ": </span>" + _0xd162x7);
- this.chatHistory.push({
- nick: _0xd162x8,
- message: _0xd162x7
- });
- if (this.chatHistory.length > 15) {
- this.chatHistory.splice(0, 1);
- }
- } else {
- if (102 == _0xd162x2) {
- toastr.warning(_0xd162x8 + ": " + _0xd162x7);
- } else {
- _0xd162x3("#messages").append(_0xd162x4);
- }
- }
- }
- },
- sendChatMessage: function(_0xd162x1, _0xd162x2) {
- if (Date.now() - this.lastMessageSentTime >= 500 && (0 != _0xd162x2.length && (0 != _0xd162x15.nick.length && this.isSocketOpen()))) {
- _0xd162x2 = _0xd162x15.nick + ": " + _0xd162x2;
- var _0xd162x3 = this.createView(2 + 2 * _0xd162x2.length);
- _0xd162x3.setUint8(0, 100);
- _0xd162x3.setUint8(1, _0xd162x1);
- var _0xd162x4 = 0;
- for (; _0xd162x4 < _0xd162x2.length; _0xd162x4++) {
- _0xd162x3.setUint16(2 + 2 * _0xd162x4, _0xd162x2.charCodeAt(_0xd162x4), true);
- }
- this.sendBuffer(_0xd162x3);
- this.lastMessageSentTime = Date.now();
- }
- },
- prepareCommand: function(_0xd162x1) {
- var _0xd162x2 = _0xd162x1.replace("%currentSector%", this.currentSector);
- return _0xd162x2;
- },
- sendCommand: function(_0xd162x1) {
- var _0xd162x2 = this.prepareCommand(_0xd162xe["comm" + _0xd162x1]);
- this.sendChatMessage(102, _0xd162x2);
- },
- init: function() {
- this.loadSettings();
- this.loadProfiles();
- this.setMenu();
- if (_0xd162x12) {
- _0xd162x12.setTheme();
- }
- this.setProfile();
- this.setButtons();
- this.setStreamMode();
- this.setHideSkinUrl();
- this.setMiniMap();
- this.setTop5();
- this.displayTime();
- this.displayStats();
- this.preDrawIndicator();
- var _0xd162x1 = this;
- setInterval(function() {
- _0xd162x1.drawMiniMap();
- }, 33);
- setInterval(function() {
- _0xd162x1.updateTeamPlayers();
- }, this.updateInterval);
- }
- };
- window. _0xd162x17 = new _0xd162x6;
- _0xd162x17.init();
- _0xd162x7();
- _0xd162x8();
- _0xd162x1.addEventListener("resize", function() {
- setTimeout(_0xd162x9, 50);
- }, false);
- _0xd162x1.onbeforeunload = _0xd162xa;
- _0xd162x1.setSettings = function(_0xd162x1, _0xd162x4) {
- if (_0xd162x16.hasOwnProperty(_0xd162x1) && null !== _0xd162x4) {
- switch (_0xd162x16[_0xd162x1] = _0xd162x4, _0xd162x2.hasOwnProperty(_0xd162x1) && (_0xd162x2[_0xd162x1] = _0xd162x4), _0xd162x1) {
- case "showMiniMap":
- _0xd162x17.setMiniMap();
- break;
- case "showTop5":
- _0xd162x17.setTop5();
- break;
- case "showTime":
- _0xd162x17.displayTime();
- _0xd162x3("#time-hud").show();
- break;
- case "showStats":
- _0xd162x17.displayStats();
- _0xd162x3("#stats-hud").show();
- }
- _0xd162x17.saveSettings(_0xd162x16, "ogarioSettings");
- }
- };
- _0xd162x2.displayLeaderboard = function() {
- _0xd162x17.displayLeaderboard(_0xd162x2.leaderboardHTML);
- };
- _0xd162x2.customDraw = function(_0xd162x1) {
- if (_0xd162x1) {
- _0xd162x17.countFPS();
- var _0xd162x3 = Math.floor(_0xd162x2.mapMinX - _0xd162x2.mapOffsetX);
- var _0xd162x4 = Math.floor(_0xd162x2.mapMinY - _0xd162x2.mapOffsetY);
- var _0xd162x5 = Math.floor(_0xd162x2.mapMaxX - _0xd162x2.mapOffsetX);
- var _0xd162x6 = Math.floor(_0xd162x2.mapMaxY - _0xd162x2.mapOffsetY);
- var _0xd162x7 = _0xd162x11.bordersWidth / 2;
- 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) {
- _0xd162x1.beginPath();
- var _0xd162x8 = 0;
- for (; _0xd162x8 < _0xd162x2.virusesCache.length; _0xd162x8++) {
- var _0xd162x9 = _0xd162x2.virusesCache[_0xd162x8].x;
- var _0xd162xa = _0xd162x2.virusesCache[_0xd162x8].y;
- _0xd162x1.moveTo(_0xd162x9, _0xd162xa);
- _0xd162x1.arc(_0xd162x9, _0xd162xa, _0xd162x2.virusesCache[_0xd162x8].size + 820, 0, _0xd162x17.pi2, false);
- }
- _0xd162x1.fillStyle = _0xd162x11.virusColor;
- _0xd162x1.globalAlpha = 0.1;
- _0xd162x1.fill();
- _0xd162x1.globalAlpha = 1;
- _0xd162x2.virusesCache = [];
- }
- if (_0xd162x2.foodCache && _0xd162x2.foodCache.length > 0) {
- _0xd162x1.beginPath();
- _0xd162x8 = 0;
- for (; _0xd162x8 < _0xd162x2.foodCache.length; _0xd162x8++) {
- _0xd162x9 = _0xd162x2.foodCache[_0xd162x8].x;
- _0xd162xa = _0xd162x2.foodCache[_0xd162x8].y;
- if (_0xd162x1.moveTo(_0xd162x9, _0xd162xa), _0xd162x2.viewScale < 0.16) {
- var _0xd162xb = _0xd162x2.foodCache[_0xd162x8].size + 4;
- _0xd162x1.rect(_0xd162x9 - _0xd162xb, _0xd162xa - _0xd162xb, 2 * _0xd162xb, 2 * _0xd162xb);
- } else {
- _0xd162x1.arc(_0xd162x9, _0xd162xa, _0xd162x2.foodCache[_0xd162x8].size + 5, 0, _0xd162x17.pi2, false);
- }
- }
- _0xd162x1.fillStyle = _0xd162x11.foodColor;
- _0xd162x1.globalAlpha = 1;
- _0xd162x1.fill();
- _0xd162x2.foodCache = [];
- }
- if (_0xd162x2.play) {
- if (_0xd162x16.splitRange) {
- if (_0xd162x2.playerCells && _0xd162x2.playerCells.length > 0) {
- _0xd162x2.playerCells.sort(function(_0xd162x1, _0xd162x2) {
- return _0xd162x2.size - _0xd162x1.size;
- });
- var _0xd162xc = _0xd162x17.selectBiggestCell ? 0 : _0xd162x2.playerCells.length - 1;
- _0xd162x1.lineWidth = 6;
- _0xd162x1.globalAlpha = _0xd162x11.darkTheme ? 0.7 : 0.35;
- _0xd162x1.strokeStyle = _0xd162x11.darkTheme ? "#FFFFFF" : "#000000";
- _0xd162x1.beginPath();
- _0xd162x1.arc(_0xd162x2.playerCells[_0xd162xc].x, _0xd162x2.playerCells[_0xd162xc].y, _0xd162x2.playerCells[_0xd162xc].size + 760, 0, _0xd162x17.pi2, false);
- _0xd162x1.closePath();
- _0xd162x1.stroke();
- }
- _0xd162x1.globalAlpha = 1;
- _0xd162x17.drawCircle(_0xd162x1, _0xd162x2.biggerSTECellsCache, 760, 4, 0.4, "#BE00FF");
- }
- if (_0xd162x16.oppRings) {
- var _0xd162xd = 14 + 2 / _0xd162x2.viewScale;
- var _0xd162xe = 12 + 1 / _0xd162x2.viewScale;
- _0xd162x17.drawCircle(_0xd162x1, _0xd162x2.biggerSTECellsCache, _0xd162xd, _0xd162xe, 0.75, "#BE00FF");
- _0xd162x17.drawCircle(_0xd162x1, _0xd162x2.biggerCellsCache, _0xd162xd, _0xd162xe, 0.75, "#FF0A00");
- _0xd162x17.drawCircle(_0xd162x1, _0xd162x2.smallerCellsCache, _0xd162xd, _0xd162xe, 0.75, "#00C8FF");
- _0xd162x17.drawCircle(_0xd162x1, _0xd162x2.STECellsCache, _0xd162xd, _0xd162xe, 0.75, "#64FF00");
- }
- if (_0xd162x16.cursorTracking && _0xd162x2.setCursorPosition) {
- _0xd162x2.setCursorPosition();
- _0xd162x1.lineWidth = 4;
- _0xd162x1.globalAlpha = _0xd162x11.darkTheme ? 0.75 : 0.35;
- _0xd162x1.strokeStyle = _0xd162x11.darkTheme ? "#FFFFFF" : "#000000";
- _0xd162x1.beginPath();
- _0xd162x8 = 0;
- for (; _0xd162x8 < _0xd162x2.playerCells.length; _0xd162x8++) {
- _0xd162x1.moveTo(_0xd162x2.playerCells[_0xd162x8].x, _0xd162x2.playerCells[_0xd162x8].y);
- _0xd162x1.lineTo(_0xd162x2.cursorX, _0xd162x2.cursorY);
- }
- _0xd162x1.stroke();
- _0xd162x1.globalAlpha = 1;
- }
- }
- _0xd162x2.playerCells = [];
- if (_0xd162x16.splitRange || _0xd162x16.oppRings) {
- _0xd162x2.biggerSTECellsCache = [];
- _0xd162x2.biggerCellsCache = [];
- _0xd162x2.smallerCellsCache = [];
- _0xd162x2.STECellsCache = [];
- }
- }
- };
- _0xd162x2.drawGrid = function(_0xd162x1) {
- _0xd162x17.drawGrid(_0xd162x1);
- };
- _0xd162x2.getCustomSkin = function(_0xd162x1, _0xd162x2) {
- return _0xd162x17.getCustomSkin(_0xd162x1, _0xd162x2);
- };
- _0xd162x2.setVirusColor = function(_0xd162x1) {
- return _0xd162x17.setVirusColor(_0xd162x1);
- };
- _0xd162x2.setVirusStrokeColor = function(_0xd162x1) {
- return _0xd162x17.setVirusStrokeColor(_0xd162x1);
- };
- _0xd162x2.setOppColor = function(_0xd162x1, _0xd162x2) {
- return _0xd162x17.setOppColor(_0xd162x1, _0xd162x2);
- };
- var _0xd162x18 = {};
- var _0xd162x19 = {};
- var _0xd162x1a = {
- "hk-feed": {
- label: _0xd162xd[_0xd162xc]["hk-feed"],
- defaultKey: "W",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.feed();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-macroFeed": {
- label: _0xd162xd[_0xd162xc]["hk-macroFeed"],
- defaultKey: "W",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.macroFeed(true);
- }
- },
- keyUp: function() {
- if (_0xd162x17) {
- _0xd162x17.macroFeed(false);
- }
- },
- type: "normal"
- },
- "hk-splitBots": {
- label: "Split Bots",
- defaultKey: "E",
- if (_0xd162x17) {
- ubot.splitBots();
- }
- },
- "hk-ejectBots": {
- label: "Eject Bots",
- defaultKey: "R",
- if (_0xd162x17) {
- ubot.ejectBots();
- }
- },
- "hk-collectPellets": {
- label:"Collect Pellets",
- defaultKey: "P",
- if (_0xd162x17) {
- ubot.sendCollectPellets();
- }
- },
- "hk-split": {
- label: _0xd162xd[_0xd162xc]["hk-split"],
- defaultKey: "SPACE",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.split();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-doubleSplit": {
- label: _0xd162xd[_0xd162xc]["hk-doubleSplit"],
- defaultKey: "Q",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.doubleSplit();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-popSplit": {
- label: "Popsplit",
- defaultKey: "ALT+Q",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.popSplit();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-split16": {
- label: _0xd162xd[_0xd162xc]["hk-split16"],
- defaultKey: "SHIFT",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.split16();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-pause": {
- label: _0xd162xd[_0xd162xc]["hk-pause"],
- defaultKey: "S",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setPause();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-showTop5": {
- label: _0xd162xd[_0xd162xc]["hk-showTop5"],
- defaultKey: "T",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setShowTop5();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-showTime": {
- label: _0xd162xd[_0xd162xc]["hk-showTime"],
- defaultKey: "ALT+T",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setShowTime();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-showSplitRange": {
- label: _0xd162xd[_0xd162xc]["hk-showSplitRange"],
- defaultKey: "U",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setShowSplitRange();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-showSplitInd": {
- label: _0xd162xd[_0xd162xc]["hk-showSplitInd"],
- defaultKey: "I",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setShowSplitInd();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-showTeammatesInd": {
- label: _0xd162xd[_0xd162xc]["hk-showTeammatesInd"],
- defaultKey: "ALT+I",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setShowTeammatesInd();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-showOppColors": {
- label: _0xd162xd[_0xd162xc]["hk-showOppColors"],
- defaultKey: "O",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setShowOppColors();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-toggleSkins": {
- label: _0xd162xd[_0xd162xc]["hk-toggleSkins"],
- defaultKey: "A",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.toggleSkins();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-showSkins": {
- label: _0xd162xd[_0xd162xc]["hk-showSkins"],
- defaultKey: "S",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setShowSkins();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-showStats": {
- label: _0xd162xd[_0xd162xc]["hk-showStats"],
- defaultKey: "ALT+S",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setShowStats();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-toggleCells": {
- label: _0xd162xd[_0xd162xc]["hk-toggleCells"],
- defaultKey: "D",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.toggleCells();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-showFood": {
- label: _0xd162xd[_0xd162xc]["hk-showFood"],
- defaultKey: "F",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setShowFood();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-showGrid": {
- label: _0xd162xd[_0xd162xc]["hk-showGrid"],
- defaultKey: "G",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setShowGrid();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-showMiniMapGuides": {
- label: _0xd162xd[_0xd162xc]["hk-showMiniMapGuides"],
- defaultKey: "ALT+G",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setShowMiniMapGuides();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-hideChat": {
- label: _0xd162xd[_0xd162xc]["hk-hideChat"],
- defaultKey: "H",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.hideChat();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-showHUD": {
- label: _0xd162xd[_0xd162xc]["hk-showHUD"],
- defaultKey: "ALT+H",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setShowHUD();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-copyLb": {
- label: _0xd162xd[_0xd162xc]["hk-copyLb"],
- defaultKey: "L",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.copyLb();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-showLb": {
- label: _0xd162xd[_0xd162xc]["hk-showLb"],
- defaultKey: "ALT+L",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setShowLb();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-resetZoom": {
- label: _0xd162xd[_0xd162xc]["hk-resetZoom"],
- defaultKey: "Z",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.resetZoom(true);
- }
- },
- keyUp: function() {
- if (_0xd162x17) {
- _0xd162x17.resetZoom(false);
- }
- },
- type: "normal"
- },
- "hk-toggleDeath": {
- label: _0xd162xd[_0xd162xc]["hk-toggleDeath"],
- defaultKey: "X",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.toggleDeath();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-clearChat": {
- label: _0xd162xd[_0xd162xc]["hk-clearChat"],
- defaultKey: "C",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.displayChatHistory(true);
- }
- },
- keyUp: function() {
- if (_0xd162x17) {
- _0xd162x17.displayChatHistory(false);
- }
- },
- type: "normal"
- },
- "hk-showBgSectors": {
- label: _0xd162xd[_0xd162xc]["hk-showBgSectors"],
- defaultKey: "B",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setShowBgSectors();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-hideBots": {
- label: _0xd162xd[_0xd162xc]["hk-hideBots"],
- defaultKey: "ALT+B",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setHideSmallBots();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-showNames": {
- label: _0xd162xd[_0xd162xc]["hk-showNames"],
- defaultKey: "N",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setShowNames();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-showMass": {
- label: _0xd162xd[_0xd162xc]["hk-showMass"],
- defaultKey: "M",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setShowMass();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-showMiniMap": {
- label: _0xd162xd[_0xd162xc]["hk-showMiniMap"],
- defaultKey: "ALT+M",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setShowMiniMap();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-chatMessage": {
- label: _0xd162xd[_0xd162xc]["hk-chatMessage"],
- defaultKey: "ENTER",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.enterChatMessage();
- }
- },
- keyUp: null,
- type: "special"
- },
- "hk-quickResp": {
- label: _0xd162xd[_0xd162xc]["hk-quickResp"],
- defaultKey: "TILDE",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.quickResp();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-zoom1": {
- label: _0xd162xd[_0xd162xc]["hk-zoomLevel"] + " 1",
- defaultKey: "ALT+1",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setZoom(0.5);
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-zoom2": {
- label: _0xd162xd[_0xd162xc]["hk-zoomLevel"] + " 2",
- defaultKey: "ALT+2",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setZoom(0.25);
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-zoom3": {
- label: _0xd162xd[_0xd162xc]["hk-zoomLevel"] + " 3",
- defaultKey: "ALT+3",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setZoom(0.125);
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-zoom4": {
- label: _0xd162xd[_0xd162xc]["hk-zoomLevel"] + " 4",
- defaultKey: "ALT+4",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setZoom(0.075);
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-zoom5": {
- label: _0xd162xd[_0xd162xc]["hk-zoomLevel"] + " 5",
- defaultKey: "ALT+5",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.setZoom(0.05);
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-switchServerMode": {
- label: "Prze\u0142\u0105cz serwer [publiczny/prywatny]",
- defaultKey: "=",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.switchServerMode();
- }
- },
- keyUp: null,
- type: "normal"
- },
- "hk-comm1": {
- label: _0xd162xe.comm1,
- defaultKey: "1",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.sendCommand(1);
- }
- },
- keyUp: null,
- type: "command"
- },
- "hk-comm2": {
- label: _0xd162xe.comm2,
- defaultKey: "2",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.sendCommand(2);
- }
- },
- keyUp: null,
- type: "command"
- },
- "hk-comm3": {
- label: _0xd162xe.comm3,
- defaultKey: "3",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.sendCommand(3);
- }
- },
- keyUp: null,
- type: "command"
- },
- "hk-comm4": {
- label: _0xd162xe.comm4,
- defaultKey: "4",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.sendCommand(4);
- }
- },
- keyUp: null,
- type: "command"
- },
- "hk-comm5": {
- label: _0xd162xe.comm5,
- defaultKey: "5",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.sendCommand(5);
- }
- },
- keyUp: null,
- type: "command"
- },
- "hk-comm6": {
- label: _0xd162xe.comm6,
- defaultKey: "6",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.sendCommand(6);
- }
- },
- keyUp: null,
- type: "command"
- },
- "hk-comm7": {
- label: _0xd162xe.comm7,
- defaultKey: "7",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.sendCommand(7);
- }
- },
- keyUp: null,
- type: "command"
- },
- "hk-comm8": {
- label: _0xd162xe.comm8,
- defaultKey: "8",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.sendCommand(8);
- }
- },
- keyUp: null,
- type: "command"
- },
- "hk-comm9": {
- label: _0xd162xe.comm9,
- defaultKey: "9",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.sendCommand(9);
- }
- },
- keyUp: null,
- type: "command"
- },
- "hk-comm0": {
- label: _0xd162xe.comm0,
- defaultKey: "0",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.sendCommand(0);
- }
- },
- keyUp: null,
- type: "command"
- },
- "hk-comm10": {
- label: _0xd162xe.comm10,
- defaultKey: "MOUSE WHEEL",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.sendCommand(10);
- }
- },
- keyUp: null,
- type: "command"
- },
- "hk-comm11": {
- label: _0xd162xe.comm11,
- defaultKey: "LEFT",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.sendCommand(11);
- }
- },
- keyUp: null,
- type: "command"
- },
- "hk-comm12": {
- label: _0xd162xe.comm12,
- defaultKey: "UP",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.sendCommand(12);
- }
- },
- keyUp: null,
- type: "command"
- },
- "hk-comm13": {
- label: _0xd162xe.comm13,
- defaultKey: "RIGHT",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.sendCommand(13);
- }
- },
- keyUp: null,
- type: "command"
- },
- "hk-comm14": {
- label: _0xd162xe.comm14,
- defaultKey: "DOWN",
- keyDown: function() {
- if (_0xd162x17) {
- _0xd162x17.sendCommand(14);
- }
- },
- keyUp: null,
- type: "command"
- }
- };
- _0xd162xb.prototype = {
- lastPressedKey: "",
- lastKeyId: "",
- defaultMessageKey: "ENTER",
- inputClassName: "custom-key-in form-control input-sm",
- loadDefaultHotkeys: function() {
- _0xd162x19 = {};
- var _0xd162x1;
- for (_0xd162x1 in _0xd162x1a) {
- if (_0xd162x1a.hasOwnProperty(_0xd162x1)) {
- _0xd162x19[_0xd162x1a[_0xd162x1].defaultKey] = _0xd162x1;
- }
- }
- _0xd162x19["spec-messageKey"] = this.defaultMessageKey;
- },
- loadHotkeys: function() {
- this.loadDefaultHotkeys();
- },
- saveHotkeys: function() {
- _0xd162x1.localStorage.setItem("ubotHotkeys", JSON.stringify(_0xd162x19));
- this.saveCommands();
- },
- saveCommands: function() {
- _0xd162x3("#hotkeys .command-in").each(function() {
- var _0xd162x1 = _0xd162x3(this);
- var _0xd162x2 = _0xd162x1.attr("id");
- if (_0xd162xe.hasOwnProperty(_0xd162x2)) {
- _0xd162xe[_0xd162x2] = _0xd162x1.val();
- }
- });
- _0xd162x1.localStorage.setItem("ogarioCommands", JSON.stringify(_0xd162xe));
- },
- resetHotkeys: function() {
- this.loadDefaultHotkeys();
- _0xd162x3("#hotkeys-cfg .custom-key-in").each(function() {
- var _0xd162x1 = _0xd162x3(this).attr("id");
- if (_0xd162x1a[_0xd162x1]) {
- _0xd162x3(this).val(_0xd162x1a[_0xd162x1].defaultKey);
- }
- });
- },
- setHotkeysMenu: function() {
- _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>" +
- _0xd162xd[_0xd162xc]["hk-inst-delete"] + "</li><li>" + _0xd162xd[_0xd162xc]["hk-inst-keys"] + "</li></ul></div></div>");
- for (keyId in _0xd162x1a) {
- if (_0xd162x1a.hasOwnProperty(keyId)) {
- var _0xd162x1 = _0xd162x1a[keyId];
- var _0xd162x2 = "";
- var _0xd162x4;
- for (_0xd162x4 in _0xd162x19) {
- if (_0xd162x19.hasOwnProperty(_0xd162x4) && _0xd162x19[_0xd162x4] === keyId) {
- _0xd162x2 = _0xd162x4;
- break;
- }
- }
- if ("hk-switchServerMode" === keyId && (_0xd162x17 && !_0xd162x17.privateIP)) {
- continue;
- }
- if ("command" === _0xd162x1.type) {
- var _0xd162x5 = keyId.replace("hk-", "");
- _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>');
- } else {
- _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>');
- }
- }
- }
- },
- getPressedKey: function(_0xd162x1) {
- var _0xd162x2 = "";
- var _0xd162x3 = "";
- switch (_0xd162x1.ctrlKey || 17 == _0xd162x1.keyCode ? _0xd162x2 = "CTRL" : (_0xd162x1.altKey || 18 == _0xd162x1.keyCode) && (_0xd162x2 = "ALT"), _0xd162x1.keyCode) {
- case 9:
- _0xd162x3 = "TAB";
- break;
- case 13:
- _0xd162x3 = "ENTER";
- break;
- case 16:
- _0xd162x3 = "SHIFT";
- break;
- case 17:
- break;
- case 18:
- break;
- case 32:
- _0xd162x3 = "SPACE";
- break;
- case 37:
- _0xd162x3 = "LEFT";
- break;
- case 38:
- _0xd162x3 = "UP";
- break;
- case 39:
- _0xd162x3 = "RIGHT";
- break;
- case 40:
- _0xd162x3 = "DOWN";
- break;
- case 46:
- _0xd162x3 = "DEL";
- break;
- case 61:
- _0xd162x3 = "=";
- break;
- case 187:
- _0xd162x3 = "=";
- break;
- case 192:
- _0xd162x3 = "TILDE";
- break;
- default:
- _0xd162x3 = String.fromCharCode(_0xd162x1.keyCode);
- }
- return "" !== _0xd162x2 ? "" !== _0xd162x3 ? _0xd162x2 + "+" + _0xd162x3 : _0xd162x2 : _0xd162x3;
- },
- deleteHotkey: function(_0xd162x1, _0xd162x2) {
- delete _0xd162x19[_0xd162x1];
- _0xd162x3("#" + _0xd162x2).val("");
- },
- setDefaultHotkey: function(_0xd162x1) {
- var _0xd162x2 = false;
- return _0xd162x1a[_0xd162x1] && !_0xd162x19.hasOwnProperty(_0xd162x1a[_0xd162x1].defaultKey) ? (_0xd162x2 = _0xd162x1a[_0xd162x1].defaultKey, _0xd162x19[_0xd162x2] = _0xd162x1, _0xd162x2) : _0xd162x2;
- },
- setHotkey: function(_0xd162x1, _0xd162x2) {
- if (_0xd162x2 && (this.lastPressedKey !== _0xd162x1 || this.lastKeyId !== _0xd162x2)) {
- var _0xd162x4 = _0xd162x3("#" + _0xd162x2).val();
- if (this.deleteHotkey(_0xd162x4, _0xd162x2), "DEL" !== _0xd162x1) {
- if (_0xd162x19[_0xd162x1] && _0xd162x19[_0xd162x1] !== _0xd162x2) {
- var _0xd162x5 = _0xd162x19[_0xd162x1];
- var _0xd162x6 = this.setDefaultHotkey(_0xd162x5);
- if (_0xd162x6) {
- _0xd162x19[_0xd162x6] = _0xd162x5;
- _0xd162x3("#" + _0xd162x5).val(_0xd162x6);
- } else {
- this.deleteHotkey(_0xd162x1, _0xd162x5);
- }
- }
- _0xd162x19[_0xd162x1] = _0xd162x2;
- _0xd162x3("#" + _0xd162x2).val(_0xd162x1);
- if ("hk-chatMessage" === _0xd162x2) {
- _0xd162x19["spec-messageKey"] = _0xd162x1;
- }
- this.lastPressedKey = _0xd162x1;
- this.lastKeyId = _0xd162x2;
- }
- }
- },
- init: function() {
- this.loadHotkeys();
- this.setHotkeysMenu();
- }
- };
- var _0xd162x1b = new _0xd162xb;
- ubot.connectToServer();
- startLocalBots();
- startRemoteBots();
- setInterval(function() {
- if (ubot.isAuthorized) {
- ubot.sendRemotePosition();
- }
- sendLocalBotsMessage({
- name: "position",
- x: ogario.mouseX + ogario.mapOffsetX,
- y: ogario.mouseY + ogario.mapOffsetY
- })
- }, 10)
- _0xd162x1b.init();
- document.onkeydown = function(_0xd162x1) {
- var _0xd162x2 = _0xd162x1b.getPressedKey(_0xd162x1);
- if (("INPUT" !== _0xd162x1.target.tagName || (_0xd162x1.target.className === _0xd162x1b.inputClassName || _0xd162x2 === _0xd162x19["spec-messageKey"])) && ("" !== _0xd162x2 && !_0xd162x18[_0xd162x2])) {
- switch(_0xd162x1.key.toLowerCase()) {
- case "e":
- ubot.splitBots();
- break;
- case "r":
- ubot.ejectBots();
- break;
- case "p":
- ubot.sendCollectPellets();
- break;
- }
- if (_0xd162x18[_0xd162x2] = true, _0xd162x1.target.className === _0xd162x1b.inputClassName) {
- return _0xd162x1.preventDefault(), void _0xd162x1b.setHotkey(_0xd162x2, _0xd162x1.target.id);
- }
- if (_0xd162x19[_0xd162x2]) {
- _0xd162x1.preventDefault();
- var _0xd162x3 = _0xd162x19[_0xd162x2];
- if ("" !== _0xd162x3) {
- if (_0xd162x1a[_0xd162x3]) {
- if (_0xd162x1a[_0xd162x3].keyDown) {
- _0xd162x1a[_0xd162x3].keyDown();
- }
- }
- }
- }
- }
- };
- document.onkeyup = function(_0xd162x1) {
- var _0xd162x2 = _0xd162x1b.getPressedKey(_0xd162x1);
- if ("" !== _0xd162x2) {
- if (_0xd162x19[_0xd162x2]) {
- var _0xd162x3 = _0xd162x19[_0xd162x2];
- if ("" !== _0xd162x3) {
- if (_0xd162x1a[_0xd162x3]) {
- if (_0xd162x1a[_0xd162x3].keyUp) {
- _0xd162x1a[_0xd162x3].keyUp();
- }
- }
- }
- }
- _0xd162x18[_0xd162x2] = false;
- }
- };
- _0xd162x1.addKeyListeners = function() {
- _0xd162x1.onkeydown = function(_0xd162x2) {
- switch (_0xd162x2.keyCode) {
- case 81:
- if (_0xd162x1.core) {
- if (_0xd162x1.core.specialOn) {
- _0xd162x1.core.specialOn();
- }
- }
- break;
- case 27:
- _0xd162x2.preventDefault();
- _0xd162x1.MC.showNickDialog(300);
- if (_0xd162x3("#oferwallContainer").is(":visible")) {
- _0xd162x1.closeOfferwall();
- }
- if (_0xd162x3("#videoContainer").is(":visible")) {
- _0xd162x1.closeVideoContainer();
- };
- }
- };
- _0xd162x1.onkeyup = function(_0xd162x2) {
- if (81 == _0xd162x2.keyCode) {
- if (_0xd162x1.specialOff) {
- _0xd162x1.core.specialOff();
- }
- }
- };
- };
- _0xd162x1.onmousedown = function(_0xd162x1) {
- if (!_0xd162x3("#overlays").is(":visible")) {
- if (2 == _0xd162x1.which) {
- _0xd162x1.preventDefault();
- if (_0xd162x17) {
- _0xd162x17.sendCommand(10);
- }
- } else {
- if (_0xd162x16.mouseSplit) {
- if (1 == _0xd162x1.which && !_0xd162x16.mouseInvert || 3 == _0xd162x1.which && _0xd162x16.mouseInvert) {
- _0xd162x1.preventDefault();
- if (_0xd162x17) {
- _0xd162x17.split();
- }
- }
- }
- if (_0xd162x16.mouseFeed) {
- if (3 == _0xd162x1.which && !_0xd162x16.mouseInvert || 1 == _0xd162x1.which && _0xd162x16.mouseInvert) {
- _0xd162x1.preventDefault();
- if (_0xd162x17) {
- _0xd162x17.macroFeed(true);
- }
- }
- }
- }
- }
- };
- _0xd162x1.onmouseup = function(_0xd162x1) {
- if (_0xd162x16.mouseFeed) {
- if (3 == _0xd162x1.which && !_0xd162x16.mouseInvert || 1 == _0xd162x1.which && _0xd162x16.mouseInvert) {
- if (_0xd162x17) {
- _0xd162x17.macroFeed(false);
- }
- }
- }
- };
- _0xd162x1.resetHotkeys = function() {
- if (_0xd162x1b) {
- _0xd162x1b.resetHotkeys();
- }
- };
- _0xd162x1.saveHotkeys = function() {
- if (_0xd162x1b) {
- _0xd162x1b.saveHotkeys();
- }
- _0xd162x3("#hotkeys").hide();
- };
- _0xd162x1.showHotkeys = function() {
- _0xd162x1.onkeydown = function() {};
- _0xd162x3("#hotkeys").show();
- };
- _0xd162x1.closeHotkeys = function() {
- _0xd162x3("#hotkeys").hide();
- };
- }(window, window.ogario, window.jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement