I'm working on a very small script to try to replace words in a sentence (for testing purposes) and I'm unsure exactly how to do this. I was wondering if perhaps someone could tell me what i'm doing wrong?
I'm native to C++, so Javascript is not too difficult to understand, it's just the MsgPlus! syntax which I am uncertain of.
my code so far:
code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
var split_message = Message.split(' ');
for(var i=0; i>=split_message.length; i=i+1)
{
split_message[i] = "word ";
}
}
Anyone able to help?
EDIT:
Oh yeah, my question is just how to return the array of the message that is going to be sent to be the new output message. Sort of like the word replace feature. (I'm changing all the words at the moment with the for loop/array, but in the end i intend to use a switch/case branch. It's just to test things for now to get the hang of it)