This script will block all contacts in the chat window if it's a group chat.
However while testing I noticed a little problem, the script blocks too fast for the "You have been blocked" message to get send...
Maybe someone knows how to fix that, I tried using a timer to block, but you can't send the ChatWnd object to the timer.
code:
function onEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
if (Origin != Messenger.MyName && MessageKind != 6 && Messenger.Mystatus == 4)
{
if (ChatWnd.EditChangeAllowed)
{
ChatWnd.SendMessage("You have been blocked for talking while I'm busy");
}
for (var e = new Enumerator(ChatWnd.Contacts); !e.atEnd(); e.moveNext())
{
e.item().blocked = true;
Debug.Trace(e.item().name + "( " + e.item().email + " ) has been blocked");
}
}
}