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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Virus
Wanderer


Joined: 29 Jun 2002
Posts: 69
Location: USA

PostPosted: Sat Jul 27, 2002 1:25 am   

Justify??
 
I was wondering if there was a command to justify text.

Richard Powell
Mux Alias: Virus
2796 Wizard Staff
64.89.10.1 port 2796
Rich@gigdev.com
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sat Jul 27, 2002 1:09 pm   
 
Nope, no justify.

Kjata
Reply with quote
Virus
Wanderer


Joined: 29 Jun 2002
Posts: 69
Location: USA

PostPosted: Sat Jul 27, 2002 5:56 pm   
 
is there any way to code one? All I want to do is something so that I can even space stuff without having to each thing the same length of letters, and I cant use tabs cause it will get toooo long.


Richard Powell
Mux Alias: Virus
2796 Wizard Staff
64.89.10.1 port 2796
Rich@gigdev.com
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sat Jul 27, 2002 6:39 pm   
 
Oh, that's something different. For that, you can use the %format function. Example:
#SHOW %format("&5s &6s", "dog", "cat")
#SHOW %format("&5s &6s", "fish", "ant")
#SHOW %format("&5s &6s", "tiger", "monkey")

would display:


cat dog
fish ant
tiger monkey


Kjata
Reply with quote
fattony
Apprentice


Joined: 27 Dec 2001
Posts: 105
Location: USA

PostPosted: Sat Jul 27, 2002 7:55 pm   
 
For some reason I can't get variables to work in the %format function like this.

Ex-
#show %format("&5s", @variable)

displays nothing. Any ideas?

Fat Tony
Reply with quote
fattony
Apprentice


Joined: 27 Dec 2001
Posts: 105
Location: USA

PostPosted: Sat Jul 27, 2002 8:08 pm   
 
Figured out what the problem was. @variable is a number, and the &s is for strings only. Changing it to

#show %format("&5.0n", @variable)

fixed it.

Thanks for your time.

Fat Tony
Reply with quote
Virus
Wanderer


Joined: 29 Jun 2002
Posts: 69
Location: USA

PostPosted: Sun Jul 28, 2002 5:45 am   
 
I actually coded one if anyone wants it. Here thet are....

#FU ljust {%1%repeat( %if( %3, %3, " "), %eval( %2-%len( %1)))}

#FU rjust {%repeat( %if( %3, %3, " "), %eval( %2-%len( %1)))%1}

#FU center {%repeat( %if( %3, %3, " "), %eval( (%2-%len( %1))/2))%1%repeat( %if( %3, %3, " "), %if( %eval( %2-%len( %1))2, %eval( ((%2-%len( %1))/2)+1), %eval( (%2-%len( %1))/2)))}

Heres one I needed for timestamps, IE if you want to know how long ago you saw something. It takes the time and converts it to seconds. I wasnt sure if there was already a code for this so I made one...

#FU secs {%eval( %time( ss)+%time( nn)*60+%time( hh)*3600)}

Good luck.

Richard Powell
Mux Alias: Virus
2796 Wizard Staff
64.89.10.1 port 2796
Rich@gigdev.com
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Jul 28, 2002 12:56 pm   
 
Actually, you can do the timestamp simpler by using %secs. This pre-defined variable contains the number of miliseconds passed since midnight. Just divide it by 1000 to get it in seconds.

Kjata
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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