I need a little help... |
Author: |
Message: |
dbgtrgr
New Member
^.^
Posts: 14
33 / / –
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, 17 minutes, 7 seconds ago
|
|
07-25-2006 01:04 AM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
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 |
|
|
Stigmata
Veteran Member
Posts: 3520 Reputation: 45
21 / /
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 |
|
|
dbgtrgr
New Member
^.^
Posts: 14
33 / / –
Joined: Apr 2004
|
O.P. RE: I need a little help...
Thank you ^^ I couldn't figure out how to use teh Enumator
Countdown to Christmas: 6547 days, 15 hours, 17 minutes, 7 seconds ago
|
|
07-25-2006 02:57 AM |
|
|
markee
Veteran Member
Posts: 1622 Reputation: 50
36 / /
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
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.
|
|
07-25-2006 03:15 AM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
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
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 |
|
|
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.
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, 31 minutes, 7 seconds ago
|
|
07-25-2006 03:26 AM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
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 |
|
|
markee
Veteran Member
Posts: 1622 Reputation: 50
36 / /
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
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.
|
|
07-25-2006 03:35 AM |
|
|
|