What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » simple problem :P

simple problem :P
Author: Message:
Kukaka
New Member
*


Posts: 2
Joined: Sep 2007
O.P. simple problem :P
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>&lt;search&gt;</Parameters>";
    ScriptCommands += "</Command>";
    ScriptCommands += "</ScriptCommands>";

    return ScriptCommands;
}


This post was edited on 09-26-2007 at 08:28 PM by Kukaka.
09-26-2007 08:24 PM
Profile E-Mail PM Find Quote Report
phalanxii
Full Member
***


Posts: 146
Reputation: 5
32 / Male / Flag
Joined: Aug 2006
Status: Away
RE: simple problem :P
I would assume the problem is because you haven't changed the string lengths in the command:
code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
    if (Message.substr(0,6) == "/stats")
    {
        Message = Message.substr(7);
       
        return query(Message);
    }
}
09-27-2007 12:43 AM
Profile PM Find Quote Report
Kukaka
New Member
*


Posts: 2
Joined: Sep 2007
O.P. RE: RE: simple problem :P
quote:
Originally posted by phalanxii
I would assume the problem is because you haven't changed the string lengths in the command:
code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
    if (Message.substr(0,6) == "/stats")
    {
        Message = Message.substr(7);
       
        return query(Message);
    }
}

Yay! it worked :D Thank you ;)
09-27-2007 06:07 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On