Advertisement
Guest User

DummyBots

a guest
Apr 21st, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.36 KB | None | 0 0
  1. // ==UserScript==
  2. // @name DummyBots
  3. // @namespace https://youtube.com/c/slxshergota/
  4. // @version 2.2
  5. // @description the best bots
  6. // @author Slxsher | Chrone
  7. // @match *.ac-clan.glitch.me/*
  8. // @match *.agar.bio/*
  9. // @match *.gota.io/*
  10. // @match *.mk-agario.glitch.me/*
  11. // @match *.cellcraft.io/*
  12. // @match *.army.ovh/web/*
  13. // @match *.targ.io/*
  14. // @match *.play.agario0.com/*
  15. // @match *.cellagar.ml/*
  16. // @match *.balz.io/*
  17. // @match *.ogar.be/*
  18. // @match *.agario.top/*
  19. // @match *.agocell.eu/*
  20. // @match *.agix.pw/*
  21. // @match *.biobots.tk/*
  22. // @match *.dummyclient.glitch.me/*
  23. // @match *.agar.red/*
  24. // @grant none
  25. // @run-at document-start
  26. // ==/UserScript==
  27.  
  28.  
  29. const observer = new MutationObserver(mutations => {
  30. mutations.forEach(({
  31. addedNodes
  32. }) => {
  33. addedNodes.forEach(node => {
  34. if (node.nodeType === 1 && node.tagName === 'SCRIPT') {
  35. const src = node.src || '';
  36. if (src.includes('assets/js/ext.js')) {
  37. node.src = '';
  38. window.playnow = () => {
  39. setNick(document.getElementById('nick').value);
  40. return false;
  41. }
  42. }
  43. if (src.includes('minimap.js') || node.innerHTML.toString().includes('cicklow_XcVCCW')) {
  44. node.type = 'javascript/blocked';
  45. node.parentElement.removeChild(node);
  46. }
  47. }
  48. });
  49. });
  50. });
  51. observer.observe(document.documentElement, {
  52. childList: true,
  53. subtree: true
  54. });
  55.  
  56. class User {
  57.  
  58. constructor() {
  59. this.wsIp = 'ws://dummybot1-rickard93.c9users.io:8081';
  60. this.started = false;
  61. this.mouseInt = -1;
  62. this.byteLen = 0;
  63. this.ws = null;
  64. this.connect();
  65. this.addUI();
  66. }
  67.  
  68. connect() {
  69. this.ws = new WebSocket(this.wsIp);
  70. this.ws.onmessage = this.onmessage.bind(this);
  71. this.ws.onerror = this.onerror.bind(this);
  72. this.ws.onclose = this.onclose.bind(this);
  73. this.ws.onopen = this.onopen.bind(this);
  74. }
  75.  
  76. onopen() {
  77. this.startMouseInt();
  78. this.started = false;
  79. }
  80.  
  81. startMouseInt() {
  82.  
  83. this.mouseInt = setInterval(() => {
  84.  
  85. let json = {};
  86.  
  87. json.type = "updatePos";
  88. json.x = this.x;
  89. json.y = this.y;
  90. json.byteLen = this.byteLen;
  91.  
  92. this.send(json);
  93.  
  94. }, 50);
  95.  
  96. }
  97.  
  98. sendChat(message) {
  99. let json = {};
  100.  
  101. json.type = "chat";
  102. json.msg = message;
  103.  
  104. this.send(json);
  105. }
  106.  
  107. onmessage(message) {
  108. message = JSON.parse(message.data);
  109.  
  110. switch (message.type) {
  111.  
  112. case 'botCount':
  113. document.getElementById('botCount').innerText = `${message.connected}/${message.maxBots}`;
  114. break;
  115.  
  116. }
  117. }
  118.  
  119. onclose() {
  120. setTimeout(this.connect(), 1500);
  121. clearInterval(this.mouseInt);
  122. }
  123.  
  124. startBots() {
  125. let json = {};
  126.  
  127. json.type = "start";
  128. json.ip = this.server;
  129.  
  130. this.send(json);
  131. }
  132.  
  133. stopBots() {
  134. this.send({
  135. type: 'stop'
  136. });
  137. }
  138.  
  139. addUI() {
  140. let ui = document.createElement('div');
  141. ui.id = 'botcanvas';
  142. ui.style['background'] = 'rgba(0,20,0)';
  143. ui.style['top'] = '50px';
  144. ui.style['left'] = '50px';
  145. ui.style['display'] = 'block';
  146. ui.style['position'] = 'absolute';
  147. ui.style['text-align'] = 'center';
  148. ui.style['font-size'] = '25px';
  149. ui.style['color'] = '#FF0000';
  150. ui.style['padding'] = '20px';
  151. ui.style['z-index'] = '1000000';
  152. ui.style['border-radius'] = '25px';
  153. ui.innerHTML += 'DummyBots.cf: ';
  154. let count = document.createElement('span');
  155. count.id = 'botCount';
  156. count.innerHTML = ':)';
  157. ui.appendChild(count);
  158. document.body.appendChild(ui);
  159. document.getElementById('botcanvas').onclick = () => {
  160. if (!this.started)
  161. this.startBots();
  162. else
  163. this.stopBots();
  164. this.started = !this.started;
  165. };
  166. }
  167.  
  168. onerror() {}
  169.  
  170. send(message) {
  171. if (this.ws && this.ws.readyState == 1) this.ws.send(JSON.stringify(message));
  172. }
  173.  
  174. get isTyping() {
  175. return document.querySelectorAll('input:focus').length;
  176. }
  177.  
  178. keyDown(event) {
  179. if (this.isTyping || !event.key) return;
  180. switch (event.key.toLowerCase()) {
  181.  
  182. case 'e':
  183. this.send({
  184. type: 'split'
  185. });
  186. break;
  187.  
  188. case 'r':
  189. this.send({
  190. type: 'eject'
  191. });
  192. break;
  193.  
  194. case 's':
  195. this.send({
  196. type: 'stop'
  197. });
  198. break;
  199.  
  200. case 'c':
  201. let msg = prompt('What do you want the bots spam?', 'Dummybots.cf is the best bots company');
  202. if (msg) this.sendChat(msg);
  203. break;
  204.  
  205. }
  206. }
  207.  
  208. }
  209.  
  210. window.addEventListener("load", () => {
  211. const client = new User();
  212. document.addEventListener('keydown', client.keyDown.bind(client));
  213.  
  214. WebSocket.prototype.realSend = WebSocket.prototype.send;
  215. WebSocket.prototype.send = function (pkt) {
  216. this.realSend(pkt);
  217. if (typeof pkt == 'string') return;
  218. if (this.url.includes('localhost')) return;
  219. if (pkt instanceof ArrayBuffer) pkt = new DataView(pkt);
  220. else if (pkt instanceof DataView) pkt = pkt;
  221. else pkt = new DataView(pkt.buffer);
  222. switch (pkt.getUint8(0, true)) {
  223. case 16:
  224. client.byteLen = pkt.byteLength;
  225.  
  226. switch (pkt.byteLength) {
  227. case 13:
  228. case 9:
  229. client.x = pkt.getInt32(1, true);
  230. client.y = pkt.getInt32(5, true);
  231. break;
  232. case 21:
  233. client.x = pkt.getFloat64(1, true);
  234. client.y = pkt.getFloat64(9, true);
  235. break;
  236. }
  237. break;
  238. }
  239. if (client.server !== this.url) {
  240. client.server = this.url;
  241. }
  242. };
  243. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement