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
Risca
Beginner


Joined: 19 Nov 2003
Posts: 16
Location: USA

PostPosted: Sat Apr 02, 2005 7:22 am   

Substitution/Gag Help
 
I'd like to give a better format to looking at my inventory instead of the following.

----------------------------------------------------------------------------------
<16206hp 2359m 5110mv> inv
You are carrying:
(Humming) a red steel warhammer called, "Mage Masher"
king's sword of the wizardry of the colossus
a vial of black poison powder
amulet of the Fountain
(Like New ) the Shield of Heroes
Kinson's Pouch of Ingredients
Kinson's costume sack
<16206hp 2359m 5110mv>
-----------------------------------------------------------------------------------

Instead of seeing You are carrying: etc. etc.

I'd like to make it look something like this.

<16206hp 2359m 5110mv> inv

Kinson's Inventory List

Weapons: 2
Containers: 2
Shields: 1
Misc: 2

<16206hp 2359m 5110mv>

--------------------------------------------------------------------------------

My problem is displaying the end results properly. Which would be best to use #show, #echo, #say? How can I get the variable counters (the variable that keeps track of the # of weapons, containers, etc) to show the correct number if I have a long inventory list? Right now, I have an alarm to display the newly formatted output. Is there a better way than setting up an alarm to display the new output?
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Sat Apr 02, 2005 2:10 pm   
 
I would check out %countlist function. For the most part its just what your looking for.

First create some triggers to parse your inventory and add what type it is to a eqlist variable (and gag the line).
When inventory list is done (you get another prompt) you should have something close to whats shown below...

Quote:

#VAR eqlist {Weapons:|Shields:|Misc:|Containers:|Containers:|Weapons:|Misc:}
#VAR eqlist %countlist(@eqlist)
#LOOPDB @eqlist {#SHOW %key %val}
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