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


Joined: 16 Oct 2006
Posts: 62

PostPosted: Wed Dec 26, 2007 4:30 am   

variable within a variable
 
Hi, I'm playing a Monk in Achaea and have a rather puzzling problem. I'm sure I could do this differently but it might be fun for you guys to play around with. I've never seen this posted but maybe some of you have seen it before. There are times when I want to add a random attack onto an action or have one there in case the action fails and it doesn't cost balance or equilibrium. I do not want to become predictable which could hapen if people catch on and trigger blocks or parry to my initial action. I have a list variable for kicks that looks like this:

#var AttackMode {axk @Target|mnk @Target left|mnk @Target right|sdk @Target|snk@Target right|snk @Target left}

I then have an alias
#alias ChooseAttack {#1 {%item(@AttackMode,%random(1,6))}}

The output I get is for example:

snk @Target left

Which should be expected. I have tried different types of brackets to get the @Target variable to show up as the actual name. Is there any way to do this?
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Wed Dec 26, 2007 10:36 am   
 
Try using #exec instead of #1 - that's what it's for, after all.

If that doesn't work, try using %eval on the result of %item.
_________________
Rorso's syntax colouriser.

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


Joined: 16 Oct 2006
Posts: 62

PostPosted: Thu Dec 27, 2007 12:37 am   
 
That works perfectly! Thanks so much!
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