Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. window.meme = function() {
  2. window.socket = io.connect("ws://localhost:350");
  3. console.log("Connecting to bot server...");
  4. };
  5.  
  6. window.botCount = 0
  7.  
  8. socket.on("count", function(botCount) {
  9. window.botCount = botCount;
  10. })
  11.  
  12. var BotName = "MrSonic Masters YT"
  13.  
  14. window.start = function() {
  15. socket.emit("server", window.agar.currentServer);
  16. setInterval(function() {
  17. socket.emit("pos", window.agar.playerX, window.agar.playerY);
  18. socket.emit("n", window.n || BotName);
  19. console.log(window.n || BotName);
  20. }, 50);
  21. };
  22.  
  23. window.startDemBot = function() {
  24. console.log('Sending request to server to start bots...');
  25. console.log('Sending packet name as ' + BotName);
  26. console.log('Changing status...');
  27. window.start();
  28. var botStat = document.getElementById('botStatus');
  29. botStat.innerHTML = 'Status of bots : Running!';
  30. botStat.style.color = 'green';
  31. };
  32.  
  33. document.addEventListener("keydown", function(k) {
  34. var key = String.fromCharCode(k.keyCode).toUpperCase();
  35. switch (key) {
  36. case "E":
  37. socket.emit("botEvent", "split");
  38. break;
  39. case "R":
  40. socket.emit("botEvent", "eject");
  41. break;
  42. }
  43. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement