|
omaek193 Novice
Joined: 10 Oct 2002 Posts: 30 Location: Italy
|
Posted: Thu Sep 25, 2003 2:19 pm
Kill the right mob beetween n mobs. |
Hi,
I think i have only a simple question.
Imagine 20 rooms with the same description,
populated of 30 identical mobs moving randomly
from room to room.
So tipycal mud output is:
A location like all others.
This location is identical to the rooms near this and
the description is the same everywhere.
Exits: North South West East
A mob is here(3).
my prompt>west
A location like all others.
This location is identical to the room near this and
the description is the same everywhere.
Exits: North South West East
A mob is here.
my prompt>west
A location like all others.
This location is identical to the room near this and
the description is the same everywhere.
Exits: North South West East
A mob is here(5).
Basically i would a script that do this:
look 1.mob, look 2.mob, look n.mob (where n is the
number of the mobs in room) and kill only the mob
that carryes the key.
When i look the right mob this is the pattern to trigger:
<wield> the key you search
so i can move in one room and i use my alias that looks
the mobs and kill only the mob with the key if is present,
until i find the right mob.
It is possible?
No problem for me to create triggers, macros or alias, only
my problem is:
how i can link the kill trigger with the right mob number?
I'm only interested to kill as faster as possible the mob that carryes the key when i have the luck of find the room in which
he is.
Thank you in advance, and sorry for my english. |
|
|
|
omaek193 Novice
Joined: 10 Oct 2002 Posts: 30 Location: Italy
|
Posted: Fri Sep 26, 2003 9:24 am |
I tried a solution like this:
#TRIGGER {^A mob is here.$} {look mob}
#TRIGGER {^A mob is here~(%d~).$} {#VAR NumLoop %1;#LOOP 1,@NumLoop look {%i}.mob}
#TRIGGER {^<wield> the key you search} {#VAR NumRight {%i}; kill @NumRight.mob}
But there's something wrong... |
|
|
|
StackAdder Wanderer
Joined: 30 Sep 2003 Posts: 77 Location: United Kingdom
|
Posted: Tue Sep 30, 2003 5:50 am |
quote: I tried a solution like this:
#TRIGGER {^A mob is here.$} {look mob}
#TRIGGER {^A mob is here~(%d~).$} {#VAR NumLoop %1;#LOOP 1,@NumLoop look {%i}.mob}
#TRIGGER {^<wield> the key you search} {#VAR NumRight {%i}; kill @NumRight.mob}
But there's something wrong...
I tried this:
#CLASS {Keyf}
#TRIGGER {(%w) is here~((%d)~)} {
#var targ %1
#loop 1,%2 {loo %{i}.%1}
}
#TRIGGER {(%w) has your key} {ki %i.@targ}
#TRIGGER {loo (%d).fred} {#if (%1==2) {#show fred has your key} {#show fred is empty.}}
#CLASS 0
(where the loo trigger is mimicking the behaviour of the mud) and it seems to work OK. I thought that the %i would be the problem (out of scope) but it seems to retain its value.
It would be nice to have an abort in there and also a trigger to abort and rerun the loop if one of the mobs leaves (or enters) the room, but not at this hour.
Can you post to say whether this worked or give more info on what isn't working? |
|
|
|
omaek193 Novice
Joined: 10 Oct 2002 Posts: 30 Location: Italy
|
Posted: Tue Sep 30, 2003 2:21 pm |
Thank for your cooperation.
Unfortunately the mud where I need this solution is temporarily down, so I can't take a real test. Anyway I'll take example of your way and when i can i report to you more info.
By the way, thanks. |
|
|
|
omaek193 Novice
Joined: 10 Oct 2002 Posts: 30 Location: Italy
|
Posted: Tue Sep 30, 2003 2:21 pm |
Thank for your cooperation.
Unfortunately the mud where I need this solution is temporarily down, so I can't take a real test. Anyway I'll take example of your way and when i can i report to you more info.
By the way, thanks. |
|
|
|
|
|