Not quite, you see, once the
return statement is parsed, your function stops running. So basically, you will want to edit Plan-1130's code. This is my version with a few fixes:
code:
var Status = false;
function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
if(Message == "irritant Hè!" && !Status) {
Status = true;
for(var i = 0; i < 5; i++) ChatWnd.SendMessage("irritant Hè!");
Status = false;
return "";
}
else return Message;
}
My coding is not excellent (and I haven't tested this) so you may want to be careful. I just realised that
ChatWnd.SendMessage will also call the function again, so the script will loop! That's why I added
Status to make sure it doesn't recall it. If you make your command different, then it will be a lot easier:
code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
if(Message == "!irritant") {
for(var i = 0; i < 5; i++) ChatWnd.SendMessage("irritant Hè!");
return "";
}
else return Message;
}
In the above script, you will need to type "!irritant" to activate your messages.
To change the amount of messages in the function, change the
number in red to the number you want.
If anyone wants to improve on this script, be my guest.