mIRC Home    About    Download    Register    News    Help

Print Thread
#159038 12/09/06 10:20 PM
Joined: Sep 2006
Posts: 15
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Sep 2006
Posts: 15
I want a countdown timer. In my channel (a clan channel), we have events and stuff and i just want a timer that i can set to the next event and it will say there is... So and so many days hrs, mins, secs like that. Can someone please help me?

#159039 12/09/06 10:48 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Here's a simple timer... though you could probably search the forum and find multiple scripts for countdown timers.

Code:
alias countdown {
  if ($1) {
    .timercountdown 0 3600 DisplayCountDown $1-
  }
  else echo -a ERROR:  Please provide a date for the timer.
}
alias DisplayCountDown {
  if ($ctime($1-) < $ctime) { .timercountdown off | return }
  msg #yourchannel Your event will start in $duration($calc($ctime($1-) - $ctime))
}

Change the "3600" (60 minutes) to whatever time limit you want for the message to display in the channel. Also, change #yourchannel to the channel you want.

USE: /countdown Oct 31 2006 16:00
USE: /countdown Oct 31 2006 4:00pm

You can also use dates like 4/6/2007, but keep in mind that mIRC treats that as European style dates... the month is the 6 and the day is the 4. And you can just include a date or just a time, rather than both if you want to.

Note that if you want months and years, you might consider using the $DateXpander identifier I wrote as it will accurately display months and years... even with leap years. You can find it on mircscripts.org along with information on how to use it for a variety of things.

Finally, if you want to display the information at a time other than just when the timer triggers, just use:

/DisplayCountDown Oct 31 2006 4:00pm

or similar.


Invision Support
#Invision on irc.irchighway.net
#159040 13/09/06 12:34 AM
Joined: Sep 2006
Posts: 15
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Sep 2006
Posts: 15
Thats not working i typed in the /countdown thing and it didn't work

#159041 13/09/06 01:42 AM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
well the reason why its not showing is because the timer is set to silent and will only display in 3600 seconds so you wont see nothing till 3600 however if you want something right away then

Code:
alias countdown {
  if ($1) {
[color:red]DisplayCountDown $1-[/color]
    .timercountdown 0 3600 DisplayCountDown $1-
  }
  else echo -a ERROR:  Please provide a date for the timer.
}
alias DisplayCountDown {
  if ($ctime($1-) < $ctime) { .timercountdown off | return }
  msg #yourchannel Your event will start in $duration($calc($ctime($1-) - $ctime))
}


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#159042 13/09/06 04:35 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Yeah, sorry. I didn't think about pointing that out. Usually people don't need it right away for something like that. Anyhow, like I mentioned, you can always just type the second alias to get the message whenever you want it. The first part is just to do the repeating message every X seconds.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard