I believe it is very simple
code:
function OnEvent_ChatWndSendMessage (ChatWnd, Message) {
Msg = Message.split(" ")
if (Msg[0] == "/sendpm") {
if (Msg[1].length != 0 && Msg[2].length != 0) {
Messenger.OpenChat(Msg[1]);
var Windows = Messenger.CurrentChats;
for(e = new Enumerator(Windows); !e.atEnd(); e.moveNext()) {
var ChatWindow = e.item().Contacts;
if (ChatWindow.Contacts.Count == 1) {
for(f = new Enumerator(ChatWindow.Contacts); !f.atEnd(); f.moveNext()) {
var Contact = f.item();
if (Contact.Email == Msg[1]) {
for (i=2; i < Msg.length; i++) {
MessageToSend = MessageToSend + Msg[i];
}
e.item().SendMessage(MessageToSend);
}
}
}
}
}
}
}
I believe this is probally broke somewhere but its on the write lines. I will fix it when i get time prob 2nite. I will also look into writing some sort of window where you can select a contact in the the current chat and send him a message with a more user friendly mannor.
Edit:
Sorry for the format. I did tab it of course but the post format has taken it out.