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
Tommy2143
Beginner


Joined: 10 Aug 2002
Posts: 17

PostPosted: Wed Aug 27, 2003 8:01 am   

Loop to create many triggers
 
Ok I've got this text file full of monster death messages. I wanna do a loop to add a trigger for each one. I'm gonna manually edit the actions tho.
So I've got this line
#loop 574 {#trigger {%read(1,%i)} {} "Monster Deaths"}
574 is the total msgs in the file. However, this line is merely making 574 triggers that say %read(1,1) and %read(1,2) and so on down the line to 574. Can anyone see what I'm doing wrong here?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Aug 27, 2003 12:50 pm   
 
You have to force expansion with something like this:
#LOOP 1,574 {#EXEC {%concat("#TRIGGER {", %read(1, %i), "} {} ", %char(34), "Monster Deaths", %char(34), "}")}}
Reply with quote
Tommy2143
Beginner


Joined: 10 Aug 2002
Posts: 17

PostPosted: Wed Aug 27, 2003 3:39 pm   
 
Thankee much
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