mIRC Homepage
Posted By: AaronL open en closing time - 05/06/04 05:23 AM
Hi all.

i have a trivia for young kids and therefore its necessary there are opening and closing times.
Now i want to have that to happen automatically.
i know i need a timer for that and a alias that actually checks the time.
For the alias i have the following:

checktijd {
if ($time >= 07:00:00) { set %speelmode ON }
elseif ($time >= 21:00:00) { set %speelmode OFF }
}

this doesn't work and im sure i do something wrong
Can someone please help me?

Greetz
Aaron
Posted By: Kelder Re: open en closing time - 05/06/04 10:42 AM
The > operator only works on numbers, not on times with comma's in it...

If you want the time to be on the hour, you can do:
if ($time(H) isnum 7-20) set %speelmode ON
else set %speelmode OFF

The H gives you hours in 24h mode only, no minutes or seconds. See /help $asctime for more format parameters.

However, a timer can also have a hour parameter:
/timer 7:00 1 1 /set %speelmode ON
This would execute once at 7am
Posted By: AaronL Re: open en closing time - 06/06/04 09:36 AM
thnxs kelder

i use the /timer 7:00 1 1 /set %speelmode ON now

greetz
Aaron
Posted By: Iori Re: open en closing time - 06/06/04 08:19 PM
You might add the -o switch in case you are disconnected before the timer executes.
  • timer -o 7:00 1 0 set %speelmode ON
© mIRC Discussion Forums