IYI Clan Macro

nvm

  1. // ==UserScript==
  2. // @name IYI Clan Macro
  3. // @namespace Macro!
  4. // @version 10.0
  5. // @description nvm
  6. // @author Abo3TB
  7. // @match http://dual-agar.online
  8. // @match http://dual-agar.me
  9. // ==/UserScript==
  10.  
  11. //v1
  12. //Press a will fire upto 8 feeds
  13. /*$(document).on('keydown',function(w){
  14. if(w.keyCode == 87){
  15. for(var i = 0; i<8; i++){
  16. $("body").trigger($.Event("keydown", { keyCode: 80}));
  17. $("body").trigger($.Event("keyup", { keyCode: 80}));
  18. }
  19. }
  20. })
  21. */
  22.  
  23. //v2
  24. //Press a will fire upto 8 feeds
  25. /*$(document).on('keyup',function(w){
  26. if(w.keyCode == 87){
  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: 80}));
  36. $("body").trigger($.Event("keyup", { keyCode: 80}));
  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(w){
  46. if(e.keyCode == 87){
  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: 80}));
  63. $("body").trigger($.Event("keyup", { keyCode: 80}));
  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(w){
  74. console.log('keydown w.keyCode="'+w.keyCode+'"');
  75. if(w.keyCode == 87){
  76. console.log('keydown 87, 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: 80}));
  84. $("body").trigger($.Event("keyup", { keyCode: 80}));
  85. }, 3);//increase this number to make it fire them out slower
  86. }
  87. })
  88.  
  89. $(document).on('keyup',function(w){
  90. console.log('keyup e.keyCode="'+w.keyCode+'"');
  91. if(w.keyCode == 87){
  92. console.log('stop firing');
  93. switchy = false;
  94. clearInterval(interval);
  95. return;
  96. }
  97. })