|
mudman Beginner
Joined: 23 Jun 2002 Posts: 13
|
Posted: 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. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Mon Jun 24, 2002 11:10 am |
#FORALL @PKList {#EXEC %expand("#TRIGGER {%i} {}")}
|
|
|
|
mudman Beginner
Joined: 23 Jun 2002 Posts: 13
|
Posted: 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.
|
|
|
|
mudman Beginner
Joined: 23 Jun 2002 Posts: 13
|
Posted: Mon Jun 24, 2002 7:40 pm |
Actually, it doesn' work. I get the %1 as the pattern. HMMM...
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: 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 |
|
|
|
mudman Beginner
Joined: 23 Jun 2002 Posts: 13
|
Posted: Mon Jun 24, 2002 9:59 pm |
Yes that was a mistype. I'll try both...however, the second one looks more efficient. Thanks.
|
|
|
|
mudman Beginner
Joined: 23 Jun 2002 Posts: 13
|
Posted: Mon Jun 24, 2002 10:09 pm |
Wow...both of them work like a charm. Thanks for your help Kjata.
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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.
|
|
|
|
Darker GURU
Joined: 24 Sep 2000 Posts: 1237 Location: USA
|
Posted: 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. |
|
|
|
|
|