Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 40.41 KB | None | 0 0
  1. window.MC = {};
  2.  
  3. function escapeHtml(a) {
  4. return String(a).replace(/[&<>"'\/]/g, function(a) {
  5. return entityMap[a];
  6. });
  7. }
  8.  
  9.  
  10. function updateBotCount(a, b) {
  11. ProAgarBots.localBotsAlive[a] = b;
  12. var c = ProAgarBots.serverBots;
  13. var d = 2 + ProAgarBots.serverBots;
  14. var e = 0;
  15. for (;e < 2;e++) {
  16. if (ProAgarBots.localBotsAlive[e]) {
  17. c++;
  18. }
  19. }
  20. if (0 == c) {
  21. $("#botCount").html('<font color="red">0 / ' + d + "</font>");
  22. } else {
  23. $("#botCount").html('<font color="#7FFF00">' + c + " / " + d + "</font>");
  24. }
  25. }
  26. function startLocalBots() {
  27. var a$$0 = 0;
  28. for (;a$$0 < ProAgarBots.startBotAmount;a$$0++) {
  29. ProAgarBots.localBotsAlive[a$$0] = false;
  30. ProAgarBots.localBots[a$$0] = new Worker(URL.createObjectURL(new Blob(["(" + generateBotFunction() + ")()"], {
  31. type : "text/javascript"
  32. })));
  33. ProAgarBots.localBots[a$$0].onmessage = function(a) {
  34. var b = a.data;
  35. switch(b.name) {
  36. case "add":
  37. updateBotCount(b.botID, true);
  38. addBallToMinimap(true, "bot" + b.botID, b.botName, b.x, b.y, "#FF00FF", true);
  39. break;
  40. case "remove":
  41. updateBotCount(b.botID, false);
  42. removeBallFromMinimap("bot" + b.botID);
  43. break;
  44. case "position":
  45. moveBallOnMinimap("bot" + b.botID, b.x, b.y);
  46. break;
  47. default:
  48. console.log("Unknown command received from bot");
  49. }
  50. };
  51. ProAgarBots.localBots[a$$0].postMessage({
  52. name : "botID",
  53. botID : a$$0
  54. });
  55. }
  56. updateBotNames();
  57. }
  58.  
  59. function sendLocalBotsMessage(a) {
  60. for (i in ProAgarBots.localBots) {
  61. ProAgarBots.localBots[i].postMessage(a);
  62. }
  63. }
  64. function sendRemoteBotsMessage(a) {
  65. for (i in ProAgarBots.remoteBots) {
  66. ProAgarBots.remoteBots[i].postMessage(a);
  67. }
  68. }
  69. function insertCore() {
  70. var f = new XMLHttpRequest;
  71. f.open("GET", "/agario.core.js", true);
  72. f.onload = function() {
  73. var script = f.responseText;
  74. script = replaceNormalFile(script, "if(h.MC&&h.MC.onPlayerSpawn)", "ProAgarBots.playerSpawned();if(h.MC&&h.MC.onPlayerSpawn)");
  75. script = replaceNormalFile(script, "if(h.MC&&h.MC.onPlayerDeath)", "ProAgarBots.playerDied();if(h.MC&&h.MC.onPlayerDeath)");
  76. script = replaceNormalFile(script, "if(h.MC&&h.MC.onAgarioCoreLoaded)", "ProAgarBots.onAgarioCoreLoaded();if(h.MC&&h.MC.onAgarioCoreLoaded)");
  77. script = replaceNormalFile(script, "if(h.MC&&h.MC.onDisconnect)", "ProAgarBots.playerDisconnected();if(h.MC&&h.MC.onDisconnect)");
  78. script = replaceNormalFile(script, "connect:function(a){", "connect:function(a){ProAgarBots.playerConnected(a);");
  79. script = replaceNormalFile(script, "sendSpectate:function(){", "sendSpectate:function(){ProAgarBots.playerSpectated();");
  80. script = replaceNormalFile(script, "sendNick:function(a){", "sendNick:function(a){ProAgarBots.updateNickname(a);");
  81. script = replaceNormalFile(script, "setTarget:function(a,b){", "setTarget:function(a,b){if(ProAgarBots.stopMovement){a = $('#canvas').width() / 2; b = $('#canvas').height() / 2;}");
  82. 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(ProAgarBots.setMapCoords){ProAgarBots.setMapCoords($3,$5,$7,$9,$2,$8);}");
  83. 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 ProAgarBots.playerX=$4; ProAgarBots.playerY=$5;");
  84. script = replaceRegexFile(script, /if\((\+\w\[\w>>3\])<1\.0\){/i, "if($1 < ProAgarBots.zoomResetValue){");
  85. 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");
  86. script = replaceRegexFile(script, /(\w)(=\+\w\[\w>>3\]\*\+\w\()(.\d)(,\+\w\);)/i, "$1$2 (ProAgarBots.zoomSpeedValue||0.9) $4 ProAgarBots.zoomValue=$1;");
  87. script = replaceRegexFile(script, /(\w=\w\[\w>>2\]\|0;)((\w\[\w>>3\])=(\w);)(\w\[\w>>0\]=a\[\w>>0\];)/i, "$1 if(!ProAgarBots.autoZoom){$3 = ProAgarBots.zoomValue;}else{$2}$5");
  88. script = replaceRegexFile(script, /((\w)=(\+\(\(\w\[\w\+\d+>>\d.*;)(\w)=(\+\(\(\w\[.*\/2\|\d\)\|0\)\/\w\+\s\+\w\[\w\+\d+>>3\];).*\4=\4<\w\?\w:\w;)/, "ProAgarBots.mouseX = $3 ProAgarBots.mouseY = $5 $1");
  89. eval(script);
  90. };
  91. f.send();
  92. }
  93. function MinimapBall(a, b, c, d, e, f) {
  94. this.isDefault = a;
  95. this.name = b;
  96. this.x = c;
  97. this.y = d;
  98. this.lastX = c;
  99. this.lastY = d;
  100. this.color = e;
  101. this.visible = f;
  102. }
  103. function drawMinimap() {
  104. 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)), ProAgarBots.mapOffsetFixed && ProAgarBots.drawMinimap) {
  105. minimapCtx.globalAlpha = 0.4;
  106. minimapCtx.fillStyle = "#000000";
  107. minimapCtx.fillRect(0, 0, miniMap.width, miniMap.height);
  108. var a = 200 / ProAgarBots.mapSize;
  109. var b = 200 / ProAgarBots.mapSize;
  110. minimapCtx.globalAlpha = 1;
  111. for (ball in minimapBalls) {
  112. minimapBalls[ball].draw(minimapCtx, a, b);
  113. }
  114. }
  115. }
  116. function resetMinimap() {
  117. for (ball in minimapBalls) {
  118. if (!minimapBalls[ball].isDefault) {
  119. delete minimapBalls[ball];
  120. }
  121. }
  122. }
  123. function addBallToMinimap(a, b, c, d, e, f, g) {
  124. minimapBalls[b] = new MinimapBall(a, c, d, e, f, g);
  125. }
  126. function removeBallFromMinimap(a) {
  127. if (minimapBalls[a]) {
  128. delete minimapBalls[a];
  129. }
  130. }
  131. function moveBallOnMinimap(a, b, c) {
  132. if (minimapBalls[a]) {
  133. minimapBalls[a].x = b;
  134. minimapBalls[a].y = c;
  135. }
  136. }
  137. function setBallVisible(a, b) {
  138. if (minimapBalls[a]) {
  139. minimapBalls[a].visible = b;
  140. }
  141. }
  142. function changeNicknameOnBall(a, b) {
  143. if (minimapBalls[a]) {
  144. minimapBalls[a].name = b;
  145. }
  146. }
  147. function replaceRegexFile(a, b, c) {
  148. var d = new RegExp(b);
  149. return d.test(a) ? a = a.replace(b, c) : console.log("[Failed] to replace: " + b), a;
  150. }
  151. function replaceNormalFile(a, b, c) {
  152. return a.indexOf(b) != -1 ? a = a.replace(b, c) : console.log("[Failed] to replace: " + b), a;
  153. }
  154. function sendCommand(a) {
  155. if (null != socket) {
  156. if (socket.connected) {
  157. socket.emit("command", a);
  158. }
  159. }
  160. }
  161.  
  162. function updateBotNames() {
  163. sendLocalBotsMessage({
  164. name : "names",
  165. botNames : ProAgarBots.botNames
  166. });
  167. if (ProAgarBots.isAuthorized) {
  168. sendCommand({
  169. name : "names",
  170. botNames : ProAgarBots.botNames
  171. });
  172. }
  173. }
  174. function validateNames(a) {
  175. if (void 0 === a) {
  176. return null;
  177. }
  178. if (a.indexOf(",") > -1) {
  179. var b = a.split(",");
  180. for (name in b) {
  181. if (b[name].length <= 0 || b[name].length > 15) {
  182. return null;
  183. }
  184. }
  185. return b;
  186. }
  187. return a.length > 0 && a.length <= 15 ? [a] : null;
  188. }
  189. function emitSplit() {
  190. if (ProAgarBots.isAuthorized) {
  191. sendCommand({
  192. name : "split"
  193. });
  194. }
  195. sendLocalBotsMessage({
  196. name : "split"
  197. });
  198. }
  199. function emitMassEject() {
  200. if (ProAgarBots.isAuthorized) {
  201. sendCommand({
  202. name : "eject"
  203. });
  204. }
  205. sendLocalBotsMessage({
  206. name : "eject"
  207. });
  208. }
  209. function emitLocalPosition() {
  210. var a = ProAgarBots.mouseX;
  211. var b = ProAgarBots.mouseY;
  212. if (!ProAgarBots.moveToMouse) {
  213. a = ProAgarBots.playerX;
  214. b = ProAgarBots.playerY;
  215. }
  216. sendLocalBotsMessage({
  217. name : "position",
  218. x : a + ProAgarBots.mapOffsetX,
  219. y : b + ProAgarBots.mapOffsetY
  220. });
  221. }
  222. function emitPosition() {
  223. var a = ProAgarBots.mouseX;
  224. var b = ProAgarBots.mouseY;
  225. if (!ProAgarBots.moveToMouse) {
  226. a = ProAgarBots.playerX;
  227. b = ProAgarBots.playerY;
  228. }
  229. sendCommand({
  230. name : "position",
  231. x : ProAgarBots.realPlayerX,
  232. y : ProAgarBots.realPlayerY,
  233. botX : a + ProAgarBots.mapOffsetX,
  234. botY : b + ProAgarBots.mapOffsetY
  235. });
  236. }
  237. function transmit_current_server(a) {
  238. if (a || last_transmited_game_server != ProAgarBots.server) {
  239. last_transmited_game_server = ProAgarBots.server;
  240. sendCommand({
  241. name : "servers",
  242. server : last_transmited_game_server
  243. });
  244. }
  245. }
  246. function generateBotFunction() {
  247. return function() {
  248. function replaceRegexFile(a, b, c) {
  249. var d = new RegExp(b);
  250. return d.test(a) ? a = a.replace(b, c) : console.log("[Failed] to replace: " + b), a;
  251. }
  252. function replaceNormalFile(a, b, c) {
  253. return a.indexOf(b) != -1 ? a = a.replace(b, c) : console.log("[Failed] to replace: " + b), a;
  254. }
  255. function getRandomInt(a, b) {
  256. return Math.floor(Math.random() * (b - a + 1)) + a;
  257. }
  258. function getBotCore() {
  259. var e = new XMLHttpRequest;
  260. e.open("GET", "http://agar.io/agario.core.js", true);
  261. e.onload = function() {
  262. var script = e.responseText;
  263. script = replaceRegexFile(script, /\w+\.location\.hostname/g, '"agar.io"');
  264. script = replaceNormalFile(script, "window", "self");
  265. script = replaceNormalFile(script, "c.setStatus=function(a){console.log(a)};", "c.setStatus=function(a){};");
  266. script = replaceNormalFile(script, 'console.log("postRun");', "");
  267. script = replaceRegexFile(script, /(\w)=\+\(\(\w\[\w\+\d+>>\d.*;(\w)=\+\(\(\w\[.*\/2\|\d\)\|0\)\/\w\+\s\+\w\[\w\+\d+>>3\];/, "$1 = ProAgarBots.newX; $2 = ProAgarBots.newY;");
  268. script = replaceNormalFile(script, "if(h.MC&&h.MC.onPlayerSpawn)", "ProAgarBots.playerSpawned();if(h.MC&&h.MC.onPlayerSpawn)");
  269. script = replaceNormalFile(script, "if(h.MC&&h.MC.onPlayerDeath)", "ProAgarBots.playerDied();if(h.MC&&h.MC.onPlayerDeath)");
  270. script = replaceNormalFile(script, "if(h.MC&&h.MC.onAgarioCoreLoaded)", "ProAgarBots.onAgarioCoreLoaded();if(h.MC&&h.MC.onAgarioCoreLoaded)");
  271. script = replaceNormalFile(script, "if(h.MC&&h.MC.onDisconnect)", "ProAgarBots.playerDisconnected();if(h.MC&&h.MC.onDisconnect)");
  272. script = replaceNormalFile(script, "h.MC&&h.MC.corePendingReload", "ProAgarBots.reloadCore();h.MC&&h.MC.corePendingReload");
  273. 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(ProAgarBots.setMapCoords){ProAgarBots.setMapCoords($3,$5,$7,$9,$2,$8);}");
  274. 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 ProAgarBots.playerX=$4; ProAgarBots.playerY=$5; ProAgarBots.setPath();");
  275. 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){ProAgarBots.recordPellet($5,$6,cellSize);}$4");
  276. eval(script);
  277. };
  278. e.send(null);
  279. }
  280. self.innerWidth = 1;
  281. self.innerHeight = 1;
  282. const window = {};
  283. elementMock = {
  284. getContext : function() {
  285. return{
  286. canvas : {
  287. width : 1,
  288. height : 1
  289. },
  290. clearRect : function() {
  291. },
  292. save : function() {
  293. },
  294. translate : function() {
  295. },
  296. scale : function() {
  297. },
  298. stroke : function() {
  299. },
  300. arc : function() {
  301. },
  302. fill : function() {
  303. },
  304. moveTo : function() {
  305. },
  306. lineTo : function() {
  307. },
  308. closePath : function() {
  309. },
  310. beginPath : function() {
  311. },
  312. restore : function() {
  313. },
  314. fillRect : function() {
  315. },
  316. measureText : function() {
  317. return{};
  318. },
  319. strokeText : function() {
  320. },
  321. fillText : function() {
  322. },
  323. drawImage : function() {
  324. }
  325. };
  326. },
  327. innerText : "",
  328. div : {
  329. appendChild : function() {
  330. }
  331. },
  332. appendChild : function() {
  333. },
  334. style : {}
  335. };
  336. document = {
  337. getElementById : function() {
  338. return elementMock;
  339. },
  340. createElement : function(a) {
  341. return elementMock;
  342. },
  343. body : {
  344. firstChild : {},
  345. insertBefore : function() {
  346. }
  347. }
  348. };
  349. Image = function() {
  350. };
  351. self.ProAgarBots = {
  352. server : null,
  353. botID : 0,
  354. botName : "ProAgarBots",
  355. playerX : 0,
  356. playerY : 0,
  357. newX : 0,
  358. newY : 0,
  359. realPlayerX : null,
  360. realPlayerY : null,
  361. mapOffset : 7071,
  362. mapOffsetX : 0,
  363. mapOffsetY : 0,
  364. mapOffsetFixed : false,
  365. collectPellets : false,
  366. pelletTargetX : 99999,
  367. pelletTargetY : 99999,
  368. pellets : [],
  369. recordPellet : function(a, b, c) {
  370. this.pellets.push({
  371. x : a,
  372. y : b,
  373. size : c
  374. });
  375. },
  376. setMapCoords : function(a, b, c, d, e, f) {
  377. if (f - e == 24) {
  378. if (c - a > 14E3) {
  379. if (d - b > 14E3) {
  380. this.mapOffsetX = this.mapOffset - c;
  381. this.mapOffsetY = this.mapOffset - d;
  382. this.mapOffsetFixed = true;
  383. }
  384. }
  385. }
  386. },
  387. playerDied : function() {
  388. postMessage({
  389. name : "remove",
  390. botID : ProAgarBots.botID
  391. });
  392. },
  393. playerSpawned : function() {
  394. postMessage({
  395. name : "add",
  396. botID : ProAgarBots.botID,
  397. botName : ProAgarBots.botName,
  398. x : ProAgarBots.realPlayerX,
  399. y : ProAgarBots.realPlayerY
  400. });
  401. },
  402. playerDisconnected : function() {
  403. postMessage({
  404. name : "remove",
  405. botID : ProAgarBots.botID
  406. });
  407. if (self.core) {
  408. if (null != ProAgarBots.server) {
  409. core.connect(ProAgarBots.server);
  410. }
  411. }
  412. },
  413. reloadCore : function() {
  414. if (self.core) {
  415. self.core.destroy();
  416. }
  417. getBotCore();
  418. },
  419. onAgarioCoreLoaded : function() {
  420. if (self.core) {
  421. if (null != ProAgarBots.server) {
  422. core.connect(ProAgarBots.server);
  423. }
  424. }
  425. },
  426. setPath : function() {
  427. var a = -1;
  428. var b = 0;
  429. var c = 0;
  430. for (;c < this.pellets.length;c++) {
  431. var d = this.getDistanceBetweenPositions(this.pellets[c].x, this.pellets[c].y, this.playerX, this.playerY);
  432. if (!(a != -1 && d > b)) {
  433. a = c;
  434. b = d;
  435. }
  436. }
  437. if (a == -1) {
  438. this.pelletTargetX = 99999;
  439. this.pelletTargetY = 99999;
  440. } else {
  441. this.pelletTargetX = this.pellets[a].x;
  442. this.pelletTargetY = this.pellets[a].y;
  443. }
  444. this.pellets = [];
  445. },
  446. getDistanceBetweenPositions : function(a, b, c, d) {
  447. return Math.sqrt(Math.pow(c - a, 2) + Math.pow(b - d, 2));
  448. }
  449. };
  450. onmessage = function(a) {
  451. var b = a.data;
  452. switch(b.name) {
  453. case "botID":
  454. ProAgarBots.botID = b.botID;
  455. break;
  456. case "server":
  457. ProAgarBots.server = b.server;
  458. if (self.core) {
  459. if (null != b.server) {
  460. core.connect(b.server);
  461. }
  462. }
  463. break;
  464. case "position":
  465. if (ProAgarBots.collectPellets && (99999 != ProAgarBots.pelletTargetX && 99999 != ProAgarBots.pelletTargetY)) {
  466. ProAgarBots.newX = ProAgarBots.pelletTargetX;
  467. ProAgarBots.newY = ProAgarBots.pelletTargetY;
  468. } else {
  469. ProAgarBots.newX = b.x - ProAgarBots.mapOffsetX;
  470. ProAgarBots.newY = b.y - ProAgarBots.mapOffsetY;
  471. }
  472. break;
  473. case "split":
  474. if (self.core) {
  475. core.split();
  476. }
  477. break;
  478. case "eject":
  479. if (self.core) {
  480. core.eject();
  481. }
  482. break;
  483. case "names":
  484. if (null == b.botNames) {
  485. ProAgarBots.botName = "ProAgarBots";
  486. break;
  487. }
  488. ProAgarBots.botName = b.botNames[getRandomInt(0, b.botNames.length - 1)];
  489. break;
  490. case "disconnect":
  491. ProAgarBots.server = null;
  492. if (self.core) {
  493. core.disconnect();
  494. }
  495. break;
  496. case "collectPellets":
  497. ProAgarBots.collectPellets = b.collectPellets;
  498. break;
  499. default:
  500. console.log("Unknown message received.");
  501. }
  502. };
  503. setInterval(function() {
  504. ProAgarBots.realPlayerX = ProAgarBots.mapOffsetX + ProAgarBots.playerX;
  505. ProAgarBots.realPlayerY = ProAgarBots.mapOffsetY + ProAgarBots.playerY;
  506. postMessage({
  507. botID : ProAgarBots.botID,
  508. name : "position",
  509. x : ProAgarBots.realPlayerX,
  510. y : ProAgarBots.realPlayerY
  511. });
  512. if (self.core) {
  513. core.sendNick(ProAgarBots.botName);
  514. }
  515. }, 100);
  516. getBotCore();
  517. }.toString();
  518. }
  519. window.history.replaceState("", "", "/" + location.hash), window.getTextWidth = function(a, b) {
  520. var c = getTextWidth.canvas || (getTextWidth.canvas = document.createElement("canvas"));
  521. var d = c.getContext("2d");
  522. d.font = b;
  523. var e = d.measureText(a);
  524. return e.width;
  525. };
  526. var entityMap = {
  527. "&" : "&amp;",
  528. "<" : "&lt;",
  529. ">" : "&gt;",
  530. '"' : "&quot;",
  531. "'" : "&#39;",
  532. "/" : "&#x2F;"
  533. };
  534. var client_uuid = escapeHtml(localStorage.getItem("ProAgarBots_uuid"));
  535. if (null === client_uuid || 15 != client_uuid.length) {
  536. client_uuid = "ProAgarBots";
  537. var ranStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  538. var ii = 0;
  539. for (;ii < 15;ii++) {
  540. client_uuid += ranStr.charAt(Math.floor(Math.random() * ranStr.length))
  541. }
  542. localStorage.setItem("ProAgarBots_uuid", client_uuid);
  543. }
  544. window.ProAgarBots = {
  545. server : null,
  546. playerName : "",
  547. startBotAmount: 2,
  548. playerX : 0,
  549. playerY : 0,
  550. mouseX : 0,
  551. mouseY : 0,
  552. realPlayerX : null,
  553. realPlayerY : null,
  554. mapSize : 14142,
  555. mapOffset : 7071,
  556. mapOffsetX : 0,
  557. mapOffsetY : 0,
  558. mapOffsetFixed : false,
  559. zoomValue : 0,
  560. zoomResetValue : 0,
  561. zoomSpeedValue : 0.9,
  562. autoZoom : true,
  563. stopMovement : false,
  564. isAlive : false,
  565. moveToMouse : true,
  566. localBots : {},
  567. localBotsAlive : {},
  568. remoteBotsServer : null,
  569. remoteBots : {},
  570. remoteBotsAlive : {},
  571. leaderboardData : "",
  572. serverBots : 0,
  573. isAuthorized : !1,
  574. drawMinimap : true,
  575. setMapCoords : function(a, b, c, d, e, f) {
  576. if (f - e == 24) {
  577. if (c - a > 14E3) {
  578. if (d - b > 14E3) {
  579. this.mapOffsetX = this.mapOffset - c;
  580. this.mapOffsetY = this.mapOffset - d;
  581. this.mapOffsetFixed = true;
  582. }
  583. }
  584. }
  585. },
  586. playerDied : function() {
  587. ProAgarBots.isAlive = false;
  588. moveBallOnMinimap("player_death", this.realPlayerX, this.realPlayerY);
  589. setBallVisible("player_pointer", false);
  590. setBallVisible("player_death", true);
  591. sendCommand({
  592. name : "dead"
  593. });
  594. },
  595. playerSpawned : function() {
  596. ProAgarBots.isAlive = true;
  597. changeNicknameOnBall("player_pointer", ProAgarBots.playerName);
  598. setBallVisible("player_spectate", false);
  599. setBallVisible("player_pointer", true);
  600. sendCommand({
  601. name : "alive",
  602. playerName : ProAgarBots.playerName
  603. });
  604. },
  605. playerConnected : function(a) {
  606. resetMinimap();
  607. if (null != this.remoteBotsServer) {
  608. if (this.remoteBotsServer == a) {
  609. sendRemoteBotsMessage({
  610. name : "disconnect"
  611. });
  612. }
  613. }
  614. ProAgarBots.server = a;
  615. console.log("Connecting to: " + a);
  616. setBallVisible("player_pointer", false);
  617. setBallVisible("player_death", false);
  618. setBallVisible("player_spectate", false);
  619. sendLocalBotsMessage({
  620. name : "server",
  621. server : a
  622. });
  623. },
  624. playerDisconnected : function() {
  625. resetMinimap();
  626. sendCommand({
  627. name : "dead"
  628. });
  629. setBallVisible("player_pointer", false);
  630. setBallVisible("player_death", false);
  631. setBallVisible("player_spectate", false);
  632. ProAgarBots.server = null;
  633. ProAgarBots.isAlive = false;
  634. },
  635. playerSpectated : function() {
  636. setBallVisible("player_pointer", false);
  637. setBallVisible("player_spectate", true);
  638. sendCommand({
  639. name : "dead"
  640. });
  641. },
  642. updateNickname : function(a) {
  643. this.playerName = a;
  644. },
  645. loadCore : function() {
  646. setTimeout(function() {
  647. startLocalBots();
  648. startRemoteBots();
  649. }, 2E3);
  650. console.log("Loading core.");
  651. var b$$0 = (document.getElementById("canvas"), localStorage.getItem("botnames"));
  652. if (null !== b$$0) {
  653. ProAgarBots.botNames = validateNames(b$$0);
  654. if (null !== ProAgarBots.botNames) {
  655. $("#botnames").val(b$$0);
  656. }
  657. updateBotNames();
  658. }
  659. $("#botnames").on("input", function() {
  660. var a = $("#botnames").val();
  661. var b = validateNames(a);
  662. ProAgarBots.botNames = b;
  663. updateBotNames();
  664. if (null !== b) {
  665. localStorage.setItem("botnames", a);
  666. }
  667. });
  668. $("#leaderboardcopy").click(function(a) {
  669. var b = $("#leaderboard")[0];
  670. b.setSelectionRange(0, b.value.length);
  671. b.select();
  672. try {
  673. document.execCommand("copy");
  674. } catch (a$$0) {
  675. console.log("Failed to copy leaderboard.");
  676. }
  677. });
  678. $("#uuidcopy").click(function(a) {
  679. var b = $("#uuid")[0];
  680. b.setSelectionRange(0, b.value.length);
  681. b.select();
  682. try {
  683. document.execCommand("copy");
  684. } catch (a$$0) {
  685. console.log("Failed to copy uuid.");
  686. }
  687. });
  688. var c;
  689. var d = false;
  690. var f$$0 = false;
  691. $(document).keydown(function(a) {
  692. switch(a.which) {
  693. case 65:
  694. ProAgarBots.moveToMouse = !ProAgarBots.moveToMouse;
  695. if (ProAgarBots.moveToMouse) {
  696. $("#ismoveToMouse").html("<font color='#7FFF00'>On</font>");
  697. } else {
  698. $("#ismoveToMouse").html("<font color='red'>Off</font>");
  699. }
  700. break;
  701. case 68:
  702. ProAgarBots.stopMovement = !ProAgarBots.stopMovement;
  703. if (ProAgarBots.stopMovement) {
  704. $("#isStopMove").html("<font color='#7FFF00'>On</font>");
  705. } else {
  706. $("#isStopMove").html("<font color='red'>Off</font>");
  707. }
  708. break;
  709. case 69:
  710. emitSplit();
  711. break;
  712. case 82:
  713. emitMassEject();
  714. break;
  715. case 77:
  716. ProAgarBots.drawMinimap = !ProAgarBots.drawMinimap;
  717. if (ProAgarBots.drawMinimap) {
  718. $("#botcanvas").show();
  719. } else {
  720. $("#botcanvas").hide();
  721. }
  722. break;
  723. case 80:
  724. f$$0 = !f$$0;
  725. if (f$$0) {
  726. $("#collectPellets").html("<font color='#7FFF00'>On</font>");
  727. } else {
  728. $("#collectPellets").html("<font color='red'>Off</font>");
  729. }
  730. sendLocalBotsMessage({
  731. name : "collectPellets",
  732. collectPellets : f$$0
  733. });
  734. if (ProAgarBots.isAuthorized) {
  735. sendCommand({
  736. name : "collectPellets",
  737. collectPellets : f$$0
  738. });
  739. }
  740. break;
  741. case 87:
  742. if (d) {
  743. return;
  744. }
  745. d = true;
  746. c = setInterval(function() {
  747. core.eject();
  748. }, 50);
  749. }
  750. });
  751. $(document).keyup(function(a) {
  752. switch(a.which) {
  753. case 87:
  754. d = false;
  755. clearInterval(c);
  756. break;
  757. case 84:
  758. var b = 0;
  759. var e = setInterval(function() {
  760. return b > 7 ? void clearInterval(e) : (b++, void core.split());
  761. }, 50);
  762. break;
  763. case 81:
  764. var f = 0;
  765. var g = setInterval(function() {
  766. return f > 1 ? void clearInterval(g) : (f++, void core.split());
  767. }, 50);
  768. }
  769. });
  770. addBallToMinimap(true, "player_pointer", ProAgarBots.playerName, ProAgarBots.realPlayerX, ProAgarBots.realPlayerY, "#00FF00", false);
  771. addBallToMinimap(true, "player_death", "Last Death", ProAgarBots.realPlayerX, ProAgarBots.realPlayerY, "#FF2400", false);
  772. addBallToMinimap(true, "player_spectate", "Spectate", ProAgarBots.realPlayerX, ProAgarBots.realPlayerY, "#0000FF", false);
  773. connectToProAgarBotsServer();
  774. insertCore();
  775. setInterval(function() {
  776. MC.ProAgarBotsFreeCoins();
  777. }, 5E3);
  778. setInterval(function() {
  779. drawMinimap();
  780. }, 33);
  781. },
  782. reloadCore : function() {
  783. console.log("Reloading Core.");
  784. insertCore();
  785. },
  786. onAgarioCoreLoaded : function() {
  787. window.skinHack = new skinHack();
  788. console.log("Loading settings into agario core.");
  789. core.setSkins(!$("#noSkins").is(":checked"));
  790. core.setNames(!$("#noNames").is(":checked"));
  791. core.setColors(!$("#noColors").is(":checked"));
  792. core.setShowMass($("#showMass").is(":checked"));
  793. core.setDarkTheme($("#darkTheme").is(":checked"));
  794. }
  795. };
  796. var tempLeaderBoard = "";
  797. var tempLeaderBoardIndex = 1;
  798. CanvasRenderingContext2D.prototype._fillText = CanvasRenderingContext2D.prototype.fillText, CanvasRenderingContext2D.prototype.fillText = function() {
  799. this._fillText.apply(this, arguments);
  800. if ("Leaderboard" === arguments[0]) {
  801. if ("" != tempLeaderBoard) {
  802. ProAgarBots.leaderboardData = tempLeaderBoard;
  803. $("#leaderboard").val(ProAgarBots.leaderboardData);
  804. }
  805. tempLeaderBoardIndex = 1;
  806. tempLeaderBoard = "";
  807. } else {
  808. if (":teams" != $("#gamemode").val() && (0 == arguments[0].indexOf(tempLeaderBoardIndex + ".") && tempLeaderBoardIndex < 11)) {
  809. tempLeaderBoard += arguments[0] + (tempLeaderBoardIndex <= 9 ? ", " : "");
  810. tempLeaderBoardIndex++;
  811. } else {
  812. this._fillText.apply(this, arguments);
  813. }
  814. }
  815. }, CanvasRenderingContext2D.prototype._drawImage = CanvasRenderingContext2D.prototype.drawImage, CanvasRenderingContext2D.prototype.drawImage = function() {
  816. if (arguments[0].src) {
  817. if ("http://agar.io/img/background.png" == arguments[0].src) {
  818. arguments[0].src = "";
  819. }
  820. }
  821. this._drawImage.apply(this, arguments);
  822. };
  823. var miniMap = null;
  824. var minimapCtx = null;
  825. minimapBalls = {}, MinimapBall.prototype = {
  826. draw : function(a, b, c) {
  827. if (this.visible) {
  828. this.lastX = (29 * this.lastX + this.x) / 30;
  829. this.lastY = (29 * this.lastY + this.y) / 30;
  830. var d = ((this.isDefault ? this.x : this.lastX) + ProAgarBots.mapOffset) * b;
  831. var e = ((this.isDefault ? this.y : this.lastY) + ProAgarBots.mapOffset) * c;
  832. a.fillStyle = this.color;
  833. a.font = "10px Ubuntu";
  834. a.textAlign = "center";
  835. a.fillText("" == this.name ? "An unnamed cell" : this.name, d, e - 10);
  836. a.beginPath();
  837. a.arc(d, e, 4.5, 0, 2 * Math.PI, false);
  838. a.closePath();
  839. a.fillStyle = this.color;
  840. a.fill();
  841. }
  842. }
  843. };
  844. var b = new XMLHttpRequest;
  845. b.open("GET", "/mc/agario.js", true), b.onload = function() {
  846. var script = b.responseText;
  847. script = replaceNormalFile(script, 'if(js.keyCode==32&&i1!="nick"){js.preventDefault()}', "");
  848. script = replaceNormalFile(script, "showAds:function(i){if", "showAds:function(i){},showFuck:function(i){if");
  849. script = replaceNormalFile(script, "showPromoBadge:function(", "showPromoBadge:function(i){},fuckbacks: function(");
  850. script = replaceRegexFile(script, /(return\s\w+.tab.toUpperCase\(\)).indexOf\(\w+.toUpperCase\(\)\)!=-1/, "$1 != 'VETERAN'");
  851. script = replaceRegexFile(script, /if\(\w+.shouldSkipConfigEntry\(\w+.productIdToQuantify.*visibility\)\)\{continue\}/, "");
  852. 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")');
  853. script = replaceRegexFile(script, /var\si2=window.document.createElement..script..+head.appendChild.i2../i, "ProAgarBots.reloadCore();");
  854. 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 ProAgarBotsFreeCoins: function(){if($2){return;}$3;},");
  855. script = replaceNormalFile(script, "onPlayerBanned:function(i)", "onPlayerBanned: function(i){},shitfacefuck:function(i)");
  856. script = replaceNormalFile(script, "setPopupActiveState:function(i){", "setPopupActiveState:function(i){console.log('stopped annoying ad');return;");
  857. eval(script);
  858. var e = new XMLHttpRequest;
  859. e.open("GET", "/", true);
  860. e.onload = function() {
  861. var a = e.responseText;
  862. a = replaceNormalFile(a, "UCC6hurPo_LxL7C0YFYgYnIw", "UCo8dhNSfZhKnhGx_awfMutw");
  863. a = replaceRegexFile(a, /<footer[\S\s]*\/footer>/i, "");
  864. 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'>ProAgarBots</font><br>Bots: <a id='botCount'><font color='red'>0 / 5</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>");
  865. a = replaceNormalFile(a, "<body>", '<body onload="ProAgarBots.loadCore()">');
  866. a = replaceRegexFile(a, /<script type="text\/javascript" src="mc\/agario\.js.*"><\/script>/i, "");
  867. a = replaceRegexFile(a, /<div id="adsBottom".*display:block;">/i, '<div id="adsBottom" style="display:none">');
  868. a = replaceNormalFile(a, '<div class="diep-cross" style="', '<div class="diep-cross" style="display:none;');
  869. a = replaceNormalFile(a, '<div id="promo-badge-container">', '<div id="promo-badge-container" style="display:none;">');
  870. 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>');
  871. 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="' +
  872. 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">');
  873. 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>');
  874. document.open();
  875. document.write(a);
  876. ProAgarBots.loadCore();
  877. document.close();
  878. };
  879. e.send();
  880. }, b.send(), setInterval(function() {
  881. ProAgarBots.realPlayerX = ProAgarBots.mapOffsetX + ProAgarBots.playerX;
  882. ProAgarBots.realPlayerY = ProAgarBots.mapOffsetY + ProAgarBots.playerY;
  883. moveBallOnMinimap("player_pointer", ProAgarBots.realPlayerX, ProAgarBots.realPlayerY);
  884. moveBallOnMinimap("player_spectate", ProAgarBots.realPlayerX, ProAgarBots.realPlayerY);
  885. }, 50);
  886. var last_transmited_game_server = null;
  887. var socket = null;
  888. setInterval(function() {
  889. if (!ProAgarBots.isAuthorized) {
  890. emitPosition();
  891. }
  892. }, 10), setInterval(function() {
  893. if (ProAgarBots.isAuthorized) {
  894. emitPosition();
  895. }
  896. emitLocalPosition();
  897. transmit_current_server(false);
  898. }, 10);
  899. window.interval = setInterval(function() {
  900. if (MC.coreWasLoaded == true && $("#nick")[0]) {
  901. clearInterval(interval);
  902. $("#agarTwitter").remove();
  903. $("h2").replaceWith("<h2>ProAgarBots</h2>");
  904. }
  905. }, 100);
  906.  
  907.  
  908.  
  909. function skinHack() {
  910. this.currentSkin = "";
  911. this.configUrlBase = window.EnvConfig.config_url + '/' + localStorage.getItem('last_config_id') + '/';
  912. this.configUrl = this.configUrlBase + 'GameConfiguration.json';
  913. this.skinObj = {};
  914. this.rotateInterval = 1000;
  915. this.playerName = '';
  916. this.canUseScript = false;
  917. this.downloadConfig();
  918. }
  919. skinHack.prototype = {
  920. downloadConfig: function() {
  921. var onDownload = this.onDownload.bind(this);
  922. $.ajax({
  923. type: "GET",
  924. url: this.configUrl,
  925. success: function(data) {
  926. onDownload(data);
  927. },
  928. error: function(jqXHR, textStatus, errorThrown) {}
  929. });
  930. },
  931. onDownload: function(data) {
  932. this.handleSkinData(data);
  933. this.injectHtml();
  934. this.overrideSetNick();
  935. this.initSkinRotation();
  936. this.updateSkin();
  937. },
  938. handleSkinData: function(data) {
  939. var shopSkins = data.gameConfig['Shop - Skins'];
  940. var equippableSkins = data.gameConfig['Gameplay - Equippable Skins'];
  941. for (var i = 0; i < equippableSkins.length; i++) {
  942. var skin = equippableSkins[i];
  943. this.skinObj[skin.productId] = {
  944. image: skin.image,
  945. color: skin.cellColor
  946. };
  947. }
  948. for (var i = 0; i < shopSkins.length; i++) {
  949. var skin = shopSkins[i];
  950. this.skinObj[skin.productIdToQuantify].title = skin.title;
  951. }
  952. },
  953. injectHtml: function() {
  954. $('#advertisement').hide();
  955. $('.agario-promo').remove();
  956. $('.diep-cross').remove();
  957. $('#agario-web-incentive').remove();
  958. //$('<select id="skinsList" class="form-control" onchange="window.skinHack.updateSkin()" required=""></select><input type="checkbox" id="rotateSkinCheckBox">Rotate Skins</input>').insertBefore('#locationUnknown');
  959. // NOT STEALING FROM RAZOR... 90% OF THIS IS FROM SINGA/A. INFINITY ALREADY...
  960. //$('<div class="agario-panel agario-side-panel"><img id="skinPreview" class="circle bordered"src=""width="96"height="96"style="height: 96px; border: 3px solid rgb(0, 44, 108);margin: 0 auto;"><br><select id="skinsList"class="form-control"onchange="window.skinHack.updateSkin()"required=""></select><br><div id="skinRotator"style="margin: auto"><label>Skin Rotator: </label><div style="left: 13px" class="btn-group btn-toggle"><button class="btn btn-sm active btn-default">ON</button><button class="btn btn-sm active btn-primary">OFF</button></div></div></div>').insertAfter('.agario-party');
  961.  
  962. this.addSkinOption({
  963. image: '',
  964. color: '0x00000000',
  965. title: 'Default Skin'
  966. });
  967. for (var idStr in this.skinObj) {
  968. if (this.skinObj.hasOwnProperty(idStr) && this.skinObj[idStr].title) {
  969. this.addSkinOption(this.skinObj[idStr]);
  970. }
  971. }
  972.  
  973. $('.btn-toggle').click(function() {
  974. $(this).find('.btn').toggleClass('active');
  975.  
  976. if ($(this).find('.btn-primary').size() > 0) {
  977. $(this).find('.btn').toggleClass('btn-primary');
  978. }
  979. if ($(this).find('.btn-info').size() > 0) {
  980. $(this).find('.btn').toggleClass('btn-info');
  981. }
  982.  
  983. $(this).find('.btn').toggleClass('btn-default');
  984. });
  985. this.preLoadSkins();
  986. $('#openfl-content').click(this.updateSkin.bind(this));
  987. },
  988. preLoadSkins: function() {
  989. for (var key in this.skinObj) {
  990. if (this.skinObj.hasOwnProperty(key)) {
  991. (new Image()).src = this.configUrlBase + this.skinObj[key].image;
  992. }
  993. }
  994. },
  995. addSkinOption: function(skin) {
  996. skin.title = skin.title.split("product_name_skin_")[1];
  997. $('#skinsList').append('<option value="' + skin.image + ':' + skin.color + '">' + skin.title + '</option>');
  998. },
  999. overrideSetNick: function() {
  1000. window.MC._setNick = window.MC.setNick;
  1001. window.MC.setNick = function() {
  1002. var name = arguments[0];
  1003. if(name === "") {
  1004. this.playerName = "ProAgarBots"
  1005. name = "ProAgarBots";
  1006. console.log('Overriding');
  1007. } else {
  1008. this.playerName = name;
  1009. }
  1010. window.MC._setNick(name);
  1011.  
  1012. this.updateSkin();
  1013. }.bind(this);
  1014. },
  1015. checkSubscription: function() {
  1016. try {
  1017. if (localStorage.getItem('canUseScript')) {
  1018. this.canUseScript = JSON.parse(localStorage.getItem('canUseScript').toLowerCase());
  1019. } else {
  1020. localStorage.setItem('canUseScript', 'false');
  1021. return this.promptSubscription();
  1022. }
  1023. if (!this.canUseScript) {
  1024. return this.promptSubscription();
  1025. }
  1026. return this.canUseScript;
  1027. } catch (err) {
  1028. console.log(err);
  1029. }
  1030. },
  1031. promptSubscription: function() {
  1032. var ask = window.confirm("You must subscribe to Dosk to Use The Script");
  1033. if (ask) {
  1034. var win = window.open('https://www.youtube.com/channel/UCo8dhNSfZhKnhGx_awfMutw?sub_confirmation=1', '_blank');
  1035. if (win) {
  1036. localStorage.setItem('canUseScript', 'true');
  1037. this.canUseScript = true;
  1038. this.updateSkin();
  1039. } else {
  1040. alert('Please allow popups and refresh the page first!');
  1041. }
  1042. }
  1043. return this.canUseScript();
  1044. },
  1045. updateSkin: function() {
  1046.  
  1047. var skinArg = $('#skinsList').val().split(':');
  1048. var usingHackSkin = skinArg[0].length > 0;
  1049. var image = usingHackSkin ? this.configUrlBase + skinArg[0] : document.getElementsByClassName('circle bordered')[0].src;
  1050. var color = usingHackSkin ?
  1051. parseInt(skinArg[1].slice(0, skinArg[1].length - 2)) :
  1052. parseInt(this.rgbToHex(document.getElementsByClassName('circle bordered')[0].style.borderColor).slice(1, 7), 16);
  1053. var name = this.playerName;
  1054. window.core.registerSkin(name, null, image, image ? 2 : 0, image ? color : null);
  1055. $('#skinPreview').attr('src', image)
  1056. var arr = ['top', 'right', 'bottom', 'left'];
  1057. for (var i = 0; i < array.length; i++) {
  1058. $('#skinPreview').css('border-' + array[i] + '-color', '#' + color.toString(16));
  1059. }
  1060.  
  1061. },
  1062. rgbToHex: function(color) {
  1063. if (color.substr(0, 1) === '#') {
  1064. return color;
  1065. }
  1066. var digits = /(.*?)rgb\((\d+), (\d+), (\d+)\)/.exec(color);
  1067.  
  1068. var red = parseInt(digits[2]);
  1069. var green = parseInt(digits[3]);
  1070. var blue = parseInt(digits[4]);
  1071.  
  1072. var rgb = blue | (green << 8) | (red << 16);
  1073. return digits[1] + '#' + rgb.toString(16);
  1074. },
  1075. initSkinRotation: function() {
  1076. setInterval(function() {
  1077. if ($('.btn-toggle').find('.btn-primary').html() === "ON") {
  1078. $('#skinsList')[0].selectedIndex = ($('#skinsList')[0].selectedIndex + 1) % $('#skinsList')[0].length;
  1079. this.updateSkin();
  1080. }
  1081. }.bind(this), this.rotateInterval);
  1082. }
  1083. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement