Advertisement
GODLIKE5

GLSG Bot 1

Mar 26th, 2016
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.25 KB | None | 0 0
  1. window.onload = function() {
  2. var ctx = document.getElementById("canvas").getContext("2d");
  3. window.agar.simpleCellDraw = true;
  4. //CSS Override, removing this will make the extension unuseable.
  5. $("h2").replaceWith('<h2><b>GLSG Bots</b></h2>'); //TITLE <----
  6. $(".agario-panel").css({'background-color': 'black'}); //MAIN PANEL COLOR <--
  7. $(".agario-panel").css({'color': 'white'});
  8. $("#user-id-tag, #version-tag").css({'color': '#222'});
  9. $("#user-id-tag, #version-tag").css({'height': '0px'});
  10. $("#user-id-tag, #version-tag").css({'width': '0px'});
  11. $(".text-muted").css({'color': '#222'});
  12. $(".text-muted").css({'height': '0px'});
  13. $(".text-muted").css({'width': '0px'});
  14. $(".form-control").css({'background-color': '#333'});
  15. $(".form-control").css({'color': 'white'});
  16. //zoom
  17. window.agar.minScale = -30;
  18.  
  19.  
  20. //draws grid, true = yes, and false = no
  21.  
  22.  
  23. window.agar.drawGrid = false;
  24. //sets dark theme to true on extension load
  25. setDarkTheme(true);
  26. //sets show mass to true on extension load
  27. setShowMass(true);
  28.  
  29. window.agar.hooks.drawCellMass = function(cell, old_draw) {
  30. if(cell.size > 20) return cell;
  31. };
  32. window.agar.hooks.cellColor = function(cell, old_color) {
  33. if(cell.size < 20) return "#3612a3"; //PELLET COLOR <-----
  34. if (cell.isVirus) {
  35. return "rgba(68, 68, 68,0.6)"; }
  36. return false;
  37.  
  38. };
  39.  
  40. //You can just delete the return 50 if you dont like the size
  41. window.agar.hooks.cellMassTextScale = function(cell, old_scale) {
  42. return 50; //number here
  43. };
  44.  
  45. //Boat Is a Fudging hoe xD
  46. setTimeout(function() {
  47. var f = -7071;
  48. var g = -7071;
  49. var h = 7071;
  50. var j = 7071;
  51. var k = {
  52. minx: 0,
  53. miny: 0,
  54. maxx: 0,
  55. maxy: 0
  56. };
  57.  
  58. function isMe(a) {
  59. for (var i = 0; i < window.agar.myCells.length; i++) {
  60. if (window.agar.myCells[i] == a.id) {
  61. return true;
  62. }
  63. }
  64. return false;
  65. }
  66.  
  67. function getCell() {
  68. var a = [];
  69. for (var b in window.agar.allCells) {
  70. var c = window.agar.allCells[b];
  71. if (isMe(c)) {
  72. a.push(c);
  73. }
  74. }
  75. return a[0];
  76. }
  77. var r = 0;
  78.  
  79. function toggleMovement() {
  80. m = !m;
  81. switch (m) {
  82. case true:
  83. p.onmousemove = o[0];
  84. o[0] = null;
  85. p.onmousedown = o[1];
  86. o[1] = null;
  87. break;
  88. case false:
  89. p.onmousemove({
  90. clientX: innerWidth / 2,
  91. clientY: innerHeight / 2
  92. });
  93. o[0] = p.onmousemove;
  94. p.onmousemove = null;
  95. o[1] = p.onmousedown;
  96. p.onmousedown = null;
  97. break;
  98. }
  99. }
  100. interval_id = setInterval(function() {
  101. emitPosition();
  102. }, 1);
  103. interval_id2 = setInterval(function() {
  104. transmit_game_server_if_changed();
  105. }, 1);
  106. document.addEventListener('keydown', function(e) {
  107. var a = e.keyCode || e.which;
  108. switch (a) {
  109. case 68:
  110. toggleMovement();
  111. break;
  112. }
  113. });
  114.  
  115. function transmit_game_server_if_changed() {
  116. if (last_transmited_game_server != window.agar.ws) {
  117. transmit_game_server();
  118. }
  119. }
  120.  
  121. function transmit_game_server() {
  122. last_transmited_game_server = window.agar.ws;
  123. l.emit("cmd", {
  124. "name": "connect_server",
  125. "ip": last_transmited_game_server
  126. });
  127. }
  128. var s = 0;
  129. var t = 0;
  130. $("body").mousemove(function(a) {
  131. s = a.clientX;
  132. t = a.clientY;
  133. });
  134. window.agar.minScale = -30;
  135. }, 200);
  136. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement