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
surge4883@yahoo.com
Beginner


Joined: 30 Jul 2010
Posts: 19

PostPosted: Tue Sep 14, 2010 7:30 pm   

formatting variables in an echo
 
I decided to make a script that would track all the potions I carry and the reagents I use for my spells. The script works great and it tracks everything correctly. The issue I'm having is small, but its annoying me so I was hoping someone here would have a good idea on how to fix it


Code:
-------------------------Potions and Reagents-------------------------
|                                                                    |
|                      Inventory          BOH          Pocket        |
| Potions                                                            |
|----------------------------------|--------------|------------------|
| Scarlet potions         0       |       0      |      0            |
|                                  |              |                  |
| Gleaming Blue potions   0       |       0      |      0            |
|                                  |              |                  |
| Indigo potions          0       |       0      |      0            |
|                                  |              |                  |
| Amethyst potions        0       |       0      |      0            |
|                                  |              |                  |
| Glowing White Vials     0       |       0      |      0            |
|                                  |              |                  |
| Liferoots               0       |       0      |      0            |
|----------------------------------|--------------|------------------|
| Reagents                        |              |                   |
|----------------------------------|--------------|------------------|
| Webstones               0       |       0      |      0            |
|                                  |              |                  |
| Blue Quartz Stones      0       |       0      |      0            |
|                                  |              |                  |
| Mirrors                 4       |       0      |      0            |
|__________________________________|______________|__________________|


EDIT (MattLofton): added code tags to preserve spacing

I realize that this doesn't line up correctly on here, but it lines up perfectly in zmud. This is an alias that shows me a menu of all the items I have with the number and location (on me, in bag, or in pocket)

When one of the variables goes to 10 or above, it shifts everything over, screwing up the look of the menu. it is an aesthetic problem, but I'd appreciate any input on how to fix it.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Tue Sep 14, 2010 10:05 pm   
 
Use the %format to control the formatting for that line.

Quote:
#SHOW %format("&10.0n",123456)</NOBR>
will display 123,456 with 3 spaces padding the front

#SHOW %format("&3.0f &s",123,"coins")
will display '123 coins'

#SHOW %format(2,1.23456)
displays 1.23
_________________
Asati di tempari!
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