Trigger -> Array?

Posted by Vureric on Tue 08 Jul 2003 05:16 AM — 2 posts, 10,928 views.

#0
Alright, I am not sure which language to use, so i Just put it in the general forum.. Alright here goes, I want to trigger off of a line in the mud, and put it in an array... for instance, I see a mob:

A dwarven worker is here.

Of course I want to put dwarf at the end of the @mob array... now if I see...

A small party of [ 4 ] dwarven workers slave away.

I want to loop

foreach(1..4) {
@mob[] = "dwarf";
}

And add each one in turn to the loop (ok so all this isn't perfect, because well uh... I am not too familiar with syntax, but You get the drift... So how would I go about accomplishing this, and which language should I use?
Thanks for any help.
Australia Forum Administrator #1
It might be easier if we knew why you wanted to do this.

The language doesn't really matter, but you might do something like this:

Trigger: A small party of [ * ] * slave away.

In this case wildcard 1 is the number and wildcard 2 is the description.

In the trigger you might do this:

sub mytrigger (name, line, wildcards)
for i = 1 to wildcards (1)
' do something with wildcards (2)
next
end sub