Advertisement
ImNotSpam

Untitled

Jan 3rd, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.08 KB | None | 0 0
  1. // ==UserScript==
  2. // @name T12121
  3. // @namespace 12121
  4. // @version 1.0
  5. // @description SIKA & Agariba & MOD3 & Pixel
  6. // @author TFG-Team.TK
  7. // @match *.agarix.esy.es/*
  8. // @match *.dual-agar.online/*
  9. // @match *.mgar.io/*
  10. // @match http://3rb.be/
  11. // @match http://agariowow.com/*
  12. // @match http://agariohere.com/*
  13. // @match http://agar.gr.sa/ // not working
  14. // @match http://www.agarp.me/* // not working
  15. // @match http://www.agariot.com/
  16. // @match http://agar.pro/ // not working
  17. // @match http://en.agar.bio/
  18. // @match http://gota.io/web/
  19. // @match http://cellcraft.io/
  20. // @match CellCraft.io
  21. // @require https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.5/socket.io.min.js
  22. // @grant none
  23. // @run-at document-start
  24. // ==/UserScript==
  25.  
  26. setTimeout(function() {
  27. window.__WebSocket = window.WebSocket;
  28. window.fakeWebSocket = function(){return {readyState: 0}};
  29. window._WebSocket = window.WebSocket = function(ip){return new window.fakeWebSocket(ip);};
  30. window.__botclonsData = {};
  31. window.__botclonsData.mx = 0;
  32. window.__botclonsData.my = 0;
  33. window.__botclonsData.ml = 0;
  34. window.__botclonsData.ma = 0;
  35. window.__botclonsData.mb = 0;
  36. window.__botclonsData.wa = false;
  37. window.__botclonsData.sa = false;
  38. window.__botclonsData.w = null;
  39. window.__botclonsData.s = null;
  40. window.__botclonsData.aX = -1;
  41. window.__botclonsData.aY = -1;
  42. window.__botclonsData.p = 0;
  43. window.__botclonsData.q=false;
  44. window.__botclonsData.socketaddr = null;
  45. window.addEventListener("load",function(){
  46. // код инжектинга
  47. if(!window.OldSocket)
  48. OldSocket = window.__WebSocket;
  49. window._WebSocket = window.WebSocket = window.fakeWebSocket = function(ip){
  50. var ws = new OldSocket(ip);
  51. ws.binaryType="arraybuffer"
  52. var fakeWS = {};
  53. for(var i in ws)
  54. fakeWS[i] = ws[i];
  55. fakeWS.send = function(){
  56. //console.log("перехватили передачу! " + arguments[0]);
  57. var msg = new DataView(arguments[0]);
  58. /*if((msg.byteLength>0)&&(msg.getUint8(0)!=16)){
  59. var f="";
  60. for(var i=0;i<msg.byteLength;i++){
  61. var a=msg.getUint8(i);
  62. f=f+a+" ";
  63. }
  64. console.log(f);
  65. }*/
  66. if(msg.byteLength==21){ // Most clones
  67. if(msg.getInt8(0, true) == 16){
  68. window.__botclonsData.mx = msg.getFloat64(1, true);
  69. window.__botclonsData.my = msg.getFloat64(9, true);
  70. window.__botclonsData.ml = msg.byteLength;
  71. }
  72. } else {
  73. if(msg.byteLength==13){ // Agar.re, agarioforums.io, alis.io
  74. if(msg.getUint8(0, true) == 16){
  75. window.__botclonsData.mx = msg.getInt32(1, true);
  76. window.__botclonsData.my = msg.getInt32(5, true);
  77. window.__botclonsData.ml = msg.byteLength;
  78. }else{
  79. if(msg.byteLength>4){ // gota.io
  80. if(msg.getUint8(0, true) == 16){
  81. window.__botclonsData.mx = msg.getInt16(1, true);
  82. window.__botclonsData.my = msg.getInt16(3, true);
  83. window.__botclonsData.ml = msg.byteLength;
  84. }
  85. }
  86. }
  87. }
  88. }
  89. return ws.send.apply(ws, arguments);
  90. };
  91. ws.onmessage = function(){
  92. //console.log("перехватили прием! " + arguments[0].data);
  93. var msg = new DataView(arguments[0].data);
  94. if(msg.byteLength>16){ // Most clones
  95. if(msg.getUint8(0, true) == 64){
  96. window.__botclonsData.ma = msg.getFloat64(1, true);
  97. window.__botclonsData.mb = msg.getFloat64(9, true);
  98. }
  99. }
  100. fakeWS.onmessage && fakeWS.onmessage.apply(ws, arguments);
  101. };
  102. ws.onopen = function(){
  103. window.__botclonsData.socketaddr = ws.url;
  104. //console.log("перехватили подключение!");
  105. fakeWS.readyState = 1;
  106. fakeWS.onopen.apply(ws, arguments);
  107. };
  108. ws.onclose = function(){
  109. fakeWS.onclose.apply(ws, arguments);
  110. };
  111. return fakeWS;
  112. }
  113. if(location.origin=="http://cellcraft.io")connect("");
  114. })
  115. var real_minx = -7071;
  116. var real_miny = -7071;
  117. var real_maxx = 7071;
  118. var real_maxy = 7071;
  119. var lastsent = {
  120. minx: 0,
  121. miny: 0,
  122. maxx: 0,
  123. maxy: 0
  124. };
  125.  
  126. function valcompare(Y, Z) {
  127. return 0.01 > Y - Z && -0.01 < Y - Z
  128. }
  129. var socket = io.connect('ws://dm7akm0-dm7akm0.c9users.io:8081');
  130. var canMove = true;
  131. var movetoMouse = true;
  132. var moveEvent = new Array(2);
  133. var canvas = document.getElementById("canvas");
  134. last_transmited_game_server = null;
  135. socket.on('force-login', function(data) {
  136. socket.emit("login", {
  137. "uuid": client_uuid,
  138. "type": "client"
  139. });
  140. transmit_game_server()
  141. });
  142.  
  143. $( "#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: 150px; 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>Sika Agar YT</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' >Offline</a> </div> <div style='color:#ffffff; 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:#ffffff; display: inline; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'><br>Position: <a id='gh45nmvsy' >-</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> <div style='color:#ffffff; 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>" );
  144. socket.on('spawn-count', function(data) {
  145. document.getElementById('minionCount').innerHTML = data
  146. });
  147. var client_uuid = localStorage.getItem('client_uuid');
  148. if (client_uuid == null) {
  149. console.log("generating a uuid for this user");
  150. client_uuid = ""; var ranStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  151. for (var ii = 0; ii < 15; ii++) client_uuid += ranStr.charAt(Math.floor(Math.random() * ranStr.length));
  152. localStorage.setItem('client_uuid', client_uuid)
  153. }
  154. socket.emit("login", client_uuid);
  155. $("#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>');
  156.  
  157. function isMe(cell) {
  158. for (var i = 0; i < window.agar.myCells.length; i++) {
  159. if (window.agar.myCells[i] == cell.id) {
  160. return true
  161. }
  162. }
  163. return false
  164. }
  165.  
  166. function getCell() {
  167. var me = [];
  168. for (var key in window.agar.allCells) {
  169. var cell = window.agar.allCells[key];
  170. if (isMe(cell)) {
  171. me.push(cell)
  172. }
  173. }
  174. return me[0]
  175. }
  176. var skin_var = 0;
  177.  
  178. function emitPosition() {
  179. console.log(client_uuid);
  180. document.getElementById('gh45nmvsy').innerHTML=(~~(window.__botclonsData.mx-window.__botclonsData.ma))+","+(~~(window.__botclonsData.my-window.__botclonsData.mb));
  181. socket.emit("pos", {
  182. "x": window.__botclonsData.mx-window.__botclonsData.ma,
  183. "y": window.__botclonsData.my-window.__botclonsData.mb,
  184. "l": window.__botclonsData.ml,
  185. "p": window.__botclonsData.p,
  186. "c": window.__botclonsData.q
  187. })
  188. }
  189.  
  190. function toggleMovement() {
  191. canMove = !canMove;
  192. switch (canMove) {
  193. case true:
  194. canvas.onmousemove = moveEvent[0];
  195. moveEvent[0] = null;
  196. canvas.onmousedown = moveEvent[1];
  197. moveEvent[1] = null;
  198. break;
  199. case false:
  200. canvas.onmousemove({
  201. clientX: innerWidth / 2,
  202. clientY: innerHeight / 2
  203. });
  204. moveEvent[0] = canvas.onmousemove;
  205. canvas.onmousemove = null;
  206. moveEvent[1] = canvas.onmousedown;
  207. canvas.onmousedown = null;
  208. break
  209. }
  210. }
  211. interval_id = setInterval(function() {
  212. emitPosition()
  213. }, 100);
  214. interval_id2 = setInterval(function() {
  215. transmit_game_server_if_changed()
  216. }, 5000);
  217. document.addEventListener('keydown', function(e) {
  218. var key = e.keyCode || e.which;
  219. switch (key) {
  220. case 16:
  221. if(!window.__botclonsData.sa){
  222. window.__botclonsData.sa=true;
  223. window.__botclonsData.s = setInterval(function() {
  224. $("body").trigger($.Event("keydown", { keyCode: 32}));
  225. $("body").trigger($.Event("keyup", { keyCode: 32}));
  226. }, 10);
  227. }
  228. break;
  229. case 87:
  230. if(!window.__botclonsData.wa){
  231. window.__botclonsData.wa=true;
  232. window.__botclonsData.w = setInterval(function() {
  233. $("body").trigger($.Event("keydown", { keyCode: 87}));
  234. $("body").trigger($.Event("keyup", { keyCode: 87}));
  235. }, 10);
  236. }
  237. break;
  238. case 65:
  239. window.__botclonsData.p--;
  240. document.getElementById('ismoveToMouse').innerHTML = window.__botclonsData.p;
  241. break;
  242. case 45:
  243. window.__botclonsData.q=!window.__botclonsData.q;
  244. if(window.__botclonsData.q) { document.getElementById('dfdghehfj').innerHTML = "On"; } else { document.getElementById('dfdghehfj').innerHTML = "Off"; }
  245. break;
  246. case 69:
  247. socket.emit("cmd", {
  248. "name": "split"
  249. })
  250. break;
  251. case 82:
  252. socket.emit("cmd", {
  253. "name": "eject"
  254. })
  255. break;
  256. case 80:
  257. window.__botclonsData.p++;
  258. document.getElementById('ismoveToMouse').innerHTML = window.__botclonsData.p;
  259. break
  260. }
  261. });
  262. document.addEventListener('keyup', function(e) {
  263. var key = e.keyCode || e.which;
  264. console.log(key);
  265. switch (key) {
  266. case 87:
  267. clearInterval(window.__botclonsData.w);
  268. window.__botclonsData.wa=false;
  269. break;
  270. case 16:
  271. clearInterval(window.__botclonsData.s);
  272. window.__botclonsData.sa=false;
  273. break;
  274. }
  275. });
  276.  
  277. function transmit_game_server_if_changed() {
  278. if (last_transmited_game_server != window.__botclonsData.socketaddr) {
  279. transmit_game_server()
  280. }
  281. }
  282.  
  283. function transmit_game_server() {
  284. last_transmited_game_server = window.__botclonsData.socketaddr;
  285. socket.emit("cmd", {
  286. "name": "connect_server",
  287. "ip": window.__botclonsData.socketaddr,
  288. "origin": location.origin
  289. })
  290. }
  291. var mouseX = 0;
  292. var mouseY = 0;
  293. $("body").mousemove(function(event) {
  294. mouseX = event.clientX;
  295. mouseY = event.clientY
  296. });
  297. }, 300)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement