What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [REQUEST] Group chat monitor...er?

[REQUEST] Group chat monitor...er?
Author: Message:
Jigain
New Member
*


Posts: 4
Joined: Apr 2009
O.P. [REQUEST] Group chat monitor...er?
If at all possible, I would greatly appreciate it if someone took the time and effort to create a script that:

  • Was executed as soon as a group chat is initiated,
  • Checks for any message you send to the group chat,
  • If no message has been sent for, say, two minutes, executes the primary function of the script.

The primary function would, in my mind, consist of three separate actions:

  • Send a predefined (preferrably user customizable) message to the group chat.
  • Close the group chat window.
  • Alert the user, when he/she arrives at his/her computer, that a group chat was initiated while you were away.

The very purpose of this is - as I myself has been the victim of many a times - to stop the senseless people who live on the other side of the world, figure they're bored, and invite everyone on their contact list regardless of status, without asking first, to a massive group chat. Last time I had almost an entire essay to scroll through - I blocked the responsible person after explaining I can't accept that.

I'm sure the idea can do with some polishing, and I don't even know if it's possible. Input very much appreciated.

This post was edited on 04-08-2009 at 02:47 PM by Jigain.
04-08-2009 02:47 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [REQUEST] Group chat monitor...er?
js code:
var oChatWnd = {};

function OnEvent_ChatWndCreated( pChatWnd ) {
    __add ( pChatWnd );
}

function OnEvent_ChatWndDestroyed( pChatWnd ) {
    __remove ( pChatWnd.Handle );
}

function OnEvent_ChatWndSendMessage( pChatWnd, sMessage ) {
    __remove( pChatWnd.Handle );
}

function OnEvent_Timer( sTimerId ) {
    if ( oChatWnd[ parseInt( sTimerId ) ].iSecondCounter === 120 ) {
>>>        oChatWnd[ parseInt( sTimerId ).pChatWnd.SendMessage( 'I am currently away from my computer. This is an auto-disconnect message that occures after 2 minutes of inactivity.' );<<<
        __remove( sTimerId );
    } else {
        oChatWnd[ parseInt( sTimerId ) ].iSecondCounter++;
        MsgPlus.AddTimer( sTimerId, 1000 );
    }
}

function __add( pChatWnd ) {
    if ( pChatWnd.Contacts.Count ) === 1 ) return;
    oChatWnd[ pChatWnd.Handle ] = {};
        oChatWnd[ pChatWnd.Handle ].pChatWnd = pChatWnd;
        oChatWnd[ pChatWnd.Handle ].iSecondCounter = 0;
    MsgPlus.AddTimer( pChatWnd.Handle, 1000 );
}

function __remove( pChatWnd ) {
    if ( typeof oChatWnd[ parseInt( pChatWnd ) ] === 'undefined' ) return;

>>>    var s=''<<<
>>>    for ( var e = new Enumerator( oChatWnd[ parseInt( pChatWnd ) ].pChatWnd.Contacts ); !e.atEnd(); e.moveNext() {<<<
>>>        s+=e.item().Email+ ( !e.atEnd() ? ', ' : '' );<<<
>>>    }<<<
>>><<<
>>>    MsgPlus.LogEvent( 'Group chat', 'A group chat session was initiated with '+s+' however was closed after 2 minutes of inactivity.', EVICON_PLUS );<<<
    MsgPlus.CancelTimer( pChatWnd );
    Interop.Call( 'user32', 'SendMessageW', parseInt( pChatWnd ), 0x10 /* WM_CLOSE */, 0, 0 );
    delete oChatWnd[ parseInt( pChatWnd ) ];
}

I dunno something like that... this closes the chat window after 2 mins of not saying anything...

This post was edited on 04-09-2009 at 01:13 PM by matty.
04-08-2009 03:25 PM
Profile E-Mail PM Find Quote Report
Jigain
New Member
*


Posts: 4
Joined: Apr 2009
O.P. RE: [REQUEST] Group chat monitor...er?
Wow, that made no sense at all to me. ;)

So, now we're missing weaving in the message just prior to closing, leaving a notification that there has been a group chat, and something I forgot to mention, stopping the script the first time the user says anything - to keep the user from having to reply within two minutes constantly. Oh, and making the rule only apply to group chats.

Many thanks to you for taking it this far!
04-08-2009 03:39 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [REQUEST] Group chat monitor...er?
quote:
Originally posted by Jigain
stopping the script the first time the user says anything
to keep the user from having to reply within two minutes constantly
making the rule only apply to group chats
The above is already taken care of...

quote:
Originally posted by Jigain
weaving in the message just prior to closing
Done

the notification thing well thats something else all depends how it is to be done.

This post was edited on 04-08-2009 at 05:27 PM by matty.
04-08-2009 05:20 PM
Profile E-Mail PM Find Quote Report
Jigain
New Member
*


Posts: 4
Joined: Apr 2009
O.P. RE: [REQUEST] Group chat monitor...er?
Splendid, excellent work and many thanks!

As for notifications, I don't know what scripts can do... send a mail to yourself? Or an instant message to yourself? Something else?
04-09-2009 04:43 AM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [REQUEST] Group chat monitor...er?
The easiest way would be to use the Event Viewer to signify that the conversation window was closed and you can have the events written to a file.

- Added (the second highlighted code block in the post)

This post was edited on 04-09-2009 at 01:14 PM by matty.
04-09-2009 01:01 PM
Profile E-Mail PM Find Quote Report
Jigain
New Member
*


Posts: 4
Joined: Apr 2009
O.P. RE: [REQUEST] Group chat monitor...er?
Splendid, thank you very much!
04-10-2009 05:31 AM
Profile E-Mail PM Find Quote Report
« 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