mIRC Home    About    Download    Register    News    Help

Print Thread
F
FlintyVa
FlintyVa
F
Hello,

I was wondering how I would go about getting a script which counts down the days/hours/minutes/seconds until Crysis is released (16th November 07). I would like it so when someone types !countdown in the channel it would tell them the time remaining until release in the channel but also wouldn't respond for say 30 seconds to prevent abuse.

Thanks,
FlintyVa

U
UFP
UFP
U
on *:TEXT:!countdown:#: {
msg # $duration($calc($ctime(16.11. $+ $asctime(yyyy)) - $ctime($asctime(dd.mm.yyyy))))
}

Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Including flood control:

Code:
on *:TEXT:!countdown:#: {
  if (%countdown.flud) { return }
  set -u30 %countdown.flud On
  msg # $duration($calc($ctime(Nov 11 2007) - $ctime))
} 


Note that you can also include a specific time, such as midnight:

Code:
on *:TEXT:!countdown:#: {
  if (%countdown.flud) { return }
  set -u30 %countdown.flud On
  msg # $duration($calc($ctime(Nov 11 2007 0:00) - $ctime))
} 


That will give you more accurate time.

Also, you can choose to get $DateXpander or datediff as those will show months rather than just weeks in the output. $DateXpander can be found on mircscripts.org. There are examples of how to use it for a countdown. datediff is easier for countdowns, but doesn't consider leap years afaik. Obviously, you don't need to worry about leap years for such a short duration, though.

F
FlintyVa
FlintyVa
F
Thanks everyone!

Is there any way I could get it to show days rather than weeks or months?


Link Copied to Clipboard