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

Contact PSM change
Author: Message:
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: Contact PSM change
code:
var Contacts = new Array();

function LoadContacts() {
      for(var e = new Enumerator(Messenger.MyContacts); !e.atEnd(); e.moveNext()) {
            Contacts[e.item().Email] = e.item(); // Convert Messenger.MyContacts to an array
      }
}

function OnEvent_ContactSignin(Email) {
      if(Contacts[Email].Status == STATUS_ONLINE /* Assume you have MsgPlus 4.23 or higher? */ ) {
            [do what you want to here]
      }
}


Call LoadContacts() somewhere in the very beginning of your script, recommend OnEvent_SigninReady();

If a change occurs in your contact list, Messenger Plus! will update the Contacts array, as well as Messenger.MyContacts and ChatWnd.Contacts.

A PSM change --> should <-- call OnEvent_ContactPsmChange() (unless you change your own psm). An extra safety option for ContactSignin would be:

code:
function OnEvent_ContactSignin(Email) {
      if(Email in Contacts) {
            if(Contacts[Email].Status == STATUS_ONLINE /* Assume you have MsgPlus 4.23 or higher? */ ) {
                  [do what you want to here]
            }
      }
}


Also, if OnEvent_ContactPsmChange() occurs, the Contacts array (by which I mean our array declared in the global scope at the top, not MsgPlus' Contact(s) object) is updated.

This post was edited on 10-28-2008 at 03:35 PM by SmokingCookie.
10-28-2008 03:32 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Contact PSM change - by ArkaneArkade on 10-28-2008 at 06:28 AM
RE: Contact PSM change - by SmokingCookie on 10-28-2008 at 03:32 PM
RE: Contact PSM change - by ArkaneArkade on 10-28-2008 at 06:29 PM
RE: Contact PSM change - by Matti on 10-28-2008 at 06:35 PM
RE: Contact PSM change - by SmokingCookie on 10-28-2008 at 06:37 PM
RE: Contact PSM change - by matty on 10-28-2008 at 06:42 PM
RE: Contact PSM change - by ArkaneArkade on 10-28-2008 at 10:32 PM
RE: Contact PSM change - by Spunky on 10-29-2008 at 04:46 PM
RE: RE: Contact PSM change - by ArkaneArkade on 10-29-2008 at 07:01 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