I try to run the code myself, it just gave me an error on the:
var randomMsg = wordArray[Math.floor(Math.rand() * wordArray.length)];
Says object doesn't support this property or method, anyway, shouldn't it be easier to turn the array into an enumerator and use a for loop?
something like this:
code:
var e = new Enumerator(wordArray)
for(; !e.atEnd(); e.moveNext())
{
var word = e.item();
if(Message.toUpperCase() == word)
{
ChatWnd.SendMessage(randomMsg);
break;
}
}
- you had this to toUppercase() instead of toUpperCase() also
That should work, at least works for me
![:)](images/smilies/msn_happy.gif)
You just need to add all other things to the array and your set to go
![;)](images/smilies/msn_wink.gif)
And if you're going to use many words, you can put them on a .txt file and load it to an array using split() after readall()