|
geosmith Wanderer
Joined: 23 Apr 2005 Posts: 57
|
Posted: 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. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
|
|