Mapper with multiple potential exit lines

Posted by Ahhh_reptar on Tue 10 Jul 2018 07:17 PM — 5 posts, 23,733 views.

#0
I'm playing a mud where we aren't supplied with room numbers, and each exit will get its own line. Each room is set up like this.

Industrial Way 
----------Cowboy Bebop------------------------------------------------------
This is the industrial pathway, where the factories and refineries are
located. There are shops that sell goods that can be used to create
usefull goods. There are sounds of clanking metal, bending metal  and
hissingnoises as the factories are in full working condition. The large
buildings and tall smokestacks dominate  the area and they seem foreboding
and gloomy. 
-------------------------------------------------------Space Cowboy---------
Obvious exits:
North - Industrial Way
East  - An Assembly Room
South - Industrial Way
West  - Clothing Manufacturing
 A male citizen wanders the streets of the colony
 A male citizen wanders the streets of the colony

Every mapper I've seen expects all the exits on one line, and I'm not sure how to change them so the mapper starts working for this game.
Australia Forum Administrator #1
Instead of looking for one "exits" line just look for a batch of them, starting with the "Obvious exits:" line.

Once you get a line that doesn't start with a direction (eg. North, South, East, West) followed by a hyphen then you know you have got all the exits and at that point you can add them to the mapper database.

Template:faq=37
Please read the MUSHclient FAQ - point 37.
#2
I looked over that, but I'm not sure what to change or how. I'm very inexperienced with coding.
#3
I imagine you'd have to collect your exit info with multiple triggers like Nick is suggesting.

This is pretty rough, but I'd say your three triggers would match on something like...

Start capturing:
^Obvious exits:$


Use this one to enable the next two triggers. You could assign them to a trigger group and use:

EnableTriggerGroup ("capture_group", true)


Your trigger that captures the exits then matches:
^(North|East|South|West)  - (.+?)$


And finally when a line arrives that isn't an exit:
^(?<!North|East|South|West).+?$


You'd use this match to tell the script that you've now collected all exit info and it can stop capturing with those two triggers:
EnableTriggerGroup ("capture_group", false)
Amended on Thu 19 Jul 2018 09:40 PM by Chaotzin
Australia Forum Administrator #4

The Learning Mapper I wrote recently can handle multiple exit lines. See Learning Mapper reply #8 for some examples, in particular look at the entry for Aber (TerraFirmA) and also Coffee MUD.