quote:
Originally posted by Ezra
quote:
Originally posted by foaly
something like this works:
code:
function OnEvent_ChatWndSendMessage(ChatWnd, sMessage){
if(sMessage == "^^CurrentMedia"){
var Message = "/me is now playing "+ Messenger.CurrentMedia ;
ChatWnd.SendMessage(Message);
sMessage="";
return sMessage;
}
}
Why do you use the SendMessage and return an empty string and not just return the new string?
Also the script doesn't return anything if the if statement is false
I used the SendMessage because that was the question...
and ofcourse it will return something if the statement is false...