#0 I opened the thread looking in full expectation to see something about AI... this has got absolutely nothing todo with AI...
#1
The ChatWndDestroyed event is fired when a chat window on your side is closed.
You can still send a message from inside this event because this event is triggered right before a chat window of you gets closed/destroyed, not after. So the window is still open at the time this event is executed.
Remember that a chat window can have multiple contacts. So it isn't as easy as "to get the contact's email". You will get the emails of all the contacts which are in the chat window.
To get the emails of the contacts, you need to enumerate a Contacts object to get a Contact object from where you can get the Email property.
If you look into the Scripting Documentation, you'll see that a ChatWnd object (which you get as a parameter in the ChatWndDestroyed event) will have a property Contacts.
Thus:
code:var objContactsInWindow = ChatWnd.Contacts;
for (var e = new Enumerator(objContactsInWindow); !e.atEnd(); e.moveNext()) {
var objContact = e.item();
Debug.Trace(objContact.Email);
}
or in short:
code:for (var e = new Enumerator(ChatWnd.Contacts); !e.atEnd(); e.moveNext()) {
Debug.Trace(e.item().Email);
}
Because of (A), what you want to do is not possible with the use of the ChatWndDestroyed event.
To do what you want you need to use 'packet sniffing' and sniff the incomming packets for a closed session notification.
Because of the nature of these closed session notifications, you can still not do what you want to do as these notifications are also send by the Messenger server itself when a timeout occurs (thus even when the contact did not closed the window).
Before you send a message to a chat window you must always check if you actually can send a message by checking upon the EditChangeAllowed boolean property of the ChatWnd object.
#2
I dunno what you exactly mean or want here, but I guess you want to know what is used in JScript as an escape character? it is the slash: \
eg:
\n => newline
\t => tab
\xCD => character in hexadecimal notation (must be 2 digits)
\uABCD => unicode character in hexadecimal notation (must be 4 digits)
\\ => the character \
\/ => the character / (for use in regular expressions for example)
etc...
As said by Cloudhunter, a nudge can not be detected by normal means. Again you must revert to 'packet sniffing' for that.
packet sniffing is listening to the raw incomming packets which are send by the servers (and listening to the raw outgoing packets send by your Messenger). You can use Pai's Xniff ActiveX DLL to do this.
This post was edited on 09-20-2006 at 12:29 AM by CookieRevised.