Advertisement
ImNotSpam

Untitled

Jan 4th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. var SplitInterval;
  2. var MacroInterval;
  3. var SplitDebounce = false;
  4. var MacroDebounce = false;
  5. $(document).on('keydown', function(input) {
  6. console.log("got keydown")
  7. if (input.keyCode == 16) {
  8. if (SplitDebounce) {
  9. return;
  10. }
  11. SplitDebounce = true;
  12. SplitInterval = setInterval(function() {
  13. $("body").trigger($.Event("keydown", {
  14. keyCode: 32
  15. }));
  16. $("body").trigger($.Event("keyup", {
  17. keyCode: 32
  18. }));
  19. }, 0);
  20. } else if (input.keyCode == 81) {
  21. if (MacroDebounce) {
  22. return;
  23. }
  24. MacroDebounce = true;
  25. MacroInterval = setInterval(function() {
  26. $("body").trigger($.Event("keydown", {
  27. keyCode: 87
  28. }));
  29. $("body").trigger($.Event("keyup", {
  30. keyCode: 87
  31. }));
  32. }, 0);
  33. }
  34. })
  35.  
  36. $(document).on('keyup', function(input) {
  37. if (input.keyCode == 16) {
  38. SplitDebounce = false;
  39. clearInterval(SplitInterval);
  40. return;
  41. } else if (input.keyCode == 81) {
  42. MacroDebounce = false;
  43. clearInterval(MacroInterval);
  44. return;
  45. }
  46. })
  47.  
  48. alert("By Sika Agar")
  49. alert ("subs To My Channel : Sika Agar")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement