Yes..
charAt is 0-based.. 0 is the first symbol, 1 is the second etc..
I'm currently working on some code for your 2nd question..
Second question:
code:
function OnEvent_ChatWndReceiveMessage(pChatWnd,mOrigin,sMessage,kMessageKind) {
if(test == "on") {
var cContacts = pChatWnd.Contacts;
var e = new Enumerator(Contacts);
for(i = 0; !e.atEnd(); e.moveNext()) {
Contact = e.item();
cEmail = Contact.Email;
}
if(cEmail != BannedEmail1 || BannedEmail2 /* and so on*/ || Messenger.MyEmail) {
if(sMessage.charAt(0) == "~") {
damessage = Message.substring(1,500);
pChatWnd.SendMessage("");
Debug.Trace("Trace it!");
}
} else {
if(sMessage.charAt(0) == "~") {
damessage = sMessage.substring(1,500);
Messenger.MyPersonalMessage = "" + name.substring(0,25) + " says: " + damessage + " - Your message here? put a ~ in front of it!";
pChatWnd.SendMessage("Your auto message" );
Debug.Trace("trace some text");
MsgPlus.DisplayToast("It's a toast!");
}
}
}
}
This should do the trick.
Btw, I have the Dutch version of your script installed
Good work
EDIT:: Maybe "Your message here? put a ~ in front of it!" should be "Your message here? Type "~<message>".. This is shorter so there's more room for the contact's mesage