UD Radio Accelerator

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name		UD Radio Accelerator
// @description		Removes one step (and thus one AP and IP) from retuning a radio reciever.
// @include		http://urbandead.com/map.cgi*
// @include		http://www.urbandead.com/map.cgi*
// @exclude		http://urbandead.com/map.cgi?logout
// @exclude		http://www.urbandead.com/map.cgi?logout
// @version 0.0.1.20210919202135
// @namespace https://greasyfork.org/users/817108
// ==/UserScript==

/* Urban Dead Radio Accelerator
 * v1.0
 *
 * Copyright (C) 2008 Ville Jokela -- [email protected]
 *
 * Released under the terms of the GNU GPL V2, which can be found at http://www.gnu.org/copyleft/gpl.html
 */

function askForFreq(evt) {
	var newFreq = prompt('Input new frequency', '');
	var address = location.protocol + '//' + location.host + '/map.cgi?newfreq=' + newFreq + '&oldfreq=' + evt.target.parentNode.lastChild.value;
	location.assign(address);
}

function insertCheckers() {
	 var radios = document.evaluate('//input[@value="radio"]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
	 for (var i = 0; i < radios.snapshotLength; i++) {
	 	var form = radios.snapshotItem(i).parentNode;
		form.firstChild.type = 'button';
		form.addEventListener('click', function(evt) { askForFreq(evt); }, true);
	 }
}

insertCheckers();