Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Linesplit
  3. // @version 0.5
  4. // @description 13 macro's. For feeding, linesplits, tricksplits, etc :)
  5. // @author Megabyte918
  6. // @match *.craftycat.esy.es/*
  7. // @match *.abs0rb.me/*
  8. // @match *.agar.io/*
  9. // @match *.gota.io/*
  10. // @match *http://protozoan.byethost10.com/*
  11. // @match *.protozoanx.glitch.me/*
  12. // @match *.protozoan.glitch.me/*
  13. // @match *.vanis.io/*
  14.  
  15.  
  16. // ==/UserScript==
  17.  
  18. window.addEventListener('keydown', keydown);
  19. window.addEventListener('keyup', keyup);
  20. document.getElementById("nick").maxLength = "9e9";
  21.  
  22.  
  23.  
  24. // Load macros
  25. var canFeed = false;
  26. function keydown(event) {
  27. if (event.keyCode == 39 ) {
  28. // Horizontal linesplit
  29. var x = window.innerWidth / 2;
  30. var y = window.innerHeight / 2;
  31. $("canvas").trigger($.Event("mousemove", {clientX: x, clientY: y}));
  32. }
  33. if (event.keyCode == 37 ) {
  34. // Horizontal linesplit
  35. x = window.innerWidth / 2;
  36. y = window.innerHeight / 2;
  37. $("canvas").trigger($.Event("mousemove", {clientX: x, clientY: y}));
  38. }
  39. if (event.keyCode == 38) { //key
  40. var X2 = window.innerWidth/2;
  41. var Y2 = window.innerHeight/3.5;
  42. $("canvas").trigger($.Event("mousemove", {clientX: X2, clientY: Y2}));
  43. }
  44. if (event.keyCode == 40) { //key
  45. X2 = window.innerWidth/2;
  46. Y2 = window.innerHeight/3.5;
  47. $("canvas").trigger($.Event("mousemove", {clientX: X2, clientY: Y2}));
  48. }
  49. window.addEventListener('keydown', keydown);
  50.  
  51. if (event.keyCode == 90) { //key Z
  52. var X = window.innerWidth/2;
  53. var Y = window.innerHeight/2;
  54. $("canvas").trigger($.Event("mousemove", {clientX: X, clientY: Y}));
  55. }
  56. if (event.keyCode == 88) { //key X
  57. X = window.innerWidth/2;
  58. Y = window.innerHeight/3.5;
  59. $("canvas").trigger($.Event("mousemove", {clientX: X2, clientY: Y2}));
  60. }
  61.  
  62. }
  63.  
  64. // When a player lets go of W stop feeding
  65. function keyup(event) {
  66. if (event.keyCode == 87) canFeed = false;
  67. }
  68.  
  69. // Alias for W key
  70. function feed() {
  71. if (!canFeed) return;
  72. window.onkeydown({keyCode: 87});
  73. window.onkeyup({keyCode: 87});
  74. setTimeout(feed, 0);
  75. }
  76.  
  77. // Alias for space
  78. function split() {
  79. $("body").trigger($.Event("keydown", { keyCode: 32}));
  80. $("body").trigger($.Event("keyup", { keyCode: 32}));
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement