NeoQuest II Remote Control

Automatically moves character based on user defined path. (1=north, 2=south, 3=west, 4=east, 5=northwest, 6=southwest, 7=northeast, 8=southeast

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name           NeoQuest II Remote Control
// @namespace      http://nq2guy.tz/
// @description    Automatically moves character based on user defined path. (1=north, 2=south, 3=west, 4=east, 5=northwest, 6=southwest, 7=northeast, 8=southeast
// @include        http://www.neopets.com/games/nq2/nq2*
// @version 0.0.1.20150906031709
// ==/UserScript==

//Copyright nq2guy 2008
//script licensed under, GNU GPL V3 , see http://www.gnu.org/licenses/gpl.txt for details

// Uncomment the below two lines to initialize your variables, but please edit them from about:config , filter:greasmonkey.scriptvals
//path = GM_setValue("Path","3");
//pathIndex = GM_setValue("pathIndex",0);

path = GM_setValue("Path","**********************PUT YOUR NUMBERS BETWEEN THESE QUOTATION MARKS*************************");
pathIndex = GM_getValue("pathIndex",0);

/*
Notes on coordinates

javascript: dosub(int)

1=north
2=south
3=west
4=east
5=northwest
6=southwest
7=northeast
8= southeast

*/
var i = 0;
var hiccup=1;
var divs = document.getElementsByTagName('div');
for(i=0;i<divs.length;i++)
{
	if (divs[i].className=="contentModuleHeader")
	{
		hiccup=0;
	}
}

if(hiccup)
{
	document.location.href="http://www.neopets.com/games/nq2/nq2.phtml";
}
else
{
var elements = document.getElementsByTagName('img');
var i = 0;
for(i=0;i<elements.length;i++)
{
	switch(elements[i].src)
	{
	case "http://images.neopets.com/nq2/x/com_begin.gif":
		document.location.href="http://www.neopets.com/games/nq2/nq2.phtml?start=1";
		break;
	case "http://images.neopets.com/nq2/x/com_atk.gif":
		document.location.href="javascript:setaction(4); document.ff.submit()";
		break;
	case "http://images.neopets.com/nq2/x/com_end.gif":
		document.location.href="javascript:setaction(2); document.ff.submit()";
		break;
	case "http://images.neopets.com/nq2/x/tomap.gif":
		document.location.href="http://www.neopets.com/games/nq2/nq2.phtml?finish=1";
		break;
	case "http://images.neopets.com/nq2/x/com_next.gif":
		document.location.href="javascript:setaction(1); document.ff.submit();";
		break;
	case "http://images.neopets.com/nq2/x/nav.gif":
		if((GM_getValue("Path").length) != pathIndex)
		{
			//alert("javascript:dosub(" + GM_getValue("Path")[pathIndex] + ");");
			document.location.href="http://www.neopets.com/games/nq2/nq2.phtml?act=move&dir=" + GM_getValue("Path")[pathIndex];
			GM_setValue("pathIndex",pathIndex+1);
		}
		else
		{
			alert("You have arrived at your destination. Please disable this script to take control.");
			GM_setValue("pathIndex",0)
		}
		break;
	}
}
}
//window.setTimeout(function() { document.location.href="http://www.neopets.com/games/nq2/nq2.phtml" }, 20000);