mIRC Home    About    Download    Register    News    Help

Print Thread
#179394 22/06/07 01:25 PM
Joined: Feb 2007
Posts: 28
F
Fill Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2007
Posts: 28
How do I make a time announcer that says the time when the hour changes?

Like this:
When it's 16:00, it says to a certain chan:

It is now: 16:00

then, at 17:00

It is now: 17:00

and every day doing that... any ideas?

Fill #179396 22/06/07 01:40 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Edit: Use Hixxy's code.

Fill #179397 22/06/07 01:47 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Code:
alias nexthour { return $iif($time(HH) == 23,00,$calc($v1 + 1)) $+ :00 }
alias dotime { 
  msg #yourchannel It is now: $time(HH:nn)
  .timertime 1 3600 dotime
}
on *:join:#yourchannel:{ .timertime $nexthour 1 1 dotime }

Fill #179400 22/06/07 01:52 PM
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
You guys should probably use the -o switch in your timers because otherwise the script will stop running when he gets accidentally disconnected.

5618 #179401 22/06/07 01:53 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
That's the idea.. if he does get disconnected then he might not be back online to msg the channel. It makes sense to let it stop, especially as mine restarts the timer when he joins the channel.

hixxy #179402 22/06/07 01:57 PM
Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Probably a great time to use me:*:join: smile

Code:
alias dotime if $me ison $1 { msg $1 It is now: $time(HH:nn) | .timertime 1 3600 dotime $1 }
on me:*:join:#yourchannel:{ .timertime $+($calc(($time(HH) +1) % 24),:00) 1 0 dotime # }

deegee #179413 22/06/07 05:18 PM
Joined: Feb 2007
Posts: 28
F
Fill Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2007
Posts: 28
thanks, it worked


Link Copied to Clipboard