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

Pages: (2): « First « 1 [ 2 ] Last »
Toast Box Help
Author: Message:
markee
Veteran Member
*****

Avatar

Posts: 1621
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
Pages: (2): « First « 1 [ 2 ] Last »
« 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