Shoutbox

Check for contact... - 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: Check for contact... (/showthread.php?tid=73755)

Check for contact... by mad_willsy on 04-19-2007 at 09:53 PM

Can I have a simple script to determine if the user no-spam@hotmail.co.uk is online and if it is give an auto-message "Try my other address (no-spam@hotmail.co.uk)" because I use one when not at my computer and another when I am?

I don't want auto-sign in because I use sharing folders as a my documents folder between my two msn addresses for home and at dads for coursework etc...

If not, could I just have the if to determine if my other address is online please?

Ta.


RE: Check for contact... by roflmao456 on 04-21-2007 at 04:52 AM

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd){
var e = new Enumerator(Messenger.MyContacts);
for(; !e.atEnd(); e.moveNext()){
var Contact = e.item();
if(Contact.Email == "no-spam@hotmail.co.uk" && Contact.Status != 1){
ChatWnd.SendMessage("Try my other address (no-spam@hotmail.co.uk)");
}
}
}

RE: Check for contact... by phalanxii on 04-21-2007 at 06:39 AM

This script will also auto-message if no-spam@hotmail.co.uk's status is set to something like Busy or Out To Lunch (I also think it's simpler):

code:
var Email = "no-spam@hotmail.co.uk";
var Message = "Try my other address (no-spam@hotmail.co.uk)";

function OnEvent_ChatWndReceiveMessage(ChatWnd) {
   var Contact = Messenger.MyContacts.GetContact(Email);
   if(Contact != null && Contact.Status > 2) ChatWnd.SendMessage(Message);
}
Change the email and message to suit your needs.
RE: Check for contact... by Matti on 04-21-2007 at 08:22 AM

And phalanxii's code has the advantage that it doesn't loop through the contacts but simply uses the GetContact() function, which is more recommended. ;)


RE: Check for contact... by mad_willsy on 04-24-2007 at 05:06 PM

How could I make it only say to try other account it if the user logged on on the computer is set to idle AND no-spam@hotmail.co.uk is online?

Also can i have a list of what numbers represen what status?


RE: Check for contact... by Matti on 04-24-2007 at 07:07 PM

quote:
Originally posted by mad_willsy
How could I make it only say to try other account it if the user logged on on the computer is set to idle AND no-spam@hotmail.co.uk is online?
Could you explain that a bit better, using commas and correct spelling? :)
quote:
Originally posted by mad_willsy
Also can i have a list of what numbers represen what status?
Sure, just look in the scripting documentation:
quote:
Originally posted by Patchou in Plus! Live Scripting Documentation - Contact::Status
A number taken from the following enumeration:
code:
1 - Offline
3 - Online
4 - Busy
5 - Be Right Back
6 - Idle
7 - Away
8 - In a Call
9 - Out to Lunch
If Messenger Plus! fails to get the contact's status for any reason, the return value is:
code:
0 - Unknown

When you're setting you're own status with Messenger::MyStatus, you can't use 1 (Offline). Instead there is option 2 (Appear Offline). ;)