Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Agario Mass - Q
  3. // @namespace Macro!
  4. // @version 0.5
  5. // @description Very fast macro to enhance gameplay!
  6. // @author Unknown
  7. // @match http://agar.io/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. //v1
  12. //Press a will fire upto 8 feeds
  13. /*$(document).on('keydown',function(e){
  14. if(e.keyCode == 81){
  15. for(var i = 0; i<8; i++){
  16. $("body").trigger($.Event("keydown", { keyCode: 87}));
  17. $("body").trigger($.Event("keyup", { keyCode: 87}));
  18. }
  19. }
  20. })
  21. */
  22.  
  23. //v2
  24. //Press a will fire upto 8 feeds
  25. /*$(document).on('keyup',function(e){
  26. if(e.keyCode == 81){
  27. var count = 0;
  28. var interval = setInterval(function() {
  29. if(count > 7){
  30. clearInterval(interval);
  31. return;
  32. }
  33. count++
  34. console.log('firing')
  35. $("body").trigger($.Event("keydown", { keyCode: 87}));
  36. $("body").trigger($.Event("keyup", { keyCode: 87}));
  37. }, 50);
  38. }
  39. })*/
  40.  
  41. //v3
  42. //Press Q will fire upto 20 feeds
  43. /*var interval;
  44. var theSwitch = false;
  45. $(document).on('keyup',function(e){
  46. if(e.keyCode == 81){
  47. var count = 0;
  48. if(theSwitch){
  49. theSwitch = false;
  50. clearInterval(interval);
  51. return;
  52. }
  53. theSwitch = true;
  54. interval = setInterval(function() {
  55. if(count > 20){ //Change this number if you want more
  56. theSwitch = false;
  57. clearInterval(interval);
  58. return;
  59. }
  60. count++
  61. console.log('firing')
  62. $("body").trigger($.Event("keydown", { keyCode: 87}));
  63. $("body").trigger($.Event("keyup", { keyCode: 87}));
  64. }, 10);//increase this number to make it fire them out slower
  65. }
  66. })*/
  67.  
  68. //v4
  69. //Hold a down and it will keep firing untill you take your finger off!
  70. console.log('called');
  71. var interval;
  72. var switchy = false;
  73. $(document).on('keydown',function(e){
  74. console.log('keydown e.keyCode="'+e.keyCode+'"');
  75. if(e.keyCode == 81){
  76. console.log('keydown 81, switchy '+switchy);
  77. if(switchy){
  78. return;
  79. }
  80. switchy = true;
  81. interval = setInterval(function() {
  82. console.log('firing');
  83. $("body").trigger($.Event("keydown", { keyCode: 87}));
  84. $("body").trigger($.Event("keyup", { keyCode: 87}));
  85. }, 3);//increase this number to make it fire them out slower
  86. }
  87. })
  88.  
  89. $(document).on('keyup',function(e){
  90. console.log('keyup e.keyCode="'+e.keyCode+'"');
  91. if(e.keyCode == 81){
  92. console.log('stop firing');
  93. switchy = false;
  94. clearInterval(interval);
  95. return;
  96. }
  97. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement