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
hiftu
Newbie


Joined: 25 Mar 2003
Posts: 3

PostPosted: Tue Mar 25, 2003 2:10 pm   

button creation from variable
 
Hello,

I have a problem with creating button from a variable.


monsters - name of the monster.

#LOOP 1,%numitems( @monsters) {
#SHOW %i
#BUTTON %i {kill %item( @monsters, %i)} {kill %item( @monsters, %i)} } {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} "" {} {} {}
}

I want some buttons to kill the chosen monster.
But the result is:
kill %item( @monsters, %i)} instead of
kill bigmonster
(The second command is not evaluated... :(

Is there any solution?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Mar 25, 2003 4:23 pm   
 
Use #EXEC and %concat to force expansion:
#EXEC {%concat("#BUTTON %i {kill %item( @monsters, %i)} {kill ", %item( @monsters, %i)"} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} ", %char(34), %char(34), " {} {} {}")}

Kjata
Reply with quote
hiftu
Newbie


Joined: 25 Mar 2003
Posts: 3

PostPosted: Tue Mar 25, 2003 7:28 pm   
 
Thanks,

I created this trigger.
You have to create pattern for entering a room. (or looking around)
#delc buttons
#class buttons
#FORALL @monsters {#exec %eval(#bu %i {kill %i} {kill %i})}
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