Advertisement
Guest User

fsdafdsa

a guest
Sep 1st, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.67 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Polar's Minions
  3. // @namespace PolarsBots.Tk
  4. // @version 1.0
  5. // @description New & Improved FULL CREDITS TO: G
  6. // @author Orad
  7. // @match *.agariofun.com/*
  8. // @match *.cellcraft.io/*
  9. // @match *.agar.io/*
  10. // @match *.agar.pro/*
  11. // @match *.agarabi.com/*
  12. // @match *.warball.co/*
  13. // @match *.agariom.net/*
  14. // @match *.agar.re/*
  15. // @match *.agarpx.com/*
  16. // @match *.easyagario.com/*
  17. // @match *.playagario.org/*
  18. // @match *.agariofr.com/*
  19. // @match *.agario.xyz/*
  20. // @match *.agarios.org/*
  21. // @match *.agariowun.com/*
  22. // @match *.usagar.com/*
  23. // @match *.agarioplay.com/*
  24. // @match *.privateagario.net/*
  25. // @match *.agariorage.com/*
  26. // @match *.blong.io/*
  27. // @match *.agar.blue/*
  28. // @match *.agar.bio/*
  29. // @match *.agario.se/*
  30. // @match *.nbkio.com/*
  31. // @match *.agariohit.com/*
  32. // @match *.agariomultiplayer.com/*
  33. // @match *.agariogameplay.com/*
  34. // @match *.agariowow.com/*
  35. // @match *.bestagario.net/*
  36. // @match *.tytio.com/*
  37. // @match *.kralagario.com/*
  38. // @match *.agario.zafer2.com/*
  39. // @match *.agarprivateserver.net/*
  40. // @match *.agarca.com/*
  41. // @match *.agarioplay.mobi/*
  42. // @match *.agario.mobi*
  43. // @match *.abs0rb.me/*
  44. // @match *.agario.us/*
  45. // @match *.agariojoy.com/*
  46. // @match *.agario.ch/*
  47. // @match *.ioagar.us/*
  48. // @match *.play.agario0.com/*
  49. // @match *.agario.run/*
  50. // @match *.agarpvp.us/*
  51. // @match *.agario.pw/*
  52. // @match *.ogario.net/*
  53. // @match *.ogario.net/*
  54. // @match *.nbk.io/*
  55. // @match *.agario.info/*
  56. // @match *.inciagario.com/*
  57. // @match *.agar.io.biz.tr/*
  58. // @match *.agariown.com/*
  59. // @match *.agario.dk/*
  60. // @match *.agario.lol/*
  61. // @match *.agario.gen.tr/*
  62. // @match *.agarioprivateserver.us/*
  63. // @match *.agariot.com/*
  64. // @match *.agarw.com/*
  65. // @match *.agario.city/*
  66. // @match *.agario.ovh/*
  67. // @match *.feedy.io/*
  68. // @match *.agar.zircon.at/*
  69. // @require https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.5/socket.io.min.js
  70. // @grant none
  71. // @run-at document-start
  72. // ==/UserScript==
  73.  
  74. setTimeout(function() {
  75. window.__WebSocket = window.WebSocket;
  76. window._WebSocket = window.WebSocket = function(){return {};};
  77. window.__botclonsData = {};
  78. window.__botclonsData.mx = 0;
  79. window.__botclonsData.my = 0;
  80. window.__botclonsData.ml = 0;
  81. window.__botclonsData.socketaddr = null;
  82. window.onload = function(){
  83. // код инжектинга
  84. if(!window.OldSocket)
  85. OldSocket = window.__WebSocket;
  86. _WebSocket = WebSocket = function(ip){
  87. var ws = new OldSocket(ip);
  88. ws.binaryType="arraybuffer"
  89. var fakeWS = {};
  90. for(var i in ws)
  91. fakeWS[i] = ws[i];
  92. fakeWS.send = function(){
  93. //console.log("перехватили передачу! " + arguments[0]);
  94. var msg = new DataView(arguments[0]);
  95. if(msg.byteLength==21){ // Most clones
  96. if(msg.getInt8(0, true) == 16){
  97. window.__botclonsData.mx = msg.getFloat64(1, true);
  98. window.__botclonsData.my = msg.getFloat64(9, true);
  99. window.__botclonsData.ml = msg.byteLength;
  100. }
  101. } else {
  102. if(msg.byteLength==13){ // Agar.re, agarioforums.io, (maybe) warlis.io
  103. if(msg.getUint8(0, true) == 16){
  104. window.__botclonsData.mx = msg.getInt32(1, true);
  105. window.__botclonsData.my = msg.getInt32(5, true);
  106. window.__botclonsData.ml = msg.byteLength;
  107. }else{
  108. if(msg.byteLength>4){ // gota.io
  109. if(msg.getUint8(0, true) == 16){
  110. window.__botclonsData.mx = msg.getInt16(1, true);
  111. window.__botclonsData.my = msg.getInt16(3, true);
  112. window.__botclonsData.ml = msg.byteLength;
  113. }
  114. }
  115. }
  116. }
  117. }
  118. return ws.send.apply(ws, arguments);
  119. };
  120. ws.onmessage = function(){
  121. //console.log("перехватили прием! " + arguments[0].data);
  122. fakeWS.onmessage && fakeWS.onmessage.apply(ws, arguments);
  123. };
  124. ws.onopen = function(){
  125. window.__botclonsData.socketaddr = ws.url;
  126. //console.log("перехватили подключение!");
  127. fakeWS.readyState = 1;
  128. fakeWS.onopen.apply(ws, arguments);
  129. };
  130. ws.onclose = function(){
  131. fakeWS.onclose.apply(ws, arguments);
  132. };
  133. return fakeWS;
  134. }
  135. }
  136. var real_minx = -7071;
  137. var real_miny = -7071;
  138. var real_maxx = 7071;
  139. var real_maxy = 7071;
  140. var lastsent = {
  141. minx: 0,
  142. miny: 0,
  143. maxx: 0,
  144. maxy: 0
  145. };
  146.  
  147. function valcompare(Y, Z) {
  148. return 0.01 > Y - Z && -0.01 < Y - Z
  149. }
  150. var socket = io.connect('ws://www.polarbotv7-ohpolarv7.c9users.io:8081');
  151. var canMove = true;
  152. var movetoMouse = true;
  153. var moveEvent = new Array(2);
  154. var canvas = document.getElementById("canvas");
  155. last_transmited_game_server = null;
  156. socket.on('force-login', function(data) {
  157. socket.emit("login", {
  158. "uuid": client_uuid,
  159. "type": "client"
  160. });
  161. transmit_game_server()
  162. });
  163.  
  164. $( "#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:#FB694A; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><a>Polar's Minions</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='minionCount' >Online</a> </div> <div style='color:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><br>Move To Mouse: <a id='ismoveToMouse' >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>" );
  165. socket.on('spawn-count', function(data) {
  166. document.getElementById('minionCount').innerHTML = data
  167. });
  168. var client_uuid = localStorage.getItem('client_uuid');
  169. if (client_uuid == null) {
  170. console.log("generating a uuid for this user");
  171. client_uuid = ""; var ranStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  172. for (var ii = 0; ii < 15; ii++) client_uuid += ranStr.charAt(Math.floor(Math.random() * ranStr.length));
  173. localStorage.setItem('client_uuid', client_uuid)
  174. }
  175. socket.emit("login", client_uuid);
  176. $("#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>');
  177.  
  178. function isMe(cell) {
  179. for (var i = 0; i < window.agar.myCells.length; i++) {
  180. if (window.agar.myCells[i] == cell.id) {
  181. return true
  182. }
  183. }
  184. return false
  185. }
  186.  
  187. function getCell() {
  188. var me = [];
  189. for (var key in window.agar.allCells) {
  190. var cell = window.agar.allCells[key];
  191. if (isMe(cell)) {
  192. me.push(cell)
  193. }
  194. }
  195. return me[0]
  196. }
  197. var skin_var = 0;
  198.  
  199. function emitPosition() {
  200. socket.emit("pos", {
  201. "x": window.__botclonsData.mx,
  202. "y": window.__botclonsData.my,
  203. "l": window.__botclonsData.ml,
  204. "dimensions": [-7071, -7071, 7071, 7071]
  205. })
  206. }
  207.  
  208.  
  209. function emitSplit() {
  210. socket.emit("cmd", {
  211. "name": "split"
  212. })
  213. }
  214.  
  215. function emitMassEject() {
  216. socket.emit("cmd", {
  217. "name": "eject"
  218. })
  219. }
  220.  
  221. function toggleMovement() {
  222. canMove = !canMove;
  223. switch (canMove) {
  224. case true:
  225. canvas.onmousemove = moveEvent[0];
  226. moveEvent[0] = null;
  227. canvas.onmousedown = moveEvent[1];
  228. moveEvent[1] = null;
  229. break;
  230. case false:
  231. canvas.onmousemove({
  232. clientX: innerWidth / 2,
  233. clientY: innerHeight / 2
  234. });
  235. moveEvent[0] = canvas.onmousemove;
  236. canvas.onmousemove = null;
  237. moveEvent[1] = canvas.onmousedown;
  238. canvas.onmousedown = null;
  239. break
  240. }
  241. }
  242. interval_id = setInterval(function() {
  243. emitPosition()
  244. }, 100);
  245. interval_id2 = setInterval(function() {
  246. transmit_game_server_if_changed()
  247. }, 5000);
  248. document.addEventListener('keydown', function(e) {
  249. var key = e.keyCode || e.which;
  250. switch (key) {
  251. case 65:
  252. movetoMouse = !movetoMouse;
  253. if(movetoMouse) { document.getElementById('ismoveToMouse').innerHTML = "On"; } else { document.getElementById('ismoveToMouse').innerHTML = "Off"; }
  254. break;
  255. case 68:
  256. toggleMovement();
  257. if(!canMove) { document.getElementById('isStopMove').innerHTML = "On"; } else { document.getElementById('isStopMove').innerHTML = "Off"; }
  258. break;
  259. case 69:
  260. emitSplit();
  261. break;
  262. case 82:
  263. emitMassEject();
  264. break
  265. }
  266. });
  267.  
  268. function transmit_game_server_if_changed() {
  269. if (last_transmited_game_server != window.__botclonsData.socketaddr) {
  270. transmit_game_server()
  271. }
  272. }
  273.  
  274. function transmit_game_server() {
  275. last_transmited_game_server = window.__botclonsData.socketaddr;
  276. socket.emit("cmd", {
  277. "name": "connect_server",
  278. "ip": window.__botclonsData.socketaddr,
  279. "origin": location.origin
  280. })
  281. }
  282. var mouseX = 0;
  283. var mouseY = 0;
  284. $("body").mousemove(function(event) {
  285. mouseX = event.clientX;
  286. mouseY = event.clientY
  287. });
  288. }, 100);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement