mIRC Homepage
Posted By: FlintyVa Countdown to game release date - 26/08/07 02:34 PM
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
Posted By: UFP Re: Countdown to game release date - 26/08/07 03:04 PM
on *:TEXT:!countdown:#: {
msg # $duration($calc($ctime(16.11. $+ $asctime(yyyy)) - $ctime($asctime(dd.mm.yyyy))))
}
Posted By: Riamus2 Re: Countdown to game release date - 26/08/07 04:07 PM
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.
Posted By: FlintyVa Re: Countdown to game release date - 26/08/07 05:06 PM
Thanks everyone!

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