Astr.io - Respawn on R

Click R to respawn in Astr.io.

  1. // ==UserScript==
  2. // @name Astr.io - Respawn on R
  3. // @namespace http://gronlokke.github.io/
  4. // @version 0.1.2
  5. // @description Click R to respawn in Astr.io.
  6. // @author Gronlokke
  7. // @match http://astr.io/*
  8. // ==/UserScript==
  9. /* jshint ignore:start */
  10. var key = 82; // Change this to any key you want, you can get the key code on keycode.info.
  11.  
  12. window.onload = function() {
  13. var respawn = document.getElementsByClassName("rspwnBtn")[0];
  14. var play = document.getElementById("playBtn");
  15. window.onkeydown = function(e) {
  16. if (e.keyCode == key && document.activeElement == document.body) {
  17. rspwn(document.getElementById('nick').value);
  18. play.click();
  19. }
  20. }
  21. }
  22. /* jshint ignore:end */