Shoutbox

Script Request - Ignore specific contacts - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Script Request - Ignore specific contacts (/showthread.php?tid=65322)

Script Request - Ignore specific contacts by kb135 on 08-24-2006 at 01:48 PM

Hello

I searched the script base, and the internet too, but coudnt find what i need...
Maybe, anyone can help me here.

I am searching for a script that is able to "ignore" messages from specific contacts. So the messages will not beeing displayed.
If a message arrives from such a contact the script should "discard" the message, and should not show the message window.
And, if i accidently write a message to one of this "ignored" contacts, the script must discard my message to, so the message will not beeing send to this contact.




Sorry for my very poor english ;)


RE: Script Request - Ignore specific contacts by Ash_ on 08-24-2006 at 02:07 PM

open up a conversation with who you want to ignore and type thing "/block" it will ignore them ;). to unignore them type "/unblock"

is this the answer you were looking for?


RE: Script Request - Ignore specific contacts by kb135 on 08-24-2006 at 02:26 PM


i dont want to actually block the contact. the contact shoud see my onlinestatus, an i want to see the contacts onlinestatus. but i dont want to receive messages from it.
sure, i can just close the conversation window. but ist very annoying to constantly get new windows and closing it all by hand...


RE: Script Request - Ignore specific contacts by RaceProUK on 08-24-2006 at 02:28 PM

quote:
Originally posted by Ash_
open up a conversation with who you want to ignore and type thing "/block" it will ignore them
Not what was asked for. I'm guessing what was asked for is similar to SPNG's Ignore feature.

And this would be quite easy as a script. at least for incoming.

Edit: Like below, for instance.
RE: Script Request - Ignore specific contacts by Felu on 08-24-2006 at 02:30 PM

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind){
if (Origin == Messenger.MyContacts.GetContact("Ignogred Contact 1").Name){
    ChatWnd.SendMessage("/close");
}
if (Origin == Messenger.MyContacts.GetContact("Ignogred Contact 2").Name){
    ChatWnd.SendMessage("/close");
}
if (Origin == Messenger.MyContacts.GetContact("Ignogred Contact 3").Name){
    ChatWnd.SendMessage("/close");
}
}
Edit Ignored Contact 1/2/3 to the email of the contacts you want to ignore.

This would close the Chat Window as soon as the message is received and you will not even notice it, unless you have pop-up notifications for Messages.
RE: RE: Script Request - Ignore specific contacts by kb135 on 08-24-2006 at 03:47 PM

quote:
Originally posted by -!Felu!-
code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind){
if (Origin == Messenger.MyContacts.GetContact("Ignogred Contact 1").Name){
    ChatWnd.SendMessage("/close");
}
if (Origin == Messenger.MyContacts.GetContact("Ignogred Contact 2").Name){
    ChatWnd.SendMessage("/close");
}
if (Origin == Messenger.MyContacts.GetContact("Ignogred Contact 3").Name){
    ChatWnd.SendMessage("/close");
}
}
Edit Ignored Contact 1/2/3 to the email of the contacts you want to ignore.

This would close the Chat Window as soon as the message is received and you will not even notice it, unless you have pop-up notifications for Messages.


This is exactly what i am looking for :) thank you
Now i need to know how to block the pop-up messages too ;)
RE: Script Request - Ignore specific contacts by markee on 08-24-2006 at 03:57 PM

I didn't think that was what you were after or else I would have posted an even better script for you.

code:
var list = Array();

function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind)
{
    for (i=0; i<list.length;i++)
    {
        if (Origin === Messenger.MyContacts.GetContact(list[i]).Name)
        {
            ChatWnd.SendMessage("/close")
        }
        else
        {
            return Message;
        }
    }
}

function OnEvent_ChatWndSendMessage(ChatWnd,Message)
{
    if (Message === "!ignore")
    {
        var ChatWndContacts = ChatWnd.Contacts;
        if(ChatWndContacts.Count == 1)
        {
            var e = new Enumerator(ChatWndContacts);
            var Contact = e.item();
            list[list.length] = Contact.Email
        }
        return "";
        ChatWnd.SendMessage("/close")
    }
    else if (Message === "!unignore")
    {
        var ChatWndContacts = ChatWnd.Contacts;
        if(ChatWndContacts.Count == 1)
        {
            var e = new Enumerator(ChatWndContacts);
            var Contact = e.item();
            for (i=0;i<list.length;i++)
            {
                if(Contact.Name === list[i])
                {
                    list[i] = "";
                }
            }
            return "";
        }
    }
}

I'm sorry I don't know how to stop the pop-ups either.  The commands are "!ignore" and "!unignore".  I hope you like it.

EDIT: Changed it with te advice of Mattike (I missed a ")" :P)
RE: RE: Script Request - Ignore specific contacts by Matti on 08-24-2006 at 04:02 PM

WARNING! BUG!

code:
        if (Origin === Messenger.MyContacts.GetContact(list[i].Name)
should be:
code:
        if (Origin === Messenger.MyContacts.GetContact(list[i]).Name)
Your code would fail because:
  • You've placed the .Name inside the GetContact() function.
  • You've forgot the end ) for the if-statement

Note: You will be able to ignore contacts in StuffPlug 3, which will be released soon. It will let them send you messages and you won't notice it, it won't even be saved in the logs! ;) So if you can wait a little bit longer... :P
RE: Script Request - Ignore specific contacts by CookieRevised on 08-24-2006 at 06:06 PM

If you do stuff like

code:
for (i=0;i<list.length;i++)
with arrays, replace it with
code:
for (i in list)
no need for length checks i increments and what not (This works for objects too to cycle thru all their properties; it will not work for enumerations).


Second, instead of
code:
ChatWnd.SendMessage("/close")
Use the sendmessage api to close the window. This is better because you don't need to send a message to the conversation in that way (for various reasons you wont always be able to send a message to the conversation).

;)
RE: RE: RE: Script Request - Ignore specific contacts by J-Thread on 08-24-2006 at 07:56 PM

quote:
Originally posted by Mattike
Note: You will be able to ignore contacts in StuffPlug 3
I wonder where you got that information?^o)
RE: Script Request - Ignore specific contacts by vikke on 08-24-2006 at 08:01 PM

Is it true? (A)


RE: Script Request - Ignore specific contacts by Jimcando on 08-24-2006 at 09:28 PM

quote:
Originally posted by kb135
Now i need to know how to block the pop-up messages too
quote:
Originally posted by markee
'm sorry I don't know how to stop the pop-ups either.
In the contact list:
Tools -> Options -> Alerts and Sounds -> Deselect 'Display alert when I message is recieved'
RE: Script Request - Ignore specific contacts by cloudhunter on 08-24-2006 at 10:12 PM

Yeah, but that will stop it for unignored contacts aswell...

Stuffplug 3 should be out soon though, which may have the feature... Check mess.be ;)

Cloudy


RE: Script Request - Ignore specific contacts by RaceProUK on 08-25-2006 at 10:10 AM

quote:
Originally posted by Jimcando
quote:
Originally posted by kb135
Now i need to know how to block the pop-up messages too
quote:
Originally posted by markee
'm sorry I don't know how to stop the pop-ups either.
In the contact list:
Tools -> Options -> Alerts and Sounds -> Deselect 'Display alert when I message is recieved'
I think he was talking about in scripting.
RE: RE: RE: RE: Script Request - Ignore specific contacts by TheBlasphemer on 08-25-2006 at 04:17 PM

quote:
Originally posted by J-Thread
quote:
Originally posted by Mattike
Note: You will be able to ignore contacts in StuffPlug 3
I wonder where you got that information?^o)


It will eventually be in SP3, as I love that feature myself too, but I haven't got round to coding it yet, so it won't be in the first release...