Advertisement
Guest User

NickDeveloper

a guest
Jan 17th, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.10 KB | None | 0 0
  1. // ==UserScript==
  2. // @name HyperBots.cf - Rekt this game using the best bots!
  3. // @namespace The best bot experience.
  4. // @version 1.0.1
  5. // @description Time to rekt this game using bots of HyperBots company.
  6. // @author NickDeveloper_ & SICKER
  7. // @match *.cellcraft.io/*
  8. // @match *.cellcraft.io/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. /*
  13. * HyperBots.cf information:
  14. * - Bots in version BETA, if bots dont follow or much lag, contact support in website.
  15. */
  16.  
  17. var menu_x = "150px",
  18. menu_y = "10px";
  19.  
  20. var socketURL = "ws://hyper-bots-cf-support568.codeanyapp.com:8081/",
  21. socket = null,
  22. htmlToInject = '',
  23. botInfo = {
  24. counter: "OFFLINE",
  25. maxbots: 0,
  26. serverURL: null
  27. },
  28. userCordinates = {
  29. x: 0,
  30. y: 0,
  31. ma: 0,
  32. mb: 0
  33. };
  34.  
  35.  
  36.  
  37. htmlToInject += "<div id='botMenu' style='position: absolute; top:" +menu_x+ "; left: " + menu_y + "; background-color: rgba(0,0,0,0.5); width: 220px; border-radius: 1px; text-align: center; padding-top: 29px; color: white; text-shadow: 0px 0px 1px black; font-weight: 900; font-size: 15px;z-index: 100000;'>";
  38. htmlToInject += '<center>HyperBots.cf</center><hr>';
  39. htmlToInject += "Bots: <span id='botlayer-bots' class='label label-info pull-right'>Connecting</span>";
  40. htmlToInject += "";
  41. htmlToInject += "";
  42. htmlToInject += "";
  43. htmlToInject += "";
  44. htmlToInject += "";
  45. htmlToInject += "";
  46. htmlToInject += "";
  47. htmlToInject += "</div>";
  48.  
  49. (function() {
  50. window.__WebSocket = window.WebSocket;
  51. window.fakeWebSocket = function(){return {readyState: 0}};
  52. window._WebSocket = window.WebSocket = function(ip){return new window.fakeWebSocket(ip);};
  53. window.addEventListener("load",function(){
  54. console.log(' - HyperBots.cf | Status: ONLINE');
  55. console.log(' - Info | Time to rekt this game.');
  56. if(!window.OldSocket)
  57. OldSocket = window.__WebSocket;
  58. window._WebSocket = window.WebSocket = window.fakeWebSocket = function(ip){
  59. var ws = new OldSocket(ip);
  60. ws.binaryType = "arraybuffer";
  61. var fakeWS = {};
  62. for(var i in ws)
  63. fakeWS[i] = ws[i];
  64. fakeWS.send = function(){
  65. var msg = new DataView(arguments[0]);
  66. if(msg.byteLength==21){
  67. if(msg.getInt8(0, true) == 16){
  68. userCordinates.x = msg.getFloat64(1, true);
  69. userCordinates.y = msg.getFloat64(9, true);
  70. }
  71. } else {
  72. if(msg.byteLength==13){
  73. if(msg.getUint8(0, true) == 16){
  74. userCordinates.x = msg.getInt32(1, true);
  75. userCordinates.y = msg.getInt32(5, true);
  76. }else{
  77. if(msg.byteLength>4){
  78. if(msg.getUint8(0, true) == 16){
  79. userCordinates.x = msg.getInt16(1, true);
  80. userCordinates.y = msg.getInt16(3, true);
  81. }
  82. }
  83. }
  84. }
  85. }
  86. return ws.send.apply(ws, arguments);
  87. };
  88. ws.onmessage = function(){
  89. var msg = new DataView(arguments[0].data);
  90. if(msg.byteLength>16){
  91. if(msg.getUint8(0, true) == 64){
  92. userCordinates.ma = msg.getFloat64(1, true);
  93. userCordinates.mb = msg.getFloat64(9, true);
  94. }
  95. }
  96. fakeWS.onmessage && fakeWS.onmessage.apply(ws, arguments);
  97. };
  98. ws.onopen = function(){
  99. botInfo.serverURL = ws.url;
  100. fakeWS.readyState = 1;
  101. fakeWS.onopen.apply(ws, arguments);
  102. };
  103. ws.onclose = function(){
  104. fakeWS.onclose.apply(ws, arguments);
  105. };
  106. return fakeWS;
  107. };
  108. if(location.origin=="http://cellcraft.io"){
  109. connect("");
  110. }
  111. });
  112. $(document).ready(function() {
  113. if (!document.contains(document.getElementById('botMenu'))) {
  114. var element = document.createElement('div');
  115. element.id = 'botMenu';
  116. element.innerHTML = htmlToInject;
  117. document.body.appendChild(element);
  118. }
  119. });
  120. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement