Advertisement
Guest User

Untitled

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