on *:text:!repeat *:#:{
if $nick !isop # { msg # $nick You are not allowed to do that | return }
if !$3 { msg # Usage: !repeat !<command name> <time in minute/off> | return }
if ($3 !isnum || $3 < 1) && $3 != off { msg # <time> must be number greater than 0 or off | return }
var %t $+(#,.,$2), %text $readini(commands.ini,n,commands,$right($2,-1))
if !%text { msg # $2 does not exists. | return }
if $timer($+(repeat.,%t)) {
if $3 == off {
$+(.timerrepeat.,%t) off
msg # $2 repetition is now off.
}
else { msg # $2 is already repeating. }
}
else {
if $3 == off { msg # $2 has not been started yet. }
else {
$+(.timerrepeat.,%t) 0 $calc($3 * 60) msg # $replace(%text,|,-,$,-,%,-)
msg # $2 is now repeating every $3 min $+ $iif($3 > 1,s) $+ .
}
}
}