Advertisement
Guest User

Untitled

a guest
Apr 26th, 2018
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.28 KB | None | 0 0
  1. $(document).ready(function() {
  2. window.onLoadScript = setTimeout(function() {
  3. window.bPackage = null;
  4. window._IOplayer = {
  5. x: 0,
  6. y: 0,
  7. ip: 0,
  8. offX: 0,
  9. offY: 0,
  10. origin: window.location.origin,
  11. MoveInt: null,
  12. startBots: false
  13. };
  14.  
  15. function initGUI() {
  16. window.guiOPEN = true;
  17.  
  18. if (!localStorage.getItem("menuScroll")) {
  19. localStorage.setItem("menuScroll", 1);
  20. } else {
  21. (localStorage.menuScroll == 0) ? $(".optionsCB").toggleClass("optionsCB-disabled"): null;
  22. }
  23. if (localStorage.guiRender != null) {
  24. window.guiRender = localStorage.guiRender;
  25.  
  26. if (localStorage.guiRender == 3) {
  27. $(".selectOptions").val("3");
  28. } else if (localStorage.guiRender == 2) {
  29. $(".selectOption").val("2");
  30. } else {
  31. $(".selectOption").val("1");
  32. }
  33. } else {
  34. localStorage.guiRender = 3;
  35. window.guiRender = 3;
  36. }
  37. }
  38. initGUI();
  39. var games = [
  40. "agar.red",
  41. "cellcraft.io",
  42. "agar.bio",
  43. "play.agario0.com"
  44. ]
  45.  
  46. function initGames() {
  47. for (var n = 0; n < games.length; n++) {
  48. var i = document.createElement("div");
  49. i.innerHTML = games[n];
  50. i.className = "serverIp";
  51. document.getElementById("serversBox").appendChild(i);
  52. }
  53. }
  54. initGames();
  55. var ws = {};
  56. window.testgui = document.getElementById("selector");
  57.  
  58. function connectToIO_Helper() {
  59. ws = io.connect("195.133.144.240:5000");
  60. ws.on("loginAccept", function(data) {
  61. swal({
  62. "title": "Login done!",
  63. "text": "Redirecting to shop",
  64. "icon": "success",
  65. "button": "Ok"
  66. })
  67. $(".form").animate({
  68. height: "toggle",
  69. opacity: "toggle"
  70. }, "slow");
  71. $("#descbots").text(`${data.datr.maxbots} bots`);
  72. $("#desctime").text(`${(data.datr.time / 86400 >> 0) +":"+ (data.datr.time / 3600 % 24 >> 0) +":"+ (data.datr.time / 60 % 60 >> 0)+":"+(data.datr.time % 60 >> 0)}`);
  73. $("#desccoins").text(`${data.datr.coins} coins`);
  74. setTimeout(function() {
  75. $(".col-md-3").animate({
  76. height: "toggle"
  77. })
  78. }, 1000);
  79. $("#userstatus_io").text(data.text);
  80. $("#logintext").text("Shop | open/close");
  81. });
  82. ws.on("registerdone", function() {
  83. swal({
  84. "title": "Register done!",
  85. "text": "You can login!",
  86. "icon": "success",
  87. "button": "Ok"
  88. })
  89. });
  90. ws.on("receiveUserStatus", function(data) {
  91. if (window._IOplayer.startBots == false) return;
  92. $("#progress_bar_io").html('<div id="minions-bar-bots" style="width:' + Math.floor((data.status.bots / data.status.maxbots) * 100) + '%"> </div>');
  93. $("#botscounter").text(data.status.bots + ' / ' + data.status.maxbots);
  94. $("#timecounter").text((data.status.time / 86400 >> 0) + ":" + (data.status.time / 3600 % 24 >> 0) + ":" + (data.status.time / 60 % 60 >> 0) + ":" + (data.status.time % 60 >> 0));
  95. });
  96. ws.on("acceptbuyfreeplan", function() {
  97. swal({
  98. "title": "Buy plan free done!",
  99. "text": "You can start your bots!",
  100. "icon": "success",
  101. "button": "Ok"
  102. })
  103. $("#desctime").text("6:0:0:0");
  104. $("#descbots").text("15");
  105. });
  106. ws.on("acceptbuypremiumplan", function() {
  107. swal({
  108. "title": "Buy plan premium done!",
  109. "text": "You can start your bots!",
  110. "icon": "success",
  111. "button": "Ok"
  112. })
  113. $("#desctime").text("6:0:0:0");
  114. $("#descbots").text("100");
  115. });
  116. ws.on("acceptbuygoldplan", function() {
  117. swal({
  118. "title": "Buy plan gold done!",
  119. "text": "You can start your bots!",
  120. "icon": "success",
  121. "button": "Ok"
  122. })
  123. $("#desctime").text("6:0:0:0");
  124. $("#descbots").text("75");
  125. });
  126. ws.on("acceptbuymediumplan", function() {
  127. swal({
  128. "title": "Buy plan medium done!",
  129. "text": "You can start your bots!",
  130. "icon": "success",
  131. "button": "Ok"
  132. })
  133. $("#desctime").text("6:0:0:0");
  134. $("#descbots").text("50");
  135. });
  136. ws.on("loginfailed", function() {
  137. swal({
  138. "title": "Login failed!",
  139. "text": "try again!",
  140. "icon": "warning",
  141. "button": "Ok"
  142. })
  143. });
  144. }
  145. var hide_login = true;
  146. $(".optionText").click(function() {
  147. $(this).parent().find(".optionBox").animate({
  148. height: "toggle",
  149. opacity: "toggle"
  150. });
  151. });
  152. $("#sendlogin").click(function() {
  153. ws.emit("login", {
  154. username: $("#login_io").val(),
  155. password: $("#password_io").val()
  156. });
  157. });
  158. window.buyfree = function() {
  159. ws.emit("buyfree");
  160. }
  161. window.buypremium = function() {
  162. ws.emit("buypremium");
  163. };
  164. window.buygold = function() {
  165. ws.emit("buygold");
  166. }
  167. window.buymedium = function() {
  168. ws.emit("buymedium");
  169. }
  170. var sendregister_click = false;
  171. $("#sendregister").click(function() {
  172. if (sendregister_click == false) {
  173. ws.emit("register", {
  174. username: $("#reg_login").val(),
  175. password: $("#reg_pass").val(),
  176. two_password: $("#reg_pass2").val(),
  177. mail: $("#email").val()
  178. })
  179. sendregister_click = true;
  180. }
  181. });
  182. $('.msg a').click(function() {
  183. $('form').animate({
  184. height: "toggle",
  185. opacity: "toggle"
  186. }, "slow");
  187. })
  188.  
  189. $(".customServer").keyup(function() {
  190. $(".customServer").parent().find(".serverIp").each(function(index, value) {
  191. if ($(this).html().indexOf($(".customServer").val()) > -1) {
  192. $(this).show();
  193. } else {
  194. $(this).hide();
  195. }
  196. });
  197. });
  198. $(".customServer").parent().find(".serverIp").click(function() {
  199.  
  200. var str = $(this).html();
  201.  
  202. window.location.replace(`http://${str}`);
  203. });
  204. $('form').submit(function() {
  205. return false;
  206. });
  207. $("#loging_io").click(function() {
  208. if (hide_login == true) {
  209. hide_login = false;
  210. } else {
  211. hide_login = true;
  212. }
  213. $(".page").animate({
  214. height: "toggle",
  215. opacity: "toggle"
  216. }, "slow");
  217. });
  218. var firstClick = false;
  219. $(".outBar").find("i").click(function() {
  220. $('.menu').animate({
  221. width: "toggle",
  222. }, "slow");
  223. if (firstClick === false) {
  224. firstClick = true;
  225. $('.outBar').animate({
  226. left: "0px",
  227. }, "slow");
  228. $("#infobots_io").animate({
  229. left: "0%"
  230. }, "slow");
  231. } else if (firstClick === true) {
  232. firstClick = false;
  233. $("#infobots_io").animate({
  234. left: "11.8%"
  235. }, "slow");
  236. $('.outBar').animate({
  237. left: "228px",
  238. }, "slow");
  239. }
  240. if (hide_login == false) {
  241. hide_login = true;
  242. $('.page').animate({
  243. height: "toggle",
  244. opacity: "toggle"
  245. }, "slow");
  246. }
  247. window.guiOPEN = (window.guiOPEN) ? false : true;
  248. });
  249.  
  250. $("#startbots").click(function() {
  251. window.debugGUI = false;
  252. if (window._IOplayer.startBots == true) {
  253. window._IOplayer.startBots = false;
  254. ws.emit("DataClose");
  255. clearInterval(window._IOplayer.MoveInt);
  256. window._IOplayer.MoveInt = null;
  257. $("#startbots").removeClass('optionsCB-disabled').addClass("optionsCB").text("Start Bots");
  258. $("#infobots_io").animate({
  259. width: "toggle"
  260. })
  261. } else if (window._IOplayer.startBots == false) {
  262. window.bPackage = "CHECK";
  263. window.debugGUI = false;
  264. if (window._IOplayer.ip !== null && typeof window._IOplayer.ip == "string" && window._IOplayer.origin !== null && window._IOplayer.startBots == false) {
  265. window._IOplayer.startBots = true;
  266. ws.emit("DataServer", {
  267. server: window._IOplayer.ip,
  268. origin: window._IOplayer.origin
  269. });
  270. if (window._IOplayer.MoveInt == null) {
  271. window._IOplayer.MoveInt = setInterval(function() {
  272. ws.emit("DataPosition", {
  273. x: window._IOplayer.x - window._IOplayer.offX,
  274. y: window._IOplayer.y - window._IOplayer.offY,
  275. mode: bots_mode
  276. });
  277. }, 100);
  278. }
  279. $("#startbots").removeClass('optionsCB').addClass("optionsCB-disabled").text("Stop Bots");
  280. $("#infobots_io").animate({
  281. width: "toggle"
  282. })
  283. }
  284. }
  285. });
  286. setInterval(function() {
  287. if (ws.json.connected == false) {
  288. window._IOplayer.startBots = false;
  289. $("#startbots").removeClass('optionsCB-disabled').addClass("optionsCB").text("Start Bots");
  290. }
  291. ws.emit("getUserInfo");
  292. }, 1000);
  293.  
  294. var bots_mode = "Mouse";
  295.  
  296. window.addEventListener("keydown", function(e) {
  297. switch (e.keyCode) {
  298. case 88:
  299. {
  300. ws.emit("splitbots");
  301. $("#split").removeClass("disabled").addClass("enabled").text("Enable");
  302. }
  303. break;
  304. case 67:
  305. {
  306. ws.emit("ejectbots");
  307. $("#eject").removeClass("disabled").addClass("enabled").text("Enable");
  308. }
  309. break;
  310. case 90:
  311. {
  312. if (bots_mode == "Mouse") {
  313. $("#mode").text("AI");
  314. bots_mode = "Collect";
  315. } else if (bots_mode == "Collect") {
  316. $("#mode").text("Default");
  317. bots_mode = "Mouse";
  318. }
  319. }
  320. break;
  321. }
  322. });
  323. window.addEventListener("keyup", function(e) {
  324. switch (e.keyCode) {
  325. case 88:
  326. {
  327. $("#split").removeClass("enabled").addClass("disabled").text("Disable");
  328. }
  329. break;
  330. case 67:
  331. {
  332. $("#eject").removeClass("enabled").addClass("disabled").text("Disable");
  333. }
  334. break;
  335. }
  336. });
  337. connectToIO_Helper();
  338. if (window.location.origin == "http://agar.bio") {
  339. window.WebSocket.prototype.prototype._FakeSend = window.WebSocket.prototype.prototype.send;
  340. window.WebSocket.prototype.prototype.send = function() {
  341. this._FakeSend.apply(this, arguments);
  342. var data = new DataView(arguments[0]);
  343. if (data.getInt8(0, true) !== 16 || data.getUint8(0, true) !== 16) return;
  344. if (data.byteLength == 21) {
  345. window._IOplayer.x = data.getFloat64(1, true);
  346. window._IOplayer.y = data.getFloat64(9, true);
  347. } else if (data.byteLength == 13) {
  348. window._IOplayer.x = data.getInt32(1, true);
  349. window._IOplayer.y = data.getInt32(5, true);
  350. } else {
  351. window._IOplayer.x = data.getInt16(1, true);
  352. window._IOplayer.y = data.getInt16(5, true);
  353. }
  354. if (this.url.match('localhost') || this.url.match('127.0.0.1')) return;
  355. window._IOplayer.ip = this.url;
  356. }
  357. } else {
  358. window.WebSocket.prototype._FakeSend = window.WebSocket.prototype.send;
  359. window.WebSocket.prototype.send = function() {
  360. this._FakeSend.apply(this, arguments);
  361. var data;
  362. if (window.location.origin == "http://qwoks.ga") {
  363. var data = new DataView(arguments[0].buffer);
  364. } else {
  365. var data = new DataView(arguments[0]);
  366. }
  367. if ((data.byteLength > 0) && (data.getUint8(0) != 16)) {
  368. var f = "";
  369. for (var i = 0; i < data.byteLength; i++) {
  370. var a = data.getUint8(i);
  371. f = f + a + " ";
  372. }
  373. var realbuffers = f.split(' ');
  374. var minusrealbuffermassiv = realbuffers.length;
  375. var drr = realbuffers.splice(i, minusrealbuffermassiv);
  376. console.log("Detected new package: " + realbuffers);
  377. }
  378. this.addEventListener("message", function() {
  379. var buffer = new DataView(arguments[0].data);
  380. if(window.location.origin == "http://agar.pro" || window.location.origin == "http://qwoks.ga") {
  381. if(buffer.getUint8(0, true) == 64) {
  382. window._IOplayer.offX = (buffer.getFloat64(1, true) + buffer.getFloat64(17, true)) / 2;
  383. window._IOplayer.offY = (buffer.getFloat64(9, true) + buffer.getFloat64(25, true)) / 2;
  384. }
  385. }
  386. });
  387. if (data.getInt8(0, true) !== 16 || data.getUint8(0, true) !== 16) return;
  388. if (data.byteLength == 21) {
  389. window._IOplayer.x = data.getFloat64(1, true);
  390. window._IOplayer.y = data.getFloat64(9, true);
  391. } else if (data.byteLength == 13) {
  392. window._IOplayer.x = data.getInt32(1, true);
  393. window._IOplayer.y = data.getInt32(5, true);
  394. } else {
  395. window._IOplayer.x = data.getInt16(1, true);
  396. window._IOplayer.y = data.getInt16(5, true);
  397. }
  398. if (this.url.match('localhost') || this.url.match('127.0.0.1')) return;
  399. window._IOplayer.ip = this.url;
  400. }
  401. }
  402. }, 1000);
  403. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement