What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Contact singout script, need some advice

Contact singout script, need some advice
Author: Message:
scutterman
Junior Member
**

Avatar
-- Scutterman avatar from Runescape

Posts: 21
– / Male / Flag
Joined: Jul 2007
O.P. Contact singout script, need some advice
Hi I have made a script which uses the DisplayToastContact feature inside the ContactSignOut to tell you about a contact who has just signed out.

The script:

code:
function OnEvent_Initialize(MessengerStart)
{

Debug.Trace("Script Started")

}

// This is so I can get the Email of a contact who has just signed out
function OnEvent_ContactSignout(Email)
{
    // This is to get all og the details I need
    var details = Messenger.MyContacts.GetContact(Email)
   
    // I want to use this to add the pic to the toast but I don't know how
    var pic = details.DisplayPicture
   
    // This is to get the name to use in DisplayToastContact
    var name = details.Name
   
    // This is to make the script neater
    var message = " has signed out"

    // This is the Toast
    MsgPlus.DisplayToastContact("Contact SignOut",name,message,"online.mp3")

}


function  OnEvent_Uninitialize(MessengerExit)
{

Debug.Trace("Script Ended")

}




I want to know if it is possible to have the display pic in the toast as well (like msn does when it tells you when a contact has signed in)

I would also like to know how I can crop names that are over a certain length and add the "..." so It doesn't just cut off the names which are too long (also like msn does for contact sign in)

Thanks for all of your help
~~Scutterman~~

Of course the world doesn't make sense
Its only purpose is to be somewhere that
humans can stand around in complaining
that the world doesn't make sense


08-17-2007 12:19 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Contact singout script, need some advice
You cannot show an image on the window.
You can check the length of the contacts Name property and see how long it is then you can resize and add "...".
code:
if (name.length > 10 /* change to whatever you want */) name = name.substr(0, 10/* change to whatever you want */) + '...';

This post was edited on 08-20-2007 at 01:54 PM by matty.
08-17-2007 01:07 PM
Profile E-Mail PM Find Quote Report
scutterman
Junior Member
**

Avatar
-- Scutterman avatar from Runescape

Posts: 21
– / Male / Flag
Joined: Jul 2007
O.P. RE: Contact singout script, need some advice
Thanks for that, helped alot.
~~Scutterman~~

Of course the world doesn't make sense
Its only purpose is to be somewhere that
humans can stand around in complaining
that the world doesn't make sense


08-17-2007 03:27 PM
Profile E-Mail PM Find Quote Report
scutterman
Junior Member
**

Avatar
-- Scutterman avatar from Runescape

Posts: 21
– / Male / Flag
Joined: Jul 2007
O.P. RE: Contact singout script, need some advice
Hi, just a quick not to say that the script:
code:

    if (name.length > 17)
    {
    name = name.substr(17) + '...';
    }



cut off everything from character 0 to 16. After a bit of playing around with it I worked out that it should have been:

code:

    if (name.length > 17)
    {
    name = name.substr(0,17) + '...';
    }



Just thought I'd mention it in case any other scripters look at this thread looking for a similar thing

later
~~Scutterman~~

Of course the world doesn't make sense
Its only purpose is to be somewhere that
humans can stand around in complaining
that the world doesn't make sense


08-20-2007 01:02 PM
Profile E-Mail 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