[TF] Help with rescue trigger (semi-tf newbie)
Brought to you by:
kenkeys
|
From: johans at stack.nl (J. v. Selst) - 2003-03-23 22:53:10
|
Hi Steve,
Steve Baker wrote:
> I'm trying to create a rescue trigger that works based on a few
> things. I'll explain what i need and perhaps someone will have
> something already written that I can modify or be able to give me some
> help.
Although the zmud script looks rather complicated, your description is
pretty straight-forward, so I'll just use that one instead ;-)
Your script probably does quite a bit more but I don't speak zmud.
> 1) I need to be able to create a list, that contains a list of names
> of people to rescue
There are some very nice macros for working with lists or arrays in TF,
but the easiest is a static list.
> 2) I need to be able to create a list that contains a list of tanks
What for?
> 3) When the script sees "XYZ switches targets" it should look in the room
> 4) If the script sees someone sit/stands/flies/ here fighting "someone
> on the rescue list" it issues rescue "person"
> (should probably just look for fighting "someone on the rescue list"
These can be done with standard triggers.
Here is a simple example which you can hopefully extend to make it do
exactly what you want:
;; rescue.tf
/set matching=regexp
/set rescue_list=Gandalf|Frodo|Gimli
/def -t' switches targets' target_switch = look
/eval /def -t' fighting (%{rescue_list})' rescue = rescue %%{P1}
;; EOF
The %rescue_list variable is the list of people to be rescued; written
as a regular expression. You can change it at any time and issue a
/load rescue.tf to reload the list and macros.
The /target_switch trigger will issue the look command when somebody
switches target. The output of look is not suppressed, so it might get
spammy if this happens a lot.
The /rescue trigger will be called whenever you see someone fighting
anyone on your %rescue_list (not just directly after the first trigger).
It will then automatically try to rescue this person.
--
Johan van Selst <jo...@st...> Koresh@OuterSpace
PGP: finger jo...@va... telnet mud.stack.nl 3333
|