What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Toast Box Help

Toast Box Help
Author: Message:
ddunk
Veteran Member
*****

Avatar

Posts: 1228
Reputation: 51
35 / Male / Flag
Joined: Mar 2004
RE: Toast Box Help
K, you have a few problems we need to address.
quote:
Originally posted by Vexor
function OnEvent_ChatWndCreated(Origin)
OnEvent_ChatWndCreated doesn't have an Origin parameter, just ChatWnd.
quote:
Originally posted by Vexor
if (Origin = Messenger.MyName)
If you're comparing two things, use == instead of =. But this if statement isn't needed anyway because there's no Origin to check.
quote:
Originally posted by Vexor
MsgPlus.DisplayToastContact(Origin ,"Opened a Chat Window With", Origin ,"CHIMES.WAV");
With that, you're saying "Open a toast with the title 'Origin' (which doesn't exist), have text of 'Opened a Chat Window With', play the sound 'Origin' and run the function 'CHIMES.WAV' when you click the toast." Also, you don't need to use DisplayToastContact. Ignore that, didn't realize DisplayToastContact used different params. :P I'd still suggest using DisplayToast instead.

code:
function OnEvent_ChatWndCreated(ChatWnd)
{
    var Contacts = ChatWnd.Contacts; //Get names of contacts in newly created window.
    var e = new Enumerator(Contacts); //iterate ChatWnd.Contacts (see: http://m00.cx/mpl/docs/ref-contacts-iterator.htm)
    var Contact = e.item();
    MsgPlus.DisplayToast(Messenger.MyName,"Opened a Chat Window With\n" + Contact.Email,"CHIMES.WAV"); //create the toast.
}
(Won't work with multi-user convos, but it works fine for the creating of a single person window. However, this toast will appear when someone sends a message to you if you do not have a window open with them before.)

EDIT: Use markee's script because I was too lazy to add a ChatWnd.Count check. My above points still stand though :P

EDIT2:
code:
function OnEvent_ChatWndCreated(ChatWnd)
{
    var ChatWndContacts = ChatWnd.Contacts;
    if(ChatWndContacts.Count == 1)
    {
        var e = new Enumerator(ChatWndContacts);
        var Contact = e.item();
         MsgPlus.DisplayToast(Messenger.MyName,"Opened a Chat Window With\n" + Contact.Email,"CHIMES.WAV");
    }
}

Use that.

This post was edited on 07-20-2006 at 11:29 AM by ddunk.
07-20-2006 11:21 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Toast Box Help - by Vexor on 07-20-2006 at 11:03 AM
RE: Toast Box Help - by markee on 07-20-2006 at 11:20 AM
RE: Toast Box Help - by ddunk on 07-20-2006 at 11:21 AM
RE: Toast Box Help - by Vexor on 07-20-2006 at 11:29 AM
RE: Toast Box Help - by ddunk on 07-20-2006 at 11:32 AM
RE: Toast Box Help - by Vexor on 07-20-2006 at 11:33 AM
RE: Toast Box Help - by markee on 07-20-2006 at 11:39 AM
RE: Toast Box Help - by Vexor on 07-20-2006 at 11:53 AM
RE: Toast Box Help - by markee on 07-20-2006 at 01:02 PM
RE: Toast Box Help - by Vexor on 07-20-2006 at 01:24 PM
RE: Toast Box Help - by markee on 07-20-2006 at 01:38 PM


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