What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Simple Problem w/ Objects

Simple Problem w/ Objects
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Simple Problem w/ Objects
The function OnEvent_ChatWndMessageReceive has a parameter called pChatWnd. This is the Chat Window where the event happened. Therefore you could do something like this:

Javascript code:
var oChatWnds = {}; // variable to hold the chat window handles and the messages we send to make sure we are not sending the message causing infinite loops
 
function OnEvent_ChatWndSendMessage ( pChatWnd , sMessage )
{
    oChatWnds [ pChatWnd.Handle ] = sMessage; // add the message to the object
}
 
function OnEvent_ChatWndReceiveMessage ( pChatWnd , sOrigin , sMessage , nMessageKind )
{
    if ( oChatWnds [ pChatWnd.Handle ] === sMessage ) return sMessage; // Since we just send this message we can ignore it
   
    if ( Messenger.MyStatus === STATUS_BUSY ) // check if your status is busy
    {
        pChatWnd.SendMessage ( 'I currently am busy and cannot reply. Thank you for your paitence.' ); // if it is busy then send a message
    }
}
 
function OnEvent_ChatWndDestroyed ( pChatWnd )
{
    delete oChatWnds [ pChatWnd.Handle ]; // delete the message from our storage object
}

09-15-2009 05:45 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Simple Problem w/ Objects - by Cetanu on 09-15-2009 at 02:34 PM
RE: Simple Problem w/ Objects - by matty on 09-15-2009 at 02:45 PM
RE: Simple Problem w/ Objects - by Cetanu on 09-15-2009 at 02:50 PM
RE: Simple Problem w/ Objects - by matty on 09-15-2009 at 02:58 PM
RE: Simple Problem w/ Objects - by Cetanu on 09-15-2009 at 05:18 PM
RE: Simple Problem w/ Objects - by matty on 09-15-2009 at 05:45 PM
RE: Simple Problem w/ Objects - by Cetanu on 09-15-2009 at 06:02 PM
RE: Simple Problem w/ Objects - by matty on 09-15-2009 at 06:36 PM
RE: Simple Problem w/ Objects - by Cetanu on 09-15-2009 at 08:32 PM
RE: Simple Problem w/ Objects - by CookieRevised on 11-23-2009 at 09:47 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