O.P. RE: [Help] ChatWndReceiveMessage function
function OnEvent_Initialize(MessengerStart)
{
activated=false;
contact=null;
msgs=new Array("bb","cya","have fun","good night");
}
function OnEvent_ChatWndSendMessage(ChatWnd,Message){
if(Message == "*bye*"){
activated=!activated;
var e = new Enumerator(ChatWnd.Contacts);
contact=e.item();
}
}
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind){
if(activated && contact.Name==Origin) ChatWnd.SendMessage(msgs[Math.ceil(Math.random()*msgs.length)]);
}
|