mIRC Homepage
Posted By: Fill Time announcer - 22/06/07 01:25 PM
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?
Posted By: SladeKraven Re: Time announcer - 22/06/07 01:40 PM
Edit: Use Hixxy's code.
Posted By: hixxy Re: Time announcer - 22/06/07 01:47 PM
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 }
Posted By: 5618 Re: Time announcer - 22/06/07 01:52 PM
You guys should probably use the -o switch in your timers because otherwise the script will stop running when he gets accidentally disconnected.
Posted By: hixxy Re: Time announcer - 22/06/07 01:53 PM
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.
Posted By: deegee Re: Time announcer - 22/06/07 01:57 PM
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 # }
Posted By: Fill Re: Time announcer - 22/06/07 05:18 PM
thanks, it worked
© mIRC Discussion Forums