Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
miegorengman
Wanderer


Joined: 05 Sep 2008
Posts: 50

PostPosted: Mon Aug 15, 2022 4:22 am   

Formatting the status window text...and everywhere else
 
is there a simple way to format content sent to a window? I have been making use of the vertical space of the Status Window...and ran out, so now I am trying to use the horizontal space and still keep everything consistently horizontally located.

For example I want to put my current hunger and thirst status side by side and keep the header stationary regardless of the length of text the variable contains.

Code:
hunger: @currentHungerState      thirst: @currentThirstState


unfortunately in it's current format the location of thirst varies based on the length of the value of @currentHungerState


the only example i have found that seems to solve this issue is below...and it works and I get the concept, but based on the amount of work each line would require I find myself asking the question, is there another/better way?

thank you for reading :)


the following code is from the following post: http://forums.zuggsoft.com/forums/viewtopic.php?t=26849

Code:
<alias name="critshow" id="25977">
  <value>#pri {#say " ";#say " ";#say  %ansi( 7)CritCounter Status:  %if(%class(crittrigs),%ansi( 3)enabled,%ansi( 4)disabled)%ansi( 7).;#say " ";#say  %ansi( 6)Critical hits:;#say  %ansi( 8)"                            Overall                 Current Session";#say  %ansi( 8)" Type of hit         Number    %hit   %crit      Number    %hit   %crit";#say " ";#sayp  %ansi( 7)" Total Hits";#sayp  %ansi( 7)%repeat(" ", 16-%len(@critcount.hits))@critcount.hits;#say  %ansi( 7)%repeat(" ", 28-%len(@critsession.hits))@critsession.hits;#sayp  %ansi( 7)" Total Criticals";#sayp  %ansi( 7)%repeat(" ", 11-%len(@critcount.crits))@critcount.crits;#sayp  %ansi( 7)%repeat(" ", 7-%len(@critpercent(@critcount.crits)))@critpercent(@critcount.crits)"%";#sayp  %ansi( 7)%repeat(" ", 20-%len(@critsession.crits))@critsession.crits;#say  %ansi( 7)%repeat(" ", 7-%len(@scritpercent(@critsession.crits)))@scritpercent(@critsession.crits)"%";#say " ";critdisplay c Criticals;critdisplay cc Crushing;critdisplay oc Obliterating;critdisplay apc Annihilating;critdisplay wsc World-Shattering;#send " "}</value>
</alias>
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Mon Aug 15, 2022 8:49 pm   
 
You would use the %format function

#HELP %format - to pull up the help file
_________________
Discord: Shalimarwildcat
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net