What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Can msg script see e-mail?

Can msg script see e-mail?
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Can msg script see e-mail?
code:
var BannedEmails = new Array('iamspammer@hotmail.com', 'iannoyyou@msn.com');

function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind) {
    if (MessageKind === 1 && Message.substring(0,4).toLowerCase() === '!psm') {
        var bProceed = true;
        for (var e = new Enumerator(ChatWnd.Contacts); !e.atEnd(); e.moveNext()) {
            var Contact = e.item();
            for (i in BannedEmails) {
                if (Contact.Email === BannedEmails[ i]) {
                    // message is send by a banned email
                    bProceed = false;
                    break;
                }
            }
            if (!bProceed) break;
        }
        if (bProceed) {
            // Do whatever you otherwise do when a contact send !PSM
            Message = Message.substr(5);
            Message = Message.replace(/^\s+|\s+$/g,"");
            Origin = Origin.substring(0,25);
            Origin = Origin.replace(/^\s+|\s+$/g,"");
            Messenger.MyPersonalMessage = Origin + " says: " + Message;
            MsgPlus.DisplayToast("PSM Chat","PSM changed to: " + Message);
            if (ChatWnd.EditChangeAllowed) ChatWnd.SendMessage("Automated Message - PSM changed to: " + Message);
        } else {
            if (ChatWnd.EditChangeAllowed) ChatWnd.SendMessage("Automated Message - " + Origin + ", you are not allowed to use my psm chat...");
        }
    }
}
This will also work in multi-contact chats. Thus chats with more than one person: If one of the people in the chat is banned, nobody in the chat would be able to use the remote !PSM command.

You can't do it otherwise since the Origin parameter is the chatname of a contact. And this chatname can be different than the screenname of the contact. For example: if you have set a nickname in WLM for this contact, or if the contact is using the plugin StuffPlug, etc...





This post was edited on 03-30-2008 at 08:52 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
03-30-2008 08:13 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Can msg script see e-mail? - by apex on 03-30-2008 at 03:33 PM
RE: Can msg script see e-mail? - by CookieRevised on 03-30-2008 at 05:43 PM
RE: Can msg script see e-mail? - by apex on 03-30-2008 at 06:49 PM
RE: Can msg script see e-mail? - by CookieRevised on 03-30-2008 at 08:13 PM
RE: Can msg script see e-mail? - by apex on 03-31-2008 at 08:32 AM


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