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:
markee
Veteran Member
*****

Avatar

Posts: 1622
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: Toast Box Help
Ok well again I haven't had a chance to test it but I think the problem was mostly how I set it out (should have had the 'cont = 1' at the begining) I have also added another timer to just make sure there is no problems.  I don't think there should be any more problems but I can't be assured of that, sorry.
code:
var cont;
function OnEvent_ChatWndCreated(ChatWnd)
{
  cont = 1
  var ChatWndContacts = ChatWnd.Contacts;
  if(ChatWndContacts.Count == 1)
  {
    var e = new Enumerator(ChatWndContacts);
    var Contact = e.item();
    Debug.Trace('1')
    MsgPlus.AddTimer('TimerId', '500')
  }
}

function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
  Debug.Trace('2')
  MsgPlus.AddTimer('TimerId2','100')
}

function OnEvent_Timer(TimerId)
{
  if (TimerId == "TimerId")
  {
    Debug.Trace('/1')
    if (cont == 1)
    {
      var Windows = Messenger.CurrentChats;
      var e = new Enumerator(Windows);
      for(; !e.atEnd(); e.moveNext())
      {
        var ChatWnd = e.item();
        var ChatWndContacts = ChatWnd.Contacts;
        if(ChatWndContacts.Count == 1)
        {
          var e = new Enumerator(ChatWndContacts);
          var Contact = e.item();
          MsgPlus.DisplayToastContact(Messenger.MyName ,"Opened a Chat Window With", Contact.Name,"CHIMES.WAV");
          cont = ''
        }
      }
    }
  }
  if (TimerId == "TimerId2")
  {
      if (cont == 1)
      {
        Debug.Trace('/2')
        MsgPlus.CancelTimer('TimerId')
        var Windows = Messenger.CurrentChats;
        var e = new Enumerator(Windows);
        for(; !e.atEnd(); e.moveNext())
        {
          var ChatWnd = e.item();
          var ChatWndContacts = ChatWnd.Contacts;
          if(ChatWndContacts.Count == 1)
          {
            var e = new Enumerator(ChatWndContacts);
            var Contact = e.item();
            MsgPlus.DisplayToastContact(Contact.Name ,"Opened a Chat Window With", Messenger.MyName ,"CHIMES.WAV");
            cont = ''
          }
        }
      }
  }
}
EDIT:Sorry I finally got to test it and had to change a timer, hope you like it (should all work for you now)

This post was edited on 07-20-2006 at 03:47 PM by markee.
[Image: markee.png]
07-20-2006 01:38 PM
Profile PM 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