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

Need help!
Author: Message:
Razeth
New Member
*


Posts: 2
Joined: Dec 2008
O.P. Need help!
I'm new to scripting....so can someone tell me why this isn't working? XD

function OnEvent_ChatWndSendMessage(ChatWnd, Message){
    if(Message="/whoihave"){
        var kisiler = Messenger.MyContacts;
        var c;
        var emessage = "Online Contact List:\n";
        for(var counter=1,counter<=kisiler.length,counter++){
            var enume = new Enumerator(kisiler[counter])
            c = enume.item();
            if(c.Status == 3){
                emessage = emessage+c.Email+"\n";
            }
        SendMessage(emessage);
    }
   
}


Basically I want it to put every email address of my online group into a message then send it
12-15-2008 09:02 PM
Profile E-Mail PM Find Quote Report
foaly
Senior Member
****

Avatar

Posts: 718
Reputation: 20
38 / Male / Flag
Joined: Jul 2006
RE: Need help!
Well for starters your for loop never closes...
Mind posting the error you get in the debug window?
12-15-2008 09:12 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Need help!
Messenger.MyContacts is an initerator object.

code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
    if(Message == "/whoihave"){
        var emessage = "Online Contact List:\n";
        for (var oContact = new Enumerator(Messenger.MyContacts); !oContact.atEnd(); oContact.moveNext()) {       
            if(oContact.item().Status == 3) emessage += oContact.item().Email+"\n";
        }
        return emessage;
    }
}

I bolded/red the parts you left out and your For Loop should be what is above not what you posted.

This post was edited on 12-15-2008 at 09:24 PM by matty.
12-15-2008 09:15 PM
Profile E-Mail PM Find Quote Report
Razeth
New Member
*


Posts: 2
Joined: Dec 2008
O.P. RE: Need help!
cheers, not used to this language XD
12-15-2008 09:34 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


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