Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alert("Don't Forget to Subscribe For FreeTz YT");
- window.MC = {};
- function escapeHtml(a) {
- return String(a).replace(/[&<>"'\/]/g, function(a) {
- return entityMap[a];
- });
- }
- function updateBotCount(a, b) {
- NeyBots.localBotsAlive[a] = b;
- var c = NeyBots.serverBots;
- var d = 2 + NeyBots.serverBots;
- var e = 0;
- for (; e < 2; e++) {
- if (NeyBots.localBotsAlive[e]) {
- c++;
- }
- }
- if (0 == c) {
- $("#botCount").html('<font color="red">0 / ' + d + "</font>");
- } else {
- $("#botCount").html('<font color="#7FFF00">' + c + " / " + d + "</font>");
- }
- }
- function startLocalBots() {
- var a$$0 = 0;
- for (; a$$0 < NeyBots.startBotAmount; a$$0++) {
- NeyBots.localBotsAlive[a$$0] = false;
- NeyBots.localBots[a$$0] = new Worker(URL.createObjectURL(new Blob(["(" + generateBotFunction() + ")()"], {
- type: "text/javascript"
- })));
- NeyBots.localBots[a$$0].onmessage = function(a) {
- var b = a.data;
- switch (b.name) {
- case "add":
- updateBotCount(b.botID, true);
- addBallToMinimap(true, "bot" + b.botID, b.botName, b.x, b.y, "#FF00FF", true);
- break;
- case "remove":
- updateBotCount(b.botID, false);
- removeBallFromMinimap("bot" + b.botID);
- break;
- case "position":
- moveBallOnMinimap("bot" + b.botID, b.x, b.y);
- break;
- default:
- console.log("Unknown command received from bot");
- }
- };
- NeyBots.localBots[a$$0].postMessage({
- name: "botID",
- botID: a$$0
- });
- }
- updateBotNames();
- }
- function startRemoteBots() {
- var a = 0;
- for (; a < 2; a++) {
- NeyBots.remoteBots[a] = new Worker(URL.createObjectURL(new Blob(["(" + generateBotFunction() + ")()"], {
- type: "text/javascript"
- })));
- }
- }
- function sendLocalBotsMessage(a) {
- for (i in NeyBots.localBots) {
- NeyBots.localBots[i].postMessage(a);
- }
- }
- function sendRemoteBotsMessage(a) {
- for (i in NeyBots.remoteBots) {
- NeyBots.remoteBots[i].postMessage(a);
- }
- }
- function insertCore() {
- var f = new XMLHttpRequest;
- f.open("GET", "/agario.core.js", true);
- f.onload = function() {
- var script = f.responseText;
- script = replaceNormalFile(script, "if(h.MC&&h.MC.onPlayerSpawn)", "NeyBots.playerSpawned();if(h.MC&&h.MC.onPlayerSpawn)");
- script = replaceNormalFile(script, "if(h.MC&&h.MC.onPlayerDeath)", "NeyBots.playerDied();if(h.MC&&h.MC.onPlayerDeath)");
- script = replaceNormalFile(script, "if(h.MC&&h.MC.onAgarioCoreLoaded)", "NeyBots.onAgarioCoreLoaded();if(h.MC&&h.MC.onAgarioCoreLoaded)");
- script = replaceNormalFile(script, "if(h.MC&&h.MC.onDisconnect)", "NeyBots.playerDisconnected();if(h.MC&&h.MC.onDisconnect)");
- script = replaceNormalFile(script, "connect:function(a){", "connect:function(a){NeyBots.playerConnected(a);");
- script = replaceNormalFile(script, "sendSpectate:function(){", "sendSpectate:function(){NeyBots.playerSpectated();");
- script = replaceNormalFile(script, "sendNick:function(a){", "sendNick:function(a){NeyBots.updateNickname(a);");
- script = replaceNormalFile(script, "setTarget:function(a,b){", "setTarget:function(a,b){if(NeyBots.stopMovement){a = $('#canvas').width() / 2; b = $('#canvas').height() / 2;}");
- 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(NeyBots.setMapCoords){NeyBots.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 NeyBots.playerX=$4; NeyBots.playerY=$5;");
- script = replaceRegexFile(script, /if\((\+\w\[\w>>3\])<1\.0\){/i, "if($1 < NeyBots.zoomResetValue){");
- script = replaceRegexFile(script, /(if\(\w<=)(20\.0)(\){\w=\w;return})(if\(!\w\){if\(\(\w\[\d+\]\|0\)!=\(\w\[\d+\]\|0\)\){\w=\w;return}if\(\(\w\[\w\+\d+>>0\]\|0\)!=0\?\(\w\[\w>>0\]\|0\)==0:0\){\w=\w;return}})/i, "$140.0$3");
- script = replaceRegexFile(script, /(\w)(=\+\w\[\w>>3\]\*\+\w\()(.\d)(,\+\w\);)/i, "$1$2 (NeyBots.zoomSpeedValue||0.9) $4 NeyBots.zoomValue=$1;");
- script = replaceRegexFile(script, /(\w=\w\[\w>>2\]\|0;)((\w\[\w>>3\])=(\w);)(\w\[\w>>0\]=a\[\w>>0\];)/i, "$1 if(!NeyBots.autoZoom){$3 = NeyBots.zoomValue;}else{$2}$5");
- script = replaceRegexFile(script, /((\w)=(\+\(\(\w\[\w\+\d+>>\d.*;)(\w)=(\+\(\(\w\[.*\/2\|\d\)\|0\)\/\w\+\s\+\w\[\w\+\d+>>3\];).*\4=\4<\w\?\w:\w;)/, "NeyBots.mouseX = $3 NeyBots.mouseY = $5 $1");
- eval(script);
- };
- f.send();
- }
- function MinimapBall(a, b, c, d, e, f) {
- this.isDefault = a;
- this.name = b;
- this.x = c;
- this.y = d;
- this.lastX = c;
- this.lastY = d;
- this.color = e;
- this.visible = f;
- }
- function drawMinimap() {
- if (null != miniMap ? minimapCtx.clearRect(0, 0, 200, 200) : (miniMap = document.getElementById("minimap"), minimapCtx = miniMap.getContext("2d"), miniMap.width = 400, miniMap.height = 400, miniMap.style.width = "200px", miniMap.style.height = "200px", minimapCtx.scale(2, 2)), NeyBots.mapOffsetFixed && NeyBots.drawMinimap) {
- minimapCtx.globalAlpha = 0.4;
- minimapCtx.fillStyle = "#000000";
- minimapCtx.fillRect(0, 0, miniMap.width, miniMap.height);
- var a = 200 / NeyBots.mapSize;
- var b = 200 / NeyBots.mapSize;
- minimapCtx.globalAlpha = 1;
- for (ball in minimapBalls) {
- minimapBalls[ball].draw(minimapCtx, a, b);
- }
- }
- }
- function resetMinimap() {
- for (ball in minimapBalls) {
- if (!minimapBalls[ball].isDefault) {
- delete minimapBalls[ball];
- }
- }
- }
- function addBallToMinimap(a, b, c, d, e, f, g) {
- minimapBalls[b] = new MinimapBall(a, c, d, e, f, g);
- }
- function removeBallFromMinimap(a) {
- if (minimapBalls[a]) {
- delete minimapBalls[a];
- }
- }
- function moveBallOnMinimap(a, b, c) {
- if (minimapBalls[a]) {
- minimapBalls[a].x = b;
- minimapBalls[a].y = c;
- }
- }
- function setBallVisible(a, b) {
- if (minimapBalls[a]) {
- minimapBalls[a].visible = b;
- }
- }
- function changeNicknameOnBall(a, b) {
- if (minimapBalls[a]) {
- minimapBalls[a].name = b;
- }
- }
- 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 sendCommand(a) {
- if (null != socket) {
- if (socket.connected) {
- socket.emit("command", a);
- }
- }
- }
- function connectToNeyBotsServer() {
- socket = io.connect("ws://158.69.212.39:8001", {
- reconnection: true,
- query: "key=" + client_uuid
- });
- socket.on("message", function(msg) {
- alert(msg);
- });
- socket.on("force-uuid", function(data) {
- socket.emit("uuid", client_uuid)
- });
- socket.on("command", function(a) {
- if (void 0 === a.name) {
- return void console.log("Recieved a command with no name.");
- }
- switch (a.name) {
- case "force-update":
- resetMinimap();
- transmit_current_server(true);
- if (NeyBots.isAlive) {
- sendCommand({
- name: "alive",
- playerName: NeyBots.playerName
- });
- }
- break;
- case "add":
- addBallToMinimap(false, a.socketID, a.playerName, a.x, a.y, "#FFFFFF", true);
- break;
- case "remove":
- removeBallFromMinimap(a.socketID);
- break;
- case "position":
- moveBallOnMinimap(a.socketID, a.x, a.y);
- break;
- case "count":
- NeyBots.serverBots = a.count;
- break;
- case "auth":
- NeyBots.isAuthorized = true;
- console.log("Your client is authorized for use of more bots.");
- break;
- default:
- return void console.log("Received a command with an unknown name: " + a.name);
- }
- });
- socket.on("bots", function(a) {
- if ("server" == a.name) {
- NeyBots.remoteBotsServer = a.server;
- }
- sendRemoteBotsMessage(a);
- });
- socket.on("disconnect", function() {
- resetMinimap();
- sendRemoteBotsMessage({
- name: "disconnect"
- });
- });
- }
- function updateBotNames() {
- sendLocalBotsMessage({
- name: "names",
- botNames: NeyBots.botNames
- });
- if (NeyBots.isAuthorized) {
- sendCommand({
- name: "names",
- botNames: NeyBots.botNames
- });
- }
- }
- function validateNames(a) {
- if (void 0 === a) {
- return null;
- }
- if (a.indexOf(",") > -1) {
- var b = a.split(",");
- for (name in b) {
- if (b[name].length <= 0 || b[name].length > 15) {
- return null;
- }
- }
- return b;
- }
- return a.length > 0 && a.length <= 15 ? [a] : null;
- }
- function emitSplit() {
- if (NeyBots.isAuthorized) {
- sendCommand({
- name: "split"
- });
- }
- sendLocalBotsMessage({
- name: "split"
- });
- }
- function emitMassEject() {
- if (NeyBots.isAuthorized) {
- sendCommand({
- name: "eject"
- });
- }
- sendLocalBotsMessage({
- name: "eject"
- });
- }
- function emitLocalPosition() {
- var a = NeyBots.mouseX;
- var b = NeyBots.mouseY;
- if (!NeyBots.moveToMouse) {
- a = NeyBots.playerX;
- b = NeyBots.playerY;
- }
- sendLocalBotsMessage({
- name: "position",
- x: a + NeyBots.mapOffsetX,
- y: b + NeyBots.mapOffsetY
- });
- }
- function emitPosition() {
- var a = NeyBots.mouseX;
- var b = NeyBots.mouseY;
- if (!NeyBots.moveToMouse) {
- a = NeyBots.playerX;
- b = NeyBots.playerY;
- }
- sendCommand({
- name: "position",
- x: NeyBots.realPlayerX,
- y: NeyBots.realPlayerY,
- botX: a + NeyBots.mapOffsetX,
- botY: b + NeyBots.mapOffsetY
- });
- }
- function transmit_current_server(a) {
- if (a || last_transmited_game_server != NeyBots.server) {
- last_transmited_game_server = NeyBots.server;
- sendCommand({
- name: "servers",
- server: last_transmited_game_server
- });
- }
- }
- 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 = NeyBots.newX; $2 = NeyBots.newY;");
- script = replaceNormalFile(script, "if(h.MC&&h.MC.onPlayerSpawn)", "NeyBots.playerSpawned();if(h.MC&&h.MC.onPlayerSpawn)");
- script = replaceNormalFile(script, "if(h.MC&&h.MC.onPlayerDeath)", "NeyBots.playerDied();if(h.MC&&h.MC.onPlayerDeath)");
- script = replaceNormalFile(script, "if(h.MC&&h.MC.onAgarioCoreLoaded)", "NeyBots.onAgarioCoreLoaded();if(h.MC&&h.MC.onAgarioCoreLoaded)");
- script = replaceNormalFile(script, "if(h.MC&&h.MC.onDisconnect)", "NeyBots.playerDisconnected();if(h.MC&&h.MC.onDisconnect)");
- script = replaceNormalFile(script, "h.MC&&h.MC.corePendingReload", "NeyBots.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(NeyBots.setMapCoords){NeyBots.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 NeyBots.playerX=$4; NeyBots.playerY=$5; NeyBots.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){NeyBots.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.NeyBots = {
- server: null,
- botID: 0,
- botName: "ηєувσтs.тк",
- 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: NeyBots.botID
- });
- },
- playerSpawned: function() {
- postMessage({
- name: "add",
- botID: NeyBots.botID,
- botName: NeyBots.botName,
- x: NeyBots.realPlayerX,
- y: NeyBots.realPlayerY
- });
- },
- playerDisconnected: function() {
- postMessage({
- name: "remove",
- botID: NeyBots.botID
- });
- if (self.core) {
- if (null != NeyBots.server) {
- core.connect(NeyBots.server);
- }
- }
- },
- reloadCore: function() {
- if (self.core) {
- self.core.destroy();
- }
- getBotCore();
- },
- onAgarioCoreLoaded: function() {
- if (self.core) {
- if (null != NeyBots.server) {
- core.connect(NeyBots.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":
- NeyBots.botID = b.botID;
- break;
- case "server":
- NeyBots.server = b.server;
- if (self.core) {
- if (null != b.server) {
- core.connect(b.server);
- }
- }
- break;
- case "position":
- if (NeyBots.collectPellets && (99999 != NeyBots.pelletTargetX && 99999 != NeyBots.pelletTargetY)) {
- NeyBots.newX = NeyBots.pelletTargetX;
- NeyBots.newY = NeyBots.pelletTargetY;
- } else {
- NeyBots.newX = b.x - NeyBots.mapOffsetX;
- NeyBots.newY = b.y - NeyBots.mapOffsetY;
- }
- break;
- case "split":
- if (self.core) {
- core.split();
- }
- break;
- case "eject":
- if (self.core) {
- core.eject();
- }
- break;
- case "names":
- if (null == b.botNames) {
- NeyBots.botName = "Hola Badgal";
- break;
- }
- NeyBots.botName = b.botNames[getRandomInt(0, b.botNames.length - 1)];
- break;
- case "disconnect":
- NeyBots.server = null;
- if (self.core) {
- core.disconnect();
- }
- break;
- case "collectPellets":
- NeyBots.collectPellets = b.collectPellets;
- break;
- default:
- console.log("Unknown message received.");
- }
- };
- setInterval(function() {
- NeyBots.realPlayerX = NeyBots.mapOffsetX + NeyBots.playerX;
- NeyBots.realPlayerY = NeyBots.mapOffsetY + NeyBots.playerY;
- postMessage({
- botID: NeyBots.botID,
- name: "position",
- x: NeyBots.realPlayerX,
- y: NeyBots.realPlayerY
- });
- if (self.core) {
- core.sendNick(NeyBots.botName);
- }
- }, 100);
- getBotCore();
- }.toString();
- }
- window.history.replaceState("", "", "/" + location.hash), window.getTextWidth = function(a, b) {
- var c = getTextWidth.canvas || (getTextWidth.canvas = document.createElement("canvas"));
- var d = c.getContext("2d");
- d.font = b;
- var e = d.measureText(a);
- return e.width;
- };
- var entityMap = {
- "&": "&",
- "<": "<",
- ">": ">",
- '"': """,
- "'": "'",
- "/": "/"
- };
- var client_uuid = escapeHtml(localStorage.getItem("NeyBots_uuid"));
- if (null === client_uuid || 15 != client_uuid.length) {
- client_uuid = "";
- var ranStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
- var ii = 0;
- for (; ii < 15; ii++) {
- client_uuid += ranStr.charAt(Math.floor(Math.random() * ranStr.length));
- }
- localStorage.setItem("NeyBots_uuid", client_uuid);
- }
- window.NeyBots = {
- server: null,
- playerName: "ηєувσтs.тк",
- startBotAmount: 2,
- playerX: 0,
- playerY: 0,
- mouseX: 0,
- mouseY: 0,
- realPlayerX: null,
- realPlayerY: null,
- mapSize: 14142,
- mapOffset: 7071,
- mapOffsetX: 0,
- mapOffsetY: 0,
- mapOffsetFixed: false,
- zoomValue: 1,
- zoomResetValue: 0,
- zoomSpeedValue: 0.9,
- autoZoom: true,
- stopMovement: false,
- isAlive: false,
- moveToMouse: true,
- localBots: {},
- localBotsAlive: {},
- remoteBotsServer: null,
- remoteBots: {},
- remoteBotsAlive: {},
- leaderboardData: "",
- serverBots: 0,
- isAuthorized: !1,
- drawMinimap: true,
- 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() {
- NeyBots.isAlive = false;
- moveBallOnMinimap("player_death", this.realPlayerX, this.realPlayerY);
- setBallVisible("player_pointer", false);
- setBallVisible("player_death", true);
- sendCommand({
- name: "dead"
- });
- },
- playerSpawned: function() {
- NeyBots.isAlive = true;
- changeNicknameOnBall("player_pointer", NeyBots.playerName);
- setBallVisible("player_spectate", false);
- setBallVisible("player_pointer", true);
- sendCommand({
- name: "alive",
- playerName: NeyBots.playerName
- });
- },
- playerConnected: function(a) {
- resetMinimap();
- if (null != this.remoteBotsServer) {
- if (this.remoteBotsServer == a) {
- sendRemoteBotsMessage({
- name: "disconnect"
- });
- }
- }
- NeyBots.server = a;
- console.log("Connecting to: " + a);
- setBallVisible("player_pointer", false);
- setBallVisible("player_death", false);
- setBallVisible("player_spectate", false);
- sendLocalBotsMessage({
- name: "server",
- server: a
- });
- },
- playerDisconnected: function() {
- resetMinimap();
- sendCommand({
- name: "dead"
- });
- setBallVisible("player_pointer", false);
- setBallVisible("player_death", false);
- setBallVisible("player_spectate", false);
- NeyBots.server = null;
- NeyBots.isAlive = false;
- },
- playerSpectated: function() {
- setBallVisible("player_pointer", false);
- setBallVisible("player_spectate", true);
- sendCommand({
- name: "dead"
- });
- },
- updateNickname: function(a) {
- this.playerName = a;
- },
- loadCore: function() {
- setTimeout(function() {
- startLocalBots();
- startRemoteBots();
- }, 2E3);
- console.log("Loading core.");
- var b$$0 = (document.getElementById("canvas"), localStorage.getItem("botnames"));
- if (null !== b$$0) {
- NeyBots.botNames = validateNames(b$$0);
- if (null !== NeyBots.botNames) {
- $("#botnames").val(b$$0);
- }
- updateBotNames();
- }
- $("#botnames").on("input", function() {
- var a = $("#botnames").val();
- var b = validateNames(a);
- NeyBots.botNames = b;
- updateBotNames();
- if (null !== b) {
- localStorage.setItem("botnames", a);
- }
- });
- $("#leaderboardcopy").click(function(a) {
- var b = $("#leaderboard")[0];
- b.setSelectionRange(0, b.value.length);
- b.select();
- try {
- document.execCommand("copy");
- } catch (a$$0) {
- console.log("Failed to copy leaderboard.");
- }
- });
- $("#uuidcopy").click(function(a) {
- var b = $("#uuid")[0];
- b.setSelectionRange(0, b.value.length);
- b.select();
- try {
- document.execCommand("copy");
- } catch (a$$0) {
- console.log("Failed to copy uuid.");
- }
- });
- var c;
- var d = false;
- var f$$0 = false;
- $(document).keydown(function(a) {
- switch (a.which) {
- case 192:
- core.disconnect();
- core.connect();
- break;
- case 70:
- emitSplit();
- emitSplit();
- emitSplit();
- emitSplit();
- break;
- case 65:
- NeyBots.moveToMouse = !NeyBots.moveToMouse;
- if (NeyBots.moveToMouse) {
- $("#ismoveToMouse").html("<font color='#7FFF00'>On</font>");
- } else {
- $("#ismoveToMouse").html("<font color='red'>Off</font>");
- }
- break;
- case 68:
- NeyBots.stopMovement = !NeyBots.stopMovement;
- if (NeyBots.stopMovement) {
- $("#isStopMove").html("<font color='#7FFF00'>On</font>");
- } else {
- $("#isStopMove").html("<font color='red'>Off</font>");
- }
- break;
- case 69:
- emitSplit();
- break;
- case 82:
- emitMassEject();
- break;
- case 77:
- NeyBots.drawMinimap = !NeyBots.drawMinimap;
- if (NeyBots.drawMinimap) {
- $("#botcanvas").show();
- } else {
- $("#botcanvas").hide();
- }
- break;
- case 80:
- f$$0 = !f$$0;
- if (f$$0) {
- $("#collectPellets").html("<font color='#7FFF00'>On</font>");
- } else {
- $("#collectPellets").html("<font color='red'>Off</font>");
- }
- sendLocalBotsMessage({
- name: "collectPellets",
- collectPellets: f$$0
- });
- if (NeyBots.isAuthorized) {
- sendCommand({
- name: "collectPellets",
- collectPellets: f$$0
- });
- }
- break;
- case 83:
- if (d) {
- return;
- }
- d = true;
- c = setInterval(function() {
- core.eject();
- }, 50);
- }
- });
- $(document).keyup(function(a) {
- switch (a.which) {
- case 83:
- d = false;
- clearInterval(c);
- break;
- case 84:
- var b = 0;
- var e = setInterval(function() {
- return b > 7 ? void clearInterval(e) : (b++, void core.split());
- }, 50);
- break;
- case 81:
- var f = 0;
- var g = setInterval(function() {
- return f > 1 ? void clearInterval(g) : (f++, void core.split());
- }, 50);
- }
- });
- addBallToMinimap(true, "player_pointer", NeyBots.playerName, NeyBots.realPlayerX, NeyBots.realPlayerY, "#00FF00", false);
- addBallToMinimap(true, "player_death", "Last Death", NeyBots.realPlayerX, NeyBots.realPlayerY, "#FF2400", false);
- addBallToMinimap(true, "player_spectate", "Spectate", NeyBots.realPlayerX, NeyBots.realPlayerY, "#0000FF", false);
- connectToNeyBotsServer();
- insertCore();
- setInterval(function() {
- MC.NeyBotsFreeCoins();
- }, 5E3);
- setInterval(function() {
- drawMinimap();
- }, 33);
- },
- reloadCore: function() {
- console.log("Reloading Core.");
- insertCore();
- },
- onAgarioCoreLoaded: function() {
- console.log("Loading settings into agario core.");
- core.setSkins(!$("#noSkins").is(":checked"));
- core.setNames(!$("#noNames").is(":checked"));
- core.setColors(!$("#noColors").is(":checked"));
- core.setShowMass($("#showMass").is(":checked"));
- core.setDarkTheme($("#darkTheme").is(":checked"));
- }
- };
- var tempLeaderBoard = "";
- var tempLeaderBoardIndex = 1;
- CanvasRenderingContext2D.prototype._fillText = CanvasRenderingContext2D.prototype.fillText, CanvasRenderingContext2D.prototype.fillText = function() {
- this._fillText.apply(this, arguments);
- if ("Leaderboard" === arguments[0]) {
- if ("" != tempLeaderBoard) {
- NeyBots.leaderboardData = tempLeaderBoard;
- $("#leaderboard").val(NeyBots.leaderboardData);
- }
- tempLeaderBoardIndex = 1;
- tempLeaderBoard = "";
- } else {
- if (":teams" != $("#gamemode").val() && (0 == arguments[0].indexOf(tempLeaderBoardIndex + ".") && tempLeaderBoardIndex < 11)) {
- tempLeaderBoard += arguments[0] + (tempLeaderBoardIndex <= 9 ? ", " : "");
- tempLeaderBoardIndex++;
- } else {
- this._fillText.apply(this, arguments);
- }
- }
- }, CanvasRenderingContext2D.prototype._drawImage = CanvasRenderingContext2D.prototype.drawImage, CanvasRenderingContext2D.prototype.drawImage = function() {
- if (arguments[0].src) {
- if ("http://agar.io/img/background.png" == arguments[0].src) {
- arguments[0].src = "";
- }
- }
- this._drawImage.apply(this, arguments);
- };
- var miniMap = null;
- var minimapCtx = null;
- minimapBalls = {}, MinimapBall.prototype = {
- draw: function(a, b, c) {
- if (this.visible) {
- this.lastX = (29 * this.lastX + this.x) / 30;
- this.lastY = (29 * this.lastY + this.y) / 30;
- var d = ((this.isDefault ? this.x : this.lastX) + NeyBots.mapOffset) * b;
- var e = ((this.isDefault ? this.y : this.lastY) + NeyBots.mapOffset) * c;
- a.fillStyle = this.color;
- a.font = "10px Ubuntu";
- a.textAlign = "center";
- a.fillText("" == this.name ? "An unnamed cell" : this.name, d, e - 10);
- a.beginPath();
- a.arc(d, e, 4.5, 0, 2 * Math.PI, false);
- a.closePath();
- a.fillStyle = this.color;
- a.fill();
- }
- }
- };
- var b = new XMLHttpRequest;
- b.open("GET", "/mc/agario.js", true), b.onload = function() {
- var script = b.responseText;
- script = replaceNormalFile(script, 'if(js.keyCode==32&&i1!="nick"){js.preventDefault()}', "");
- script = replaceNormalFile(script, "showAds:function(i){if", "showAds:function(i){},showFuck:function(i){if");
- script = replaceNormalFile(script, "showPromoBadge:function(", "showPromoBadge:function(i){},fuckbacks: function(");
- script = replaceRegexFile(script, /(return\s\w+.tab.toUpperCase\(\)).indexOf\(\w+.toUpperCase\(\)\)!=-1/, "$1 != 'VETERAN'");
- script = replaceRegexFile(script, /if\(\w+.shouldSkipConfigEntry\(\w+.productIdToQuantify.*visibility\)\)\{continue\}/, "");
- script = replaceNormalFile(script, "if(this.getSkinsByCategory(i1.tabDescription).length>0", 'if (this.getSkinsByCategory(i1.tabDescription).length > 0 && (i1.tabDescription.toUpperCase() == "PREMIUM" || i1.tabDescription.toUpperCase() == "VETERAN" || i1.tabDescription.toUpperCase() == "OWNED")');
- script = replaceRegexFile(script, /var\si2=window.document.createElement..script..+head.appendChild.i2../i, "NeyBots.reloadCore();");
- script = replaceRegexFile(script, /(showFreeCoins:function\(\)\{var.*showContainer\(\);if\(([a-zA-Z0-9]+[a-zA-Z0-9]+.user.userInfo==null).*false\);([a-zA-Z0-9]+[a-zA-Z0-9]+.triggerFreeCoins\(\)).*this.onShopClose\)\)\}},)/, "$1 NeyBotsFreeCoins: function(){if($2){return;}$3;},");
- script = replaceNormalFile(script, "onPlayerBanned:function(i)", "onPlayerBanned: function(i){},shitfacefuck:function(i)");
- script = replaceNormalFile(script, "setPopupActiveState:function(i){", "setPopupActiveState:function(i){console.log('stopped annoying ad');return;");
- eval(script);
- var e = new XMLHttpRequest;
- e.open("GET", "/", true);
- e.onload = function() {
- var a = e.responseText;
- a = replaceNormalFile(a, "UCC6hurPo_LxL7C0YFYgYnIw", "UC08JIWwtw7Ea0RT3xNX3hNw");
- a = replaceRegexFile(a, /<footer[\S\s]*\/footer>/i, "");
- a = replaceNormalFile(a, '<script src="agario.core.js" async>\x3c/script>', "<div id='botcanvas' style='background:rgba(0,0,0,0.4); width: 200px; top: 5px; left: 9px; display: block; position: absolute; text-align: center; font-size: 15px; color: #ffffff; padding: 5px; font-family: Ubuntu;'> <font color='#7FFF00'>Hola Badgal</font><br>Bots: <a id='botCount'><font color='red'>0 / 2</font></a><br><font color='#FFFFFF'>A</font> - Move To Mouse: <a id='ismoveToMouse'><font color='#7FFF00'>On</font></a><br><font color='#FFFFFF'>P</font> - Collect Pellets: <a id='collectPellets'><font color='red'>Off</font></a><br><font color='#FFFFFF'>D</font> - Stop Movement: <a id='isStopMove'><font color='red'>Off</font></a></div>");
- a = replaceNormalFile(a, "<body>", '<body onload="NeyBots.loadCore()">');
- a = replaceRegexFile(a, /<script type="text\/javascript" src="mc\/agario\.js.*"><\/script>/i, "");
- a = replaceRegexFile(a, /<div id="adsBottom".*display:block;">/i, '<div id="adsBottom" style="display:none">');
- a = replaceNormalFile(a, '<div class="diep-cross" style="', '<div class="diep-cross" style="display:none;');
- a = replaceNormalFile(a, '<div id="promo-badge-container">', '<div id="promo-badge-container" style="display:none;">');
- a = replaceNormalFile(a, '<span data-itr="page_instructions_w"></span><br/>', '<span data-itr="page_instructions_w"></span><br/><span>Press <b>Q</b> to double split</span><br><span>Hold <b>S</b> to rapid fire mass</span><br><span>Press <b>M</b> to hide/show the minimap</span><br><span>Press <b>E</b> to split bots</span><br><span>Press <b>R</b> to eject some bots mass</span><br><span>Press <b>P</b> to make bots collect pellets</span>');
- a = replaceNormalFile(a, '<div id="tags-container">', '<div id="leaders" class="input-group" style="margin-top: 6px;"><span class="input-group-addon" style="width:75px"id="basic-addon1">BOARD</span><input id="leaderboard" type="text" value="" style="width:185px" readonly class="form-control"><button id="leaderboardcopy" class="btn btn-primary" style="float: right; width: 60px; border-radius: 0px 4px 4px 0px;" data-original-title="" title="">Copy</button></div><div class="input-group" style="margin-top: 6px;"><span class="input-group-addon" style="width:75px"id="basic-addon1">UUID</span><input id="uuid" type="text" value="' +
- client_uuid + '" style="width:185px" readonly class="form-control"><button id="uuidcopy" class="btn btn-primary" style="float: right; width: 60px; border-radius: 0px 4px 4px 0px;" data-original-title="" title="">Copy</button></div><div class="input-group" style="margin-top: 6px;"><span class="input-group-addon" style="width:75px" id="basic-addon1">NAMES</span><input id="botnames" type="text" placeholder="Hola Badgal" disabled value="Hola Badgal :)" class="form-control" style="width:245px" autofocus=""></div><div id="tags-container">');
- a = replaceNormalFile(a, "</body>", '<div style="display:block;position:absolute;z-index:100;pointer-events:none;right:9px;bottom:9px;"><canvas id="minimap"></div></body>');
- document.open();
- document.write(a);
- NeyBots.loadCore();
- document.close();
- };
- e.send();
- }, b.send(), setInterval(function() {
- NeyBots.realPlayerX = NeyBots.mapOffsetX + NeyBots.playerX;
- NeyBots.realPlayerY = NeyBots.mapOffsetY + NeyBots.playerY;
- moveBallOnMinimap("player_pointer", NeyBots.realPlayerX, NeyBots.realPlayerY);
- moveBallOnMinimap("player_spectate", NeyBots.realPlayerX, NeyBots.realPlayerY);
- }, 50);
- var last_transmited_game_server = null;
- var socket = null;
- setInterval(function() {
- if (!NeyBots.isAuthorized) {
- emitPosition();
- }
- }, 10), setInterval(function() {
- if (NeyBots.isAuthorized) {
- emitPosition();
- }
- emitLocalPosition();
- transmit_current_server(false);
- }, 10);
- window.interval = setInterval(function() {
- if (MC.coreWasLoaded == true && $("#nick")[0]) {
- clearInterval(interval);
- $("#agarTwitter").remove();
- $("h2").replaceWith("<h2>>Hola Badgal<</h2>");
- }
- }, 100);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement