Trend Statistics for RhostMUSH


  • Coder

    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().


  • Coder

    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()'.


  • Coder

    @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"


  • Coder

    @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.


  • Coder

    @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. :/


  • Coder

    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.

    :clock1: :clock2: :clock3: :clock4: :clock5: :clock6: :clock7: :clock8: :clock9: :clock10: :clock11: :clock12:


  • Coder

    @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.


  • Coder

    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.


Log in to reply
 

Looks like your connection to MU Soapbox was lost, please wait while we try to reconnect.