mIRC Home    About    Download    Register    News    Help

Print Thread
Countdown to game release date #184194 26/08/07 02:34 PM
Joined: Aug 2007
Posts: 2
F
FlintyVa Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
F
Joined: Aug 2007
Posts: 2
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

Re: Countdown to game release date [Re: FlintyVa] #184195 26/08/07 03:04 PM
Joined: Dec 2006
Posts: 15
U
UFP Offline
Pikka bird
Offline
Pikka bird
U
Joined: Dec 2006
Posts: 15
on *:TEXT:!countdown:#: {
msg # $duration($calc($ctime(16.11. $+ $asctime(yyyy)) - $ctime($asctime(dd.mm.yyyy))))
}

Re: Countdown to game release date [Re: FlintyVa] #184202 26/08/07 04:07 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
Re: Countdown to game release date [Re: Riamus2] #184215 26/08/07 05:06 PM
Joined: Aug 2007
Posts: 2
F
FlintyVa Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
F
Joined: Aug 2007
Posts: 2
Thanks everyone!

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