Skip to content
General IRCd

$calc Question

A TG007 community discussion started by Silo.

Discussion 3 posts
Page 1 of 1
Open
Topic #11406 · 3 published posts · 1,665 views

Guys & Dolls, I know I know, you all fret if I don't post a question every week... so without further aidue, my question is thus:

 

[Banned for $int($calc(%bt / 60) * 100)) $iif(%bt <= 60,minute,minutes) $+ ]

 

and the %var for %bt is via:

var %bt = $input(Enter ban time in seconds,qend,Duration) | ban -u $+ %bt $address($$1,3)

 

The first code (as well as the second) is quite obvious. I enter a ban time in seconds - say 300 seconds. After the kick it messages it's calculated into minutes.

 

Obviously, if the time exceeds 60 minutes we're into the hours. Can someone show me how to make it go into hours?

 

Would I need to $calc the first calculation in a similar fashion?

 

If anyone can shed some light on the subject, I'd love to hear it.

 

Thank you in advance :)

$duration(%bt,2)

 

You make it way to complicated. If you do $duration(%bt,3), it'll return it in h:m:s format.

Ahhhh, ok thanks, X... And I thought I was being pretty clever, too! Sad to say, I'm sure I quite often do do things the hard way.

 

I said do do :oops:

 

Cheers, mate :)