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


Joined: 10 Dec 2002
Posts: 8

PostPosted: Sat Dec 14, 2002 8:15 am   

#foralll loops and triggers
 
For some reason, when I try to use %i inside the name of a new trigger in a forall loop, it won't give me the name I need. Here's basically all it is:



#VARIABLE bool %prompt( "Yes", "Is this a new RP?") {} "Chat Capture"
#IF (@bool = "Yes") {
#VARIABLE looping %prompt( "1", "How many RPers are there currently?") {} "Chat Capture"
rpd
#LOOP @looping {
#ADDITEM rpers %prompt( "Tallas", "Who do you wish to add?")
#FORALL {@rpers} {
#CLASS {Chat Capture|%i}
#TRIGGER {~(CHAT~) '[%i]} {#CAPTURE (1) RolePlay}
#TRIGGER {~(CHAT~) [%i]} {#CAPTURE (1) RolePlay}
#CLASS 0
}
}
} {
#ADDITEM rpers %prompt( "Tallas", "Who do you wish to add?")
#FORALL {@rpers} {
#CLASS {Chat Capture|%i}
#TRIGGER {~(CHAT~) '[%i]} {#CAPTURE (1) RolePlay}}
#TRIGGER {~(CHAT~) [%i]} {#CAPTURE (1) RolePlay}
#CLASS 0
}

For some reason, all I get here where %i is in the trigger is %{i}. I've tried changing it to <<%i>>, and that had no effect either. I also tried putting single "< >" tags around it, which also yielded no results. Any ideas on how I can get this to work ?

Jez
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sat Dec 14, 2002 12:22 pm   
 
You need to force zMUD into expanding %i instead of using it literaly:
#EXEC %concat("#TRIGGER {~(CHAT~) '", %i, "} {#CAPTURE (1) RolePlay}")
%i instead of using it literaly:
#EXEC %concat("#TRIGGER {~(CHAT~) ", %i, "} {#CAPTURE (1) RolePlay}")

Kjata
Reply with quote
DevJez
Newbie


Joined: 10 Dec 2002
Posts: 8

PostPosted: Sat Dec 14, 2002 10:20 pm   
 
Thanks! Appreciate it, Kjata. That worked as well as something I tried just recently, although my way was much more difficult.

Jez
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