Neopets : Lunar Temple

By w35l3y Last update Sep 29, 2008 — Installed 1,745 times. Daily Installs: 1, 1, 4, 2, 1, 5, 1, 5, 2, 1, 2, 1, 0, 3, 3, 4, 2, 2, 3, 1, 0, 3, 6, 0, 2, 2, 2, 0, 0, 0, 2, 1

There are 1 previous version of this script.

// ==UserScript==
// @name           Neopets : Lunar Temple
// @namespace      http://gm.wesley.eti.br/neopets
// @description    Selects the correct image to Lunar Temple
// @include        http://www.neopets.com/shenkuu/lunar/?show=puzzle
// @require        http://www.wesley.eti.br/includes/js/php.js
// @require        http://www.wesley.eti.br/includes/js/php2js.js
// @require        http://gm.wesley.eti.br/gm_default.js
// @author         w35l3y
// @email          w35l3y@brasnet.org
// @version        1.0.1
// @copyright      w35l3y 2008
// @license        GNU GPL
// @homepage       http://www.wesley.eti.br
// ==/UserScript==

/**************************************************************************

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

**************************************************************************/

checkForUpdate({
	'file':'http://userscripts.org/scripts/source/28359.user.js',
	'name':'Neopets : Lunar Temple',
	'namespace':'http://gm.wesley.eti.br/neopets',
	'version':'1.0.1'
});

(function(){	// script scope
	var user = {
		interval:GM_getValue('interval',	'4000-7000').split('-').array_map(parseInt,array_fill(0,2,10))
	};

	var script = {
		answer:((8+Math.round(document.body.innerHTML.match(/angleKreludor=(\d+)/)[1]/22.5)) % 16)
	};

	var shadow = document.evaluate("//form[contains(@action,'results.phtml')]/table/tbody/tr/td/input[@name = 'phase_choice']",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null).snapshotItem(script.answer);
	if (shadow)
	{
		var nextAction = function(){shadow.click();};

		setTimeout(nextAction,randomValue(user.interval));
	}
})();