Advertisement
SniiKz

R To Split

Mar 14th, 2016
1,226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. // ==UserScript==
  2. // @name R-To-Split
  3. // @namespace R-To-Split
  4. // @version 1.0
  5. // @description R Key to Split
  6. // @author SYx
  7. // @match http://agar.io/*
  8. // @grant none
  9. // @run-at document-end
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. var amount = 1;
  14. var duration = 1; //ms
  15.  
  16. var overwriting = function(evt) {
  17. if (evt.keyCode === 82) { // KEY_R
  18. for (var i = 0; i < amount; ++i) {
  19. setTimeout(function() {
  20. window.onkeydown({keyCode: 32}); // KEY_SPACE
  21. window.onkeyup({keyCode: 32});
  22. }, i * duration);
  23. }
  24. }
  25. };
  26.  
  27. window.addEventListener('keydown', overwriting);
  28. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement