mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2007
Posts: 2
F
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

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))))
}

Joined: Oct 2004
Posts: 8,330
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
Joined: Aug 2007
Posts: 2
F
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?


Link Copied to Clipboard