Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.47 KB | None | 0 0
  1. var chrome = {
  2. load: function() {
  3. window.addEventListener("mousemove", function(e) {
  4. chrome.player.mouse.x = e.clientX;
  5. chrome.player.mouse.y = e.clientY;
  6. });
  7. window.addEventListener("keydown", chrome.player.capture_key_press);
  8. window.addEventListener("keyup", chrome.player.capture_key_press);
  9.  
  10. for (var x = 1; x < 50; x++) {
  11. chrome.units.blank.push(x);
  12. }
  13. },
  14. player: {
  15. last_key: "",
  16. capture_key_press(a) {
  17. chrome.player.last_key = a.key;
  18. if (game.chat.info.input.info.state == 0 && game.is_run == true) {
  19. if (chrome.macro[a.key] != undefined) {
  20. if (a.type == "keydown" && chrome.macro[a.key].down == false) {
  21. chrome.macro[a.key].down = true;
  22. chrome.macro[a.key].trigger();
  23. }
  24. if (a.type == "keyup" && chrome.macro[a.key].down == true) {
  25. chrome.macro[a.key].down = false;
  26. }
  27. }
  28. }
  29. },
  30. mouse: {
  31. x: 0,
  32. y: 0
  33. },
  34. scan: function(id) {
  35. //Returns all queen and oib data through data object
  36. let GameOibs = lapa28426mauve.lapa28388mauve;
  37. let queen = new Object();
  38. let oibs = new Array();
  39. let k = 0;
  40. for (k = 0; k < GameOibs.length; k++) {
  41. if (GameOibs[k] != undefined) {
  42. if (GameOibs[k].id == id) {
  43. if (GameOibs[k].queen == true) {
  44. queen = GameOibs[k];
  45. } else {
  46. oibs.push(GameOibs[k]);
  47. }
  48. }
  49. }
  50. }
  51. var data = {
  52. oibs: oibs,
  53. queen: queen
  54. }
  55. return data;
  56. },
  57. sendKey(charCode) {
  58. {
  59. var ev = new KeyboardEvent('keydown', {
  60. 'keyCode': charCode,
  61. 'which': charCode
  62. });
  63. window.dispatchEvent(ev);
  64. ev = new KeyboardEvent('keyup', {
  65. 'keyCode': charCode,
  66. 'which': charCode
  67. });
  68. window.dispatchEvent(ev);
  69. }
  70. }
  71. },
  72. math: {
  73. distance(x1, y1, x2, y2) {
  74. var a = x1 - x2;
  75. var b = y1 - y2;
  76. return Math.sqrt(a * a + b * b);
  77. }
  78. },
  79. units: {
  80. blank: [],
  81. move(x, y) {
  82. //Moves selected units to reletive map pos 0,0 = top left
  83. lapa28344mauve[_0xda98("0xd9")]({
  84. x: parseInt(x.toString(), 10),
  85. y: parseInt(y.toString(), 10)
  86. });
  87. },
  88. move_origin_queen(x, y) {
  89. queen = chrome.player.scan(player.id).queen;
  90. //Moves selected units to reletive queen pos 0,0 = queen center
  91. lapa28344mauve[_0xda98("0xd9")]({
  92. x: parseInt((x + queen.x + player.cam.rx).toString(), 10),
  93. y: parseInt((y + queen.y + player.cam.ry).toString(), 10)
  94. });
  95. },
  96. move_origin_mouse(x, y) {
  97. //Moves selected units to reletive mouse pos 0,0 = directly on mouse
  98. lapa28344mauve[_0xda98("0xd9")]({
  99. x: parseInt((x + chrome.player.mouse.x).toString(), 10),
  100. y: parseInt((y + chrome.player.mouse.y).toString(), 10)
  101. });
  102. }
  103. },
  104. macro: {
  105. }
  106. }
  107. chrome.load();
  108. var bots = new Array();
  109. var loop = setInterval(makebots, 500);
  110. var players = 0;
  111. var connecting = 0;
  112. var MousePos = new Object();
  113. window.addEventListener("mousemove", captureMousePos);
  114.  
  115. function captureMousePos(event) {
  116. MousePos.x = event.clientX;
  117. MousePos.y = event.clientY;
  118. }
  119.  
  120. function getplayercount() {
  121. players = 0;
  122. for (var a = 0; a < lapa28390mauve.length; a++) {
  123. if (lapa28390mauve[a].bot == false && lapa28390mauve[a].alive == true) {
  124. players++;
  125. }
  126. }
  127. }
  128.  
  129. function remove() {
  130. for (var i = 0; i < bots.length; i++) {
  131. if (bots[i].readyState != 1 && bots[bots.length - 1].opened == 1) {
  132. bots[i].close();
  133. connecting = 0;
  134. ring_slots[bots[i].ring_perma_pos] = 0;
  135. bots.splice(i, 1);
  136. }
  137. }
  138. }
  139.  
  140. var friend_id = [];
  141. var ring_slots = [];
  142. for(var a = 0; a < 30; a++){
  143. ring_slots.push(0);
  144. }
  145.  
  146.  
  147. function deathbybots() {
  148. /*for (var a = 0; a < lapa28390mauve.length; a++) {
  149. {
  150. if (lapa28390mauve[a].nickname.includes("Chromium")) {
  151. //friend_id.push({uuid:"leader",id:a);
  152. }
  153. }
  154. }*/
  155. if (players < 30 && connecting == 0) {
  156. connecting = 1;
  157. var b = ui.lapa28498mauve.info.choice;
  158. bots.push(new WebSocket("ws://" + lapa28344mauve.lapa28498mauve[b].i + ":" + lapa28344mauve.lapa28498mauve[b].p))
  159. bots[bots.length - 1].onopen = function() {
  160. var name = Math.floor(Math.random()*10000);
  161. bots[bots.length - 1].send(JSON.stringify([String(name), 1, 1, 1, 1, 1, lapa28362mauve.lapa28367mauve]));
  162. bots[bots.length - 1].opened = 1;
  163. bots[bots.length - 1].uuid = String(name);
  164. var index = ring_slots.indexOf(0)
  165. bots[bots.length -1].ring_perma_pos = index;
  166. ring_slots[index] = 1;
  167. connecting = 0;
  168. }
  169. }
  170. }
  171. var spawn = false;
  172. var regroup = false;
  173. var inc = 0;
  174. function makethemdoshit() {
  175. var queen = chrome.player.scan(player.id).queen;
  176. for (var i = 0; i < bots.length; i++) {
  177. if(spawn){
  178. bots[i].send(new Uint8Array([0]));
  179. }
  180. for (var a = 0; a < 50; a++) {
  181. if (a != 0) {
  182. if(spawn){
  183. bots[i].send(JSON.stringify([3, queen.x, queen.y, [a]]));
  184. }
  185. } else {
  186. bots[i].send(JSON.stringify([3, 400+i*150, 0, [a]]));
  187. inc+=.001;
  188. }
  189. }
  190. }
  191. }
  192. window.addEventListener('keypress', function(e) {
  193. if (game.chat.info.input.info.state == 0 && game.is_run == true) {
  194. if (e.key == "e") {
  195. spawn = true;
  196. }
  197. if (e.key == "q"){
  198. spawn = false;
  199. }
  200. if(e.key=="`"){
  201. regroup = true;
  202. }
  203. if(e.key =="-"){
  204. regroup = false;
  205. }
  206. }
  207.  
  208. });
  209. function makebots() {
  210. getplayercount();
  211. remove();
  212. deathbybots();
  213. makethemdoshit();
  214. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement