CellBots V8 - Client For Agar.Bio And CellBots.io

Free Bots

  1. // ==UserScript==
  2. // @name CellBots V8 - Client For Agar.Bio And CellBots.io
  3. // @namespace Alfa!@!
  4. // @version 1.2
  5. // @description Free Bots
  6. // @author GV
  7. // @match *.agma.io/*
  8. // @match *.agarup.us/*
  9. // @match *.gaver.io/*
  10. // @match *.agar.bio/*
  11. // @match *.nbk.io/*
  12. // @match *.rata.io/*
  13. // @match *.cellcraft.io/*
  14. // @match *.gota.io/*
  15. // @match *.germs.io/*
  16. // @match *.galx.io/*
  17. // @match *.germs.io/*
  18. // @match *.happyfor.win/*
  19. // @match *.agarios.org/*
  20. // @match *.kralagario.com/*
  21. // @match *.agarmin.co.nf/*
  22. // @match *.gkclan.me/*
  23. // @require https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.5/socket.io.min.js
  24. // @grant none
  25. // @run-at document-start
  26. // ==/UserScript==
  27. /* jshint -W097 */
  28. ////http://grozavlogs.my-free.website By GrozaVlogs
  29. //Thx For Installed This Script // Don't Forget to Subscribe For FreeTzYT
  30. 'use strict';
  31.  
  32. //window.botServer='79.113.229.186:8081';
  33. //var script=document.createElement("script");
  34. //script.src="https://pastebin.com/raw/Cs53dBCx";
  35. //document.getElementsByTagName("head")[0].appendChild(script);
  36.  
  37. alert('CellBots.ML (CellBots customized by GrozaVlogs). Visit https://discord.gg/KeU3vkb for updates.');
  38. setTimeout(function() {
  39. window.sUkt327Dkhi = window.WebSocket;
  40. window.aRm3gK2Ogm = function(){return {readyState: 0}};
  41. window.AgK5fn9Lgau = window.WebSocket = function(ip){return new window.aRm3gK2Ogm(ip);};
  42. window.aYbm28lPgj43 = {};
  43. window.aYbm28lPgj43.mx = 0;
  44. window.aYbm28lPgj43.my = 0;
  45. window.aYbm28lPgj43.ml = 0;
  46. window.aYbm28lPgj43.ma = 0;
  47. window.aYbm28lPgj43.mb = 0;
  48. window.aYbm28lPgj43.wa = false;
  49. window.aYbm28lPgj43.sa = false;
  50. window.aYbm28lPgj43.w = null;
  51. window.aYbm28lPgj43.s = null;
  52. window.aYbm28lPgj43.aX = -1;
  53. window.aYbm28lPgj43.aY = -1;
  54. window.aYbm28lPgj43.p = 0;
  55. window.aYbm28lPgj43.q=false;
  56. window.aYbm28lPgj43.socketaddr = null;
  57. window.addEventListener("load",function(){
  58. // ??? ??????????
  59. if(!window.Sm4Kgj0gKrubG)
  60. Sm4Kgj0gKrubG = window.sUkt327Dkhi;
  61. window.AgK5fn9Lgau = window.WebSocket = window.aRm3gK2Ogm = function(ip){
  62. var ws = new Sm4Kgj0gKrubG(ip);
  63. ws.binaryType="arraybuffer"
  64. var fakeWS = {};
  65. for(var i in ws)
  66. fakeWS[i] = ws[i];
  67. fakeWS.send = function(){
  68. //console.log("??????????? ????????! " + arguments[0]);
  69. var msg = new DataView(arguments[0]);
  70. /*if((msg.byteLength>0)&&(msg.getUint8(0)!=16)){
  71. var f="";
  72. for(var i=0;i<msg.byteLength;i++){
  73. var a=msg.getUint8(i);
  74. f=f+a+" ";
  75. }
  76. console.log(f);
  77. }*/
  78. if(msg.byteLength==21){ // Most clones
  79. if(msg.getInt8(0, true) == 16){
  80. window.aYbm28lPgj43.mx = msg.getFloat64(1, true);
  81. window.aYbm28lPgj43.my = msg.getFloat64(9, true);
  82. window.aYbm28lPgj43.ml = msg.byteLength;
  83. }
  84. } else {
  85. if(msg.byteLength==13){ // gota.io, gota.io, gota.io
  86. if(msg.getUint8(0, true) == 16){
  87. window.aYbm28lPgj43.mx = msg.getInt32(1, true);
  88. window.aYbm28lPgj43.my = msg.getInt32(5, true);
  89. window.aYbm28lPgj43.ml = msg.byteLength;
  90. }else{
  91. if(msg.byteLength>4){ // gota.io
  92. if(msg.getUint8(0, true) == 16){
  93. window.aYbm28lPgj43.mx = msg.getInt16(1, true);
  94. window.aYbm28lPgj43.my = msg.getInt16(3, true);
  95. window.aYbm28lPgj43.ml = msg.byteLength;
  96. }
  97. }
  98. }
  99. }
  100. }
  101. return ws.send.apply(ws, arguments);
  102. };
  103. ws.onmessage = function(){
  104. //console.log("??????????? ?????! " + arguments[0].data);
  105. var msg = new DataView(arguments[0].data);
  106. if(msg.byteLength>16){ // Most clones
  107. if(msg.getUint8(0, true) == 64){
  108. window.aYbm28lPgj43.ma = msg.getFloat64(1, true);
  109. window.aYbm28lPgj43.mb = msg.getFloat64(9, true);
  110. }
  111. }
  112. fakeWS.onmessage && fakeWS.onmessage.apply(ws, arguments);
  113. };
  114. ws.onopen = function(){
  115. window.aYbm28lPgj43.socketaddr = ws.url;
  116. //console.log("??????????? ???????????!");
  117. fakeWS.readyState = 1;
  118. fakeWS.onopen.apply(ws, arguments);
  119. };
  120. ws.onclose = function(){
  121. fakeWS.onclose.apply(ws, arguments);
  122. };
  123. return fakeWS;
  124. }
  125. if(location.origin=="http://gota.io"||location.origin=="http://gota.io")connect("");
  126. })
  127. var real_minx = -7071;
  128. var real_miny = -7071;
  129. var real_maxx = 7071;
  130. var real_maxy = 7071;
  131. var lastsent = {
  132. minx: 0,
  133. miny: 0,
  134. maxx: 0,
  135. maxy: 0
  136. };
  137.  
  138. function valcompare(Y, Z) {
  139. return 0.01 > Y - Z && -0.01 < Y - Z
  140. }
  141. if(window.botServer) {//Olaf4Snow customization. Added window.botServer line.
  142. var socket = io.connect('ws://' + window.botServer);
  143. } else {
  144. var socket = io.connect('ws://cellbots.ddns.net:8081');
  145. }
  146. var canMove = true;
  147. var movetoMouse = true;
  148. var moveEvent = new Array(2);
  149. var canvas = document.getElementById("canvas");
  150. last_transmited_game_server = null;
  151. socket.on('force-login', function(data) {
  152. socket.emit("login", {
  153. "uuid": "cellbots",
  154. "type": "client"
  155. });
  156. transmit_game_server()
  157. });
  158. $( "#overlays" ).after( "<div style='z-index: 10000000; border-radius: 20px;position: fixed; top: 3px; right: 800px; text-align: center; width: 200px; background-color: #b8ff0173; opacity: 0.9; padding: 1px;'> <div style='border-radius: 25px; text-indent:0; border:3px solid #fff; display:inline-block; color:#000; font-family:arial; font-size:15px; font-weight:bold; font-style:normal; height:30px; -webkit-box-shadow: 0px 0px 52px -6px rgba(46,204,113,1); -moz-box-shadow: 0px 0px 52px -6px rgba(46,204,113,1); box-shadow: 0px 0px 52px -6px rgb(202, 202, 202); line-height:1.5em; text-decoration:none; text-align:center; width: 190px; color: #fff;'>CellBots.ML V8</div><br><br> <a style='color: #fff; font-family: arial;'>Bots: </a><a style='color: #fff; font-family: arial;' id='minionCount'></a><br> <a style='color: #fff; font-family: arial;'>X/Y: </a><a style='color: #fff; font-family: arial;'id='gh45nmvsy'>0,0</a><br><br><a style='color: #fff; font-family: arial;'>E - Split Bots</a><br><a style='color: #fff; font-family: arial;'>R - Bots Feed </a> </div>" );
  159. socket.on('spawn-count', function(data) {
  160. document.getElementById('minionCount').innerHTML = '<div style="display: inline;"><span id="botlayer-bots" class="label label-info pull-right">' + data + '</span></a></div>';
  161. });
  162. var client_uuid = localStorage.getItem('client_uuid');
  163. if (client_uuid == null) {
  164. console.log("generating a uuid for this user");
  165. client_uuid = ""; var ranStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  166. for (var ii = 0; ii < 1; ii++) client_uuid += ranStr.charAt(Math.floor(Math.random() * ranStr.length));
  167. localStorage.setItem('client_uuid', client_uuid)
  168. }
  169. socket.emit("login", client_uuid);
  170. $("#instructions").replaceWith('<br><div class="input-group"><span class="input-group-addon" id="basic-addon1">UUID</span><input type="text" value="' + client_uuid + '" readonly class="form-control"</div>');
  171.  
  172. function isMe(cell) {
  173. for (var i = 0; i < window.agar.myCells.length; i++) {
  174. if (window.agar.myCells[i] == cell.id) {
  175. return true
  176. }
  177. }
  178. return false
  179. }
  180.  
  181. function getCell() {
  182. var me = [];
  183. for (var key in window.agar.allCells) {
  184. var cell = window.agar.allCells[key];
  185. if (isMe(cell)) {
  186. me.push(cell)
  187. }
  188. }
  189. return me[0]
  190. }
  191. var skin_var = 0;
  192.  
  193. function emitPosition() {
  194. console.log(client_uuid);
  195. socket.emit("pos", {
  196. "x": window.aYbm28lPgj43.mx-window.aYbm28lPgj43.ma,
  197. "y": window.aYbm28lPgj43.my-window.aYbm28lPgj43.mb,
  198. "l": window.aYbm28lPgj43.ml,
  199. "p": window.aYbm28lPgj43.p,
  200. "c": window.aYbm28lPgj43.q
  201. })
  202. document.getElementById('gh45nmvsy').innerHTML=(~~(window.aYbm28lPgj43.mx-window.aYbm28lPgj43.ma))+","+(~~(window.aYbm28lPgj43.my-window.aYbm28lPgj43.mb));
  203. }
  204.  
  205. function toggleMovement() {
  206. canMove = !canMove;
  207. switch (canMove) {
  208. case true:
  209. canvas.onmousemove = moveEvent[0];
  210. moveEvent[0] = null;
  211. canvas.onmousedown = moveEvent[1];
  212. moveEvent[1] = null;
  213. break;
  214. case false:
  215. canvas.onmousemove({
  216. clientX: innerWidth / 2,
  217. clientY: innerHeight / 2
  218. });
  219. moveEvent[0] = canvas.onmousemove;
  220. canvas.onmousemove = null;
  221. moveEvent[1] = canvas.onmousedown;
  222. canvas.onmousedown = null;
  223. break
  224. }
  225. }
  226. interval_id = setInterval(function() {
  227. emitPosition()
  228. }, 100);
  229. interval_id2 = setInterval(function() {
  230. transmit_game_server_if_changed()
  231. }, 5000);
  232. document.addEventListener('keydown', function(e) {
  233. var key = e.keyCode || e.which;
  234. switch (key) {
  235. case 16:
  236. if(!window.aYbm28lPgj43.sa){
  237. window.aYbm28lPgj43.sa=true;
  238. window.aYbm28lPgj43.s = setInterval(function() {
  239. $("body").trigger($.Event("keydown", { keyCode: 32}));
  240. $("body").trigger($.Event("keyup", { keyCode: 32}));
  241. }, 10);
  242. }
  243. break;
  244. case 87:
  245. if(!window.aYbm28lPgj43.wa){
  246. window.aYbm28lPgj43.wa=true;
  247. window.aYbm28lPgj43.w = setInterval(function() {
  248. $("body").trigger($.Event("keydown", { keyCode: 87}));
  249. $("body").trigger($.Event("keyup", { keyCode: 87}));
  250. }, 10);
  251. }
  252. break;
  253. case 65:
  254. window.aYbm28lPgj43.p--;
  255. document.getElementById('ismoveToMouse').innerHTML = window.aYbm28lPgj43.p;
  256. break;
  257. case 67:
  258. window.aYbm28lPgj43.q=!window.aYbm28lPgj43.q;
  259. if(window.aYbm28lPgj43.q) { document.getElementById('dfdghehfj').innerHTML = "On"; } else { document.getElementById('dfdghehfj').innerHTML = "Off"; }
  260. break;
  261. case 69://Olaf4Snow customization. Was 69 ("E"). 88 for X
  262. socket.emit("cmd", {
  263. "name": "split"
  264. })
  265. break;
  266. case 82:
  267. socket.emit("cmd", {
  268. "name": "eject"
  269. })
  270. break;
  271. case 80:
  272. window.aYbm28lPgj43.p++;
  273. document.getElementById('ismoveToMouse').innerHTML = window.aYbm28lPgj43.p;
  274. break
  275. }
  276. });
  277. document.addEventListener('keyup', function(e) {
  278. var key = e.keyCode || e.which;
  279. console.log(key);
  280. switch (key) {
  281. case 87:
  282. clearInterval(window.aYbm28lPgj43.w);
  283. window.aYbm28lPgj43.wa=false;
  284. break;
  285. case 16:
  286. clearInterval(window.aYbm28lPgj43.s);
  287. window.aYbm28lPgj43.sa=false;
  288. break;
  289. }
  290. });
  291.  
  292. function transmit_game_server_if_changed() {
  293. if (last_transmited_game_server != window.aYbm28lPgj43.socketaddr) {
  294. transmit_game_server()
  295. }
  296. }
  297.  
  298. function transmit_game_server() {
  299. last_transmited_game_server = window.aYbm28lPgj43.socketaddr;
  300. socket.emit("cmd", {
  301. "name": "connect_server",
  302. "ip": window.aYbm28lPgj43.socketaddr,
  303. "origin": location.origin
  304. })
  305. }
  306. var mouseX = 0;
  307. var mouseY = 0;
  308. $("body").mousemove(function(event) {
  309. mouseX = event.clientX;
  310. mouseY = event.clientY
  311. });
  312. }, 200)