quote:
Originally posted by Matty
You will need to code it so it find the ID number based on the profile name or however its done.
Well I want it so that I could type:
/PlayerID *players ID here*
So basically I just want that number to be attached to the end of the link the game is using. (Keep in mind this is the first thing I've written in JS 

)
Btw heres my code:
function OnEvent_Initialize(MessengerStart)
{
}
function OnGetScriptCommands()
{
    var s = "<ScriptCommands>";
    s += " <Command>";
    s += " <Name>PlayerID</Name>";
    s += " <Description>Search Player ID's!</Description>";
    s += " </Command>";
    s += "</ScriptCommands>";
return s;
}
Debug.Trace("Hello World!");
function OnEvent_ChatWndSendMessage(ChatWnd, strMessage)
{
     if (strMessage.charAt(0) != '/') return strMessage;
       var arrMessage = strMessage.split(' ');
       var strCommand = arrMessage[0];
      switch(strCommand){
        case "/PlayerID":
    var idnumber = "2";
    MsgPlus.DisplayToast("Game Search", "You have searched for idnumber", "Please wait.");
    //Interop.Call("shell32", "ShellExecuteW", ChatWnd.Handle, "open", "http://www.game.com/profiles.php?XID=" + idnumber;
    new ActiveXObject("WScript.Shell").Run("http://www.game.com/profiles.php?XID=" + idnumber);
    return "";
    default:
    return strMessage;
}}
Debug.Trace("Hello World!");
function OnEvent_Uninitialize(MessengerExit)
{
}