UD Radio Accelerator

Removes one step (and thus one AP and IP) from retuning a radio reciever.

  1. // ==UserScript==
  2. // @name UD Radio Accelerator
  3. // @description Removes one step (and thus one AP and IP) from retuning a radio reciever.
  4. // @include http://urbandead.com/map.cgi*
  5. // @include http://www.urbandead.com/map.cgi*
  6. // @exclude http://urbandead.com/map.cgi?logout
  7. // @exclude http://www.urbandead.com/map.cgi?logout
  8. // @version 0.0.1.20210919202135
  9. // @namespace https://greasyfork.org/users/817108
  10. // ==/UserScript==
  11.  
  12. /* Urban Dead Radio Accelerator
  13. * v1.0
  14. *
  15. * Copyright (C) 2008 Ville Jokela -- midianian@penny-craal.org
  16. *
  17. * Released under the terms of the GNU GPL V2, which can be found at http://www.gnu.org/copyleft/gpl.html
  18. */
  19.  
  20. function askForFreq(evt) {
  21. var newFreq = prompt('Input new frequency', '');
  22. var address = location.protocol + '//' + location.host + '/map.cgi?newfreq=' + newFreq + '&oldfreq=' + evt.target.parentNode.lastChild.value;
  23. location.assign(address);
  24. }
  25.  
  26. function insertCheckers() {
  27. var radios = document.evaluate('//input[@value="radio"]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
  28. for (var i = 0; i < radios.snapshotLength; i++) {
  29. var form = radios.snapshotItem(i).parentNode;
  30. form.firstChild.type = 'button';
  31. form.addEventListener('click', function(evt) { askForFreq(evt); }, true);
  32. }
  33. }
  34.  
  35. insertCheckers();