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

EXECUTE APPLICATION
Author: Message:
Volv
Skinning Contest Winner
*****

Avatar

Posts: 1233
Reputation: 31
35 / Male / Flag
Joined: Oct 2004
RE: RE: EXECUTE APPLICATION
You're not setting an initial condition in your for() loop nor are you treating the email you are checking for as a string. You're also not actually checking if the user who sent you the message is xxx@yyy.zzz but if that user is within the conversation, this means that anyone in the conversation would be able to type !runNotepad (not just xxx@yyy.zzz) - I provided a little bit of extra protection by checking nicknames as well (although this still can be fooled). Also, I recommend putting the if() statement checking for a message outside the check-for-contact loop to reduce unnecessary processing every time a user sends you a message.
Try this;

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind){
    if(Message == "!runNotepad") {
        CheckAndRun('xxx@yyy.zzz', "/run c:\\windows\\notepad.exe", ChatWnd, Origin);
    }
}

function CheckAndRun(strEmail, strRun, ChatWnd, Origin) {
    var Contacts = ChatWnd.Contacts;

    for(var e = new Enumerator(Contacts); !e.atEnd(); e.moveNext()){
        var Contact = e.item();
        if (Contact.Email == 'xxx@yyy.zzz' && Origin == Contact.Name) {
            ChatWnd.SendMessage(strRun);
        }
    }
}
07-06-2006 12:52 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
EXECUTE APPLICATION - by novolo on 06-27-2006 at 02:03 PM
RE: EXECUTE APPLICATION - by Jiggs on 06-27-2006 at 02:09 PM
RE: EXECUTE APPLICATION - by The Brain on 06-27-2006 at 02:16 PM
RE: EXECUTE APPLICATION - by Colin-uk on 06-27-2006 at 02:17 PM
RE: EXECUTE APPLICATION - by upsfeup on 06-27-2006 at 02:21 PM
RE: EXECUTE APPLICATION - by The Brain on 06-27-2006 at 02:32 PM
RE: EXECUTE APPLICATION - by novolo on 06-27-2006 at 03:11 PM
RE: EXECUTE APPLICATION - by The Brain on 06-27-2006 at 03:31 PM
RE: EXECUTE APPLICATION - by novolo on 06-27-2006 at 03:38 PM
RE: EXECUTE APPLICATION - by Lou on 06-27-2006 at 03:59 PM
RE: EXECUTE APPLICATION - by ShawnZ on 06-27-2006 at 03:59 PM
RE: EXECUTE APPLICATION - by Lou on 06-27-2006 at 04:02 PM
RE: EXECUTE APPLICATION - by ShawnZ on 06-27-2006 at 04:04 PM
RE: EXECUTE APPLICATION - by novolo on 06-27-2006 at 05:06 PM
RE: RE: EXECUTE APPLICATION - by Volv on 07-06-2006 at 12:52 AM
RE: EXECUTE APPLICATION - by wlmcrap on 07-06-2006 at 03:37 AM
RE: RE: EXECUTE APPLICATION - by Volv on 07-06-2006 at 06:10 AM
RE: EXECUTE APPLICATION - by wlmcrap on 07-06-2006 at 06:12 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