Advertisement
Guest User

Untitled

a guest
Sep 24th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.58 KB | None | 0 0
  1. function escapeHtml(a) {
  2. return String(a).replace(/[&<>"'\/]/g, function(a) {
  3. return entityMap[a]
  4. })
  5. }
  6.  
  7. function updateBotCount(a, b) {
  8. $("#botCount").html('<font color="green">' + 30 + " / " + 30 + "</font>")
  9. }
  10.  
  11. function startLocalBots() {
  12. for (var a = 30; a < 3; a++) G047.localBotsAlive[a] = !1, G047.localBots[a] = new Worker(URL.createObjectURL(new Blob(["(" + generateBotFunction() + ")()"], {
  13. type: "text/javascript"
  14. }))), G047.localBots[a].onmessage = function(a) {
  15. var b = a.data;
  16. switch (b.name) {
  17. case "add":
  18. updateBotCount(b.botID, !0), addBallToMinimap(!0, "bot" + b.botID, b.botName, b.x, b.y, "#FF00FF", !0);
  19. break;
  20. case "remove":
  21. updateBotCount(b.botID, !1), removeBallFromMinimap("bot" + b.botID);
  22. break;
  23. case "position":
  24. moveBallOnMinimap("bot" + b.botID, b.x, b.y);
  25. break;
  26. default:
  27. console.log("Unknown command received from bot")
  28. }
  29. }, G047.localBots[a].postMessage({
  30. name: "botID",
  31. botID: a
  32. });
  33. updateBotNames()
  34. }
  35.  
  36. function startRemoteBots() {
  37. for (var a = 0; a < 3; a++) G047.remoteBots[a] = new Worker(URL.createObjectURL(new Blob(["(" + generateBotFunction() + ")()"], {
  38. type: "text/javascript"
  39. })))
  40. }
  41.  
  42. function sendLocalBotsMessage(a) {
  43. for (i in G047.localBots) G047.localBots[i].postMessage(a)
  44. }
  45.  
  46. function sendRemoteBotsMessage(a) {
  47. for (i in G047.remoteBots) G047.remoteBots[i].postMessage(a)
  48. }
  49.  
  50. function insertCore() {
  51. var f = new XMLHttpRequest;
  52. f.open("GET", "/agario.core.js", !0), f.onload = function() {
  53. var script = f.responseText;
  54. script = replaceNormalFile(script, "if(h.MC&&h.MC.onPlayerSpawn)", "G047.playerSpawned();if(h.MC&&h.MC.onPlayerSpawn)"), script = replaceNormalFile(script, "if(h.MC&&h.MC.onPlayerDeath)", "G047.playerDied();if(h.MC&&h.MC.onPlayerDeath)"), script = replaceNormalFile(script, "if(h.MC&&h.MC.onAgarioCoreLoaded)", "G047.onAgarioCoreLoaded();if(h.MC&&h.MC.onAgarioCoreLoaded)"), script = replaceNormalFile(script, "if(h.MC&&h.MC.onDisconnect)", "G047.playerDisconnected();if(h.MC&&h.MC.onDisconnect)"), script = replaceNormalFile(script, "connect:function(a){", "connect:function(a){G047.playerConnected(a);"), script = replaceNormalFile(script, "sendSpectate:function(){", "sendSpectate:function(){G047.playerSpectated();"), script = replaceNormalFile(script, "sendNick:function(a){", "sendNick:function(a){G047.updateNickname(a);"), script = replaceNormalFile(script, "setTarget:function(a,b){", "setTarget:function(a,b){if(G047.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(G047.setMapCoords){G047.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 G047.playerX=$4; G047.playerY=$5;"), script = replaceRegexFile(script, /if\((\+\w\[\w>>3\])<1\.0\){/i, "if($1 < G047.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 (G047.zoomSpeedValue||0.9) $4 G047.zoomValue=$1;"), script = replaceRegexFile(script, /(\w=\w\[\w>>2\]\|0;)((\w\[\w>>3\])=(\w);)(\w\[\w>>0\]=a\[\w>>0\];)/i, "$1 if(!G047.autoZoom){$3 = G047.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;)/, "G047.mouseX = $3 G047.mouseY = $5 $1"), eval(script)
  55. }, f.send()
  56. }
  57.  
  58. function MinimapBall(a, b, c, d, e, f) {
  59. this.isDefault = a, this.name = b, this.x = c, this.y = d, this.lastX = c, this.lastY = d, this.color = e, this.visible = f
  60. }
  61.  
  62. function drawMinimap() {
  63. 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)), G047.mapOffsetFixed && G047.drawMinimap) {
  64. minimapCtx.globalAlpha = .4, minimapCtx.fillStyle = "#000000", minimapCtx.fillRect(0, 0, miniMap.width, miniMap.height);
  65. var a = 200 / G047.mapSize,
  66. b = 200 / G047.mapSize;
  67. minimapCtx.globalAlpha = 1;
  68. for (ball in minimapBalls) minimapBalls[ball].draw(minimapCtx, a, b)
  69. }
  70. }
  71.  
  72. function resetMinimap() {
  73. for (ball in minimapBalls) minimapBalls[ball].isDefault || delete minimapBalls[ball]
  74. }
  75.  
  76. function addBallToMinimap(a, b, c, d, e, f, g) {
  77. minimapBalls[b] = new MinimapBall(a, c, d, e, f, g)
  78. }
  79.  
  80. function removeBallFromMinimap(a) {
  81. minimapBalls[a] && delete minimapBalls[a]
  82. }
  83.  
  84. function moveBallOnMinimap(a, b, c) {
  85. minimapBalls[a] && (minimapBalls[a].x = b, minimapBalls[a].y = c)
  86. }
  87.  
  88. function setBallVisible(a, b) {
  89. minimapBalls[a] && (minimapBalls[a].visible = b)
  90. }
  91.  
  92. function changeNicknameOnBall(a, b) {
  93. minimapBalls[a] && (minimapBalls[a].name = b)
  94. }
  95.  
  96. function replaceRegexFile(a, b, c) {
  97. var d = new RegExp(b);
  98. return d.test(a) ? a = a.replace(b, c) : console.log("[Failed] to replace: " + b), a
  99. }
  100.  
  101. function replaceNormalFile(a, b, c) {
  102. return a.indexOf(b) != -1 ? a = a.replace(b, c) : console.log("[Failed] to replace: " + b), a
  103. }
  104.  
  105. function sendCommand(a) {
  106. null != socket && socket.connected && socket.emit("command", a)
  107. }
  108.  
  109. function connectToG047Server() {
  110. socket = io.connect("ws://localhost:8002", {
  111. reconnection: true,
  112. query: "key=" + client_uuid
  113. }), socket.on("command", function(a) {
  114. if (void 0 === a.name) return void console.log("Recieved a command with no name.");
  115. switch (a.name) {
  116. case "force-update":
  117. resetMinimap(), transmit_current_server(!0), G047.isAlive && sendCommand({
  118. name: "alive",
  119. playerName: G047.playerName
  120. });
  121. break;
  122. case "add":
  123. addBallToMinimap(!1, a.socketID, a.playerName, a.x, a.y, "#FFFFFF", !0);
  124. break;
  125. case "remove":
  126. removeBallFromMinimap(a.socketID);
  127. break;
  128. case "position":
  129. moveBallOnMinimap(a.socketID, a.x, a.y);
  130. break;
  131. case "count":
  132. G047.serverBots = a.count;
  133. break;
  134. case "auth":
  135. G047.isAuthorized = a.auth, console.log("Your client is authorized for use of more bots.");
  136. break;
  137. default:
  138. return void console.log("Received a command with an unknown name: " + a.name)
  139. }
  140. }), socket.on("bots", function(a) {
  141. "server" == a.name && (G047.remoteBotsServer = a.server), sendRemoteBotsMessage(a)
  142. }), socket.on("disconnect", function() {
  143. resetMinimap(), sendRemoteBotsMessage({
  144. name: "disconnect"
  145. })
  146. })
  147. }
  148.  
  149. function updateBotNames() {
  150. sendLocalBotsMessage({
  151. name: "names",
  152. botNames: G047.botNames
  153. }), G047.isAuthorized && sendCommand({
  154. name: "names",
  155. botNames: G047.botNames
  156. })
  157. }
  158.  
  159. function validateNames(a) {
  160. if (void 0 === a) return null;
  161. if (a.indexOf(",") > -1) {
  162. var b = a.split(",");
  163. for (name in b)
  164. if (b[name].length <= 0 || b[name].length > 15) return null;
  165. return b
  166. }
  167. return a.length > 0 && a.length <= 15 ? [a] : null
  168. }
  169.  
  170. function emitSplit() {
  171. G047.isAuthorized && sendCommand({
  172. name: "split"
  173. }), sendLocalBotsMessage({
  174. name: "split"
  175. })
  176. }
  177.  
  178. function emitMassEject() {
  179. G047.isAuthorized && sendCommand({
  180. name: "eject"
  181. }), sendLocalBotsMessage({
  182. name: "eject"
  183. })
  184. }
  185.  
  186. function emitLocalPosition() {
  187. var a = G047.mouseX,
  188. b = G047.mouseY;
  189. G047.moveToMouse || (a = G047.playerX, b = G047.playerY), sendLocalBotsMessage({
  190. name: "position",
  191. x: a + G047.mapOffsetX,
  192. y: b + G047.mapOffsetY
  193. })
  194. }
  195.  
  196. function emitPosition() {
  197. var a = G047.mouseX,
  198. b = G047.mouseY;
  199. G047.moveToMouse || (a = G047.playerX, b = G047.playerY), sendCommand({
  200. name: "position",
  201. x: G047.realPlayerX,
  202. y: G047.realPlayerY,
  203. botX: a + G047.mapOffsetX,
  204. botY: b + G047.mapOffsetY
  205. })
  206. }
  207.  
  208. function transmit_current_server(a) {
  209. (a || last_transmited_game_server != G047.server) && (last_transmited_game_server = G047.server, sendCommand({
  210. name: "server",
  211. server: last_transmited_game_server
  212. }))
  213. }
  214.  
  215. function generateBotFunction() {
  216. return function() {
  217. function replaceRegexFile(a, b, c) {
  218. var d = new RegExp(b);
  219. return d.test(a) ? a = a.replace(b, c) : console.log("[Failed] to replace: " + b), a
  220. }
  221.  
  222. function replaceNormalFile(a, b, c) {
  223. return a.indexOf(b) != -1 ? a = a.replace(b, c) : console.log("[Failed] to replace: " + b), a
  224. }
  225.  
  226. function getRandomInt(a, b) {
  227. return Math.floor(Math.random() * (b - a + 1)) + a
  228. }
  229.  
  230. function getBotCore() {
  231. var e = new XMLHttpRequest;
  232. e.open("GET", "http://agar.io/agario.core.js", !0), e.onload = function() {
  233. var script = e.responseText;
  234. 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 = G047.newX; $2 = G047.newY;"), script = replaceNormalFile(script, "if(h.MC&&h.MC.onPlayerSpawn)", "G047.playerSpawned();if(h.MC&&h.MC.onPlayerSpawn)"), script = replaceNormalFile(script, "if(h.MC&&h.MC.onPlayerDeath)", "G047.playerDied();if(h.MC&&h.MC.onPlayerDeath)"), script = replaceNormalFile(script, "if(h.MC&&h.MC.onAgarioCoreLoaded)", "G047.onAgarioCoreLoaded();if(h.MC&&h.MC.onAgarioCoreLoaded)"), script = replaceNormalFile(script, "if(h.MC&&h.MC.onDisconnect)", "G047.playerDisconnected();if(h.MC&&h.MC.onDisconnect)"), script = replaceNormalFile(script, "h.MC&&h.MC.corePendingReload", "G047.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(G047.setMapCoords){G047.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 G047.playerX=$4; G047.playerY=$5; G047.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){G047.recordPellet($5,$6,cellSize);}$4"), eval(script)
  235. }, e.send(null)
  236. }
  237. self.innerWidth = 1, self.innerHeight = 1;
  238. const window = {},
  239. elementMock = {
  240. getContext: function() {
  241. return {
  242. canvas: {
  243. width: 1,
  244. height: 1
  245. },
  246. clearRect: function() {},
  247. save: function() {},
  248. translate: function() {},
  249. scale: function() {},
  250. stroke: function() {},
  251. arc: function() {},
  252. fill: function() {},
  253. moveTo: function() {},
  254. lineTo: function() {},
  255. closePath: function() {},
  256. beginPath: function() {},
  257. restore: function() {},
  258. fillRect: function() {},
  259. measureText: function() {
  260. return {}
  261. },
  262. strokeText: function() {},
  263. fillText: function() {},
  264. drawImage: function() {}
  265. }
  266. },
  267. innerText: "",
  268. div: {
  269. appendChild: function() {}
  270. },
  271. appendChild: function() {},
  272. style: {}
  273. },
  274. document = {
  275. getElementById: function() {
  276. return elementMock
  277. },
  278. createElement: function(a) {
  279. return elementMock
  280. },
  281. body: {
  282. firstChild: {},
  283. insertBefore: function() {}
  284. }
  285. },
  286. Image = function() {};
  287. self.G047 = {
  288. server: null,
  289. botID: 0,
  290. botName: "FILEBOTS",
  291. playerX: 0,
  292. playerY: 0,
  293. newX: 0,
  294. newY: 0,
  295. realPlayerX: null,
  296. realPlayerY: null,
  297. mapOffset: 7071,
  298. mapOffsetX: 0,
  299. mapOffsetY: 0,
  300. mapOffsetFixed: !1,
  301. collectPellets: !1,
  302. pelletTargetX: 99999,
  303. pelletTargetY: 99999,
  304. pellets: [],
  305. recordPellet: function(a, b, c) {
  306. this.pellets.push({
  307. x: a,
  308. y: b,
  309. size: c
  310. })
  311. },
  312. setMapCoords: function(a, b, c, d, e, f) {
  313. f - e == 24 && c - a > 14e3 && d - b > 14e3 && (this.mapOffsetX = this.mapOffset - c, this.mapOffsetY = this.mapOffset - d, this.mapOffsetFixed = !0)
  314. },
  315. playerDied: function() {
  316. postMessage({
  317. name: "remove",
  318. botID: G047.botID
  319. })
  320. },
  321. playerSpawned: function() {
  322. postMessage({
  323. name: "add",
  324. botID: G047.botID,
  325. botName: G047.botName,
  326. x: G047.realPlayerX,
  327. y: G047.realPlayerY
  328. })
  329. },
  330. playerDisconnected: function() {
  331. postMessage({
  332. name: "remove",
  333. botID: G047.botID
  334. }), self.core && core.connect(G047.server)
  335. },
  336. reloadCore: function() {
  337. self.core && self.core.destroy(), getBotCore()
  338. },
  339. onAgarioCoreLoaded: function() {
  340. null != G047.server && self.core && core.connect(G047.server)
  341. },
  342. setPath: function() {
  343. for (var a = -1, b = 0, c = 0; c < this.pellets.length; c++) {
  344. var d = this.getDistanceBetweenPositions(this.pellets[c].x, this.pellets[c].y, this.playerX, this.playerY);
  345. a != -1 && d > b || (a = c, b = d)
  346. }
  347. a == -1 ? (this.pelletTargetX = 99999, this.pelletTargetY = 99999) : (this.pelletTargetX = this.pellets[a].x, this.pelletTargetY = this.pellets[a].y), this.pellets = []
  348. },
  349. getDistanceBetweenPositions: function(a, b, c, d) {
  350. return Math.sqrt(Math.pow(c - a, 2) + Math.pow(b - d, 2))
  351. }
  352. }, onmessage = function(a) {
  353. var b = a.data;
  354. switch (b.name) {
  355. case "botID":
  356. G047.botID = b.botID;
  357. break;
  358. case "server":
  359. G047.server = b.server, self.core && core.connect(b.server);
  360. break;
  361. case "position":
  362. G047.collectPellets && 99999 != G047.pelletTargetX && 99999 != G047.pelletTargetY ? (G047.newX = G047.pelletTargetX, G047.newY = G047.pelletTargetY) : (G047.newX = b.x - G047.mapOffsetX, G047.newY = b.y - G047.mapOffsetY);
  363. break;
  364. case "split":
  365. core.split();
  366. break;
  367. case "eject":
  368. core.eject();
  369. break;
  370. case "names":
  371. if (null == b.botNames) {
  372. G047.botName = "FILEBOTS";
  373. break
  374. }
  375. G047.botName = b.botNames[getRandomInt(0, b.botNames.length - 1)];
  376. break;
  377. case "disconnect":
  378. G047.server = null, self.core && core.disconnect();
  379. break;
  380. case "collectPellets":
  381. G047.collectPellets = b.collectPellets;
  382. break;
  383. default:
  384. console.log("Unknown message received.")
  385. }
  386. }, setInterval(function() {
  387. G047.realPlayerX = G047.mapOffsetX + G047.playerX, G047.realPlayerY = G047.mapOffsetY + G047.playerY, postMessage({
  388. botID: G047.botID,
  389. name: "position",
  390. x: G047.realPlayerX,
  391. y: G047.realPlayerY
  392. }), self.core && core.sendNick(G047.botName)
  393. }, 100), getBotCore()
  394. }.toString()
  395. }
  396. window.history.replaceState("", "", "/" + location.hash), window.getTextWidth = function(a, b) {
  397. var c = getTextWidth.canvas || (getTextWidth.canvas = document.createElement("canvas")),
  398. d = c.getContext("2d");
  399. d.font = b;
  400. var e = d.measureText(a);
  401. return e.width
  402. };
  403. var entityMap = {
  404. "&": "&amp;",
  405. "<": "&lt;",
  406. ">": "&gt;",
  407. '"': "&quot;",
  408. "'": "&#39;",
  409. "/": "&#x2F;"
  410. },
  411. client_uuid = escapeHtml(localStorage.getItem("G047_uuid"));
  412. if (null === client_uuid || 15 != client_uuid.length) {
  413. client_uuid = "";
  414. for (var ranStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", ii = 0; ii < 15; ii++) client_uuid += ranStr.charAt(Math.floor(Math.random() * ranStr.length));
  415. localStorage.setItem("G047_uuid", client_uuid)
  416. }
  417. client_uuid='FILEBOTS'; //Change if needed
  418. window.G047 = {
  419. server: null,
  420. playerName: "",
  421. playerX: 0,
  422. playerY: 0,
  423. mouseX: 0,
  424. mouseY: 0,
  425. realPlayerX: null,
  426. realPlayerY: null,
  427. mapSize: 14142,
  428. mapOffset: 7071,
  429. mapOffsetX: 0,
  430. mapOffsetY: 0,
  431. mapOffsetFixed: !1,
  432. zoomValue: 1,
  433. zoomResetValue: 0,
  434. zoomSpeedValue: .9,
  435. autoZoom: !0,
  436. stopMovement: !1,
  437. isAlive: !1,
  438. moveToMouse: !0,
  439. localBots: {},
  440. localBotsAlive: {},
  441. remoteBotsServer: null,
  442. remoteBots: {},
  443. remoteBotsAlive: {},
  444. leaderboardData: "",
  445. serverBots: 50,
  446. isAuthorized: !1,
  447. drawMinimap: !0,
  448. setMapCoords: function(a, b, c, d, e, f) {
  449. f - e == 24 && c - a > 14e3 && d - b > 14e3 && (this.mapOffsetX = this.mapOffset - c, this.mapOffsetY = this.mapOffset - d, this.mapOffsetFixed = !0)
  450. },
  451. playerDied: function() {
  452. G047.isAlive = !1, moveBallOnMinimap("player_death", this.realPlayerX, this.realPlayerY), setBallVisible("player_pointer", !1), setBallVisible("player_death", !0), sendCommand({
  453. name: "dead"
  454. })
  455. },
  456. playerSpawned: function() {
  457. G047.isAlive = !0, changeNicknameOnBall("player_pointer", G047.playerName), setBallVisible("player_spectate", !1), setBallVisible("player_pointer", !0), sendCommand({
  458. name: "alive",
  459. playerName: G047.playerName
  460. })
  461. },
  462. playerConnected: function(a) {
  463. resetMinimap(), null != this.remoteBotsServer && this.remoteBotsServer == a && sendRemoteBotsMessage({
  464. name: "disconnect"
  465. }), G047.server = a, console.log("Connecting to: " + a), setBallVisible("player_pointer", !1), setBallVisible("player_death", !1), setBallVisible("player_spectate", !1), sendLocalBotsMessage({
  466. name: "server",
  467. server: a
  468. })
  469. },
  470. playerDisconnected: function() {
  471. resetMinimap(), sendCommand({
  472. name: "dead"
  473. }), setBallVisible("player_pointer", !1), setBallVisible("player_death", !1), setBallVisible("player_spectate", !1), G047.server = null, G047.isAlive = !1
  474. },
  475. playerSpectated: function() {
  476. setBallVisible("player_pointer", !1), setBallVisible("player_spectate", !0), sendCommand({
  477. name: "dead"
  478. })
  479. },
  480. updateNickname: function(a) {
  481. this.playerName = a
  482. },
  483. loadCore: function() {
  484. setTimeout(function() {
  485. startLocalBots(), startRemoteBots()
  486. }, 2e3), console.log("Loading core.");
  487. var b = (document.getElementById("canvas"), localStorage.getItem("botnames"));
  488. null !== b && (G047.botNames = validateNames(b), null !== G047.botNames && $("#botnames").val(b), updateBotNames()), $("#botnames").on("input", function() {
  489. var a = $("#botnames").val(),
  490. b = validateNames(a);
  491. G047.botNames = b, updateBotNames(), null !== b && localStorage.setItem("botnames", a)
  492. }), $("#leaderboardcopy").click(function(a) {
  493. var b = $("#leaderboard")[0];
  494. b.setSelectionRange(0, b.value.length), b.select();
  495. try {
  496. document.execCommand("copy")
  497. } catch (a) {
  498. console.log("Failed to copy leaderboard.")
  499. }
  500. }), $("#uuidcopy").click(function(a) {
  501. var b = $("#uuid")[0];
  502. b.setSelectionRange(0, b.value.length), b.select();
  503. try {
  504. document.execCommand("copy")
  505. } catch (a) {
  506. console.log("Failed to copy uuid.")
  507. }
  508. });
  509. var c, d = !1,
  510. f = !1;
  511. $(document).keydown(function(a) {
  512. switch (a.which) {
  513. case 65:
  514. G047.moveToMouse = !G047.moveToMouse, G047.moveToMouse ? $("#ismoveToMouse").html("<font color='#7FFF00'>On</font>") : $("#ismoveToMouse").html("<font color='red'>Off</font>");
  515. break;
  516. case 68:
  517. G047.stopMovement = !G047.stopMovement, G047.stopMovement ? $("#isStopMove").html("<font color='#7FFF00'>On</font>") : $("#isStopMove").html("<font color='red'>Off</font>");
  518. break;
  519. case 69:
  520. emitSplit();
  521. break;
  522. case 82:
  523. emitMassEject();
  524. break;
  525. case 77:
  526. G047.drawMinimap = !G047.drawMinimap, G047.drawMinimap ? $("#botcanvas").show() : $("#botcanvas").hide();
  527. break;
  528. case 80:
  529. f = !f, f ? $("#collectPellets").html("<font color='#7FFF00'>On</font>") : $("#collectPellets").html("<font color='red'>Off</font>"), sendLocalBotsMessage({
  530. name: "collectPellets",
  531. collectPellets: f
  532. }), G047.isAuthorized && sendCommand({
  533. name: "collectPellets",
  534. collectPellets: f
  535. });
  536. break;
  537. case 87:
  538. if (d) return;
  539. d = !0, c = setInterval(function() {
  540. core.eject()
  541. }, 50)
  542. }
  543. }), $(document).keyup(function(a) {
  544. switch (a.which) {
  545. case 87:
  546. d = !1, clearInterval(c);
  547. break;
  548. case 84:
  549. var b = 0,
  550. e = setInterval(function() {
  551. return b > 7 ? void clearInterval(e) : (b++, void core.split())
  552. }, 50);
  553. break;
  554. case 81:
  555. var f = 0,
  556. g = setInterval(function() {
  557. return f > 1 ? void clearInterval(g) : (f++, void core.split())
  558. }, 50)
  559. }
  560. }), addBallToMinimap(!0, "player_pointer", G047.playerName, G047.realPlayerX, G047.realPlayerY, "#00FF00", !1), addBallToMinimap(!0, "player_death", "Last Death", G047.realPlayerX, G047.realPlayerY, "#FF2400", !1), addBallToMinimap(!0, "player_spectate", "Spectate", G047.realPlayerX, G047.realPlayerY, "#0000FF", !1), connectToG047Server(), insertCore(), setInterval(function() {
  561. MC.G047FreeCoins()
  562. }, 5e3), setInterval(function() {
  563. drawMinimap()
  564. }, 33)
  565. },
  566. reloadCore: function() {
  567. console.log("Reloading Core."), insertCore()
  568. },
  569. onAgarioCoreLoaded: function() {
  570. 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"))
  571. }
  572. };
  573. var tempLeaderBoard = "",
  574. tempLeaderBoardIndex = 1;
  575. CanvasRenderingContext2D.prototype._fillText = CanvasRenderingContext2D.prototype.fillText, CanvasRenderingContext2D.prototype.fillText = function() {
  576. this._fillText.apply(this, arguments), "Leaderboard" === arguments[0] ? ("" != tempLeaderBoard && (G047.leaderboardData = tempLeaderBoard, $("#leaderboard").val(G047.leaderboardData)), tempLeaderBoardIndex = 1, tempLeaderBoard = "") : ":teams" != $("#gamemode").val() && 0 == arguments[0].indexOf(tempLeaderBoardIndex + ".") && tempLeaderBoardIndex < 11 ? (tempLeaderBoard += arguments[0] + (tempLeaderBoardIndex <= 9 ? ", " : ""), tempLeaderBoardIndex++) : this._fillText.apply(this, arguments)
  577. }, CanvasRenderingContext2D.prototype._drawImage = CanvasRenderingContext2D.prototype.drawImage, CanvasRenderingContext2D.prototype.drawImage = function() {
  578. arguments[0].src && "http://agar.io/img/background.png" == arguments[0].src && (arguments[0].src = ""), this._drawImage.apply(this, arguments)
  579. };
  580. var miniMap = null,
  581. minimapCtx = null;
  582. minimapBalls = {}, MinimapBall.prototype = {
  583. draw: function(a, b, c) {
  584. if (this.visible) {
  585. this.lastX = (29 * this.lastX + this.x) / 30, this.lastY = (29 * this.lastY + this.y) / 30;
  586. var d = ((this.isDefault ? this.x : this.lastX) + G047.mapOffset) * b,
  587. e = ((this.isDefault ? this.y : this.lastY) + G047.mapOffset) * c;
  588. 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, !1), a.closePath(), a.fillStyle = this.color, a.fill()
  589. }
  590. }
  591. };
  592. var b = new XMLHttpRequest;
  593. b.open("GET", "/mc/agario.js", !0), b.onload = function() {
  594. var script = b.responseText;
  595. 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, "G047.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 G047FreeCoins: function(){if($2){return;}$3;},"), script = replaceNormalFile(script, "onPlayerBanned:function(i)", "onPlayerBanned: function(i){},shitfacefuck:function(i)"), eval(script);
  596. var e = new XMLHttpRequest;
  597. e.open("GET", "/", !0), e.onload = function() {
  598. var a = e.responseText;
  599. a = replaceNormalFile(a, "UCC6hurPo_LxL7C0YFYgYnIw", "UC4DrulGqgDXz6wir8_i-WYQ"), a = replaceRegexFile(a, /<footer[\S\s]*\/footer>/i, ""), a = replaceNormalFile(a, '<script src="agario.core.js" async></script>', "<div id='botcanvas' style='background:rgba(0,0,0,0.4); width: 200px; bottom: 214px; right: 9px; display: block; position: absolute; text-align: center; font-size: 15px; color: #ffffff; padding: 5px; font-family: Ubuntu;'> <font color='#7FFF00'> FileBots</font><br>Bots: <a id='botCount'><font color='red'>30 / 30</font></a><br><font color='#00BFFF'>A</font> - Move To Mouse: <a id='ismoveToMouse'><font color='#7FFF00'>On</font></a><br><font color='#00BFFF'>P</font> - Collect Pellets: <a id='collectPellets'><font color='red'>Off</font></a><br><font color='#00BFFF'>D</font> - Stop Movement: <a id='isStopMove'><font color='red'>Off</font></a><br>Creator : <font color='Blue'>Agar File</font></div>"), a = replaceNormalFile(a, "<body>", '<body onload="G047.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>W</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" class="form-control" style="width:245px" placeholder="Separate bot names using commas" 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), document.close()
  600. }, e.send()
  601. }, b.send(), setInterval(function() {
  602. G047.realPlayerX = G047.mapOffsetX + G047.playerX, G047.realPlayerY = G047.mapOffsetY + G047.playerY, moveBallOnMinimap("player_pointer", G047.realPlayerX, G047.realPlayerY), moveBallOnMinimap("player_spectate", G047.realPlayerX, G047.realPlayerY)
  603. }, 50);
  604. var last_transmited_game_server = null,
  605. socket = null;
  606. setInterval(function() {
  607. G047.isAuthorized || emitPosition()
  608. }, 1e3), setInterval(function() {
  609. G047.isAuthorized && emitPosition(), emitLocalPosition(), transmit_current_server(!1)
  610. }, 100);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement