Top

Better $duration


mIRC Code
+ 0 likes
Please Register to submit score.
Average Score  5.0
Scores Submitted  1
Date Added  Dec 30, 2006
Last Updated  Dec 31, 2006
Tags  duration  time 
  Bookmark and Share

Introduction

This snippet does what $duration should do and converts a string like 2w4d10h3m2s into seconds. Usage is $lduration(string) where string should be formatted as above. Accepted time measures are the same as for $duration and include w, d, h, m, and s. Poorly formatted strings, such as 5m2h4m, are okay (the previous example would be evaluated the same as 2h9m).

Grab the Code

Comments

  (2)  RSS
Cherish
Comments: 11
 
mIRC Snippet:  Better $duration
Posted on Dec 31, 2006 8:35 am
.echo -q can be replaced with .noop
Yoinx
Comments: 424
 
mIRC Snippet:  Better $duration
Posted on Dec 31, 2006 11:05 am
It can, however, that would only work in 6.2 ^ I believe.

As it is, this should work from at aleast 6.16 and up.

Please Register or Login to start posting comments.
Bottom