Thanks for the help, Markee. =)
I tried putting in function OnEvent_ChatWndReceivedMessage(ChatWnd,Origin,Msg,Kind){ instead, and after doing so, that part of the script completely stops working(!command will simply show up as !command, for both sides of the conversation).
I figured it must be a conflict with some other part of my script, so I systematically removed all of those other parts, and tested without each one, but it didn't fix the problem.
Here is the relevent code section:
code:
//// Actions
function OnEvent_ChatWndReceivedMessage(ChatWnd,Origin,Msg,Kind){
if(Message.substr(0,8).toLowerCase()=="!petrafi"){
nbrPet++;
var h = Math.floor((Math.random()*(dArray.length-1)));
return "*" + Messenger.MyName + " pets Rafeal* \n" +dArray[h];
}
}
//// End Actions
There were more !commands, but I temporarily removed them so they wouldn't complicate my diagnosis. Anyway, I can't seem to find the problem with it =/
The display name was indeed what I was after.
However, with that code, won't it only work with one person, the person whose email I define? If it's possible and not too horribly complex, I was trying to make the script adapt to whoever I was talking to at the time.