Shoutbox

Need help! - 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: Need help! (/showthread.php?tid=87766)

Need help! by Razeth on 12-15-2008 at 09:02 PM

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


RE: Need help! by foaly on 12-15-2008 at 09:12 PM

Well for starters your for loop never closes...
Mind posting the error you get in the debug window?


RE: Need help! by matty on 12-15-2008 at 09:15 PM

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.
RE: Need help! by Razeth on 12-15-2008 at 09:34 PM

cheers, not used to this language XD