quote:
Originally posted by scutterman
Ol, Matty's code seems good but i did notice that the:
if (MsgPlus.RemoveFormatCodes(Origin) != name) {
inside the ChatWndReceiveMessage function should replace "Origin" with "sOrigin" since that's what it is declared as in the function, is that right?
Thanks again for all of the help
~~Scutterman~~
That is true but there are problems with your code if you end up using some features of StuffPlug or something like that however.... I suggest using the following code instead....
code:
var aSent = new Array();
function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
aSent[ChatWnd.Handle] = Message;
}
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind) {
if (aSent[ChatWnd.Handle] === Message) {
delete aSent[ChatWnd.Handle];
} else {
MsgPlus.PlaySound("i likse the way you moo.mp3",1500) //this sound will be replaced with "type" when i have converted it to mp3
}
}
Please note that this isn't my code, it is CookieRevised's code and any thanks should go to him. It is a more failsafe way of going about what you are trying and I
HIGHLY recommend that you use it instead.
I also would like to point everyone to the code at the bottom of
CookieRevised's reply to [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin for any issue involving triggering events only when a contact sends a message.