It works good, but not for my script... this is what I have now:
code:
// our pmchat script
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind)
{
var Blaat = '!chat'; // Text that must be in your name
var LangeText = Messenger.MyName;
var Mijnnaam = Messenger.MyName.substr(0,20);
if(LangeText.indexOf(Blaat) != -1){
if(MessageKind == 1)
{
if(Message.substr(0,6) == '!chat ') {
var Contacts = ChatWnd.Contacts
var e = new Enumerator(Contacts);
Debug.Trace(Contacts.Count);
if(Origin.indexOf(Mijnnaam) != -1){
for(var Email = ''; !e.atEnd(); e.moveNext())
{
var Contact = e.item();
if (Email == '' || Contact.Name == Origin){
Email = Contact.Email;
}
}
if (Messenger.MyName == Origin) //If I say someting
{
Email = Messenger.MyEmail;
}
if (Message.substr != '')
{
Messenger.MyPersonalMessage = Email + " zegt: " + Message.substr;
}
}else{
var naam = Origin.substring(0,20);
Messenger.MyPersonalMessage = naam + " zegt: " + Message.substr;
}
}
}
}
}
function OnEvent_Uninitialize(MessengerExit)
{
Messenger.MyPersonalMessage = CurrPM;
}
but if I say something, the script don't show MyName but my email because I have the same name als I do... this script must control if my contact had the same name as me, if he have the e-mail will be showed instead of his name. but if I say something my e-mail wil be displayed instead of my name, thats the reason why he must only must check if it is the same as my name so I can say things with my nam instead of my e-mail, you get it?