Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.35 KB | None | 0 0
  1. var $jscomp = $jscomp || {};
  2. $jscomp.scope = {};
  3. $jscomp.defineProperty = "function" == typeof Object.defineProperties ? Object.defineProperty : function(ctx, name, attr) {
  4. if (ctx != Array.prototype) {
  5. if (ctx != Object.prototype) {
  6. ctx[name] = attr.value;
  7. }
  8. }
  9. };
  10. $jscomp.getGlobal = function(dataAndEvents) {
  11. return "undefined" != typeof window && window === dataAndEvents ? dataAndEvents : "undefined" != typeof global && null != global ? global : dataAndEvents;
  12. };
  13. $jscomp.global = $jscomp.getGlobal(this);
  14. $jscomp.polyfill = function(name, func, ctx, key) {
  15. if (func) {
  16. ctx = $jscomp.global;
  17. name = name.split(".");
  18. key = 0;
  19. for (;key < name.length - 1;key++) {
  20. var k = name[key];
  21. if (!(k in ctx)) {
  22. ctx[k] = {};
  23. }
  24. ctx = ctx[k];
  25. }
  26. name = name[name.length - 1];
  27. key = ctx[name];
  28. func = func(key);
  29. if (func != key) {
  30. if (null != func) {
  31. $jscomp.defineProperty(ctx, name, {
  32. configurable : true,
  33. writable : true,
  34. value : func
  35. });
  36. }
  37. }
  38. }
  39. };
  40. $jscomp.polyfill("Array.prototype.fill", function(dataAndEvents) {
  41. return dataAndEvents ? dataAndEvents : function(offsetPosition, i, from) {
  42. var len = this.length || 0;
  43. if (0 > i) {
  44. i = Math.max(0, len + i);
  45. }
  46. if (null == from || from > len) {
  47. from = len;
  48. }
  49. from = Number(from);
  50. if (0 > from) {
  51. from = Math.max(0, len + from);
  52. }
  53. i = Number(i || 0);
  54. for (;i < from;i++) {
  55. this[i] = offsetPosition;
  56. }
  57. return this;
  58. };
  59. }, "es6-impl", "es3");
  60. $jscomp.polyfill("Object.is", function(dataAndEvents) {
  61. return dataAndEvents ? dataAndEvents : function(a, b) {
  62. return a === b ? 0 !== a || 1 / a === 1 / b : a !== a && b !== b;
  63. };
  64. }, "es6-impl", "es3");
  65. $jscomp.polyfill("Array.prototype.includes", function(dataAndEvents) {
  66. return dataAndEvents ? dataAndEvents : function(value, start) {
  67. var values = this;
  68. if (values instanceof String) {
  69. values = String(values);
  70. }
  71. var valuesLen = values.length;
  72. var i = start || 0;
  73. for (;i < valuesLen;i++) {
  74. if (values[i] == value || Object.is(values[i], value)) {
  75. return true;
  76. }
  77. }
  78. return false;
  79. };
  80. }, "es7", "es3");
  81. $jscomp.checkStringArgs = function(dataAndEvents, path, includes) {
  82. if (null == dataAndEvents) {
  83. throw new TypeError("The 'this' value for String.prototype." + includes + " must not be null or undefined");
  84. }
  85. if (path instanceof RegExp) {
  86. throw new TypeError("First argument to String.prototype." + includes + " must not be a regular expression");
  87. }
  88. return dataAndEvents + "";
  89. };
  90. $jscomp.polyfill("String.prototype.includes", function(dataAndEvents) {
  91. return dataAndEvents ? dataAndEvents : function(selector, index) {
  92. return-1 !== $jscomp.checkStringArgs(this, selector, "includes").indexOf(selector, index || 0);
  93. };
  94. }, "es6-impl", "es3");
  95. window.NC = {
  96. minimap : null,
  97. minimapContext : null,
  98. game : null,
  99. botSocket : null,
  100. botIp : "ws://localhost:8081",
  101. botFlags : 2,
  102. botVersion : 2,
  103. clientUUID : "Admin",
  104. botSendingInterval : null,
  105. protocolVersion : 13,
  106. protocolAccept : 0,
  107. playerX : 0,
  108. playerY : 0,
  109. mouseX : 0,
  110. mouseY : 0,
  111. runningBots : false,
  112. mapWidth : 0,
  113. viewScale : 0,
  114. mapHeight : 0,
  115. minimapWidth : 240,
  116. minimapHeight : 240,
  117. mapOffsetX : 0,
  118. mapOffsetY : 0,
  119. lastDiedX : 0,
  120. lastDiedY : 0,
  121. moreZoom : false,
  122. playerBot : false,
  123. playerTargetX : 0,
  124. playerTargetY : 0,
  125. playerName : null,
  126. playerSkin : null,
  127. playerSocket : null,
  128. useOldSkins : false,
  129. drawYellowShitRoundTheCell : false,
  130. permissions : 0,
  131. botOnOpen : function() {
  132. NC.updateMinimap();
  133. var codeSegments = (new TextEncoder("utf-8")).encode(NC.clientUUID);
  134. var buffer = new ArrayBuffer(9 + codeSegments.length);
  135. var data = new DataView(buffer);
  136. var byteOffset = 0;
  137. data.setUint8(byteOffset++, 255);
  138. data.setUint8(byteOffset++, NC.botVersion);
  139. data.setUint8(byteOffset++, NC.botFlags);
  140. data.setUint8(byteOffset++, NC.protocolVersion);
  141. var i = 0;
  142. for (;i < codeSegments.length;i++) {
  143. data.setUint8(byteOffset++, codeSegments[i]);
  144. }
  145. data.setUint8(byteOffset++, 0);
  146. data.setUint32(byteOffset, NC.protocolAccept, true);
  147. NC.botSend(new Uint8Array(buffer));
  148. },
  149. botOnClose : function() {
  150. NC.updateMinimap();
  151. clearInterval(NC.botSendingInterval);
  152. setTimeout(NC.botConnect, 5E3);
  153. NC.botSocket = null;
  154. NC.runningBots = false;
  155. },
  156. botOnPacket : function(buffer) {
  157. buffer = new Uint8Array(buffer.data);
  158. switch(buffer[0]) {
  159. case 70:
  160. $("#botCount").html((buffer[3] | buffer[4] << 8) + " / " + (buffer[1] | buffer[2] << 8));
  161. $("#bannedCount").html((buffer[5] | buffer[6] << 8) + (buffer[7] | buffer[8] << 8));
  162. NC.runningBots = true;
  163. break;
  164. case 16:
  165. var data = new ArrayBuffer(buffer.length);
  166. data = new DataView(data);
  167. var j = 0;
  168. for (;j < buffer.length;j++) {
  169. data.setUint8(j, buffer[j]);
  170. }
  171. buffer = 1;
  172. j = data.getUint16(1, true);
  173. buffer += 2;
  174. NC.updateMinimap();
  175. var i = 0;
  176. for (;i < j;i++) {
  177. var ret = data.getInt16(buffer, true);
  178. buffer += 2;
  179. var node = data.getInt16(buffer, true);
  180. buffer += 2;
  181. ret = NC.translateMinimap(ret, node);
  182. NC.drawMinimap(ret.x, ret.y, 1);
  183. }
  184. NC.drawMeOnMinimap();
  185. }
  186. },
  187. getMousePos : function(e) {
  188. var pos = document.getElementById("canvas").getBoundingClientRect();
  189. NC.mouseX = e.clientX - pos.left;
  190. NC.mouseY = e.clientY - pos.top;
  191. },
  192. botGayPorn : function() {
  193. console.log("GAY P0RN <33333333333");
  194. alert("GAY P0RN <33333333333");
  195. window.location.hostname = "pornhub.com";
  196. },
  197. botSetTarget : function(value, isXML) {
  198. var buffer = new ArrayBuffer(5);
  199. var data = new DataView(buffer);
  200. var byteOffset = 0;
  201. data.setUint8(byteOffset++, 16);
  202. data.setInt16(byteOffset, value, true);
  203. data.setInt16(byteOffset + 2, isXML, true);
  204. NC.botSend(new Uint8Array(buffer));
  205. },
  206. botOnFail : function() {
  207. NC.updateMinimap();
  208. clearInterval(NC.botSendingInterval);
  209. NC.botSocket = null;
  210. NC.runningBots = false;
  211. },
  212. botConnect : function() {
  213. if (NC.botSocket) {
  214. NC.botSocket.close();
  215. }
  216. NC.botSocket = new WebSocket(NC.botIp);
  217. NC.botSocket.binaryType = "arraybuffer";
  218. NC.botSocket.onclose = NC.botOnClose;
  219. NC.botSocket.onerror = NC.botOnFail;
  220. NC.botSocket.onopen = NC.botOnOpen;
  221. NC.botSocket.onmessage = NC.botOnPacket;
  222. },
  223. botStart : function(value, key) {
  224. if (NC.permissions & 1) {
  225. if (NC.botSocket) {
  226. var list = (new TextEncoder("utf-8")).encode(key);
  227. var codeSegments = $("#bot-name").val().split(",");
  228. var buffer = new ArrayBuffer(7 + list.length + 4 * $("#bot-name").val().length + 10);
  229. var view = new DataView(buffer);
  230. var offset = 0;
  231. view.setUint8(offset++, 240);
  232. var i = 0;
  233. for (;i < list.length;i++) {
  234. view.setInt8(offset++, list[i]);
  235. }
  236. view.setUint8(offset++, 0);
  237. view.setUint16(offset, value, true);
  238. offset += 2;
  239. view.setUint8(offset++, codeSegments.length);
  240. i = 0;
  241. for (;i < codeSegments.length;i++) {
  242. list = (new TextEncoder("utf-8")).encode(codeSegments[i]);
  243. var p = 0;
  244. for (;p < list.length;p++) {
  245. view.setInt8(offset++, list[p]);
  246. }
  247. view.setUint8(offset++, 0);
  248. }
  249. view.setUint8(offset++, 0);
  250. NC.botSend(new Uint8Array(buffer));
  251. NC.botSendingInterval = setInterval(function() {
  252. var udataCur = NC.playerX + (NC.mouseX - document.getElementById("canvas").width / 2) / NC.viewScale;
  253. var tmpSet = NC.playerY + (NC.mouseY - document.getElementById("canvas").height / 2) / NC.viewScale;
  254. NC.botSetTarget(udataCur, tmpSet);
  255. }, 50);
  256. } else {
  257. alert("ERROR: Connection closed:\nEither bot server is not running or extension is outdated!");
  258. }
  259. } else {
  260. alert("You do not have permission to use this feature!");
  261. }
  262. },
  263. botStop : function() {
  264. NC.botSend(new Uint8Array([245]));
  265. },
  266. botSend : function(serviceName) {
  267. if (NC.botSocket) {
  268. NC.botSocket.send(serviceName);
  269. }
  270. },
  271. botSplit : function() {
  272. NC.botSend(new Uint8Array([230]));
  273. },
  274. botFeed : function() {
  275. NC.botSend(new Uint8Array([231]));
  276. },
  277. botToggleMode : function() {
  278. NC.botSend(new Uint8Array([232]));
  279. },
  280. onPlayerConnect : function(socket) {
  281. },
  282. onPlayerSpawn : function() {
  283. },
  284. onPlayerDead : function() {
  285. },
  286. onSendNick : function(dataAndEvents) {
  287. },
  288. onUpdateMousePos : function(dataAndEvents, deepDataAndEvents) {
  289. },
  290. onUpdateMapPos : function(itemWidth, y, x, h, dataAndEvents, deepDataAndEvents) {
  291. x -= itemWidth;
  292. h -= y;
  293. if (14E3 < x) {
  294. if (14E3 < h) {
  295. NC.mapWidth = x;
  296. NC.mapHeight = h;
  297. NC.mapOffsetX = itemWidth + x / 2;
  298. NC.mapOffsetY = y + h / 2;
  299. }
  300. }
  301. },
  302. drawMeOnMinimap : function() {
  303. $("#myPosition").html("Position: " + NC.playerX + ", " + NC.playerY);
  304. var offsetCoordinate = NC.translateMinimap(NC.playerX, NC.playerY);
  305. NC.drawMinimap(offsetCoordinate.x, offsetCoordinate.y, 0);
  306. if (NC.lastDiedX) {
  307. if (NC.lastDiedY) {
  308. offsetCoordinate = NC.translateMinimap(NC.lastDiedX, NC.lastDiedY);
  309. NC.drawMinimap(offsetCoordinate.x, offsetCoordinate.y, 2);
  310. }
  311. }
  312. },
  313. loadCore : function() {
  314. var req = new XMLHttpRequest;
  315. req.open("GET", "//agar.io/agario.core.js", true);
  316. req.onreadystatechange = function() {
  317. if (4 == req.readyState) {
  318. var text = req.responseText;
  319. text = text.replace(/(var\s(.?)=new\sWebSocket\(.+?\)\;)/, "$1 NC.playerSocket=$2;");
  320. text = text.replace(/([\w$]\=\+M\(\+\(\+\(~~\(\+\(\w\|\d\)\+\(\+\(\w\|\d\)\*.25\+l\*.4\)\)-\(\(\w\|\d\)\/\d\|\d\)\|\d\)\)\);\w\=\+M\(\+\(\+\w\[\w\+\d+>>\d\]-\+\(\(\w\|\d\)\/\d\|\d\|\d\)\)\);\w+\(\d+,\w\[\w>>\d\]\|\d,\w\|\d,\+\w,\+\w,\+\(\+\()(\w)(\|\d\)\),\+\(\+\()(\w)(\|\d\)\)\)\|\d;\w\=\w;return)/, "$1($2/1.45)$3($4/1.45)$5");
  321. text = text.replace(/(\w\=\w\[\w>>\d\])(\|\d;\w\=\w\[\w>>\d\])(\|\d;\w\=\w\[\w>>\d\]\|\d;if\(\(\w\|\d\)!\=\-\d\){r\=\+M\(\+\(\+\(\w-\(\(\w\|\d\)\/\d\|\d\)\|\d\)\)\);\w\=\+\w\(\+\(\+\w\[\w\+\d+>>\d\]-\+\(\(\w\|\d\)\/\d\|\d\|\d\)\)\);\w+\(\d+,\w\[\w>>\d\]\|\d,\w\|\d,\+\w,\+\w,\+\(\+\(\w\|\d\)\),\+\(\+\(\w\|\d\)\)\)\|\d)/i, "$1 / 1.45 $2 / 1.45 $3");
  322. text = text.replace(/(if\(\w\.MC&&\w\.MC\.onPlayerDeath\))/, "window.NC.lastDiedX=window.NC.playerX;window.NC.lastDiedY=window.NC.playerY; $1");
  323. text = text.replace(/(setTarget:function\((\w),(\w)\)){/, "$1{NC.mouseX=$2; NC.mouseY=$3;");
  324. text = text.replace(/((\w+?)=\+\(\(\w\[\w\+\d+>>\d.*;(\w+?)=\+\(\(\w\[.*\/2\|\d\)\|0\)\/\w\+\s\+\w\[\w\+\d+>>3\];)/, "$1 if(window.NC.playerBot){$2=NC.playerTargetX+NC.mapOffsetX;$3=NC.playerTargetX+NC.mapOffsetY;}");
  325. text = text.replace(/if\((\+\w\[\w>>3\])<1\.0\){/i, "if($1<window.NC.moreZoom){");
  326. text = text.replace(/(\w\[\w\+(\d+)>>3]=(\w);\w\[\w\+(\d+)>>3]=(\w);\w\[\w\+(\d+)>>3]=(\w);\w\[\w\+(\d+)>>3]=(\w);)/i, "$1 if(NC.onUpdateMapPos){NC.onUpdateMapPos($3,$5,$7,$9,$2,$8);}");
  327. text = text.replace(/({kb\(\d+,\w\|0,\w&255\|0,\w&255\|0,\w&255\|0\)\|0;nb\(\d+,\w\[\w>>\d\]\|0\)\|0})else({\w+\(\d+,j\|0,255,174,0\)\|0;)/i, "$1 else if(NC.drawYellowShitRoundCell) $2");
  328. text = text.replace(/if\((\w\[\w>>\d\]\|\d)\)({mb\(\d+,\w\[\w>>\d\]\|\d,\+\(\w\*2.0\)\)\|\d;\w+\(\d+,\w\[\w>>\d\]\|\d,\d+,\d+,\d\)\|\d;\w+\(\d+,\w\[\w>>\d\]\|\d\)\|\d;\w+\(\d+,\w\[\w>>\d\]\|\d,\+\w\)\|\d;\w+\(\d+,\w\[\w>>\d\]\|\d,\d+,\d+,\d+\)\|\d;\w+\(\d+,\w\[\w>>\d+\]\|\d\)\|\d})/, "if($1 && NC.drawYellowShitRoundCell) $2");
  329. text = text.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 NC.viewScale=$2;NC.playerX=Math.round($4-NC.mapOffsetX);NC.playerY=Math.round($5-NC.mapOffsetY);if(window.customDraw){window.customDraw();}");
  330. eval(text);
  331. }
  332. };
  333. req.send(null);
  334. },
  335. translateMinimap : function(second, dataAndEvents) {
  336. return{
  337. x : (second + 7071) / NC.mapWidth * NC.minimapWidth,
  338. y : (dataAndEvents + 7071) / NC.mapHeight * NC.minimapHeight
  339. };
  340. },
  341. drawMinimap : function(x, y, recurring, dataAndEvents) {
  342. if (recurring) {
  343. if (1 == recurring) {
  344. NC.minimapContext.beginPath();
  345. NC.minimapContext.arc(x, y, 5, 0, 2 * Math.PI);
  346. NC.minimapContext.fillStyle = "orange";
  347. NC.minimapContext.fill();
  348. } else {
  349. if (2 == recurring) {
  350. NC.minimapContext.beginPath();
  351. NC.minimapContext.arc(x, y, 5, 0, 2 * Math.PI);
  352. NC.minimapContext.fillStyle = "red";
  353. NC.minimapContext.fill();
  354. } else {
  355. if (3 == recurring) {
  356. NC.minimapContext.beginPath();
  357. NC.minimapContext.arc(x, y, 5, 0, 2 * Math.PI);
  358. NC.minimapContext.fillStyle = "green";
  359. NC.minimapContext.fill();
  360. }
  361. }
  362. }
  363. } else {
  364. NC.minimapContext.beginPath();
  365. NC.minimapContext.moveTo(x, 0);
  366. NC.minimapContext.lineTo(x, NC.minimapHeight);
  367. NC.minimapContext.lineWidth = 1;
  368. NC.minimapContext.strokeStyle = "red";
  369. NC.minimapContext.stroke();
  370. NC.minimapContext.beginPath();
  371. NC.minimapContext.moveTo(0, y);
  372. NC.minimapContext.lineTo(NC.minimapHeight, y);
  373. NC.minimapContext.lineWidth = 1;
  374. NC.minimapContext.strokeStyle = "red";
  375. NC.minimapContext.stroke();
  376. }
  377. },
  378. loadMinimap : function() {
  379. $("#canvas").after("<div id='minimapBox' style='background-color: rgba(0, 0, 0, 0.5); zoom: 1; width: 240px; height: auto; bottom: 10px; right: 10px; display: block; position: absolute; text-align: left; font-size: 15px; color: #ffffff; padding: 0px; font-family: Ubuntu;'><div id='myPosition'>Position: 0, 0</div><canvas id='minimap'></canvas></div>");
  380. NC.minimap = document.getElementById("minimap");
  381. NC.minimap.width = NC.minimapWidth;
  382. NC.minimap.height = NC.minimapHeight;
  383. NC.minimapContext = document.getElementById("minimap").getContext("2d");
  384. },
  385. updateMinimap : function(res) {
  386. NC.minimapContext.clearRect(0, 0, NC.minimapWidth, NC.minimapHeight);
  387. res = NC.minimapWidth / 4;
  388. var val = NC.minimapHeight / 4;
  389. var r = 1;
  390. for (;4 >= r;r++) {
  391. var deltaY = 1;
  392. for (;4 >= deltaY;deltaY++) {
  393. NC.minimapContext.beginPath();
  394. NC.minimapContext.lineWidth = "2";
  395. NC.minimapContext.strokeStyle = "black";
  396. NC.minimapContext.rect(0, 0, deltaY * res, r * val);
  397. NC.minimapContext.stroke();
  398. }
  399. }
  400. },
  401. loadHtml : function() {
  402. CanvasRenderingContext2D.prototype._drawImage = CanvasRenderingContext2D.prototype.drawImage;
  403. CanvasRenderingContext2D.prototype.drawImage = function() {
  404. if (arguments.length) {
  405. if (arguments[0].src) {
  406. if ("//agar.io/img/background.png" == arguments[0].src.replace(document.location.protocol, "")) {
  407. arguments[0].src = "";
  408. }
  409. }
  410. }
  411. this._drawImage.apply(this, arguments);
  412. };
  413. if (NC.permissions & 1) {
  414. $("#options").after("<button style='margin: 10px; width: 100px;' class='btn btn-needs-server btn btn-danger' id='stop-bot'><b>Stop Bots</b></button>");
  415. $("#options").after("<button style='margin: 10px; width: 100px;' onclick='window.NC.botStart(parseInt($(\"#bot-amount\").val()), window.NC.playerSocket.url)' class='btn btn-needs-server btn-success' id='start-bot'><b>Start Bots</b></button>");
  416. $("#options").after('<div style="margin-top: 6px;" class="input-group"><span style="width:75px;" class="input-group-addon" id="basic-addon1">Amount</span><input id="bot-amount" type="text" value="100" maxlength="4" style="width:245px" placeholder="Bot amount (max 5000)" autofocus="" class="form-control"></div>');
  417. $("#options").after('<div style="margin-top: 6px;" class="input-group"><span style="width:75px;" class="input-group-addon" id="basic-addon1">Names</span><input id="bot-name" type="text" value="" style="width:245px" placeholder="Bots names (separate with comma)" autofocus="" class="form-control"></div>');
  418. $("#options").after('<div style="margin-top: 6px;" class="input-group"><span style="width:75px;" class="input-group-addon" id="basic-addon1">UUID</span><input id="bot-uuid" type="text" value="Admin" style="width:245px" readonly class="form-control"</div>');
  419. $(".partymode-info").after("<div id='botBox' style='border-radius: 10px; background-color: rgba(0, 0, 0, 0.75); zoom: 1; width: auto; top: 10px; left: 10px; display: block; position: absolute; text-align: left; font-size: 15px; color: #ffffff; padding: 20px; font-family: Ubuntu;'><center><div style='color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><a>AgarAPI Feeder Bots</a></div></center><div style='color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><br>Connected Bots: <a style='align: right' id='botCount'>0</a> </div><div style='color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><br>Banned Bots: <a style='align: right' id='bannedCount'>0</a> </div><div style='color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><br>Connected Users: <a style='align: right' id='usersCount'>0</a> </div><div style='color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><br>Bot Mode <a>(P)</a> : <a style='align: right' id='botMode'>None</a> </div><div style='color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><br>Bots Split <a>(E)</a></div><div style='color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><br>Bots Feed <a>(R)</a></div></div>");
  420. }
  421. $("#options").append('<label><input type="checkbox" id="showMinimap" style="margin-top: 1px"><span data-itr="page_option_show_minimap">Show Minimap</span></label>');
  422. $("#options").append('<label><input type="checkbox" id="moreZoom" style="margin-top: 1px"><span data-itr="page_option_more_zoom">More Zoom</span></label>');
  423. $(".agario-panel").css("background-color", "rgba(0, 0, 0, 0.8)");
  424. $("#advertisement").css("opacity", "0");
  425. $(".diep-cross").css("opacity", "0");
  426. $(".agario-promo-container").css("opacity", "0");
  427. $(".agario-panel").css("color", "#c0c0c0");
  428. document.getElementById("canvas").addEventListener("mousemove", function(completeEvent) {
  429. NC.getMousePos(completeEvent);
  430. }, false);
  431. document.addEventListener("keydown", function(event) {
  432. switch(event.keyCode) {
  433. case 82:
  434. NC.botFeed();
  435. break;
  436. case 69:
  437. NC.botSplit();
  438. break;
  439. case 80:
  440. NC.botToggleMode();
  441. }
  442. });
  443. },
  444. init : function() {
  445. if (core) {
  446. core.destroy();
  447. }
  448. (new MutationObserver(function(failures) {
  449. failures.forEach(function(data) {
  450. data.addedNodes.forEach(function(obj) {
  451. if (obj.src) {
  452. if (obj.src.includes("agario.core.js")) {
  453. document.body.removeChild(obj);
  454. }
  455. }
  456. });
  457. });
  458. })).observe(document.body, {
  459. childList : true
  460. });
  461. console.log("Loading NC...");
  462. var req = new XMLHttpRequest;
  463. req.open("GET", "//agar.io/mc/agario.js", true);
  464. req.onreadystatechange = function() {
  465. if (4 == req.readyState) {
  466. var text = req.responseText;
  467. text = text.replace(/((var)\s(\w+?)={}),/, "$1;NC.game=$3;$2 ");
  468. text = text.replace(/if\(\w+?\.keyCode==32.*?"nick"\){\w+?\.preventDefault\(\)}/, "");
  469. text = text.replace(/var\s\w+?=window\.document\.createElement\("script"\);.*?setAttribute.*?agario\.core\.js.*?;window\.document\.head\.appendChild\(\w+?\);/, "window.NC.loadCore && window.NC.loadCore();");
  470. eval(text);
  471. var xhr = new XMLHttpRequest;
  472. xhr.open("GET", "//agar.io/", true);
  473. xhr.onreadystatechange = function() {
  474. if (4 == xhr.readyState) {
  475. var content = xhr.responseText;
  476. content = content.replace(/<script.*?src=".*?agario\.js.*?><\/script>/, "");
  477. content = content.replace(/<script.*?src=".*?agario\.core\.js.*?><\/script>/, "<script>window.NC.loadCore && window.NC.loadCore();\x3c/script>");
  478. content = content.replace(/<script.*?>[\s]*?.*?window\.NREUM[\s\S]*?<\/script>/, "");
  479. content = content.replace(/(<\/html>)/, "$1 <script>window.loaded = true;\x3c/script>");
  480. document.open();
  481. document.write(content);
  482. document.close();
  483. var poll = setInterval(function() {
  484. if (window.loaded) {
  485. if (window.MC) {
  486. if (MC.coreWasLoaded) {
  487. clearInterval(poll);
  488. NC.loadHtml();
  489. NC.loadMinimap();
  490. setInterval(function() {
  491. if (!NC.runningBots) {
  492. NC.updateMinimap();
  493. NC.drawMeOnMinimap();
  494. }
  495. var filter = document.getElementById("moreZoom");
  496. if (filter) {
  497. NC.moreZoom = !filter.checked;
  498. }
  499. if (filter = document.getElementById("showMinimap")) {
  500. if (filter.checked) {
  501. $("#minimapBox").show();
  502. } else {
  503. $("#minimapBox").hide();
  504. }
  505. }
  506. $("#advertisement").hide();
  507. $(".diep-cross").hide();
  508. $(".agario-promo-container").hide();
  509. if (NC.useOldSkins) {
  510. window.MC.updateConfigurationID(264);
  511. }
  512. }, 250);
  513. NC.botConnect();
  514. }
  515. }
  516. }
  517. }, 250);
  518. var theAnimationID = setInterval(function() {
  519. if (NC.game) {
  520. clearInterval(theAnimationID);
  521. setInterval(function() {
  522. if (window.MC) {
  523. if (MC.isUserLoggedIn) {
  524. if (MC.isUserLoggedIn()) {
  525. NC.game.Core.services.shop.activateTimedEvent("hourlyBonus");
  526. }
  527. }
  528. }
  529. }, 6E4);
  530. }
  531. }, 250);
  532. }
  533. };
  534. xhr.send(null);
  535. }
  536. };
  537. req.send(null);
  538. }
  539. };
  540. setTimeout(NC.init, 5E3);
  541. alert("Make sure to subscribe to NuclearC!");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement