mIRC Home    About    Download    Register    News    Help

Print Thread
#201279 24/06/08 05:19 AM
Joined: Jun 2008
Posts: 2
B
Bowl of petunias
OP Offline
Bowl of petunias
B
Joined: Jun 2008
Posts: 2
Im trying to make a script that will display the time remaining until 7 PM. Im still a noob with this kind of stuff but Im wanting to learn.

Here is what i have:

Code:
test: {
  set %ct $time
  set %st 19:00:00
  set %tt [%st - %ct]
  msg $chan test %tt
}



I know this is wrong but can someone help me?

Thanks

Bassxman1 #201281 24/06/08 07:13 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
First off, you need to use $calc to calculate the difference in the time.
Code:
alias test {
  $iif($chan,.msg $chan,echo -a) $duration($calc($duration(19:00:00) - $duration($time)),3)
}

This will give an incorrect response if the time is after 7 pm, but other than that should give you what you're asking for.

Read the help file under $duration and $calc for more details as to how they work.

RusselB #201311 24/06/08 06:32 PM
Joined: Jun 2008
Posts: 2
B
Bowl of petunias
OP Offline
Bowl of petunias
B
Joined: Jun 2008
Posts: 2
Cool! Thanks for you help. smile


Link Copied to Clipboard