MU Soapbox

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Muxify
    • Mustard

    A timestring-ish function in TinyMUX?

    MU Questions & Requests
    mux tinymux
    2
    3
    414
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Highfalutin
      Highfalutin last edited by Highfalutin

      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"
      
      1 Reply Last reply Reply Quote 0
      • Thenomain
        Thenomain last edited by

        Yes.

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

        “If you wish to make an apple pie from scratch, you must first invent the universe.”
        ― Carl Sagan, Cosmos

        Highfalutin 1 Reply Last reply Reply Quote 1
        • Highfalutin
          Highfalutin @Thenomain last edited by

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

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post