TinyFugue statistics generation scripts

Need some help with your MUD client? Forgot your password? Get help here.
Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
Post Reply
User avatar
Rhaegar
Legend
Posts: 960
Joined: 13 May 2010 06:22

TinyFugue statistics generation scripts

Post by Rhaegar » 17 May 2010 09:55

I'm not sure how many people are still using this old but sturdy client, but for all those that do, I'd like to share a simple script for generating statistics that might come in handy.
It's working are very simple, it gathers the data and then displays it at command with a nice graph accompanying it (and we all love graphs).

Here's the simple version for herbs:

Code: Select all

;
; commands and triggers for herbing
;

; variables

/set herbs 0
/set attanar 0
/set chicory 0
/set suranie 0

; aliases

/alias find /alias hh search here for %{*} %; hh 
                                        
/alias hstat /hstat
                                        
/alias hh search here for herbs

; triggers

/def -F -t'*You find*!' herb_found = /set herbs=$[herbs+1] %;\
                                        open pouch %;\
                                        put herbs in pouch %;\
                                        close pouch %;\
                                        hh                                    
                                                         
/def -F -t'*You find*little blue berry*!' attanar_found = /set attanar=$[attanar+1] %;\
     /echo -aCgreen * Attanar *
                                                          
/def -F -t'*You find*sharp short leaf*!' chicory_found = /set chicory=$[chicory+1] %;\
     /echo -aCgreen * Chicory *
                                                            
/def -F -t'*You find*small red berry*!' suranie_found = /set suranie=$[suranie+1] %;\
     /echo -aCgreen * Suranie *

; statistics
                                                            
/def draw_graph = /if (variable_ratio=0) \
                      /set graph .............................. %;\
                  /elseif ((variable_ratio>0)&(variable_ratio<4)) \
                          /set graph #............................. %;\
                  /elseif ((variable_ratio>3)&(variable_ratio<7)) \
                          /set graph ##............................ %;\
                  /elseif ((variable_ratio>6)&(variable_ratio<11)) \
                          /set graph ###........................... %;\
                  /elseif ((variable_ratio>10)&(variable_ratio<14)) \
                          /set graph ####.......................... %;\
                  /elseif ((variable_ratio>13)&(variable_ratio<17)) \
                          /set graph #####......................... %;\
                  /elseif ((variable_ratio>16)&(variable_ratio<21)) \
                          /set graph ######........................ %;\
                  /elseif ((variable_ratio>20)&(variable_ratio<24)) \
                          /set graph #######....................... %;\
                  /elseif ((variable_ratio>23)&(variable_ratio<27)) \
                          /set graph ########...................... %;\
                  /elseif ((variable_ratio>26)&(variable_ratio<31)) \
                          /set graph #########..................... %;\
                  /elseif ((variable_ratio>30)&(variable_ratio<34)) \
                          /set graph ##########.................... %;\
                  /elseif ((variable_ratio>33)&(variable_ratio<37)) \
                          /set graph ###########................... %;\
                  /elseif ((variable_ratio>36)&(variable_ratio<41)) \
                          /set graph ############.................. %;\
                  /elseif ((variable_ratio>40)&(variable_ratio<44)) \
                          /set graph #############................. %;\
                  /elseif ((variable_ratio>43)&(variable_ratio<47)) \
                          /set graph ##############................ %;\
                  /elseif ((variable_ratio>46)&(variable_ratio<51)) \
                          /set graph ###############............... %;\
                  /elseif ((variable_ratio>50)&(variable_ratio<54)) \
                          /set graph ################.............. %;\
                  /elseif ((variable_ratio>53)&(variable_ratio<57)) \
                          /set graph #################............. %;\
                  /elseif ((variable_ratio>56)&(variable_ratio<61)) \
                          /set graph ##################............ %;\
                  /elseif ((variable_ratio>60)&(variable_ratio<64)) \
                          /set graph ###################........... %;\
                  /elseif ((variable_ratio>63)&(variable_ratio<67)) \
                          /set graph ####################.......... %;\
                  /elseif ((variable_ratio>66)&(variable_ratio<71)) \
                          /set graph #####################......... %;\
                  /elseif ((variable_ratio>70)&(variable_ratio<74)) \
                          /set graph ######################........ %;\
                  /elseif ((variable_ratio>73)&(variable_ratio<77)) \
                          /set graph #######################....... %;\
                  /elseif ((variable_ratio>76)&(variable_ratio<81)) \
                          /set graph ########################...... %;\
                  /elseif ((variable_ratio>80)&(variable_ratio<84)) \
                          /set graph #########################..... %;\
                  /elseif ((variable_ratio>83)&(variable_ratio<87)) \
                          /set graph ##########################.... %;\
                  /elseif ((variable_ratio>86)&(variable_ratio<91)) \
                          /set graph ###########################... %;\
                  /elseif ((variable_ratio>90)&(variable_ratio<94)) \
                          /set graph ############################.. %;\
                  /elseif ((variable_ratio>93)&(variable_ratio<97)) \
                          /set graph #############################. %;\
                  /elseif ((variable_ratio>96)&(variable_ratio<101)) \
                          /set graph ############################## %;\
                  /else \
                        /echo -aBCred *** ERROR: value out of range *** %;\
                  /endif 
                                                      
/def hstat = \
     /echo -aCgreen @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ %;\
     /echo -aCgreen @@@@ ---------------------------------------------- @@@@ %;\
     /echo -aCgreen @@@@ |    H E R B I N G    S T A T I S T I C S    | @@@@ %;\
     /echo -aCgreen @@@@ ---------------------------------------------- @@@@ %;\
     /echo -aCgreen @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ %;\
     /echo -aCgreen @ %;\
     /echo -aCgreen @ Total herbs found                               : %herbs %;\
     /echo -aCgreen @ %;\
     /echo -aCgreen @ ---------------------------------------------------- @ %;\
     /echo -aCgreen @ %;\
     	   /if (attanar>0) \
               /set variable_ratio=$[100-(((herbs-attanar)*100)/herbs)] %;\
               /else \
               	     /set variable_ratio=0 %;\
                     /endif %;\
                     /draw_graph %;\
                     /echo -aCgreen @ Attanar     %graph      : %attanar %;\
           /if (chicory>0) \
               /set variable_ratio=$[100-(((herbs-chicory)*100)/herbs)] %;\
               /else \
               	     /set variable_ratio=0 %;\
                     /endif %;\
                     /draw_graph %;\
                     /echo -aCgreen @ Chicory     %graph      : %chicory %;\
           /if (suranie>0) \
               /set variable_ratio $[100-(((herbs-suranie)*100)/herbs)] %;\
               /else \
               	     /set variable_ratio=0 %;\
                     /endif %;\
                     /draw_graph %;\
                     /echo -aCgreen @ Suranie     %graph      : %suranie %;\
     /echo -aCgreen @ %;\
     /echo -aCgreen @ ---------------------------------------------------- @ %;\
     /eval /echo -aCgreen [+]  Statistics taken  :  $[ftime("%a %b %d %X %Y", time())]  [+]
Here's the sample output generated by the script:

Code: Select all

> hstat
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ ---------------------------------------------- @@@@
@@@@ |    H E R B I N G    S T A T I S T I C S    | @@@@
@@@@ ---------------------------------------------- @@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@
@ Total herbs found                               : 45
@
@ ---------------------------------------------------- @
@
@ Attanar     ####..........................      : 5
@ Chicory     #################.............      : 25
@ Suranie     ###########...................      : 15
@
@ ---------------------------------------------------- @
[+]  Statistics taken  :  Mon May 17 05:13:32 PM 2010  [+]
I know it doesn't show much with just 3 herb types added, but it can be expanded to whatever length you want.
It can also be changed to count other things, special attacks, hits and misses in combat, leftovers gathered or whatever else you would like to count and can set a trigger for.

I hope some of you might find it interesting. Please enjoy.
I fear no evil for I am fear incarnate.

Yanus
Adventurer
Posts: 95
Joined: 08 Mar 2010 15:58

Re: TinyFugue statistics generation scripts

Post by Yanus » 05 Oct 2010 00:09

.
Last edited by Yanus on 30 May 2014 22:49, edited 1 time in total.

User avatar
Rhaegar
Legend
Posts: 960
Joined: 13 May 2010 06:22

Re: TinyFugue statistics generation scripts

Post by Rhaegar » 13 Jan 2011 17:23

That's nice. Thanks for suggesting this, I'll test it out as soon as I'm able to (you might've noticed my sudden disappearance over the past months but I had A LOT on my head between my newborn son, work and university).
I fear no evil for I am fear incarnate.

Post Reply
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/