Greasy Fork is available in English.

Virgo Gaming Bots

SUBSCRIBE Virgo Gaming!

  1. // ==UserScript==
  2. // @name Virgo Gaming Bots
  3. // @namespace Virgo Gaming
  4. // @version 1.3
  5. // @description SUBSCRIBE Virgo Gaming!
  6. // @author Virgo Gaming Bots By Virgo GAMING
  7. // @match *.agar.red*
  8. // @require https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.5/socket.io.min.js
  9. // @grant none
  10. // @run-at document-start
  11. // ==/UserScript==
  12.  
  13. setTimeout(function() {
  14. window.__WebSocket = window.WebSocket;
  15. window.fakeWebSocket = function(){return {readyState: 0}};
  16. window._WebSocket = window.WebSocket = function(ip){return new window.fakeWebSocket(ip);};
  17. window.__botclonsData = {};
  18. window.__botclonsData.mx = 0;
  19. window.__botclonsData.my = 0;
  20. window.__botclonsData.socketaddr = null;
  21. window.addEventListener("load",function(){
  22. // код инжектинга
  23. if(!window.OldSocket)
  24. OldSocket = window.__WebSocket;
  25. window._WebSocket = window.WebSocket = window.fakeWebSocket = function(ip){
  26. var ws = new OldSocket(ip);
  27. ws.binaryType="arraybuffer"
  28. var fakeWS = {};
  29. for(var i in ws)
  30. fakeWS[i] = ws[i];
  31. fakeWS.send = function(){
  32. //console.log("перехватили передачу! " + arguments[0]);
  33. var msg = new DataView(arguments[0]);
  34. if(msg.byteLength==21){ // Most clones
  35. if(msg.getInt8(0, true) == 16){
  36. window.__botclonsData.mx = msg.getFloat64(1, true);
  37. window.__botclonsData.my = msg.getFloat64(9, true);
  38. window.__botclonsData.ml = msg.byteLength;
  39. }
  40. } else {
  41. if(msg.byteLength==13){ // Agar.re, agarioforums.io, (maybe) warlis.io
  42. if(msg.getUint8(0, true) == 16){
  43. window.__botclonsData.mx = msg.getInt32(1, true);
  44. window.__botclonsData.my = msg.getInt32(5, true);
  45. window.__botclonsData.ml = msg.byteLength;
  46. }else{
  47. if(msg.byteLength>4){ // gota.io
  48. if(msg.getUint8(0, true) == 16){
  49. window.__botclonsData.mx = msg.getInt16(1, true);
  50. window.__botclonsData.my = msg.getInt16(3, true);
  51. window.__botclonsData.ml = msg.byteLength;
  52. }
  53. }
  54. }
  55. }
  56. }
  57. return ws.send.apply(ws, arguments);
  58. };
  59. ws.onmessage = function(){
  60. //console.log("перехватили прием! " + arguments[0].data);
  61. fakeWS.onmessage && fakeWS.onmessage.apply(ws, arguments);
  62. };
  63. ws.onopen = function(){
  64. window.__botclonsData.socketaddr = ws.url;
  65. //console.log("перехватили подключение!");
  66. fakeWS.readyState = 1;
  67. fakeWS.onopen.apply(ws, arguments);
  68. };
  69. ws.onclose = function(){
  70. fakeWS.onclose.apply(ws, arguments);
  71. };
  72. return fakeWS;
  73. }
  74. })
  75. var real_minx = -7071;
  76. var real_miny = -7071;
  77. var real_maxx = 7071;
  78. var real_maxy = 7071;
  79. var lastsent = {
  80. minx: 0,
  81. miny: 0,
  82. maxx: 0,
  83. maxy: 0
  84. };
  85. alert("Don't Forget to Subscribe Virgo Gaming! | SUBSCRIBE Virgo Gaming |");
  86. function valcompare(Y, Z) {
  87. return 0.01 > Y - Z && -0.01 < Y - Z
  88. }
  89. var socket = io.connect('ws://127.0.0.1:8081');
  90. var canMove = true;
  91. var movetoMouse = true;
  92. var moveEvent = new Array(2);
  93. var canvas = document.getElementById("canvas");
  94. last_transmited_game_server = null;
  95. socket.on('force-login', function(data) {
  96. socket.emit("login", {
  97. "uuid": client_uuid,
  98. "type": "client"
  99. });
  100. transmit_game_server()
  101. });
  102. $( "#canvas" ).after( "<div style='background-color: #000000; -moz-opacity: 0.4; -khtml-opacity: 0.4; opacity: 0.4; filter: alpha(opacity=40); zoom: 1; width: 205px; top: 10px; left: 10px; display: block; position: absolute; text-align: center; font-size: 15px; color: #ffffff; padding: 5px; font-family: Ubuntu;'> <div style='color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><a>AH Clan Bots</a></div> <div style='color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><br>Bots: <a id=Minions' >Offline</a> </div> <div style='color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><br>Control Eith your mouse: <a id='isControsWithYourMouse' >On</a> </div> <div style='color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><br>Stop Movement: <a id='isStopMove' >Off</a> </div>" );
  103. socket.on('spawn-count', function(data) {
  104. document.getElementById('minionCount').innerHTML = data
  105. });
  106. var client_uuid = localStorage.getItem('client_uuid');
  107. if (client_uuid == null) {
  108. console.log("generating a uuid for this user");
  109. client_uuid = ""; var ranStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  110. for (var ii = 0; ii < 15; ii++) client_uuid += ranStr.charAt(Math.floor(Math.random() * ranStr.length));
  111. localStorage.setItem('client_uuid', client_uuid)
  112. }
  113. socket.emit("login", client_uuid);
  114. $("#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>');
  115.  
  116. function isMe(cell) {
  117. for (var i = 0; i < window.agar.myCells.length; i++) {
  118. if (window.agar.myCells[i] == cell.id) {
  119. return true
  120. }
  121. }
  122. return false
  123. }
  124.  
  125. function getCell() {
  126. var me = [];
  127. for (var key in window.agar.allCells) {
  128. var cell = window.agar.allCells[key];
  129. if (isMe(cell)) {
  130. me.push(cell)
  131. }
  132. }
  133. return me[0]
  134. }
  135. var skin_var = 0;
  136.  
  137. function emitPosition() {
  138. socket.emit("pos", {
  139. "x": window.__botclonsData.mx,
  140. "y": window.__botclonsData.my,
  141. "l": window.__botclonsData.ml,
  142. "dimensions": [-7071, -7071, 7071, 7071]
  143. })
  144. }
  145.  
  146. function emitSplit() {
  147. socket.emit("cmd", {
  148. "name": "split"
  149. })
  150. }
  151.  
  152. function emitMassEject() {
  153. socket.emit("cmd", {
  154. "name": "eject"
  155. })
  156. }
  157.  
  158. function toggleMovement() {
  159. canMove = !canMove;
  160. switch (canMove) {
  161. case true:
  162. canvas.onmousemove = moveEvent[0];
  163. moveEvent[0] = null;
  164. canvas.onmousedown = moveEvent[1];
  165. moveEvent[1] = null;
  166. break;
  167. case false:
  168. canvas.onmousemove({
  169. clientX: innerWidth / 2,
  170. clientY: innerHeight / 2
  171. });
  172. moveEvent[0] = canvas.onmousemove;
  173. canvas.onmousemove = null;
  174. moveEvent[1] = canvas.onmousedown;
  175. canvas.onmousedown = null;
  176. break
  177. }
  178. }
  179. interval_id = setInterval(function() {
  180. emitPosition()
  181. }, 100);
  182. interval_id2 = setInterval(function() {
  183. transmit_game_server_if_changed()
  184. }, 5000);
  185. document.addEventListener('keydown', function(e) {
  186. var key = e.keyCode || e.which;
  187. switch (key) {
  188. case 65:
  189. movetoMouse = !movetoMouse;
  190. if(movetoMouse) { document.getElementById('ismoveToMouse').innerHTML = "On"; } else { document.getElementById('ismoveToMouse').innerHTML = "Off"; }
  191. break;
  192. case 68:
  193. toggleMovement();
  194. if(!canMove) { document.getElementById('isStopMove').innerHTML = "On"; } else { document.getElementById('isStopMove').innerHTML = "Off"; }
  195. break;
  196. case 69:
  197. emitSplit();
  198. break;
  199. case 82:
  200. emitMassEject();
  201. break
  202. }
  203. });
  204.  
  205. function transmit_game_server_if_changed() {
  206. if (last_transmited_game_server != window.__botclonsData.socketaddr) {
  207. transmit_game_server()
  208. }
  209. }
  210.  
  211. function transmit_game_server() {
  212. last_transmited_game_server = window.__botclonsData.socketaddr;
  213. socket.emit("cmd", {
  214. "name": "connect_server",
  215. "ip": window.__botclonsData.socketaddr,
  216. "origin": location.origin
  217. })
  218. }
  219. var mouseX = 0;
  220. var mouseY = 0;
  221. $("body").mousemove(function(event) {
  222. mouseX = event.clientX;
  223. mouseY = event.clientY
  224. });
  225. }, 200)