Advertisement
JOOTAA

Untitled

Dec 11th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.72 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Agar Clone Smasher
  3. // @namespace https://CloneSmasher.ml
  4. // @version 1
  5. // @description Best agar clone bots for free!
  6. // @author Sh0T
  7. // @match *.cellcraft.io/*
  8. // @match *.prosplit.io/*
  9. // @match *.agario0.com/*
  10. // @match *.astr.io/*
  11. // @match *.cell.sh/*
  12. // @match *.agariomachos.com/*
  13. // @match *.wreckit.io/*
  14. // @match *.abs0rb.me/*
  15. // @match *.agariohub.net/client/*
  16. // @match *.agarmin.co.nf/*
  17. // @match *.agario.se/*
  18. // @match *.agar.io/*
  19. // @match *.agar.pro/play/*
  20. // @match *.ogar.be/*
  21. // @match *.agar.red/*
  22. // @match *.germs.io/*
  23. // @match *.nbkio.com/
  24. // @match *.togarcell.gq/web/*
  25. // @grant none
  26. // ==/UserScript==
  27. window.botConfig = {
  28. botSplit: 'x', // change e to any key you want!
  29. botFeed: 'c', // change r to any key you want!
  30. botStart: 'z', // change = to any key you want!
  31. botServer: 'localhost' // keep it as localhost unless you are using vps! //bots-jhorvin2001.c9users.io
  32. };
  33. window.agarServer = 'none';
  34. window.started = false;
  35. window.pelletMode = false;
  36. window._ws = null;
  37. (function() {
  38. 'use strict';
  39. function bufToArray(buf) {
  40. var ab = [];
  41. for (var i = 0; i < buf.byteLength; i++) {
  42. ab.push(buf.getUint8(i, true));
  43. }
  44. return ab;
  45. }
  46. function toArrayBuffer(buf) {
  47. var ab = new ArrayBuffer(buf.length);
  48. var view = new Uint8Array(ab);
  49. for (var i = 0; i < buf.length; ++i) {
  50. view[i] = buf[i];
  51. }
  52. return ab;
  53. }
  54. connect();
  55. function connect() {
  56. window._ws = new WebSocket('ws://' + window.botConfig.botServer + ':8080?origin=' + location.origin + '&token=' + Math.floor(Math.random() * 100000));
  57. window._ws.binaryType = 'arraybuffer';
  58. window._ws.onclose = onclose;
  59. window._ws.onopen = onopen;
  60. window._ws._send = window._ws.send;
  61. window._ws.send = send;
  62. console.log('Connecting!');
  63. }
  64. function onopen() {
  65. console.log('Connected!');
  66. let buf = new DataView(new ArrayBuffer(1 + 2 * window.agarServer.length));
  67. let offset = 0;
  68. buf.setUint8(offset++, 3);
  69. for (let i = 0; i < window.agarServer.length; i++) {
  70. buf.setUint16(offset, window.agarServer.charCodeAt(i), true);
  71. offset += 2;
  72. }
  73. window._ws.send(buf);
  74. }
  75. function send(e) {
  76. if (window._ws.readyState === window._ws.OPEN) window._ws._send(e);
  77. }
  78. function onclose(e) {
  79. //console.log(e.reason);
  80. if (e.reason !== 'FULL')
  81. connect();
  82. else
  83. alert('Agar Clone Smasher server is currently full!');
  84. }
  85. WebSocket.prototype.realSend = WebSocket.prototype.send;
  86. WebSocket.prototype.send = function(pkt) {
  87. this.realSend(pkt);
  88. if (this.url.indexOf(window.botConfig.botServer) !== -1) return;
  89. if (pkt instanceof ArrayBuffer) pkt = new DataView(pkt);
  90. else if (pkt instanceof DataView) pkt = pkt;
  91. else pkt = new DataView(toArrayBuffer(pkt));
  92. switch (pkt.getUint8(0, true)) {
  93. case 16:
  94. window._ws.send(pkt);
  95. break;
  96. case 254:
  97. window.pkt254 = bufToArray(pkt);
  98. var buf = new DataView(new ArrayBuffer(1 + pkt.byteLength));
  99. buf.setUint8(0, 254);
  100. buf.setUint8(1, pkt.getUint8(0));
  101. for (var i = 0; i < pkt.byteLength; i++) {
  102. buf.setUint8(i + 1, pkt.getUint8(i));
  103. }
  104. window._ws.send(buf);
  105. break;
  106. case 255:
  107. window.pkt255 = bufToArray(pkt);
  108. buf = new DataView(new ArrayBuffer(1 + pkt.byteLength));
  109. buf.setUint8(0, 255);
  110. buf.setUint8(1, pkt.getUint8(0));
  111. for (var i = 0; i < pkt.byteLength; i++) {
  112. buf.setUint8(i + 1, pkt.getUint8(i));
  113. }
  114. window._ws.send(buf);
  115. break;
  116. }
  117. };
  118. var _WebSocket = WebSocket;
  119. WebSocket = function(ip) {
  120. if (ip.indexOf(window.botConfig.botServer) == -1) {
  121. window.agarServer = ip;
  122. let buf = new DataView(new ArrayBuffer(1 + 2 * ip.length));
  123. let offset = 0;
  124. buf.setUint8(offset++, 3);
  125. for (let i = 0; i < ip.length; i++) {
  126. buf.setUint16(offset, ip.charCodeAt(i), true);
  127. offset += 2;
  128. }
  129. window._ws.send(buf);
  130. return new _WebSocket(ip);
  131. } else
  132. return new _WebSocket(ip);
  133. };
  134. function isTyping() {
  135. return $("input:focus").length;
  136. }
  137. document.addEventListener('keyup', key => {
  138. key = key.key.toLowerCase();
  139. if (isTyping()) return;
  140. switch (key) {
  141. case window.botConfig.botStart.toLowerCase():
  142. if (window.started)
  143. window._ws.send(new Uint8Array([1]));
  144. else
  145. window._ws.send(new Uint8Array([0]));
  146. window.started = !window.started;
  147. break;
  148. }
  149. });
  150. document.addEventListener('keydown', key => {
  151. key = key.key.toLowerCase();
  152. if (isTyping()) return;
  153. switch (key) {
  154. case window.botConfig.botSplit.toLowerCase():
  155. window._ws.send(new Uint8Array([2, 0]));
  156. break;
  157. case window.botConfig.botFeed.toLowerCase():
  158. window._ws.send(new Uint8Array([2, 1]));
  159. break;
  160. }
  161. });
  162. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement