What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » I need a little help...

I need a little help...
Author: Message:
dbgtrgr
New Member
*

Avatar
^.^

Posts: 14
33 / Male / –
Joined: Apr 2004
O.P. I need a little help...
I'm having some problems getting the email of the person who sent the message inside of a "RecieveMessage" function. :\ How could I go about doing this?
Countdown to Christmas: 6547 days, 15 hours, 29 minutes, 1 second ago
07-25-2006 01:04 AM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: I need a little help...
quote:
Originally posted by dbgtrgr
I'm having some problems getting the email of the person who sent the message inside of a "RecieveMessage" function. :\ How could I go about doing this?
There really isn't an easy way of doing it.

code:
function OnEvent_ChatWndReceiveMessage(pChatWnd, sOrigin, sMessage, nMessageKind){
    if (pChatWnd.Contacts.Count == 1 && Messenger.MyName != sOrigin){
        for(var enumerator = new Enumerator(pChatWnd.Contacts) ; !enumerator.atEnd(); enumerator.moveNext())    {
            var Contact = enumerator.item();
            Debug.Trace(Contact.Email);
        }
    }
}

[edit]
    Beat ya stiggy
[/edit]

This post was edited on 07-25-2006 at 02:42 AM by matty.
07-25-2006 02:37 AM
Profile E-Mail PM Find Quote Report
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
21 / Other / Flag
Joined: Jul 2003
RE: I need a little help...
i wrote this for a mate a while ago

code:
var Contacts = ChatWnd.Contacts;
var e = new Enumerator(Contacts);
for(; !e.atEnd(); e.moveNext()) {
    var Contact = e.item();
    Debug.Trace("Contact's Email: "+Contact.Email);
}

07-25-2006 02:38 AM
Profile PM Web Find Quote Report
dbgtrgr
New Member
*

Avatar
^.^

Posts: 14
33 / Male / –
Joined: Apr 2004
O.P. RE: I need a little help...
Thank  you ^^ I couldn't figure out how to use teh Enumator :P
Countdown to Christmas: 6547 days, 15 hours, 29 minutes, 1 second ago
07-25-2006 02:57 AM
Profile E-Mail PM Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1622
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: I need a little help...
quote:
Originally posted by dbgtrgr
Thank  you ^^ I couldn't figure out how to use teh Enumator :P
The way I do it is just copy and paste from ones that work everytim I need one.  It is much easier that way and you always know it is going to be right because you have used it before.
[Image: markee.png]
07-25-2006 03:15 AM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: I need a little help...
quote:
Originally posted by markee
quote:
Originally posted by dbgtrgr
Thank  you ^^ I couldn't figure out how to use teh Enumator :P
The way I do it is just copy and paste from ones that work everytim I need one.  It is much easier that way and you always know it is going to be right because you have used it before.
Wow that was the worst advice ever sorry to say. Simply put he wanted the code to do it we gave it. And how are you going to know what the code does if you just look at it and aren't familiar with it.
07-25-2006 03:25 AM
Profile E-Mail PM Find Quote Report
cloudhunter
Senior Member
****


Posts: 536
Reputation: 18
37 / – / –
Joined: Dec 2005
RE: I need a little help...
He's only saying that looking at code (if you understand it) can save you writing a long function yourself.
[Image: cloudy.jpg]
Sig by pirateok/marisaok/marisa ;)
quote:
Originally posted by Moulin Rouge
The greatest thing you'll ever learn, is just to love and be loved in return

6914 days, 5 hours, 43 minutes, 1 second ago
07-25-2006 03:26 AM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: I need a little help...
quote:
Originally posted by cloudhunter
He's only saying that looking at code (if you understand it) can save you writing a long function yourself.
I know what hes saying but its not good to go and steal code because you will possibly learn bad habbits or not learn at all.
07-25-2006 03:34 AM
Profile E-Mail PM Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1622
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: I need a little help...
quote:
Originally posted by Matty
quote:
Originally posted by markee
quote:
Originally posted by dbgtrgr
Thank  you ^^ I couldn't figure out how to use teh Enumator :P
The way I do it is just copy and paste from ones that work everytim I need one.  It is much easier that way and you always know it is going to be right because you have used it before.
Wow that was the worst advice ever sorry to say. Simply put he wanted the code to do it we gave it. And how are you going to know what the code does if you just look at it and aren't familiar with it.
I have only started to understand it very recently (I still wouldn't be able to fully do it myself, but it's getting there).  The main 2 things that someone would start to use an enumerator for are for getting a contact specific object and a ChatWnd specific object from contacts and ChatWnds objects respectively.  It is really easy to change a couple of little things in te enumerator to adapt it between the two, but once you have worked each one out once you don't really need to look back on it again until you become a more compitant scripter trying to make more complex scripts.  That's just my opinion and what I did, it has worked for me and I was jst trying to share a little bit of my advice, maybe I should have made a better explaination of this before.
[Image: markee.png]
07-25-2006 03:35 AM
Profile 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