Shoutbox

Notify StatusChange 1.1 - 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: Notify StatusChange 1.1 (/showthread.php?tid=91701)

Notify StatusChange 1.1 by diddy81 on 07-30-2009 at 04:45 PM

hi im new to this scripting stuff

i downloaded Notify StatusChange 1.1 but its in french so i translated it to English

it works but it calls the email of contact in the notify box
i want it to show their display name

so i checked the Scripting Documentation which told me the string was "Name"

so i changed every "Email" in the script to "Name" it don't work
can anyone help by doing this for me or pointing me in the right direction

my translated version is below

code:
/*
       Notify statusChanges 1.1


  This script displays a popup with the Email address and the new status of your contact when it modifies.

  I distribute it freely, so please do not change the code, thank you.

  Bon courage! ;)

  WaLd39 (wald39@hotmail.com)

*/

function OnEvent_ContactStatusChange(Email, Status)
{
    switch(Status)
    {
        case 3:
        var MyStatus = "Online";
        break;
        case 4:
        var MyStatus = "Busy";
        break;
        case 5:
        var MyStatus = "Back in a minute";
        break;
        case 7:
        var MyStatus = "Away";
        break;
        case 8:
        var MyStatus = "On the phone";
        break;
        case 9:
        var MyStatus = "out to lunch";
        break;
        default:
        var MyStatus = "Idle";
    }   

    var Message = Email + " has changed his status to " + MyStatus;
    Message = MsgPlus.RemoveFormatCodes(Message);
    MsgPlus.DisplayToast("", Message, "newalert.wma", "OnClick", Email);
}

function OnClick(Email)
{
    Messenger.OpenChat(Email);
}

RE: Notify StatusChange 1.1 by SmokingCookie on 07-31-2009 at 12:51 PM

Replace the code after the switch-case block (until the end of the function) with this:

JScript code:
var sName = Messenger.MyContacts.GetContact(Email).Name; // Retrieve the contact's display name
var Message = sName + " has changed their status to " + MyStatus;// Generate the message
Message = MsgPlus.RemoveFormatCodes(Message); // Remove formatting
MsgPlus.DisplayToast("",Message,"newalert.wma","OnClick",Email); // Display the toast and send the email address along with it