on *:text:!repeat *:#:{
if $nick !isop # { msg # You are not allowed | 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,$2)
if !%text { msg # $2 does not exists. | return }
if $timer($+(repeat.,%t)) {
if $3 == off {
$+(.timerrepeat.,%t) off
msg # $2 turns off.
}
else { msg # $2 was already repeating. }
}
else {
if $3 == off { msg # $2 was never started yet. }
else {
$+(.timerrepeat.,%t) 0 $calc($3 * 60) msg # $replace(%text,|,-,$,-,%,-)
msg # $2 turns on. Auto repeat in $3 min $+ $iif($3 > 1,s) $+ .
}
}
}