Contact Name - Printable Version
-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Contact Name (/showthread.php?tid=64474)
Contact Name by Suma on 08-04-2006 at 10:07 PM
Hi,
I was searching for a code that show's me the nickname of your contact person, I want to make a script like:
[/code]
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind)
{
// if my contact has the same name as me, then: {
var Message = + HERE THE CONTACT NAME CODE + "Has the same name " ;
Message = MsgPlus.RemoveFormatCodes(Message);
MsgPlus.DisplayToast("Name check", Message);
}
//} else { do nothing }
[/code]
But I'm missing some codes, could anyone help me with these codes? (look at the commands)
Thanks
RE: Contact Name by alexp2_ad on 08-04-2006 at 10:10 PM
code: function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind){
if(Origin == Messenger.MyName){
var ToastMessage = Origin + "Has the same name " ;
ToastMessage = MsgPlus.RemoveFormatCodes(ToastMessage);
MsgPlus.DisplayToast("Name check", ToastMessage);
}
}
RE: Contact Name by Suma on 08-04-2006 at 10:29 PM
yes, i know the Origin code... but that don't work on my new script... is ther no other code who get only the name of your contact?
RE: Contact Name by cloudhunter on 08-05-2006 at 12:59 AM
Why doesn't it work on your new script? Post it here and lets look to see if we can fix it.
The origin code is the only code for getting a name from your recieved message.
Cloudy
RE: Contact Name by Suma on 08-05-2006 at 10:37 AM
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?
|