first, you'll have to place the OnEvent_Timer() function out of this condition and out of this function.
then, you should do some verifications before your operations. for example if you don't type something with the right format (which is blabla;blabla;blabla) the script will trigger errors when you send Messages.
try this
code:
var WndRepeat = new ChatWnd(); // used to store the ChatWnd
var strMessage = "";
function OnEvent_ChatWndSendMessage(ChatWnd, sMessage)
{
if (sMessage.match(/^#.+;.+;.+/)
{
var arrayMessage = sMessage.split(";");
var stringCommand = arrayMessage[0];
var variableDelay = arrayMessage[1];
strMessage = arrayMessage[2];
if (stringCommand == "#Delay")
{
MsgPlus.AddTimer("timerDelay",variableDelay);
return "";
}
}
}
function OnEvent_Timer(TimerId)
{
if (TimerId == "timerDelay") WndRepeat.SendMessage(strMessage);
}
well, i'm not sure about the regular expression and i'm too lazy to test it. Test and modify this thing if needed