Sorry, but I have to note that Origin is the name of the user sending the message, and thus is
not the e-mail address of the person. Therefore, you'd need to loop through the conversation contacts looking for the Origin, like this:
code:
//number of times to send message
var times = 2; //Why do you make this a string and force JScript to convert it to a number each time?
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message)
{
if (Origin != Messenger.MyName)
{
//Start contact search
var sEmail = ""; //Create a variable to store the e-mail in
//Loop through the contacts in the chat
for(var e = new Enumerator(ChatWnd.Contacts); !e.atEnd(); e.moveNext)
{
//If the contact's name matches the name of the sender...
if (e.item().Name == Origin)
{
sEmail = e.item().Email; //Store the e-mail address
break; //Exit the loop
}
}
//End contact search
if(sEmail == "example@hotmail.com")
{
if (Message == "hi")
{
for(i=0; i<times; i++)
{
ChatWnd.SendMessage("hey, how r u");
}
}
}
}
}
If you mean with "send it a certain amount of times" that you want to set a maximum amount of times the message should be sent, it'll get a bit more complicated. I'll explain that if you really need to know.