I don't know JS at all, so as a learning experience I just started throwing things together, and naturally I've run into some questions.
First question
The following code works fine when I type !whatevercommand, but I also want my contacts to be able to type !whatevercommand, have the script respond to them, and increment the nbrPoke++.
code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
... there was a lot more in here; I'm just including the relevent stuff...
code:
if(Message.substr(0,5).toLowerCase()=="!poke"){
nbrPoke++;
var z = Math.floor((Math.random()*(xArray.length-1)));
return "*" + Messenger.MyName + " pokes with a pointy stick* \n" +xArray[z];
}
Any tips on doing what I need to do?
Second question
I can't understand Messenger.MyContacts. For example, here,
code:
aArray[6] = "*" + Messenger.MyName +" attacks " + Messenger.MyContacts + "*";
MyName works fine, but Contacts just produces a blank space.
I read in the documentation that this could happen due to the contact being logged out, but that wasn't the case here.
Thanks for any help