$msn and /msn

By Mpdreamz on Dec 08, 2005

Me having some fun with COMs :) returns information from MSN messenger.

UPDATE: added /msn command so you can control MSN :D

/*
####Usage: $msn(valuetype)
###Valuetypes : returnvalue

###online : $true or $false indicating wheter your signed in or not (actually $true indicates status but was added to have an independent online checker)
###status : returns the status of MSN (Busy,Online,Invisible etc)
###nickname : your nickname
###email : your email

###user [ added syntax $msn(user,method,N,command) ] : $true when succesful $false when not hihi.

##Methods:
#Blocked [returns a boolean for weather you have the contact blocked]
#CanPage [returns a boolean for weather the contact can recieve pager messages]
#FriendlyName [returns the contacts friendly name]
#IsSelf [reutns a boolean for weather the contact is the local user]
#PhoneNumber [returns the phone number of the MPHONE_TYPE specified]
#ServiceId [returns the contacts service id, this will be {9b017612-c9f1-11d2-8d9f-0000f875c541}]
#ServiceName [returns the name of the service the contact is using, this will be .NET Messenger Service]
#SigninName [returns the signin name of the contact, this will be an email]
#Status [returns the contacts status as MISTATUS]

##N
#you can specify a command to perform on the Nth address in your msn.
#use 0 to get the total ammount of contacts in which case total command paremeter is ignored
#or -1 to perform on all your contacts

##command
#if command isnt specified echo -a <m> is assumed.
#ie $msn(user,SigninName,2,echo -a <m> stinks!)
#<m> will hold the email address or whatever else you specified as method

Commands
/msn -l <email address> [password]
Sign in to Msn Messenger dialog ( password might be omited by the messengerAPI)
/msn -c
sign out to Msn Messenger
/msn <email address>  
Opens a chat window to the person
/msn -a  [email address]
Opens the Add a Contact wizzard if a email is specified it will go to the 2nd page with the specified email filled in
/msn -i
Opens your inbox
/msn -o 
Opens the MSN Messengers Options Dialog

*/
alias  msn {
  .comopen msn Messenger.UIAutomation
  if ($comerr) { return $err }
  if $isid {
    if ($1 == user) { 
      var %t= $com(msn,MyContacts,3,dispatch* items) 
      .comclose msn
      if $com(items) { 
        var %t = $com(items,Count,3) , %t2 = $com(items).result , %t3 = 1 , %c = $4 
        if (!%c) { %c = echo -a <m> }
        if ($3 == 0) { .comclose items | return %t2 }
        if ($3 == -1) {
          while (%t3 <= %t2) {
            $($replace(%c,<m>,$comval(items,%t3,$2)),2)
            inc %t3
          }
        }
        elseif $3 <= %t2 { $($replace(%c,<m>,$comval(items,$3,$2)),2) }
        .comclose items
        halt
      }
      else { return $false }
    }
    if ($1 == status)  || ($1 == online) { 
      var %t2 = $com(msn,MyStatus,3) , %t = $com(msn).result , $&
        %return = $iif($v1 == status || %t != 1,$replacex(%t,10,Busy,66,Out For Lunch,0,unknown,14,Be Right Back,18,Away,1,Offline,2,Online,6,Invisible,34,Away,50,On The Phone),$false) 

    }
    if ($1 == nickname) { var %t= $com(msn,MyFriendlyName,3) , %return = $com(msn).result }
    if ($1 == email) { var %t= $com(msn,MySigninName,3) , %return = $com(msn).result }
    .comclose msn
    return %return
  }
  if !isid { 
    if (*@* iswm $1) { var %t = $com(msn,InstantMessage,1,bstr,$1) }
    if (-a == $1) { var %t = $com(msn,AddContact,1,uint,0,bstr,$2) }
    if (-i == $1) { var %t = $com(msn,OpenInbox,1) }
    if (-o == $1) { var %t = $com(msn,OptionsPages,1,uint,0,bstr,0) }
    if (-l == $1) { var %t = $com(msn,Signin,1,uint,0,bstr,$2,bstr,$3) }
    if (-c == $1) { var %t = $com(msn,Signout,1) }
    echo -a %t
    .comclose msn
  }
}

Comments

Sign in to comment.
Jonesy44   -  Nov 29, 2008

lol, which bastard?! Asshole! :P:P I've tested with live, most work from what i tested x]

 Respond  
^Neptune   -  Nov 29, 2008

hi bastard :O

 Respond  
Mpdreamz   -  Nov 29, 2008

The Bastard is still on the site :). This snippet was created before the Live series of MSN it might not work with these versions anymore i'll have to do some research on that.

 Respond  
Jonesy44   -  Nov 20, 2008

Aha, my bad :L Perhaps the bastard's fucked off from this site :L he helped me a bit with some JS a while back lolol

 Respond  
^Neptune   -  Nov 20, 2008

I think you're missing something Jonesy. Posted on December 05 lol

 Respond  
Jonesy44   -  Nov 19, 2008

Looks amazing! Nice to see you again, Mpdreamz x]

 Respond  
^Neptune   -  Nov 19, 2008

This doesn't seem to work for me. :|

 Respond  
StonedStoner   -  Dec 19, 2005

Happen to know the command to see how many new emails u got?

 Respond  
StonedStoner   -  Dec 19, 2005

Nice job.

 Respond  
Mpdreamz   -  Dec 14, 2005

Commands
/msn -l [password]
Sign in to Msn Messenger dialog ( password might be omited by the messengerAPI)
/msn -c
sign out to Msn Messenger
/msn
Opens a chat window to the person
/msn -a [email address]
Opens the Add a Contact wizzard if a email is specified it will go to the 2nd page with the specified email filled in
/msn -i
Opens your inbox
/msn -o
Opens the MSN Messengers Options Dialog

Identifiers
$msn(online) : $true or $false indicating wheter your signed in or not (actually $true indicates status but was added to have an independent online checker)
$msn(status) : returns the status of MSN (Busy,Online,Invisible etc)
$msn(nickname) : your nickname
$msn(email) : your email
$msn(user,FriendlyName,0) total contacts in your msn
$msn(user,FriendlyName,1, echo -a Stinks!) will echo that the first contact in your msn stinks
$msn(user,FriendlyName,-1, echo -a Stinks!) will echo that everyone stinks!

Hope this clarifies it a bit more

 Respond  
TheHawk`   -  Dec 10, 2005

Nice, but is it possible to writh what lines you need to type to get the info?

 Respond  
nark0tics   -  Dec 09, 2005

interesting.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.