What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Getting Contacts name.

Getting Contacts name.
Author: Message:
apex
Junior Member
**


Posts: 20
Joined: Mar 2008
O.P. Getting Contacts name.
Hey all,

i made a (very) tiny script to change my psm.

The script auto detects if i use any smiley's like
code:
:) :D :P and (A)
and changes my psm according to the smiley.

Example:

When i say :) at the beginning of my sentence, the script changes my PSM to: "I am happy now."

BUT

I want to change it so that if i type :) in a convorsation with john, the psm will say:

Thx to John i am happy now!

I made it like this:

code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
    var cmd;
    var msg;
    var param = new Array();
    var sitem;
    var sarray = new Array();
    sarray = Message.split(" ");
    msg = "";   
    for (sitem in sarray)
    {
        switch(sitem)                 
        {
            case "0":   
                cmd = sarray[sitem].toLowerCase();
            break;
            default:
                param[sitem] = sarray[sitem].toLowerCase();
                msg += " " + sarray[sitem];
            break;
        }
    }
    if(cmd == ":)")
    {
    Messenger.MyPersonalMessage = "Huidige Stemming: Blij! :)" + name + "test";
    }
        else if(cmd == ":(")
    {
    Messenger.MyPersonalMessage = "Huidige Stemming: Niet blij! ";
    }
        else if(cmd == ":d")
    {
    Messenger.MyPersonalMessage = "Huidige Stemming: Erg blij!! ";
    }
        else if (cmd == ":'(")
    {
    Messenger.MyPersonalMessage = "Huidige Stemming: Verdrietig. ";
    }
        else if(cmd == ":@")
   
    Messenger.MyPersonalMessage = "Huidige Stemming: Boos! ";
    }
        else if(cmd == ":o")
    {
    Messenger.MyPersonalMessage = "Huidige Stemming: Verast. ";
    }
        else if(cmd == "(l)")
    {
    Messenger.MyPersonalMessage = "Huidige Stemming: Verliefd! ";
    }
        else if(cmd == "(u)")
    {

}

But i don't know how to get the contacts name?

p.s.  Some parts are dutch but their not important for the script.
10-08-2008 06:49 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Getting Contacts name.
the ChatWnd parameter has a Contacts object which you need to iterate through

code:
for(var oContact = new Enumerator(ChatWnd.Contacts); !oContact.atEnd(); oContact.moveNext()){
    Debug.Trace(oContact.item().Name);
}

This post was edited on 10-08-2008 at 06:58 PM by matty.
10-08-2008 06:58 PM
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