This is an edited google query script. Im trying to make it search the highscores of the MMORPG RuneScape and it workd fine untill I try to change the command from /google, !google or !search. What would the problem be? :P I think this is probably me beeing a complete n00b and a very simple problem :D
code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
if (Message.substr(0,7) == "/stats")
{
Message = Message.substr(8);
return query(Message);
}
}
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
if (Message.substr(0,7) == "!google" || Message.substr(0,7) == "!search")
{
Message = Message.substr(8);
ChatWnd.SendMessage("RuneScape HighScores Search Results: " + query(Message));
}
if (MessageKind == 4)
{
ChatWnd.SendMessage("RuneScape HighScores Search Results: " + query(Message));
}
}
function query(query)
{
query = escape(query);
query = "http://hiscore.runescape.com/hiscorepersonal.ws?user1=" + query;
return query;
}
function OnGetScriptCommands()
{
var ScriptCommands = "<ScriptCommands>";
ScriptCommands += "<Command>";
ScriptCommands += "<Name>RuneScape Stats Lookup</Name>";
ScriptCommands += "<Description>Search RuneScape Personal HighScores</Description>";
ScriptCommands += "<Parameters><search></Parameters>";
ScriptCommands += "</Command>";
ScriptCommands += "</ScriptCommands>";
return ScriptCommands;
}