|
hoku Newbie
Joined: 21 Dec 2001 Posts: 7 Location: USA
|
Posted: Fri Dec 21, 2001 7:27 am
Advanced Triggers |
Hi. I'm in the process of building a bot and was wondering how I would go about checking a room for NPC's to kill and killing them. For example, I enter a room and I see a description similar to this:
-------------------------
> In the farm
(Exits: n e s w)
A small pig
A small pig
A large hen
A small pig
-------------------------
Now all I want to do is kill the first small pig. How would I go about setting up a trigger for this action? Thanks in advance. :)
BTW, I can't type 'kill a small pig'. It has to be 'kill pig'. |
|
|
|
Acaila Apprentice
Joined: 30 Aug 2001 Posts: 187 Location: Netherlands
|
Posted: Fri Dec 21, 2001 9:08 am |
#TR {~(Exits:*~)$(*)} {kill %word("%1", %numwords("%1"))}
This will look at the first line after the exits line and uses the last word of the mob as keyword
To attack all of the mobs in a room you can use the following:
#TRIGGER {^~(Exits:*~)} {#T+ Targets;#TEMP {$} {#FORALL @Targets {Kill %i};Targets = %null;#T- Targets}}
#CLASS Targets
#VARIABLE Targets {}
#TRIGGER {(*)} {#VARIABLE Targets %additem(%word("%1",%numwords("%1")),@Targets)}
#CLASS 0
Acaila |
|
|
|
|
|
|
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
|
|