MU Soapbox

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

    Trend Statistics for RhostMUSH

    MU Code
    2
    8
    2337
    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.
    • Ashen-Shugar
      Ashen-Shugar last edited by Ashen-Shugar

      I made full statistical code for RhostMUSH.

      The trend will keep track of:

      1. Daily statistics for a full 365 day period.
      2. Monthly statics for a full 365 day period.
      3. Hourly statistics for a full 24 hour period (with averaging for all time)
      4. Year statistics for life of the mush
      5. A 'record' option that will show date and time when records are reached.

      It keeps track of max players and max unique connections.

      It's recommended you run on at least 3.9.5 before using this.

      Do to its heavy use of color (for the bar graphs) it tends to eat large buffering, so recommended you compile for 32K lbufs, though 16K should be sufficient and 8K may work but it'll be tight for +trend/hour. The others will work fine.

      I may look to recode it using list() instead of iter() then 4K lbufs would be sufficient.

      That's for Version 1.0.2 😉

      It's part of the git repo for the Mushcode suite.

      You can download and install it from: Trend Object

      This will not work on MUX.

      This may work on Penn with a rewrite. It actively uses printf() which would have to be converted to Penn's align().

      1 Reply Last reply Reply Quote 0
      • Thenomain
        Thenomain last edited by

        It looks at very first blush that the only block to getting this on Mux is the use of fprint(). I could not find the help file that explained 'and(!!$...)', but I can see how it's being used so can do the same thing with 'strcat()'.

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

        Ashen-Shugar 1 Reply Last reply Reply Quote 0
        • Ashen-Shugar
          Ashen-Shugar @Thenomain last edited by

          @Thenomain said:

          It looks at very first blush that the only block to getting this on Mux is the use of fprint(). I could not find the help file that explained 'and(!!$...)', but I can see how it's being used so can do the same thing with 'strcat()'.

          The !!$ can be reproduced likely with t(). It's a bit of pre-parser voodoo.

          BANG NOTATION
          Bang notation allows you to use '!' and '!!' in functions for 'not' and
          'not-not' functionality. This works similiarilly to the C equivelant of
          using 'bangs'. You may also specify '!$' and '!!$' for FALSE or TRUE
          conditions on functions that return string values. Finally, you may
          specify '!^' and '!!^' for true-boolean FALSE or TRUE conditions on
          functions that return true-boolean based on the function t()'.

          Example:
          > say match(one two three four five,four)
          You say "4"
          > say !match(one two three four five,four)
          You say "0"
          > say !!match(one two three four five,four)
          You say "1"
          > say !!$grab(this is a test,was)
          You say "0"
          > say !!$grab(this is a test,this)
          You say "1"
          > say !!^space(1000) (spaces are non-boolean strings)
          You say "0"
          > say !!$space(1000) (spaces are not-null strings)
          You say "1"

          Thenomain 1 Reply Last reply Reply Quote 0
          • Thenomain
            Thenomain @Ashen-Shugar last edited by

            @Ashen-Shugar

            That's what it looked like, it was just odd to see.

            It's the fprint() that is going to be so babies.

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

            Ashen-Shugar 1 Reply Last reply Reply Quote 0
            • Ashen-Shugar
              Ashen-Shugar @Thenomain last edited by

              @Thenomain said:

              @Ashen-Shugar

              That's what it looked like, it was just odd to see.

              It's the fprint() that is going to be so babies.

              Absolutely. Penn has the closest chance of making it work with align(), but sadly align() doesn't offer some things that printf() does, like having multi-char fillers for different columns in the same command. That's gonna suck. 😕

              1 Reply Last reply Reply Quote 0
              • Thenomain
                Thenomain last edited by

                Nah, what's going to suck is turning things like $-2s$-2s $-2s$-2s $-2s$-2s $-2s$-2s $-2s$-2s $-2s$-2s $-2s$-2s $-2s$-2s $-2s$-2s $-2s$-2s $-2s$-2s $-2s$-2s into English.

                🕐 🕑 🕒 🕓 🕔 🕕 🕖 🕗 🕘 🕙 🕚 🕛

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

                Ashen-Shugar 1 Reply Last reply Reply Quote 0
                • Ashen-Shugar
                  Ashen-Shugar @Thenomain last edited by Ashen-Shugar

                  @Thenomain said:

                  Nah, what's going to suck is turning things like $-2s$-2s $-2s$-2s $-2s$-2s $-2s$-2s $-2s$-2s $-2s$-2s $-2s$-2s $-2s$-2s $-2s$-2s $-2s$-2s $-2s$-2s $-2s$-2s into English.

                  Mmm, it's not that bad. It works a lot like the hardcoded printf() command.

                  To break it down:

                  $ means the start of a substitution
                  -- means left justify (default is right justify)
                  ^ means center justify
                  2 means 2 character alignment (auto-cut's off unless specified otherwise)
                  s means the end of the substitution.

                  If no number is specified for the $s pair (ergo, you just have $s) it just prints the value without any justification.

                  So putting it together $-2s means 'Start substitution, left justify to 2 characters'

                  For every $...s pattern you have one argument.

                  so:

                  printf(|$-2s|$-5s|$^20s|$s|,arg 1, arg 2, arg 3, arg 4)
                  

                  Will return:

                  |ar|arg 2|       arg 3        |arg 4|
                  

                  You get the hang of it when you work with it some.

                  1 Reply Last reply Reply Quote 0
                  • Thenomain
                    Thenomain last edited by

                    strcat( %b %b, iter( lnum( 1, 23, 2 ), strcat( ljust( v( %i0 ), 2 ), ljust( v( inc( %i0 )), 2 ))), %b %b )

                    Okay, got it. Harder to change, not difficult to set up, more issue with iteration limits. C'est la vie.

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

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