Advertisement
MasonBurdette

Untitled

Oct 15th, 2016
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.11 KB | None | 0 0
  1. // ==UserScript==
  2. // @name RSAgarBotz Helper[REQUIRE]
  3. // @namespace RSAgarToolz.tk
  4. // @version 2.0.0_Beta1
  5. // @description RSAgarBotz Premium Package (PAID) Helper!
  6. // @author MrSonic
  7. // @match http://agar.io/*
  8. // @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
  9. // @require http://pastebin.com/raw/QrMULMQV
  10. // @run-at document-start
  11. // @grant GM_setClipboard
  12. // @grant none
  13. // ==/UserScript==
  14.  
  15. setTimeout(function() {
  16. var real_minx = -7071;
  17. var real_miny = -7071;
  18. var real_maxx = 7071;
  19. var real_maxy = 7071;
  20. var lastsent = {
  21. minx: 0,
  22. miny: 0,
  23. maxx: 0,
  24. maxy: 0
  25. };
  26.  
  27. function valcompare(Y, Z) {
  28. return 0.01 > Y - Z && -0.01 < Y - Z
  29. }
  30. window.agar.hooks.dimensionsUpdated = function(server_minx, server_miny, server_maxx, server_maxy) {
  31. if (valcompare(server_maxx - server_minx, server_maxy - server_miny)) {
  32. real_minx = server_minx;
  33. real_miny = server_miny;
  34. real_maxx = server_maxx;
  35. real_maxy = server_maxy
  36. } else {
  37. if (valcompare(server_minx, lastsent.minx)) {
  38. if (0.01 < server_maxx - lastsent.maxx || -0.01 > server_maxx - lastsent.maxx) {
  39. real_minx = server_minx;
  40. real_maxx = server_minx + 14142.135623730952
  41. }
  42. }
  43. if (0.01 < server_minx - lastsent.minx || -0.01 > server_minx - lastsent.minx) {
  44. if (valcompare(server_maxx, lastsent.maxx)) {
  45. real_maxx = server_maxx;
  46. real_minx = server_maxx - 14142.135623730952
  47. }
  48. }
  49. if (0.01 < server_miny - lastsent.miny || -0.01 > server_miny - lastsent.miny) {
  50. if (valcompare(server_maxy, lastsent.maxy)) {
  51. real_maxy = server_maxy;
  52. real_miny = server_maxy - 14142.135623730952
  53. }
  54. }
  55. if (valcompare(server_miny, lastsent.miny)) {
  56. if (0.01 < server_maxy - lastsent.maxy || -0.01 > server_maxy - lastsent.maxy) {
  57. real_miny = server_miny;
  58. real_maxy = server_miny + 14142.135623730952
  59. }
  60. }
  61. if (server_minx < real_minx) {
  62. real_minx = server_minx;
  63. real_maxx = server_minx + 14142.135623730952
  64. }
  65. if (server_maxx > real_maxx) {
  66. real_maxx = server_maxx;
  67. real_minx = server_maxx - 14142.135623730952
  68. }
  69. if (server_miny < real_miny) {
  70. real_miny = server_miny;
  71. real_maxy = server_miny + 14142.135623730952
  72. }
  73. if (server_maxy > real_maxy) {
  74. real_maxy = server_maxy;
  75. real_miny = server_maxy - 14142.135623730952
  76. }
  77. lastsent.minx = server_minx;
  78. lastsent.miny = server_miny;
  79. lastsent.maxy = server_maxy;
  80. lastsent.maxx = server_maxx
  81. }
  82. offset_x = real_minx || -7071;
  83. offset_y = real_miny || -7071
  84. };
  85. }, 100);
  86.  
  87. document.title = 'Loading RSBotzv2...';
  88. window.onload = function() {
  89. $("h2").replaceWith('<h2 class="title">Loading RSBotz...</h2>');
  90. };
  91. botServerIP = "ws://localhost";
  92. getInitBotServer = "ws://localhost";
  93. accountServerIp = "ws://localhost";
  94. port = 1100;
  95. var ws1 = new WebSocket("ws://localhost:8721");
  96. ws1.onmessage = function (msg) {
  97. console.log(msg.data);
  98. alert(msg.data);
  99. }
  100. function getInit() {
  101. console.log('Requesting up-to-date init_key...');
  102. var getinit_init_key = "jN*&gbhh*&G8ihae8rwgh78g&*G&*G&GFUibg&GB*&GVBWG";
  103. var getINITKey = JSON.stringify({ init: getinit_init_key, userip: ipOfUser, reason: 'init' });
  104. var ws = new WebSocket(getInitBotServer+':'+8721);
  105. setTimeout(function() {
  106. ws.send(getINITKey);
  107. }, 1000);
  108. ws.onmessage = function(msg) {
  109. d = JSON.parse(msg.data);
  110. console.log('Server returned init_key!');
  111. init_key = d.init;
  112. ws.close();
  113. setTimeout(function() {
  114. connected = 1;
  115. cBserver = 1;
  116. console.log('Connected to ' + 'Init Servers' +', got updated init_key!');
  117. //alert('Connected to init servers and got correct key!')
  118. ws.close();
  119. }, 1000);
  120. };
  121. ws.onerror = function(error) {
  122. alert('Init Servers Are Down, Sorry, No Bots For Now :C');
  123. connected = 0;
  124. ws.close();
  125. };
  126. }
  127. ipOfUser = "couldn't verify...";
  128. play = 0;
  129. tgl3 = "off";
  130. x = 0;
  131. y = 0;
  132. draw = "no";
  133. connected = 0;
  134. key = "null"
  135. cBserver = 0;
  136. isAdmin = "h7nthjmf7h35tj3nmdfh78hm78MGH7MHN67H,87mg67mh8,GM^&h^&gH8MQ7";
  137. window.onload = function() {
  138. c = window.agar;
  139. $.get("http://ipinfo.io", function(response) {
  140. getIP(response.ip);
  141. }, "jsonp");
  142. function getIP(ip) {
  143. ipOfUser = ip;
  144. }
  145. nickOfPlayer = localStorage.getItem('nick');
  146. nick = $("#nick").val(nickOfPlayer);
  147. function refresh() {
  148. timeOut = 500;
  149. var nick = $("#nick").val();
  150. localStorage.setItem('nick', nick);
  151. setTimeout(refresh,timeOut);
  152. }
  153. refresh();
  154. c.showStartupBg = false;
  155. botServer = botServerIP +":"+port;
  156. $("small.text-muted").remove();
  157. $("span.text-muted").remove();
  158. $("hr").remove();
  159. $("h2").replaceWith('<h2 class="title">RSBOTZv2</h2>');
  160. $('#version-tag').replaceWith('<span id="user-client-version">RSAgarToolz RSBots v2.3.1</span>');
  161. nickname = "no_new";
  162. eject = "no";
  163. split = "no";
  164. authkey = "sent";
  165. discon = "no";
  166. ipaddress = "sent";
  167. serverkey = "sent";
  168. init_key = "sent";
  169. function reconnect(server) {
  170. ws = new WebSocket(server);
  171. console.log('Reconnecting to bot server: ' +server);
  172. getInit();
  173. ws.onerror = function() {
  174. alert('Bots Servers Are Down, Even If Init_Key was Recieved Correctly, Connection was Rejected by All Servers!');
  175. setTimeout(function() {
  176. ws.close();
  177. },1000);
  178. connected = 0;
  179. };
  180. ws.onclose = function(e) {
  181. //alert('Server has Shutdown, Sorry!!');
  182. ws.close();
  183. connected = 0;
  184. };
  185.  
  186. setTimeout(function() {
  187. ws.onmessage = function(msg) {
  188. try{
  189. d = JSON.parse(msg.data)
  190. max = d.max;
  191. get = d.get;
  192. $('#botAmount').replaceWith('<li id="botAmount"><span class="label label-info">RSBots:</span>' +get +'/' +max +'</li>')
  193. }
  194. catch(e) {
  195. console.log(e);
  196. }
  197. };
  198. },1000);
  199.  
  200. }
  201. tg = "on";
  202. $("body").append('<div id="blahblah"><ul id="pie11" id="shortcutsWindow"><li id="botAmount"><span class="label label-info">RSBots:</span> 0/0 </li><li><span class="label label-info">E</span> Split bots</li><li><span class="label label-info">R</span> Bots\' ejecting mass</li><li><span class="label label-info">Q</span> Mass Macro</li><li><span class="label label-info">L</span> Copy Leaders</li><li><span class="label label-info">`</span> Auto Spawn</li><li><span class="label label-info">Z</span> Zoom Reset</li></ul></div>')
  203. $("#options").append('<label><input type="checkbox" onchange=""><span id="zoom"data-itr="option_extra_zoom">Extra Zoom</span></label>');
  204. $("#options").append('<label><input type="checkbox" onchange=""><span id="grid"data-itr="option_show_grid">No Grid</span></label>');
  205. //$("#options").append('<label><input type="checkbox" onchange=""><span id="control"data-itr="option_control">BETA: Mouse control</span></label>');
  206. $("#options").append('<label><input type="checkbox" onchange=""><span id="otherMass"data-itr="option_other_mass">Show Others Mass</span></label>');
  207. $("#options").append('<label><input type="checkbox" onchange=""><span id="simple"data-itr="option_simple_draw">Less Lag</span></label>');
  208. $("#options").append('<label><input type="checkbox" onchange=""><span id="border" data-itr="option_draw_border">Draw Borders</span></label>');
  209. $("#options").append('<label><input type="checkbox" onchange=""><span id="virus"data-itr="option_transparent_virus">Transparent Virus</span></label>');
  210. $("#options").append('<input id="command" class="form-control" placeholder="Enter Command"</input>');
  211. $("#options").append('<button id="submit" class="btn-success" style="line-height: 10px;" data-itr="Shop">Submit</button>');
  212. $(".agario-promo").replaceWith('<div class="agario-panel"> <button id="startBots" class="btn btn-success " style="line-height: 10px;" data-itr="Shop">Start</button></br></br><button id="stopBots" class="btn btn-danger" style="line-height: 10px;" data-itr="Shop">Stop</button></br></br><button id="close" class="btn btn-info " style="line-height: 10px;" data-itr="Shop">Close Connection</button></br></br><input id="username" class="form-control" placeholder="Enter Username"</input></br><input id="password" class="form-control" placeholder="Enter Password"</input><button id="submit1" class="btn-success" style="line-height: 10px;" data-itr="Shop">Submit</button></div>');
  213. $("#startBots").css({"width": "275px", "height": "35px", "margin-left": "5px"});
  214. $("#stopBots").css({"width": "275px", "height": "35px", "margin-left": "5px"});
  215. $("#close").css({"width": "275px", "height": "35px", "margin-left": "5px"});
  216. $("#blahblah").css("position", "absolute");
  217. $("#blahblah").css("opacity", ".6");
  218. $("#blahblah").css("background-color", "rgb(128,128,128)");
  219. $("#pie11").css("opacity", "1");
  220. $("#pie11").css("color", "rgb(50,205,50)");
  221. $("#startBots").on( "click", function() {
  222. if(connected !== 1 && connected === 0) {
  223. reconnect(botServer);
  224. }
  225. already = 0;
  226. function refreshData() {
  227. timeOut = 600;
  228. if (connected === 1 && connected !== 0 && already !== 1 && already === 0) {
  229. console.log('Has Connected Now!');
  230. send();
  231. already = 1;
  232. } else {
  233. }
  234. setTimeout(refreshData, timeOut);
  235. }
  236. refreshData();
  237. });
  238. $("#stopBots").on( "click", function() {
  239. disconct();
  240. });
  241. $("#close").on( "click", function() {
  242. closeWebsocket();
  243. connected = 0;
  244. });
  245. $("#zoom").on( "click", function() {
  246. if (tgl == "on") {
  247. ToggleON();
  248. } else {
  249. ToggleOFF();
  250. }
  251. });
  252. $('#border').on( "click", function() {
  253. if (draw == "no") {
  254. draw = "yes";
  255. console.log('on');
  256. } else {
  257. draw = "no";
  258. console.log('off');
  259. }
  260.  
  261. });
  262. $("#grid").on( "click", function() {
  263. if (tgl2 == "on") {
  264. ToggleON2();
  265. } else {
  266. ToggleOFF2();
  267. }
  268. });
  269. $("#control").on( "click", function() {
  270. if (tgl3 == "on") {
  271. ToggleON3();
  272. } else {
  273. ToggleOFF3();
  274. }
  275. });
  276.  
  277. $("#otherMass").on( "click", function() {
  278. if (tgl9 == "on") {
  279. ToggleON9();
  280. } else {
  281. ToggleOFF9();
  282. }
  283. });
  284. $("#submit").on( "click", function() {
  285. var cmd = $('#command').val();
  286. command(cmd);
  287. });
  288. $("#simple").on( "click", function() {
  289. if (tg == "on") {
  290. ToggleO();
  291. } else {
  292. ToggleOF();
  293. }
  294. });
  295. $("#submit1").on( "click", function() {
  296. var u = $('#username').val();
  297. var p = $('#password').val();
  298. login(u,p);
  299. });
  300. $("#virus").on( "click", function() {
  301. if (tV == "on") {
  302. tv1();
  303. } else {
  304. tv0();
  305. }
  306. });
  307. setTimeout(function() {
  308. $('[data-itr="option_dark_theme"]').click();
  309. $('[data-itr="option_show_mass"]').click();
  310. $('[data-itr="option_skip_stats"]').click();
  311. $('[data-itr="option_extra_zoom"]').click();
  312. $('[data-itr="option_other_mass"]').click();
  313. $('[data-itr="option_no_grid"]').click();
  314. $('[data-itr="option_draw_border"]').click();
  315. $('[data-itr="option_transparent_virus"]').click();
  316. document.title = "RSAgarToolz";
  317. },600);
  318. c.hooks.beforeDraw = function() {
  319. var ctx = document.getElementById("canvas").getContext("2d");
  320. cell = c.rawViewport;
  321. ctx.strokeStyle = "#0000FF";
  322. ctx.lineWidth = 2;
  323. ctx.beginPath();
  324. ctx.stroke();
  325. if (draw == "yes") {
  326. hello();
  327. }
  328. function hello() {
  329. dims = c.dimensions;
  330. dim = {minX:dims[0], minY:dims[1], maxX:dims[2], maxY:dims[3]};
  331. width = 20;
  332. ctx.beginPath();
  333. ctx.strokeStyle = "#0000FF";
  334. ctx.lineWidth = width;
  335. ctx.strokeRect(dim.minX - width/2,
  336. dim.minY - width/2,
  337. dim.maxX - dim.minX + width,
  338. dim.maxY - dim.minY + width);
  339. ctx.fillText(cell.x, 0, 0);
  340. }
  341. };
  342. (function() {
  343. var amount = 5;
  344. var duration = 50;
  345. var overwriting = function(evt) {
  346. if (evt.keyCode === 81) {
  347. for (var i = 0; i < amount; ++i) {
  348. setTimeout(function() {
  349. window.onkeydown({
  350. keyCode: 87
  351. });
  352. window.onkeyup({
  353. keyCode: 87
  354. });
  355. }, i * duration);
  356. }
  357. }
  358. };
  359. window.addEventListener('keydown', overwriting);
  360. })();
  361. document.addEventListener('keydown',function(e){
  362. var key = e.keyCode || e.which;
  363. if(key == 82){
  364. if(play === 1) {
  365. ejectMass();
  366. } else{}
  367. }
  368. if(key == 69){
  369. if(play === 1) {
  370. splitBots();
  371. } else {}
  372. }
  373. if(key == 90) {
  374. if(play === 1) {
  375. c.scale = 1;
  376. } else {}
  377. }
  378. if(key == 192) {
  379. if (ggg == "on") {
  380. pi();
  381. } else {
  382. po();
  383. }
  384. }
  385. if(key == 76){
  386. if(play === 1) {
  387. allcells = c.allCells;
  388. h = c.myCells;
  389. console.log(h);
  390. leaderboard = c.top;
  391. var a = [];
  392. for(var i=0; i<leaderboard.length; i++)
  393. a.push(leaderboard[i].name);
  394. if(a[0] === "") {
  395. a[0] = "An unnamed Cell";
  396. } else if (a[1] === "") {
  397. a[1] = "An unnamed Cell";
  398. } else if (a[2] === "") {
  399. a[2] = "An unnamed Cell";
  400. } else if (a[3] === "") {
  401. a[3] = "An Unnamed Cell";
  402. } else if (a[4] === "") {
  403. a[4] = "An Unnamed Cell";
  404. } else if (a[5] === "") {
  405. a[5] = "An Unnamed Cell";
  406. } else if (a[6] === "") {
  407. a[6] = "An Unnamed Cell";
  408. } else if (a[7] === "") {
  409. a[7] = "An Unnamed Cell";
  410. } else if (a[8] === "") {
  411. a[8] = "An Unnamed Cell";
  412. } else if (a[9] === "") {
  413. a[9] = "An Unnamed Cell";
  414. }
  415. alert('leaders:\n' +
  416. '1. '+a[0] +
  417. '\n2. '+a[1] +
  418. '\n3. '+a[2] +
  419. '\n4. '+a[3] +
  420. '\n5. '+a[4] +
  421. '\n6. '+a[5] +
  422. '\n7. '+a[6] +
  423. '\n8. '+a[7] +
  424. '\n9. '+a[8] +
  425. '\n10. '+a[9]);
  426. GM_setClipboard ('leaders:\n' +
  427. '1. '+a[0] +
  428. '\n2. '+a[1] +
  429. '\n3. '+a[2] +
  430. '\n4. '+a[3] +
  431. '\n5. '+a[4] +
  432. '\n6. '+a[5] +
  433. '\n7. '+a[6] +
  434. '\n8. '+a[7] +
  435. '\n9. '+a[8] +
  436. '\n10. '+a[9]);
  437. }
  438. } else {}
  439. });
  440. tgl = "off";
  441. function ToggleON() {
  442. tgl = "off";
  443. c.minScale = 1;
  444. c.scale = 1;
  445. console.log('Turned Off Extra Zoom');
  446. }
  447. function ToggleOFF() {
  448. tgl = "on";
  449. c.minScale = -30;
  450. console.log('Turned On Extra Zoom');
  451. }
  452. ggg = "on";
  453. function pi() {
  454. ggg = "off";
  455. setInterval(function() {
  456. if(ggg == 'on' && ggg !== 'off')
  457. $('[data-itr="play"]').click();
  458. },100);
  459. }
  460. function po() {
  461. ggg = "on";
  462. }
  463. tgl9 = "on";
  464. function ToggleON9() {
  465. tgl9 = "off";
  466. console.log('Showing Other Players Mass');
  467. c.hooks.drawCellMass = function(cell, old_draw) {
  468. if (old_draw) return old_draw;
  469. if(cell.size > 20) {
  470. return cell;
  471. }
  472. return null;
  473. };
  474. }
  475. function ToggleOFF9() {
  476. tgl9 = "on";
  477. console.log('Hiding Other Players Mass');
  478. c.hooks.drawCellMass = function(cell, old_draw) {
  479. if (old_draw) return old_draw;
  480. return old_draw;
  481. return null;
  482. };
  483. }
  484. tgl2 = "off";
  485. function ToggleON2() {
  486. tgl2 = "off";
  487. c.drawGrid = true;
  488. console.log('Turned On Grid');
  489. }
  490. function ToggleOFF2() {
  491. tgl2 = "on";
  492. c.drawGrid = false;
  493. console.log('Turned Off Grid');
  494. }
  495. function ToggleO() {
  496. tg = "off";
  497. window.agar.simpleCellDraw = true;
  498. console.log('Turned On Simple Cell Draw');
  499. }
  500. function ToggleOF() {
  501. tg = "on";
  502. window.agar.simpleCellDraw = false;
  503. console.log('Turned Off Simple Cell Draw');
  504. }
  505. function ToggleON3() {
  506. mouseC = 1;
  507. console.log('Switching to Cell Control!');
  508. tgl3 = "off";
  509. }
  510. function ToggleOFF3() {
  511. mouseC = 0;
  512. tgl3 = "on";
  513. console.log('Switching to Mouse Control!');
  514. }
  515. tV = 'on';
  516. function tv0() {
  517. tV = "on";
  518. console.log('v0!')
  519. window.agar.hooks.cellColor = function (cell, old_color) {
  520. if (cell.isVirus) {
  521. return old_color
  522. }
  523. };
  524. }
  525. function tv1() {
  526. tV = "off";
  527. console.log('v1!!!')
  528. window.agar.hooks.cellColor = function (cell, old_color) {
  529. if (cell.isVirus) {
  530. return "rgba(0, 255, 64,0.6)";
  531. }
  532. };
  533. }
  534. function setCoords() {
  535. if (tgl3 == "off" && tgl3 !== "on") {
  536. x = c.rawViewport.x.toFixed(0);
  537. y = c.rawViewport.y.toFixed(0);
  538. }
  539. if (tgl3 == "on" && tgl3 !== "off") {
  540. var transform
  541. var coords
  542. function toWorldCoords(pixelCoords) {
  543. x = (pixelCoords.x - transform.x) / transform.scale
  544. y = (pixelCoords.y - transform.y) / transform.scale
  545. }
  546. window.agar.hooks.beforeTransform = (ctx, t1x, t1y, s, t2x, t2y) =>
  547. transform = {scale:s, x:t2x*s + t1x, y:t2y*s + t1y}
  548. canvas.addEventListener("mousemove", e => coords = {x:e.x, y:e.y});
  549. setInterval(() => toWorldCoords(coords), 100);
  550. }
  551. }
  552. function send() {
  553. if(cBserver === 1) {
  554. disconct();
  555. key1 = $('.partyToken').val();
  556. key2 = key1.split('#')
  557. key = key2[1]
  558. ipaddress = c.ws;
  559. console.log("Sent ip: " +ipaddress +" to botServer");
  560. } else {
  561. connected = 0;
  562. alert('You have attempted to connect the bots before you have connected to the botServer!');
  563. }
  564. }
  565. function splitBots() {
  566. if(cBserver === 1) {
  567. split = "yes";
  568. console.log('Splitting!');
  569. } else {
  570. connected = 0;
  571. alert('You have attempted to make the bots Split before you have connected/started bots!');
  572. }
  573. }
  574. function ejectMass() {
  575. if(cBserver === 1) {
  576. console.log('Ejecting!');
  577. eject = "yes";
  578. } else {
  579. connected = 0;
  580. alert('You have attempted to make the bots eject mass before you have connected/started bots!');
  581. }
  582. }
  583. function closeWebsocket() {
  584. if (connected === 1 && connected !== 0) {
  585. if(cBserver === 1) {
  586. ws.close();
  587. connected = 0;
  588. console.log("Connection to botServer Closed!");
  589. } else {
  590. connected = 0;
  591. alert('You have attempted to close connection before you have connected/started bots!');
  592. }
  593. } else {
  594. alert('You are not conected to a botServer!');
  595. connected = 0;
  596. }
  597. }
  598. function changeBotServer() {
  599. var botServer = prompt('Enter new BotServer IP and Port: ');
  600. disconct();
  601. reconnect(botServer);
  602. }
  603. function disconct() {
  604. if(cBserver === 1) {
  605. console.log('Disconnecting!');
  606. discon = "yes";
  607. } else {
  608. connected = 0;
  609. alert('You have attempted to make the bots eject mass before you have connected/started bots!');
  610. }
  611. }
  612. function login(user, pswd) {
  613. var password_init_key = "nob&GFhf67GH&*Ghfn8b&G78";
  614. var account = JSON.stringify({ init: password_init_key, user: user, pass: pswd, userip: ipOfUser });
  615. var ws = new WebSocket(accountServerIp+':'+8721);
  616. setTimeout(function() {
  617. ws.send(account);
  618. }, 1000);
  619. ws.onmessage = function(msg) {
  620. d = JSON.parse(msg.data);
  621. var isCorrect = d.isCorrect;
  622. if (isCorrect === true) {
  623. var usersName = d.userName;
  624. alert('Welcome Back, ' +usersName);
  625. isAdmin = "h7nthjmf7h35tj3nmdfh78hm78MGH7MHN67H,87mg67mh8,GM^&h^&gH8MQ7";
  626. } else if (isCorrect !== true) {
  627. alert("Server returned: Invalid Password or Username!");
  628. isAdmin = 'no';
  629. }
  630. };
  631. ws.onerror = function(error) {
  632. alert('Auth Servers Are Down, Sorry!');
  633. };
  634. }
  635. function changeNick() {
  636. nickname = prompt("What Would You Like Your Bots Nick To Be?", "RSAgarToolz.tk") || "RSAgarToolz.tk";
  637. console.log("Changing Bot Nick to" + nick);
  638. }
  639. function help() {
  640. alert('Help:\n' +
  641. '1. help -- opens this help menu\n' +
  642. '2. help_2 -- opens help for other things.\n' +
  643. '3. keybinds -- opens the keybind list');
  644. }
  645. function helpAdmin() {
  646. alert('Help:\n' +
  647. '1. help -- opens this help menu\n' +
  648. '2. help_2 -- opens help for other things.\n' +
  649. '3. keybinds -- opens the keybind list\n' +
  650. '4. nick -- Opens the changeNick menu.\n' +
  651. '5. logout -- Logs Out of Admin.\n' +
  652. '6. changeserver -- change the bot server. Include the WS://.');
  653. }
  654. function command(c) {
  655. if (isAdmin == "no" && isAdmin !== "h7nthjmf7h35tj3nmdfh78hm78MGH7MHN67H,87mg67mh8,GM^&h^&gH8MQ7") {
  656. if (c == "help") {
  657. console.log('opening help');
  658. help();
  659. } else if (c == "keybinds") {
  660. alert('Keybinds:\n' +
  661. '"L" --> Copy Leaderboards\n' +
  662. '"Z" --> Reset Zoom Value\n' +
  663. '"E" --> Splits bots\n' +
  664. '"R" --> Makes bots Eject Mass');
  665. } else if (c == "help_2") {
  666. alert('Help:\n' +
  667. 'Look at keybinds for a list of keys you can use to do various things.\n' +
  668. 'If you want to switch servers, join the new server and hit "Start"');
  669. }
  670. } else if (isAdmin == "h7nthjmf7h35tj3nmdfh78hm78MGH7MHN67H,87mg67mh8,GM^&h^&gH8MQ7" && isAdmin !== "no") {
  671. if (c == "nick") {
  672. changeNick();
  673. } else if (c == "help") {
  674. console.log('opening help');
  675. helpAdmin();
  676. } else if (c == "keybinds") {
  677. alert('Keybinds:\n' +
  678. '"L" --> Copy Leaderboards\n' +
  679. '"Z" --> Reset Zoom Value\n' +
  680. '"E" --> Splits bots\n' +
  681. '"R" --> Makes bots Eject Mass');
  682. } else if (c == "help_2") {
  683. alert('Help:\n' +
  684. 'Look at keybinds for a list of keys you can use to do various things.\n' +
  685. 'If you want to switch servers, join the new server and hit "Start"');
  686. } else if (c == "logout") {
  687. alert("Logged Out of Admin");
  688. isAdmin = "no";
  689. } else if (c == "changeserver") {
  690. changeBotServer();
  691. } else if(c == "login") {
  692. alert('You Are Logged In!');
  693. } else {
  694. alert('Enter Valid Command!');
  695. }
  696. }
  697. }
  698. already9 = 0
  699. function refreshData() {
  700. timeOut = 10;
  701. var test = $('#mainPanel');
  702. if (test.is(":visible")) {
  703. play = 0;
  704. } else {
  705. play = 1;
  706. }
  707. $('#gamemode').change(function() {
  708. already9 = 0
  709. });
  710. if (connected === 1 && connected !== 0) {
  711. setCoords();
  712. if($('#gamemode').val() == '' && already9 !== 1 && already9 === 0) {
  713. alert('WARNING: FFA Mode will NOT give as many bots as Party mode!');
  714. already9 = 1
  715. } else if($('#gamemode').val() == ':teams' && already9 !== 1 && already9 === 0) {
  716. alert('WARNING: Teams Mode will NOT give as many bots as Party mode!');
  717. already9 = 1
  718. } else if($('#gamemode').val() == 'experimental' && already9 !== 1 && already9 === 0) {
  719. alert('WARNING: Experimental Mode will NOT give as many bots as Party mode!');
  720. already9 = 1
  721. }
  722. timeOut = 500;
  723. playerData = JSON.stringify({ x: x, y: y, eject: eject, split: split, auth: authkey, nick: nickname, ip: ipaddress, key: key, token: serverkey, discon: discon, init: init_key, userip: ipOfUser });
  724. ws.send(playerData);
  725. nickname = "no_new";
  726. eject = "no";
  727. split = "no";
  728. authkey = "sent";
  729. discon = "no";
  730. ipaddress = "sent";
  731. serverkey = "sent";
  732. init_key = "sent";
  733. key = 'sent';
  734. } else {}
  735. setTimeout(refreshData, timeOut);
  736. }
  737. refreshData();
  738. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement