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

Selective Talker
Author: Message:
Intosia
Junior Member
**

Avatar
I'm dynamic ^^

Posts: 78
40 / Male / –
Joined: Mar 2004
RE: Selective Talker
Ill post the code here...


code:
var blocked = "False";
var BlockedContacts = new Array()

function OnEvent_ChatWndCreated(ChatWnd) {
    var e = new Enumerator(ChatWnd.Contacts);
    var Contact = e.item();
    Contact.Blocked = "False";
}

function OnGetScriptMenu(Location) {
    var ScriptMenu = "<ScriptMenu>";

        ScriptMenu += "<MenuEntry Id=\"mnuBlockall\">Block all!</MenuEntry>";
        ScriptMenu += "<Seperator/>";
        ScriptMenu += "<MenuEntry Id=\"mnuUnblockall\">Unblock all!</MenuEntry>";
    ScriptMenu += "</ScriptMenu>";
    return ScriptMenu;
}


function OnEvent_MenuClicked(MenuItemId,Location,OriginWnd) {
   switch(MenuItemId) {
      case 'mnuBlockall':
         blockall();
         break;
      case 'mnuUnblockall':
         unblockall();
         break;
   }
}

function blockall()
{
    i = -1;
    var e = new Enumerator(Messenger.MyContacts);
    for(; !e.atEnd();  e.moveNext()) {
        var Contact = e.item();
           
        if (Contact.Blocked) {
            BlockedContacts[i++] = Contact.Email;
        }
   
        Contact.Blocked = true;
    }
    blocked = true;
}

function unblockall()
{
    var e = new Enumerator(Messenger.MyContacts);
    for(; !e.atEnd();  e.moveNext()) {
        var Contact = e.item();
       
        // Check if contact was blocked before       
        Match = false;
        var e2 = new Enumerator(BlockedContacts);
        for(; !e2.atEnd();  e2.moveNext()) {
            var BlockedEmail = e2.item();
            if (Contact.Email == BlockedEmail) {
                Match = true;
            }
               
        }
        // Contact was blocked before > dont unblock
        if (Match != true) {
            Contact.Blocked = false;
        }
    }
    blocked = false;       
}


This post was edited on 07-29-2006 at 10:12 AM by Intosia.
07-29-2006 10:11 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Selective Talker - by mlevit on 07-28-2006 at 02:43 PM
RE: Selective Talker - by RaceProUK on 07-28-2006 at 02:45 PM
RE: Selective Talker - by mlevit on 07-28-2006 at 02:54 PM
RE: Selective Talker - by Intosia on 07-28-2006 at 03:43 PM
RE: Selective Talker - by mlevit on 07-28-2006 at 10:27 PM
RE: Selective Talker - by Intosia on 07-29-2006 at 10:11 AM
RE: Selective Talker - by mlevit on 07-29-2006 at 11:05 AM
RE: Selective Talker - by Geo on 07-30-2006 at 05:43 PM
RE: Selective Talker - by Intosia on 07-30-2006 at 06:06 PM
RE: RE: Selective Talker - by Silentdragon on 07-30-2006 at 11:11 PM
RE: RE: Selective Talker - by mlevit on 07-30-2006 at 11:01 PM
RE: Selective Talker - by CookieRevised on 11-12-2006 at 03:34 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