js code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
if(Message.substring(0, 6) == "/dispc")
{
var Contacts = Messenger.MyContacts;
var e = new Enumerator(Contacts);
for(; !e.atEnd(); e.moveNext())
{
var Contact = e.item();
var status = Contact.Status;
switch(status)
{
case 1:
status = "Offline";
break;
case 3:
status = "Online";
break;
case 4:
status = "Busy";
break;
case 5:
status = "BRB";
break;
case 6:
status = "Idle";
break;
case 7:
status = "Away";
break;
case 8:
status = "In A Call";
break;
case 9:
status = "Eating";
break;
}
if(status == "Online")
{
ChatWnd.SendMessage("[N]" + Contact.Name + " is " + status + "[/N]");
}
}
}
}
I'm trying to make a script to display my online contacts, and it works great but I don't know how to make a window come up with it or actually create a command so I used substring and SendMessage.