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


Joined: 23 Jun 2002
Posts: 13

PostPosted: Mon Jun 24, 2002 8:16 am   

Making Triggers Using #FORALL Command
 
I'm trying to make separate triggers from a stringlist using the #FORALL command. For example:

#FORALL @PKList {#TRIGGER %i}

I have a stringlist of all the characters in my PK range in the MUD at that time. I want to make each one of those names in that list a trigger. Anyway, what happens currently is that a trigger is formed with the ID of %1 and there is no pattern. Any help would be great. Thanks.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Mon Jun 24, 2002 11:10 am   
 
#FORALL @PKList {#EXEC %expand("#TRIGGER {%i} {}")}
Reply with quote
mudman
Beginner


Joined: 23 Jun 2002
Posts: 13

PostPosted: Mon Jun 24, 2002 7:11 pm   
 
Grrr... I'm still getting used to the proper syntax to use. You're a great help. Thank you very much.
Reply with quote
mudman
Beginner


Joined: 23 Jun 2002
Posts: 13

PostPosted: Mon Jun 24, 2002 7:40 pm   
 
Actually, it doesn' work. I get the %1 as the pattern. HMMM...
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Jun 24, 2002 8:58 pm   
 
A mistype perhaps? It is supposed to be a %i, not %1. If that isn't the problem, you might want to try this then:
#FORALL @PKList {#EXEC { %concat("#TRIGGER {", %i, "} {}")}}

However, you should also know that you can use a stringlist variable as the pattern of a trigger. Example:
#TRIGGER {({@PKList})} {The trigger fired with: %1}

Kjata
Reply with quote
mudman
Beginner


Joined: 23 Jun 2002
Posts: 13

PostPosted: Mon Jun 24, 2002 9:59 pm   
 
Yes that was a mistype. I'll try both...however, the second one looks more efficient. Thanks.
Reply with quote
mudman
Beginner


Joined: 23 Jun 2002
Posts: 13

PostPosted: Mon Jun 24, 2002 10:09 pm   
 
Wow...both of them work like a charm. Thanks for your help Kjata.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue Jun 25, 2002 1:53 am   
 
Yep, my bad. I am getting to be like those mindless programmers I hated at my old job. They would take a bad program spec and do it cause they could, and wouldn't ever bother to fix the spec to something they know is better.
Reply with quote
Darker
GURU


Joined: 24 Sep 2000
Posts: 1237
Location: USA

PostPosted: Tue Jun 25, 2002 2:04 pm   
 
quote:

They would take a bad program spec and do it cause they could, and wouldn't ever bother to fix the spec to something they know is better.



Takes offence

Hehe, just kidding.



zMUD 6 Online Help: All the power you'll ever need.
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