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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Fuego Ledrey
Wanderer


Joined: 09 May 2007
Posts: 64
Location: Dustin Acres, California

PostPosted: Tue May 22, 2007 10:03 pm   

@rift_%1.%key
 
Ok, so I got this trigger capturing the contents of my rift (Achaea) into a database record variable called riftContents (lame, eh?). Anyway, I have these other string list variables (constant) to store all the different kinds of things that can be in my rift, commodities, crystals, herbs, inks, etc. They are all named appropriately rift_<thing> like, rift_comms, rift_crystals.... You get the idea. Well, I wanted an alias to show JUST the stuff from rift_crystals, or just the stuff from rift_herbs. So I tried

Code:
#if (%1) {#LOOPDB @riftContents {#if (@rift_%1.%key) {#show %val" of "%key} {}}}


It doesn't display anything.

Any suggestions?

Note:

Code:
#LOOPDB @riftContents {#show %val" of "%key}


works just fine, but it shows EVERYTHING in my rift, and that is like, 50 different things, not very convenient.
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Tue May 22, 2007 10:10 pm   
 
Try
Code:
#if (%1) {#LOOPDB @riftContents {#if (%concat("@rift_",%1.%key) {#show %val" of "%key} {}}}

instead.
_________________
Taz :)
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Tue May 22, 2007 10:14 pm   
 
Or maybe @{rift_%1.%key} or @{%concat("rift_",%1,".",%key)} or something like that.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Fuego Ledrey
Wanderer


Joined: 09 May 2007
Posts: 64
Location: Dustin Acres, California

PostPosted: Tue May 22, 2007 10:18 pm   
 
Taz, your stuff just made everything echo in riftContents, and Fang Xianfu, your stuff didn't echo anything at all :-/

Sorry, and thanks for trying.
_________________
EDIT: Image moved to Avatar FINALLY.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Tue May 22, 2007 10:32 pm   
 
You may well be using the wrong syntax here. You says that your @rift_whatever variables are stringlists - if that's true in the sense that they contain lists like {steel|stone|haddock|gold}, you're using the wrong syntax. I think what you mean is "if %key is a member of the rift_%1 list" and for that you need #if (%ismember(%key,@{rift_%1}).
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Fuego Ledrey
Wanderer


Joined: 09 May 2007
Posts: 64
Location: Dustin Acres, California

PostPosted: Tue May 22, 2007 10:35 pm   
 
Doh! I bet you're right, let me go plug it in. I can't believe I did that :P
_________________
EDIT: Image moved to Avatar FINALLY.
Reply with quote
Fuego Ledrey
Wanderer


Joined: 09 May 2007
Posts: 64
Location: Dustin Acres, California

PostPosted: Tue May 22, 2007 10:39 pm   
 
Yeah man, that worked great :P Thanks a lot!
_________________
EDIT: Image moved to Avatar FINALLY.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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