function callBack(){ Messenger.OpenChat(crntContact.Email); } function OnEvent_Initialize(MessengerStart){ OnGetScriptCommands(); } function OnEvent_ChatWndSendMessage(objChatWnd, strMessage){ if (strMessage.charAt(0) != '/') return strMessage; var arrMessage = strMessage.split(' '); var strCommand = arrMessage[0]; switch(strCommand){ case "/cl": //Command to open contact list MsgPlus.CreateWnd("interface.xml", "main"); case "/look4": //Command to look for contact var Contacts = Messenger.MyContacts; spEmail = arrMessage[1] crntContact = Contacts.GetContact(spEmail) if(crntContact==null){ MsgPlus.DisplayToast("Error","That address does not exist within your contact list"); }else{ tempvar = crntContact.Status msg = "Unknown" if(tempvar=="0")msg="Unknown" if(tempvar=="1")msg="Offline" if(tempvar=="3")msg="Online" if(tempvar=="4")msg="Busy" if(tempvar=="5")msg="Be Right Back" if(tempvar=="6")msg="Idle" if(tempvar=="7")msg="Away" if(tempvar=="8")msg="In A Call" if(tempvar=="9")msg="Out To Lunch" MsgPlus.DisplayToast(crntContact.Email,msg,"","callBack"); return ""; } } } function OnmainEvent_CtrlClicked(Wnd, ControlId){ if(ControlId == "btn_ok"){ var sel = Wnd.Combo_GetCurSel("cmb_emails"); mySel = Wnd.GetControlText("cmb_emails") Messenger.OpenChat(mySel); Wnd.Close(0); } if(ControlId == "btn_pop"){ var Contacts = Messenger.MyContacts; var e = new Enumerator(Contacts); for(; !e.atEnd(); e.moveNext()){ var Contact = e.item(); if(Contact.Status != "1")Wnd.Combo_AddItem("cmb_emails",Contact.Email); } } } function OnGetScriptCommands(){ var commands = ''; commands+=''; commands+='look4'; commands+='Displays status of a specified user'; commands += "<Email>"; commands+=''; commands+=''; commands+='cl'; commands+='Displays list of online users'; commands+=''; commands+=''; return commands; }