Your code was bugging me to try and read so I fixed it up... and then decided to re do it all for you
It's just a lot easier to understand like this (to me anyway)
code:
var Asterix = false;
var pre = "_ (¯ | |¯¯) | | /¯¯' _¯ ._) | |¯¯\ |´¯`| \__, ¯\n";
var post = "\n_ (¯ | |¯¯) | | /¯¯' _¯ ._) | |¯¯\ |´¯`| \__, ¯";
var Contact = new Array();
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
if(Message.substr(0,5)=="/adon"){
Contact[ChatWnd.Handle] = true;
return "";
}
if (Message.substr(0,6)=="/adoff"){
Contact[ChatWnd.Handle] = false;
return "";
}
if(Message.substr(0,8)=="/adallon"){
Asterix = true;
return "";
}
if (Message.substr(0,9)=="/adalloff"){
Asterix = false;
return "";
}
if (Asterix==true&&Message.substr(0,1)!="/"){
for(var i in Contact){
if(i==ChatWnd.Handle&&Contact[i]==true){
return pre+Message+post;
}
}
}else{
return Message;
}
}