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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Lina
Novice


Joined: 12 Oct 2006
Posts: 49

PostPosted: Fri Oct 05, 2007 4:47 am   

[2.04] Question about database variables
 
I'm not sure if I am simply doing something wrong and thinking too much of zmud or if it's a bug, but here goes..

I made a pipe_coltsfoot variables which keeps records of id, puffs and status.

Now, I'm trying to make an alias which will call the id from this variable to use.

Alias name: light
Script: #if (%ismember( %1, coltsfoot|myrtle|faeleaf)) {~light @pipe_%1.id}

I've tried all kinds of things, but I cannot get it to work. Confused help?
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Fri Oct 05, 2007 4:58 am   
 
You say zMUD, but you've posted in the CMUD forum. Which did you mean? For now, I'll assume you meant CMUD.

This sort of implicit concatenation can cause problems. You need to tell CMUD what's part of the variable name and what isn't, like so:

~light @{pipe_%1.id}

an even better way would be

~light @{%concat("pipe_",%1,".id")}

but that'll be slower and probably not necessary.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Lina
Novice


Joined: 12 Oct 2006
Posts: 49

PostPosted: Fri Oct 05, 2007 5:02 am   
 
ah! yes...I tried " " and ' ' and <> and all kinds of things, but not curly braces .. thanks , see I knew it was just me.

and yes. my sentence says zmud, because I was working around what I knew how to get things working in zmud, but hasnt worked for me in cmud. It'll take me some time to pick it up I guess. Thanks though.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Fri Oct 05, 2007 12:44 pm   
 
Ah, sorry, I misread your post (it was almost 6am at the time). Glad that's helped :)
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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