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
geosmith
Wanderer


Joined: 23 Apr 2005
Posts: 57

PostPosted: Sun Mar 19, 2006 7:38 am   

Variables (data record variables?) question
 
Basically I'm trying to create a variable that associates the short names of numerous items (for example, Pouch38742) with their long names (for example, "a Prism Pouch"), and a trigger which will fire on any line matching "You remove (the long name of any listed item)" with the resulting input "wear (the short name of that item)".

So for example, "You remove a Prism Pouch." would cause the response "wear pouch38742".

I'd also need to create a trigger which could easily add items to that variable when the MUD displays something along the lines of:

You are wearing:
"ring14654" a sapphire and orichalcum ring
"pouch52484" a Prism Pouch
"pack149616" a canvas backpack


Any advice on this would be appreciated.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Mar 19, 2006 8:46 am   
 
Adding items
#trigger {^You are wearing:} {#T+ tAddInventoryItems}
#condition {^$} {#T- tAddInventoryItems}

#trigger "tAddInventoryItems" {^~"(%w%d)~" (*)} {#addkey Items %1 "%2"}

sending the shortname command
#trigger {^You remove (*).} {#loopdb @Items {#if (%val = "%1") {wear %key}}}
_________________
EDIT: I didn't like my old signature
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