mIRC Home    About    Download    Register    News    Help

Print Thread
#179290 20/06/07 02:06 PM
Joined: Jun 2007
Posts: 2
O
oOgl Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
O
Joined: Jun 2007
Posts: 2
Hi

I'm a bit of a noob with all of this, I was trying to make a simple script to change a chan topic every 24 hrs that counted down to a date

this is what I was trying

Code:
on *:text:!test*:*:{
  .msg $iif($chan,$v1,$nick) 9Only 7 $duration($calc($ctime(06/08/2007 9:00:00) - $ctime)) 9 left
}

on *:text:!startcountdown*:*:{
/timer 00:01 0 86400 topic #testies 9Only 7 $duration($calc($ctime(06/08/2007) - $ctime)) 9 left

.msg #testies countdown topic thingie started
}


the idea being that every 86400 secs - 24 hrs, it would write the topic with the weeks/days left - the 1st bit works fine, and allows people to check the time left whenever.

The problem I have is that the $duration calc is only done when the timer is started.. so it never changes, but as I'm not very experienced in all this I don't what to do to fix that so that it recalculates each time it changes the topic..

Prolly far to easy a question to bother u all with smile
Any help would be greatly appreciated.

oOgl #179294 20/06/07 02:52 PM
Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
You can use a 'bang' (an exclamation mark) to delay evaluation until the timer triggers.

$!duration($calc($ctime(06/08/2007)-$ctime))
OR
$!duration($calc($ctime(06/08/2007) - $!ctime))

In the second example, $!ctime also has a ! due to the space before it.

deegee #179296 20/06/07 03:05 PM
Joined: Jun 2007
Posts: 2
O
oOgl Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
O
Joined: Jun 2007
Posts: 2
laugh

cheers, looks like it works fine now smile


Link Copied to Clipboard