Time of day can be scripted like $asctime($ctime,HH:nn), which goes from 00:00 thru 23:59. I'll leave out the colon when it's easier to treat it like a number range. If time crosses midnight, must either treat as 2 time periods, or use the opposite time period as disallowed:
var %time $asctime($ctime,HHnnss)
then
if (%time isnum 2200-2359) goto allowed
if (%time isnum 0-300) goto allowed
or
if (%time !isnum 301-2159) goto allowed
another method is to set a variable to $true or $false depending on whether something is allowed right now. Then create a timer that activates at the next time boundary
set %spank.allowed $true
timerSpankOFF -o 3:01 1 0 TurnSpankOffAlias
or
set %spank.allowed $false
timerSpankOn -o 22:00 1 0 TurnSpankOnAlias
Beware that timers run on time that doesn't see the seconds, so if it's 22:00 now and you want to set a timer to activate at 22:00 tomorrow, setting a timer for 22:00 activates now.
Calculating the number of seconds until 22:00 and setting a timer to activate after that number of seconds into the future will not be accurate because of mirc being busy during the day:
//var %stoptime $calc(10+$ctime) | echo -a timer started $asctime(HH:nn:ss) | timer -o 1 15 echo -a timer should activate 15 seconds after $asctime(HH:nn:ss) but activated $!asctime(HH:nn:ss) | :loop | var %x $rand(1,999) | if ($ctime < %stoptime) goto loop | echo -a finished making randoms $asctime(HH:nn:ss)