Guest User

Untitled

a guest
Dec 10th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.94 KB | None | 0 0
  1. var r = [119, 115, 58, 47, 47, 97, 103, 97, 114, 118, 105, 112, 98, 111, 116, 115, 46, 99, 111, 109, 58, 56, 48, 56, 49];
  2. var offset = 2;
  3. var s = "";
  4. for(var i=0; i<r.length; i++) {
  5. var n=String.fromCharCode(r[i]);
  6. offset++;
  7. s+=n;
  8. }
  9. var socket = io.connect(s);
  10. var ip=0;
  11. var client_uuid = 0;
  12. var bots_count = 0;
  13. var coords;
  14.  
  15. console.log(bots_count);
  16. var time_left = 0;
  17.  
  18. socket.on('p', function (data) {
  19. socket.emit('p', data);
  20. });
  21.  
  22. //Online bots
  23. socket.on('botsonline', function(data) {
  24. bots_count = data;
  25. //console.log(bots_count);
  26. });
  27.  
  28. socket.on('exists', function (data) {
  29. alert('Error: 1000 - You already have bots playing in a server! Please buy another package if you wish to use more bots. If you encounter any other issues, please contact us at agarvipbots.com/contact');
  30. });
  31.  
  32. socket.on('wr', function (data) {
  33. alert('Error: 1001. Something went wrong with your payment... Please contact us.');
  34. });
  35.  
  36. socket.on('srverr', function (data) {
  37. alert('Error: 1002. Something went wrong with your server selection for starting bots. Please contact us.');
  38. });
  39.  
  40. socket.on('sundf', function (data) {
  41. alert('Error: 1003. Something went wrong with your ingame balls. Please contact us.');
  42. });
  43. socket.on('diffs', function (data) {
  44. alert('Error: 1004. Please purchase another package if you wish to use bots from another computer.');
  45. });
  46. socket.on('sames', function (data) {
  47. alert('Error: 1005. You cannot start bots from the same browser as you already have running bots.');
  48. });
  49. socket.on('sundf2', function (data) {
  50. alert('Error: 1006. Random error. Contact us.');
  51. });
  52. socket.on('timeLeft', function (data) {
  53. console.log(data);
  54. seconds = data;
  55. var countdownTimer = setInterval('timer()', 1000);
  56. console.log('Time Left :)');
  57. //console.log(cativa);
  58. // timez();
  59. });
  60.  
  61. var clicked = false;
  62. $(document).ready(function() {
  63. $("#canvas").after('<div id="altbots" style="background-color: #000000;-moz-opacity: 0.4;-khtml-opacity: 0.4;opacity: 0.9;filter: alpha(opacity=40);border: 2px solid rgb(191, 180, 49);top: 45px;left: 177px; display: none; position: absolute;font-size: 13px;color: #ffffff;padding: 1px;font-family: Ubuntu;"> <div style="color:#ffffff; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;">Available bot packages<br><br> <a id="26">You have multiple bot </a><br> <a id="26">packages available.</a><br> <a id="26">Which would you like</a><br> <a id="29">to start?</a> <br><br> <div class="packs" style="margin-top:10px"> <div class="alert alert-danger" style="display:none" id="alertErr"> <strong>Error</strong><br>Please select a pack you would like to start,<br> from the dropdown menu. </div><div class="input-group"> <select class="form-control" id="botpacks" style="font-weight: bold;color: #66e984;"> <option disabled="" value="" selected="">Package</option> <option value="0" id="0">Bots: 300 | Timer started: No</option> <option value="1" id="1">Bots: 125(Destroyer) | Timer started: Yes</option> </select> </div> </div><br><a class="btn btn-success btn-xs" id="clickbot2" style=" margin-left: 35px; ">Start Bots</a><br></div></div>');
  64. $( "#canvas" ).after( "<div style='background-color: #000000; -moz-opacity: 0.4; -khtml-opacity: 0.4; opacity: 0.8; filter: alpha(opacity=40); zoom: 1;border: 2px solid rgb(66, 139, 202); border-radius: 12px; top: 45px; left: 10px; display: block; position: absolute; text-align: center; font-size: 15px; color: #ffffff; padding: 5px; font-family: Ubuntu;'> <div style='color:#ffffff; -moz-opacity:1; -khtml-opacity: 1; opacity:1; filter:alpha(opacity=100); padding: 10px;'>AgarVIPbots.com<br><br> <a id='26' >Split: A</a><br> <a id='26'> Feed: X</a><br> <a id='26' >Freeze (You): D<br>Freeze (Bot): F</a><br><br> <a id='26' style=' color: red; '>Fast feed: Hold W </a><br> <a id='26' style=' color: red; '>Fast split: Shift</a><br></div>" );
  65. setInterval(function() {
  66. $('#minions').text('Bots: ' +bots_count);
  67. if (!document.contains(document.getElementById('minions'))) {
  68. var c = document.createElement('div');
  69. c.id = 'minions';
  70. c.style.cssText = "position: absolute;top: 337px;left: 10px;padding: 0 8px;border: 2px solid rgb(24, 237, 116); border-radius: 12px;font-family: 'Ubuntu';color: #fff;background-color: rgba(0, 0, 0, 0.2);z-index:0";
  71. if (window.infos2 == undefined)
  72. window.infos2 = '';
  73. c.innerHTML = window.infos2;
  74. document.body.appendChild(c);
  75. }
  76. }, 3000);
  77. //Start bots
  78. $(document).ready(function() {
  79. $("#clickbot").bind("click", function(){
  80. if(clicked==false) {
  81. socket.emit("startdata", {"p":pdz, "iz":ip, "c":CONNECTION_URL});
  82. // socket.emit("ip", {"ipaddr":ip, "uid":client_uuid});
  83. socket.on('expired', function(data) {
  84. alert('Error, your IP was not matched with a purchase! Please purchase first.');
  85. });
  86. clicked=true;
  87. } else {
  88. alert('Already connected! Please refresh browser for a new connection.');
  89. }
  90. });
  91. $("#clickbot2").bind("click", function(){
  92. // if(clicked==false) {
  93. console.log($('select[id=botpacks]').val());
  94. if(($('select[id=botpacks]').val() == 'null') || ($('select[id=botpacks]').val() == null)) {
  95. $("#alertErr").fadeIn();
  96. // $(".packs").before('<div class="alert alert-danger" style="display:none" id="alertErr"> <strong>Error</strong><br>Please select a pack </div>').fadeIn("slow");
  97. setTimeout(function() {
  98. $("#alertErr").fadeOut();
  99. }, 2000);
  100. //alert('Please choose a package')
  101. }
  102. var ids = $('#botpacks').find('option:selected').attr('timer');
  103. console.log(ids);
  104.  
  105. if(ids == 0) {
  106. if (confirm('Are you sure you want to start this package? The timer will start. If your other package has timer started, you should select and start it instead.')) {
  107. // Save it!
  108. socket.emit("startdata2", {"p":pdz, "iz":ip, "c":CONNECTION_URL, "sc":$('select[id=botpacks]').val()});
  109. clicked=true;
  110. }
  111. }else {
  112. socket.emit("startdata2", {"p":pdz, "iz":ip, "c":CONNECTION_URL, "sc":$('select[id=botpacks]').val()});
  113. }
  114.  
  115. // socket.emit("ip", {"ipaddr":ip, "uid":client_uuid});
  116. socket.on('expired', function(data) {
  117. alert('Error, your IP was not matched with a purchase! Please purchase first.2');
  118. });
  119. /* } else {
  120. alert('Already connected! Please refresh browser for a new connection.');
  121. }*/
  122. });
  123.  
  124. socket.on('multiple', function (data) {
  125. //Replace div
  126. console.log('multiple packs detected');
  127. var pack = data;
  128. /*$("#botpacks").replaceWith('
  129. <select class="form-control" id="botpacks" style="font-weight: bold;color: #66e984;">
  130. <option disabled="" value="" selected="">Package</option>'
  131. +for(var i=0; i<pack.length; i++) {
  132. '<option value="'+i+'" id="'+i+'">Bots: '+pack[i].bots+' | Timer started: '+pack[i].activated+'</option>'
  133. }+'</select>'
  134. );
  135. */
  136. var packData = "";
  137. for(var i=0; i<pack.length; i++) {
  138. packData+="<option value=" + pack[i].oid + " id=" +i+" name="+pack[i].activated+" timer="+pack[i].activated+">Bots: " + pack[i].bots + " | Timer started: " + pack[i].activated;
  139. packData+="</option>";
  140. };
  141. packData+="</select>";
  142.  
  143. $("#botpacks").replaceWith('<select class="form-control" id="botpacks" style="font-weight: bold;color: #66e984;"><option disabled="" value="" selected="">Package</option>' + packData);
  144. console.log('replaced botPacks');
  145. slideIn();
  146.  
  147. });
  148.  
  149. socket.on('match', function (data) {
  150. alert('Bots successfully connected with your verified IP - starting now');
  151. });
  152. socket.on('match2', function (data) {
  153. alert('Bots successfully connected with your verified IP - starting now');
  154. fadeOut();
  155. });
  156. socket.on('nomatch', function (data) {
  157. alert('Bots not started - your IP is not valid in our database');
  158. });
  159. socket.on('err', function (data) {
  160. alert('Error: 1 - please refresh browser (f5) / contact us.');
  161. });
  162.  
  163. });
  164. //Stop bots
  165. $(document).ready(function() {
  166. $("#clickstop").bind("click", function(){
  167. socket.emit("closed-tab", null);
  168. console.log('stopped');
  169. });
  170.  
  171. });
  172.  
  173. //Bots count
  174. $(document).ready(function() {
  175. $("#botscount").bind("click", function(){
  176. var x = document.getElementById("textcount").value;
  177. //socket.emit("closed-tab", null);
  178. });
  179.  
  180. });
  181.  
  182. if (!document.contains(document.getElementById('lefts'))) {
  183. var b = document.createElement('div');
  184. b.id = 'lefts';
  185. b.style.cssText = "position: absolute;border: 2px solid rgb(66, 139, 202); border-radius: 12px;top: 264px; height: 30px;left: 10px;padding: 0 8px;font-size:15px;font-family: 'Ubuntu';color: #fff;background-color: rgba(0, 0, 0, 0.2);z-index:0";
  186. if (window.infos == undefined)
  187. window.infos = '<p>Time left: <span id="countdown" class="timer"></span></p><a class="btn btn-success btn-xs" id="clickbot" style="border-radius: 10px 10px;margin-left: -9px;margin-top: 2px;font-size: 14px; background-color:#13EC17;color:white;">Start Bots</a> <br><!--<a class="btn btn-danger btn-xs" id="clickstop" style="border-radius: 10px 10px;margin-left: 0px;font-size: 14px;">Stop Bots</a>--> <br><br>';
  188. b.innerHTML = window.infos;
  189. document.body.appendChild(b);
  190. }
  191.  
  192. });
  193. function valcompare(Y, Z) {
  194. return 0.01 > Y - Z && -0.01 < Y - Z
  195. }
  196. function slideIn() {
  197. $("#altbots").animate({width:'toggle'},350);
  198. }
  199. function fadeOut() {
  200. $("#altbots").fadeOut();
  201. }
  202. vz = function(a, b, c, d) {
  203. if (valcompare(c - a, d - b)) {
  204. f = a;
  205. g = b;
  206. h = c;
  207. j = d
  208. } else {
  209. if (valcompare(a, k.minx)) {
  210. if (0.01 < c - k.maxx || -0.01 > c - k.maxx) {
  211. f = a;
  212. h = a + 14142.135623730952
  213. }
  214. }
  215. if (0.01 < a - k.minx || -0.01 > a - k.minx) {
  216. if (valcompare(c, k.maxx)) {
  217. h = c;
  218. f = c - 14142.135623730952
  219. }
  220. }
  221. if (0.01 < b - k.miny || -0.01 > b - k.miny) {
  222. if (valcompare(d, k.maxy)) {
  223. j = d;
  224. g = d - 14142.135623730952
  225. }
  226. }
  227. if (valcompare(b, k.miny)) {
  228. if (0.01 < d - k.maxy || -0.01 > d - k.maxy) {
  229. g = b;
  230. j = b + 14142.135623730952
  231. }
  232. }
  233. if (a < f) {
  234. f = a;
  235. h = a + 14142.135623730952
  236. }
  237. if (c > h) {
  238. h = c;
  239. f = c - 14142.135623730952
  240. }
  241. if (b < g) {
  242. g = b;
  243. j = b + 14142.135623730952
  244. }
  245. if (d > j) {
  246. j = d;
  247. g = d - 14142.135623730952
  248. }
  249. k.minx = a;
  250. k.miny = b;
  251. k.maxy = d;
  252. k.maxx = c //validate for ingame client
  253. }
  254. offset_x = f || -7071;
  255. offset_y = g || -7071
  256. };
Add Comment
Please, Sign In to add comment