A timestring-ish function in TinyMUX?



  • Hi guys. I was wondering if there is an equivalent in TinyMUX to the timestring() function?

    timestring() in PennMUSH:

    TIMESTRING()
      timestring(<seconds>[,<pad flag>])
    
      The timestring function takes a number of seconds as input and
      returns the amount of time formatted into days, hours, minutes, and
      seconds. If <pad flag> is 1, all time periods will be used even
      if the number of seconds is less than a day, hour, or minute.
      If <pad flag> is 2, all numbers will be 2 digits long.
    
      Example:
      > say [timestring(301)]
      You say, " 5m  1s"
      > say [timestring(301,1)]
      You say, "0d  0h  5m  1s"
      > say [timestring(301,2)]
      You say, "00d 00h 05m 01s"
    

    Maybe exptime()? Would that do the same thing?

    exptime() from MUX:

      FUNCTION: exptime(<seconds>)
    
      This function converts seconds to a number of time elements (hours,
      minutes, seconds) that is equivalent to the given number of
      <seconds>.
    
      This is very similar to the writetime() function, but the elements
      are given their short names instead of long names.
    
      Example:
        > say exptime(45)
        You say, "45s"
        > say exptime(12345)
        You say, "3h 25m 45s"
        > say exptime(123456)
        You say, "1d 10h 17m 36s"
    


  • Yes.

    Nothing else to say here. Just "yes, this is what you're looking for unless you want the padding".



  • @thenomain Thank you! Certainly SEEMED the same, but you never know. MU*s are tricky beasts.


Log in to reply