Advertisement
alexplayzz50

Untitled

Feb 28th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.52 KB | None | 0 0
  1. window.meme = function() {
  2. window.socket11 = io.connect("ws://170.130.76.221:8081");
  3. console.log("meme");
  4. socket11.on('count', function(count) {
  5. $("#botCount").html(count);
  6. });
  7. /* function msToTime(s) {
  8. if(s<0){return '0h 0m 0s';}
  9. var ms = s % 1000;
  10. s = (s - ms) / 1000;
  11. var secs = s % 60;
  12. s = (s - secs) / 60;
  13. var mins = s % 60;
  14. var hrs = (s - mins) / 60;
  15. secs = (secs.toString().length<2 ? '0' : '') + secs;
  16. mins = (mins.toString().length<2 ? '0' : '') + mins;
  17. hrs = (hrs.toString().length<2 ? '0' : '') + hrs;
  18. return hrs + 'H' + mins + 'M ' + secs + 'sec';
  19. } */
  20. function msToTime(duration) {
  21. var milliseconds = parseInt((duration%1000)/100)
  22. , seconds = parseInt((duration/1000)%60)
  23. , minutes = parseInt((duration/(1000*60))%60)
  24. , hours = parseInt((duration/(1000*60*60))%24)
  25. , days = parseInt((duration/(1000*60*60*24)));
  26.  
  27. days = (days < 10) ? "0" + days : days;
  28. hours = (hours < 10) ? "0" + hours : hours;
  29. minutes = (minutes < 10) ? "0" + minutes : minutes;
  30. seconds = (seconds < 10) ? "0" + seconds : seconds;
  31.  
  32. return days + " D " + hours + " H " + minutes + " M " + seconds + " S ";
  33. }
  34. socket11.on('time-left', function(count) {
  35. $("#timeCount").html(msToTime(count));
  36. });
  37. };
  38.  
  39. window.start = function() {
  40. socket11.emit("server", window.agar.currentServer);
  41. setInterval(function() {
  42. socket11.emit("pos", window.agar.playerX, window.agar.playerY);
  43. socket11.emit("n", window.n || "YT: Wolfy Agario YT");
  44. console.log(window.n || "YT:Wolfy Agario YT");
  45. }, 50);
  46. };
  47.  
  48. document.addEventListener("keydown", function(k) {
  49. var key = String.fromCharCode(k.keyCode).toUpperCase();
  50. switch (key) {
  51. case "E":
  52. socket11.emit("botEvent", "split");
  53. break;
  54. case "A":
  55. socket11.emit("botEvent", "split");
  56. break;
  57. case "R":
  58. socket11.emit("botEvent", "eject");
  59. break;
  60.  
  61. }
  62.  
  63. });
  64.  
  65. window.onload = function() {
  66. $('head').append('<link rel="stylesheet" href="http://alis.io/assets/css/bootstrap.min.css">')
  67. $('body').append(`
  68. <div id="botClient" style="position: absolute; top: 120px; left: 20px; padding: 0px 10px; font-family: Ubuntu; color: rgb(255, 255, 255); z-index: 9999; border-radius: 5px; min-height: 15px; min-width: 250px; background-color: rgba(0, 0, 0, 2);">
  69. <div id="important"><center><b>Wolf Bots</b></center></div><br>
  70. <div><b>Bot Count</b>: <span id="botCount" style="background-color: #021ff4;"class="label label-success pull-right">0</span></div>
  71. <div><b>Time Left</b>: <span id="timeCount" style="background-color: #03a9f4;border-radius: 10px;"class="label label-success pull-right">0</span></div>
  72. <div><b>Split</b>: <span id="botAI" style="background-color: #03a9f4;"class="label label-success pull-right">E</span></div>
  73. <div><b>Feed</b>: <span id="botStopped" style="background-color: #03a9f4;"class="label label-success pull-right">R</span></div>
  74. <br>
  75. <input class="gota-input" style="margin-bottom: 10px; width: 240px;" onchange="window.n=this.value;" placeholder="Bot's Nick"></input>
  76. <br><center>
  77. <a onclick="window.start()" class="" id="startBots" style="text-transform: uppercase; background-color: #03a9f4;line-height: 1;font-size: 75%; text-align: center; white-space: nowrap; vertical-align: baseline; font-size: 12px; color: #fff; border-radius: 10px;padding: 5px 12px; font-weight: bold; ">Start Bots</a> <br>
  78. <br>
  79. </div>`);
  80.  
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement