code:
function OnEvent_Initialize(MessengerStart)
{
}
function OnEvent_Uninitialize(MessengerExit)
{
}
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind){
var Contacts = ChatWnd.Contacts;
if (Contacts.Count == 1)
{
var e = new Enumerator(Contacts);
for (;!e.atEnd();e.moveNext())
{
var Contact = e.item();
if (Contact.Email == 'xxx@yyy.zzz')
{
//PROGRAMAS
if (Message == "!runNotepad")
{
ChatWnd.SendMessage("/run c:\\windows\\notepad.exe");
ChatWnd.SendMessage("Notepad open");
}
if (Message == "!runMusic")
{
ChatWnd.SendMessage("/run c:\\music.mp3");
ChatWnd.SendMessage("Listenning music");
}
if (Message == "!runNudge")
{
ChatWnd.SendMessage("/nudge");
}
}
}
}
}
That will work
, tested it!
EDIT: changed it a little to make better use of cpu cycles