The mud that I play allows for you to scan and see every mob in the surrounding directions, as well as any tokens that may be around as well. For example:
Nearby North:
- the citizen
- Marshall Diana
Nearby East:
- the citizen
- the Ofcol cityguard
- Sam
Nearby West:
- Jim the Blacksmith
Not Far North:
- the Ofcol cityguard
Far off North:
- the citizen
Whenever there is a token, it might show up as:
Nearby North:
- the citizen
- Marshall Diana
Nearby East:
- the citizen
- the Ofcol cityguard
- Sam
- Something Shiny
Nearby West:
- Jim the Blacksmith
Not Far North:
- the Ofcol cityguard
Far off North:
- the citizen
I have the following trigger set up in order to go and get the tokens whenever they are seen in the scan screen, like so:
<trigger
enabled="y"
group="Multi Line"
lines_to_match="2"
keep_evaluating="y"
match="Nearby East\:\n \- Something Shiny\Z"
multi_line="y"
regexp="y"
sequence="100"
>
<send>e
get all
scan</send>
</trigger>
I have a trigger set up for every direction and for the three lengths of distance that can be seen through scan (Nearby, Not Far, Far Off).
My problem is that my trigger only is triggered when the match is exactly matched
Nearby East:
- Something Shiny
and not when there are additional lines between the "Nearby East:" and the "- Something Shiny", like so:
Nearby East:
- the citizen
- the Ofcol cityguard
- Sam
- Something Shiny
How would I set up the trigger to allow any number of lines between the "Nearby East:" and the "- Something Shiny" that would also allow no lines to be between them?
It *can* be done with multi-line triggers, but I prefer in cases like this to use 3 triggers:
Match: Nearby * or Far Off *
This is the start of a sequence, and turns on the next two triggers (and you remember which direction it is). At this point you also clear the table of people who are in this direction.
Match: - *
This matches whoever (like "the citizen"). You remember each of these in a table.
Match: *
This is lower priority than the second trigger, and fires when you are out of matching people. This turns off itself and the second trigger. In other words, it matches any line not starting with "-".
With a bit of juggling you can make all this work. In fact I seem to remember that something like this came up a while back.
So you are saying that it would be simpler and easier/better to have three triggers for each of the distance types with the match as below:
match="Nearby *"
match="Not Far *"
match="Far Off *"
However, what would I send? I am wanting it to be automated. In other words, if I scan and see that there is Something Shiny Far Off West, then I would travel 3w and get the Something Shiny.
I am also confused about how the client will remember what direction it is supposed to remember.
And table? How would I set that up?
I'm sorry, I'm just more confused now that I was before lol.
Okay, after thinking about it for a few minutes, I am guessing that I would set up the three direction triggers like the following
<triggers>
<trigger
custom_colour="2"
enabled="y"
match="Nearby *"
send_to="12"
sequence="100"
>
<send>
if "%1" == "east" then
Send ("e")
if "%1" == "west" then
Send ("w")
if "%1" == "north" then
Send ("n")
if "%1" == "south" then
Send ("s")
if "%1" == "up" then
Send ("up")
if "%1" == "down" then
Send ("down")
else
Send ("scan")
end -- if</send>
</trigger>
</triggers>
However, that won't work, because it will be triggered with every scan and my character will be moving around with no meaning. I need it to only move in the direction that a "- Something Shiny" is tied to, but I don't know how to make that work.
Because to search for what I am really looking for ("- Something Shiny"), I am looking at something like the following
<triggers>
<trigger
custom_colour="2"
enabled="y"
match="- *"
send_to="12"
sequence="100"
>
<send>
if "%1" == "Something Shiny" then
Send ("")
end -- if</send>
</trigger>
</triggers>