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
ie. //echo -a $msn(nickname) will return ur msn nickname.
user [ added syntax $msn(user,method,N,command) ] : $true when succesful $false when not
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
Other 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
CODE
alias msn {
.comopen msn Messenger.UIAutomation
if ($comerr) { return $false }
if $isid {
if ($1 == user) {
.comclose msn $com(msn,MyContacts,3,dispatch* items)
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) {
var %x = $comval(items,%t3,$2)
$($replace(%c,<m>,%x),2)
inc %t3
}
}
elseif $3 <= %t2 { var %x = $comval(items,$3,$2) | $($replace(%c,<m>,%x),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 (*@* 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) }
.comclose msn
}
.comopen msn Messenger.UIAutomation
if ($comerr) { return $false }
if $isid {
if ($1 == user) {
.comclose msn $com(msn,MyContacts,3,dispatch* items)
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) {
var %x = $comval(items,%t3,$2)
$($replace(%c,<m>,%x),2)
inc %t3
}
}
elseif $3 <= %t2 { var %x = $comval(items,$3,$2) | $($replace(%c,<m>,%x),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 (*@* 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) }
.comclose msn
}
Have fun with this!!


