mIRC Home    About    Download    Register    News    Help

Print Thread
#85432 05/06/04 05:23 AM
Joined: Jan 2004
Posts: 129
A
AaronL Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2004
Posts: 129
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


Deridio fatum
#85433 05/06/04 10:42 AM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
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

#85434 06/06/04 09:36 AM
Joined: Jan 2004
Posts: 129
A
AaronL Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2004
Posts: 129
thnxs kelder

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

greetz
Aaron


Deridio fatum
#85435 06/06/04 08:19 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
You might add the -o switch in case you are disconnected before the timer executes.
  • timer -o 7:00 1 0 set %speelmode ON


Link Copied to Clipboard