What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Help with some code

Help with some code
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Help with some code
quote:
Originally posted by saralk
code:
OnEvent_Signin(Email) {
Debug.Trace("Contacts in the user's contact list:");
var Contacts = Messenger.MyContacts;
var e = new Enumerator(Contacts);
for(; !e.atEnd(); e.moveNext())
{
    var Contact = e.item();
    if (Contact.Status != 1) {
                    Messenger.OpenChat(Contact);
                    ChatWnd.SendMessage("MESSAGE");
         }
}
}

correction:
code:
OnEvent_Signin(Email) {
Debug.Trace("Contacts in the user's contact list:");
var Contacts = Messenger.MyContacts;
var e = new Enumerator(Contacts);
for(; !e.atEnd(); e.moveNext())
{
    var Contact = e.item();
    if (Contact.Status != 1) {
                    var ChatWnd = Messenger.OpenChat(Contact);
                    if (ChatWnd.EditChangeAllowed) ChatWnd.SendMessage("MESSAGE");
       }
}
}

quote:
Originally posted by 134jimbodude
Oh, ok. Thanks Saralk
EDIT: One last quick question, can scripts check if a certain person is online ans if they are, it automatically sends a message to them?
yes

what saralk's code does is:

1) get the object which holds all your contacts (var Contacts = Messenger.MyContacts;)

2) iterate thru each contact (enumeration and the for loop) and check if they are online (if (Contact.Status != 1))

3) open a chat window (Messenger.OpenChat(Contact);)

4) send the message (ChatWnd.SendMessage("MESSAGE");)

So instead of only checking all your contacts if they are online or not, also check the email of the contact you currently are iterating and only send the message if it is the one you need.

Another (shorter) way is to do what dead showed. This is actually turning it around and instead of checking all the contacts, directly look up the contact you need.

This post was edited on 10-02-2006 at 06:18 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
10-02-2006 06:11 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Help with some code - by Jimbo on 10-02-2006 at 05:21 PM
RE: Help with some code - by saralk on 10-02-2006 at 05:44 PM
RE: RE: Help with some code - by Jimbo on 10-02-2006 at 05:46 PM
RE: Help with some code - by saralk on 10-02-2006 at 05:51 PM
RE: Help with some code - by Jimbo on 10-02-2006 at 05:53 PM
RE: Help with some code - by deAd on 10-02-2006 at 06:09 PM
RE: Help with some code - by CookieRevised on 10-02-2006 at 06:11 PM
RE: Help with some code - by Jimbo on 10-02-2006 at 06:13 PM
RE: Help with some code - by saralk on 10-02-2006 at 06:14 PM
RE: Help with some code - by deAd on 10-02-2006 at 06:15 PM
RE: Help with some code - by Jimbo on 10-02-2006 at 06:17 PM
RE: Help with some code - by deAd on 10-02-2006 at 06:21 PM
RE: Help with some code - by CookieRevised on 10-02-2006 at 06:21 PM
RE: Help with some code - by deAd on 10-02-2006 at 06:23 PM
RE: Help with some code - by Jimbo on 10-02-2006 at 06:24 PM
RE: Help with some code - by saralk on 10-02-2006 at 06:25 PM
RE: Help with some code - by CookieRevised on 10-02-2006 at 06:25 PM
RE: Help with some code - by deAd on 10-02-2006 at 06:27 PM
RE: RE: Help with some code - by CookieRevised on 10-02-2006 at 06:31 PM
RE: Help with some code - by Jimbo on 10-02-2006 at 06:27 PM
RE: Help with some code - by saralk on 10-02-2006 at 06:28 PM
RE: Help with some code - by deAd on 10-02-2006 at 06:30 PM
RE: Help with some code - by Jimbo on 10-02-2006 at 06:31 PM
RE: Help with some code - by Jimbo on 10-02-2006 at 06:34 PM
RE: Help with some code - by deAd on 10-02-2006 at 06:36 PM
RE: Help with some code - by CookieRevised on 10-02-2006 at 06:38 PM
RE: Help with some code - by Jimbo on 10-02-2006 at 06:40 PM


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