The problems were:
- Message.match only accepts a regular expression as parameter (e.g.: /Hello/i), where your script had an undefined variable Hello
- you tried to send an undefined variable hi to the chat window
- the script would respond on both your and the contacts messages
So, a solution when you really want to use regular expression would be:
code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
if(Message.match(/hello/i) && Origin != Messenger.MyName)
{
ChatWnd.SendMessage('Hi')
}
}
But if you don't need regular expressions, you can just keep -!Felu!-'s version.