Difference between revisions of "Generic Mapper Additions"

From Mudlet
Jump to navigation Jump to search
(Advise folks to copy triggers outside of the package)
 
(13 intermediate revisions by 10 users not shown)
Line 1: Line 1:
This is a collection of triggers for the generic mapper script that are too dangerous to be enabled for all games and should only be added on a per-game basis. Eventually we'd like to add the to the generic mapper script when it's able to enable patterns on a per-game basis.
+
{{TOC right}}
 +
 
 +
== Introduction ==
 +
This is a collection of triggers for the generic mapper script that are too dangerous to be enabled for all games and should only be added on a per-game basis. Eventually we'd like to add them to the generic mapper script when it's able to enable patterns on a per-game basis.
 +
 
 +
== Important Note ==
 +
When following these instructions, always create copies of triggers/scripts outside of the generic_mapper package before modifying them. This ensures your changes won't be lost when the package is updated. Do not modify the original package files directly.
 +
 
 +
== 3 Kingdoms / 3 Scapes ==
 +
3k.org  3000 / 3200
 +
 
 +
You can create a color trigger to capture room name and exits.
 +
 
 +
First choose the color ingame with <code>setcolor room_short <color></code>, it can be any color as long as it's used only for this and doesn't match any other color *exactly*.
 +
To see the list of colors ingame type <code>ansi colors</code>.
 +
 
 +
Next disable <code>English Exits Trigger</code> under <code>generic_mapper</code> > <code>English Trigger Group</code>
 +
 
 +
Next create a new trigger group outside the generic_mapper folder and add two items to it, room name and room exits.
 +
 
 +
* room name
 +
** choose color trigger and set foreground color to the one you set ingame
 +
** paste
 +
 
 +
<syntaxhighlight>
 +
map.prompt.room = matches[1]
 +
</syntaxhighlight>
 +
 
 +
in the Lua code field.
 +
 
 +
You will have to create one for exits as well since sometimes they span over multiple lines and fail to get captured.
 +
*room exits
 +
** choose color trigger and set foreground color to the same color as room name
 +
** paste
 +
 
 +
<syntaxhighlight>
 +
mystring = matches[1]
 +
map.prompt.exits = mystring:gsub([[.+%((.+)%).+]], "%1")
 +
</syntaxhighlight>
 +
 
 +
in the Lua code field.
 +
 
 +
Create a copy of <code>English Failed Move Trigger</code> from <code>generic_mapper</code> > <code>English Trigger Group</code> and add these patterns to it:
 +
 
 +
.+ only .+ may go in there.$
 +
^You must be .+ to (?:pass|enter).*$
 +
.+ won't let you go .*.$
 +
^You can't head .*.$
 +
^Sorry, but you must be .*.$
 +
^You bump into the .+ (?:door|gate).$
 +
^You are too .+ to (?:enter|pass).*.$
 +
^A locked .* blocks your passage .*.$
 +
^You jump back .*.$
 +
.+ you .+ come back.$
 +
 
 +
There's probably a lot more...
 +
 
 +
== Akanbar ==
 +
akanbar.com:23
 +
 
 +
This section is for MUDs that share a resemblance with the below:
 +
Balcony outside the Council Hall
 +
You can see by the light of a torch you carry.
 +
You stand on a wooden balcony, high in the tree tops, overlooking a small village of markets. You
 +
cannot help but notice that there are no houses, helping to emphasise that this is somewhere that
 +
people gather only, not somewhere that they live. The balcony itself forms the front of the Council
 +
Hall, a wooden platform extending out from the south wall, a wide doorway leading inside the
 +
hall. A low fence of wood and rope surrounds the platform on the three open sides, limiting any chance
 +
of you falling off. A gap in the fence to your south provides access to a rope bridge linking
 +
the balcony to a large wooden platform suspended in the branches of several trees. From this vantage
 +
point you could no doubt be heard by anyone standing on that platform, almost as if you were
 +
standing amongst them.
 +
A brown leather tome lies here, grey writing across its cover reading "The Ways of the Clans of
 +
Ysallyra". There are two clan warriors of Ysallyra here.
 +
You can progress north (a closed door), east (an open door), south (a closed door) and down.
 +
3120/3120h 390/390m 34xp >
 +
 
 +
=== Setup ===
 +
The first thing that you will need to do is capture your prompt, this can be done with the following command:
 +
map prompt %d+/%d+h %d+/%d+m %d+xp >
 +
Additionally, there is an Ingame command that ensures that room exits will always start on a new line, I highly recommend enabling this as it assists the mapper significantly:
 +
display room line
 +
 
 +
=== Triggers ===
 +
Create a new trigger group outside the generic_mapper folder. Copy the "English Exits Trigger" from the English Trigger group and modify it as follows:
 +
 
 +
The English Exits Trigger contains a lot of lines that we don't really need, the following capture line is all that we need to capture basic exits:
 +
You can progress (.*)\.
 +
 
 +
Slightly More complicated is when there are a lot of exits and they spill over to another line. Create a new trigger (don't modify the existing Multiline Exits Trigger) that looks like the following:
 +
You can progress(.*\s.*[^.])                                  (perl regex line)
 +
1                                                            (line spacer)
 +
(.*)\.                                                        (perl regex line)
 +
With the code:
 +
local roomExits = string.trim(multimatches[1][2]) .. " " .. string.trim(multimatches[3][1])
 +
raiseEvent("onNewRoom",roomExits or "")
 +
 
 +
With those two triggers, you should be set to start mapping.
 +
 
 +
== Aladon ==
 +
 
 +
Create a new trigger group outside the generic_mapper folder and add a new trigger with this perl regex pattern:
 +
 
 +
<code>^\s*\[\s*Видимые выходы:\s*(.*)\]</code>
 +
 
 +
that does this:
 +
 
 +
<code>raiseEvent("onNewRoom",matches[2] or "")</code>
 +
 
 +
Then enter the following in the input line:
 +
 
 +
<syntaxhighlight lang="text">
 +
map translate north север с
 +
map translate south юг ю
 +
map translate east восток в
 +
map translate west запад з
 +
map translate up вверх вв
 +
map translate down вниз вн
 +
</syntaxhighlight>
  
{{TOC right}}
+
That's it! Now you can do <code>start mapping my_first_area</code>.
  
 
== Ashes to Ashes/Alternate Illusions ==
 
== Ashes to Ashes/Alternate Illusions ==
Line 7: Line 125:
  
 
This is for muds with multiline exits similar below:
 
This is for muds with multiline exits similar below:
<syntaxhighlight>
+
<syntaxhighlight lang="text">
 
Temple of Midgaard
 
Temple of Midgaard
 
   You are in the southern end of the temple hall in the Temple of Midgaard.
 
   You are in the southern end of the temple hall in the Temple of Midgaard.
Line 30: Line 148:
  
 
'''Here are the steps:'''
 
'''Here are the steps:'''
 +
* Create a new trigger group outside the generic_mapper folder
 
* On the <code>generic_mapper -> English Trigger Group</code>, <code>disable the English Exits Trigger</code>
 
* On the <code>generic_mapper -> English Trigger Group</code>, <code>disable the English Exits Trigger</code>
* There's a disabled <code>English Multi-Line Exits Trigger</code> under the same folder.  Copy and paste it outside the <code>generic_mapper</code> folder.
+
* Copy the disabled <code>English Multi-Line Exits Trigger</code> from the generic_mapper folder to your new trigger group
 
* Change the trigger filter regex of <code>English Multi-Line Exits Trigger</code> to <code>^Obvious exits:</code>
 
* Change the trigger filter regex of <code>English Multi-Line Exits Trigger</code> to <code>^Obvious exits:</code>
 
* On the next item <code>Exit Line Trigger</code>, change the regex to <code>^([\w\s]+)\s*\-\s[\w ']+</code>
 
* On the next item <code>Exit Line Trigger</code>, change the regex to <code>^([\w\s]+)\s*\-\s[\w ']+</code>
Line 41: Line 160:
 
avatar.outland.org:3000
 
avatar.outland.org:3000
  
Create a new script called <code>SetGMCPRoomName</code>
+
Create a new script called <code>SetGMCPRoomName</code> outside the generic_mapper folder:
  
 
Add User Event Handler: <code>gmcp.Room.Info</code>
 
Add User Event Handler: <code>gmcp.Room.Info</code>
Line 58: Line 177:
 
That's it :) map away! Will update if any more things need to be tweaked
 
That's it :) map away! Will update if any more things need to be tweaked
 
- Added by Whiteheat - 9 April 2021
 
- Added by Whiteheat - 9 April 2021
 +
 +
== Brutália ==
 +
telnetbrutalia2.avantek.hu 4444
 +
 +
Create a new trigger group outside the generic_mapper folder and add a new trigger with this perl regex pattern:
 +
 +
<code>^.+kijáratot látsz: (.*)\.$</code>
 +
 +
That does this:
 +
 +
<code>raiseEvent("onNewRoom",matches[2] or "")</code>
 +
 +
Then add another trigger perl regex pattern:
 +
 +
<code>Nem mehetsz abba az iranyba.</code>
 +
 +
That does this:
 +
 +
<code>raiseEvent("onMoveFail")</code>
 +
 +
Then, enter the following to the input line:
 +
<syntaxhighlight lang="text">
 +
map translate north észak e
 +
map translate south dél d
 +
map translate east kelet k
 +
map translate west nyugat n
 +
map translate northwest északnyugat en
 +
map translate northeast északkelet ek
 +
map translate southwest délnyugat dn
 +
map translate southeast délkelet dk
 +
map translate up fel fe
 +
map translate down le le
 +
map translate out ki ki
 +
map translate in be be
 +
</syntaxhighlight>
 +
 +
Now you can do <code>start mapping my first area</code>.
 +
 +
== COGG ==
 +
cogg.contrarium.net:4001
 +
 +
Create a new trigger group outside the generic_mapper folder. Find the "English Trigger Group" in the generic_mapper package and disable it.
 +
 +
Create a new trigger called "Room Name Trigger". Use the pattern <code>^\[(.*)\] \(.*\).*?</code> and set it to perl regex.
 +
 +
In the large script box, enter <code>map.prompt.room = matches[2]</code>.
 +
 +
Create a new trigger called "Room Exits Trigger". This trigger has two patterns.
 +
 +
Pattern 1: <code>^Obvious (?:paths|exits):\s+(.*?), (?:an?|the|\.)</code> . Perl regex.
 +
 +
Pattern 2: <code>^Obvious (?:paths|exits):\s+(.*(?:north|south|east|west|out))\.</code> . Perl regex.
 +
 +
Into the script box: <code>map.prompt.exits = string.gsub(matches[2], "'", "")</code> .
 +
 +
Remember to make sure the "English Trigger Group" is disabled again if the package needs updating.
 +
 +
== Federation2 ==
 +
play.federation2.com: 30003
 +
 +
Create a new script called <code>gotRoomInfo</code> outside the generic_mapper folder:
 +
 +
<syntaxhighlight lang="lua">
 +
function gotRoomInfo(event, ...)
 +
  map.prompt.room = gmcp.room.info.name
 +
  map.prompt.exits = table.concat(table.keys(gmcp.room.info.exits), " ")
 +
  map.prompt.hash = string.format("%s %s %d",
 +
    gmcp.room.info.system,
 +
    gmcp.room.info.area,
 +
    gmcp.room.info.num
 +
  )
 +
  if map.mapping then
 +
    map.set_area(gmcp.room.info.area)
 +
  end
 +
  raiseEvent("onNewRoom")
 +
end
 +
 +
registerAnonymousEventHandler("gmcp.room.info", "gotRoomInfo")
 +
</syntaxhighlight>
 +
 +
In game type echo ... It is the closest thing to a prompt you will find
 +
 +
Next type find prompt
 +
 +
Create copies of these triggers from the generic_mapper folder and modify them:
 +
 +
English Failed Move Trigger ---> You will need to add lines for failed moves "there is a lot of them".
 +
 +
English Forced Move Trigger ---> Will need lines added as well. "Very important" or it will trash your map.
 +
 +
Now you can do <code>start mapping</code>
  
 
== Kingdoms of the Lost ==
 
== Kingdoms of the Lost ==
Line 72: Line 282:
 
[city(very bright): north east south west up northwest]</code>
 
[city(very bright): north east south west up northwest]</code>
  
regex for the above: <code>\[.+: (.+)\]</code> ([https://regex101.com/r/NJ5dla/1 regex101])
+
Create a new trigger group outside the generic_mapper folder and add a trigger with this regex: <code>\[.+: (.+)\]</code> ([https://regex101.com/r/NJ5dla/1 regex101])
 +
 
 +
== MysticalMud ==
 +
mysticalmud.org:5000
 +
 
 +
Create a new trigger group outside the generic_mapper folder. Copy the English Exit Triggers from Triggers->generic_Mapper->English Trigger Group and add this pattern:
 +
 
 +
<code>^\[Exits:\s*(.*)\]</code>
 +
 
 +
and add to the LUA code ABOVE the existing line:
 +
<code>if (matches[2]) then matches[2] = matches[2]:gsub("."," %0"):sub(2) end</code>
 +
 
 +
Now you can do <code>start mapping my first area</code>.
 +
 
 +
== Realm of Magic ==
 +
realmofmagic.org:4000
 +
 
 +
This is for muds that look like below:
 +
[[File:RealmofMagic Room display.png|thumb]]
 +
 
 +
<syntaxhighlight>
 +
A Peaceful Inn [ D ]
 +
  The inn seems to be strong and finely built with many plaques and tapestries
 +
adorning the walls. On either side of the inn there are very large delicately
 +
crafted glass windows that look out onto the rest of Entrancity. You see a
 +
dark, cherry wood desk sitting near the back of the northern wall. The desk is
 +
cluttered with paperwork and many different types of writing tools.
 +
There is a sign on top of the desk written in gold that should be 'read'.
 +
There is a book with QUESTS on the cover, you should read the quests book.
 +
An automatic teller machine has been installed in the wall here.
 +
Anthony the wise is sitting at a table.
 +
His eyes shine in a soft blue!
 +
Janet the Innkeep is leaning on the front desk.
 +
|572H 625M 582V >
 +
</syntaxhighlight>It also adds the ability to save doornames for doors, and changes the speedwalk mapper function to use doornames and modifies the door open/unlock string to match the command syntax expected for this server.  (ie <code>open <doorname> <direction></code>)
 +
 
 +
==== Triggers: ====
 +
In the generic_mapper trigger group, disable all language groups
 +
 
 +
Create a new trigger group for your mapping triggers (so they don't get deleted on generic_mapper package updates), and create the following (numbered) triggers:
 +
 
 +
# Trigger has two patterns.  The first is a color pattern with the foreground color being ANSI 6 (Cyan).  The second pattern is Regex: <code>^(.*?) (?:\(#\d+\) )?(?:\[ .*? ?\] )?\[ ?((?:\(?[NESWUD]\)?\s?)*)\] ?(?:Home: \d+)?$</code>  This should match for both mortals and immortals.  The script for this trigger:<syntaxhighlight lang="lua">
 +
if not map.prompt.name_found then
 +
  map.prompt.name_found = true
 +
  map.prompt.room = multimatches[2][2]
 +
  map.prompt.exits = string.gsub(multimatches[2][3], "%(%a%)%s?", "") --remove doors so unmapped playerhomes or unmapped doors don't mess up the map/following when immortal
 +
end
 +
</syntaxhighlight>
 +
# Trigger is just a regex match: <code>^\|(-?)(\d+)H (\d+)M (\d+)V (.*)>$</code>  with the script:<syntaxhighlight lang="lua">
 +
raiseEvent("onPrompt")
 +
if map.prompt.name_found then
 +
  map.prompt.name_found = false
 +
  --The onPrompt event called above raises "onNewRoom" when exits are found.
 +
  --The following block will catch the infrequent rooms found with no listed exits.
 +
  if map.prompt.exits == "" then
 +
    raiseEvent("onNewRoom")
 +
  end
 +
  --Whem onRandomMove event wasn't following reliably, the below block was created to force
 +
  --the map to reorient its position after certain actions (entering portals, fleeing from combat, etc).
 +
  if map.prompt.user_portaled then
 +
    map.prompt.user_portaled = nil
 +
    map.find_me()
 +
  end
 +
end
 +
 
 +
</syntaxhighlight>
 +
# Trigger that matches the following lines and throws the onMoveFail event:
 +
## Start of Line: <code>As you step on something very slippery, you lose your</code>
 +
## Regex: <code>^(.*) seems to be closed.$</code>
 +
## Exact Match: <code>Maybe you should get on your feet first?</code>
 +
## Exact Match: <code>Alas, you cannot go that way...</code>
 +
## Exact Match: <code>You would have to fly to go there!</code>
 +
## Exact Match: <code>You need a boat or be able to swim to go there.</code>
 +
## Exact Match: <code>That place is already full!</code>
 +
## Exact Match: <code>No way!  You're fighting for your life!</code>
 +
## Regex: <code>^There is no (.*) here.$</code><syntaxhighlight lang="lua">
 +
raiseEvent("onMoveFail")
 +
</syntaxhighlight>
 +
# Trigger that exact matches: <code>It is pitch black...</code> and throws the onVisionFail event:<syntaxhighlight lang="lua">
 +
raiseEvent("onVisionFail")
 +
</syntaxhighlight>
 +
# Trigger that exact matches the following lines and scripted to set the map.prompt.user_portaled variable.  (tried to use the onRandomMove event, but it wasn't as reliable)
 +
## You enter the portal.
 +
## You flee head over heels.
 +
## You skillfully retreat from battle.<syntaxhighlight lang="lua">
 +
map.prompt.user_portaled = true
 +
</syntaxhighlight>
 +
 
 +
==== Aliases: ====
 +
Create a new alias group outside the generic_mapper folder. Add an alias with pattern: <code>^add doorname (\w+) (north|south|east|west|up|down|n|s|e|w|u|d)$</code>  and the script is:<syntaxhighlight lang="lua">
 +
map.add_doorName(matches[2], matches[3])
 +
</syntaxhighlight>
 +
 
 +
==== Scripts: ====
 +
Create a new script outside the generic_mapper folder to add new mapping functions with the following code:<syntaxhighlight lang="lua">
 +
function map.add_doorName(name, dir)
 +
  if map.mapping then
 +
    name = name or ""
 +
    dir = dir or ""
 +
    if (name == "") or (dir == "") then return end
 +
    local exits = {
 +
      north = "north", south = "south", east = "east",
 +
      west = "west", up = "up", down = "down",
 +
      n = "north", s = "south", e = "east",
 +
      w = "west", u = "up", d = "down" }
 +
    dir = string.lower(dir)
 +
    if not exits[dir] then return end
 +
 
 +
    local dataKey = "doorname_"..exits[dir]
 +
    name = string.lower(name)
 +
    if name == "door" then
 +
      clearRoomUserDataItem(map.currentRoom, dataKey)
 +
    else
 +
      setRoomUserData(map.currentRoom, dataKey, name)
 +
    end
 +
    map.echo("Added "..name.." as a doorname for "..dataKey.." in roomID: "..map.currentRoom)
 +
  else
 +
    map.echo("Not mapping",false,true)
 +
  end
 +
end
 +
 
 +
function map.get_doorName(roomID, dir)
 +
  local doorkey = "doorname_"..dir
 +
  local doorname = getRoomUserData(roomID, doorkey)
 +
  if doorname == "" then doorname = "door" end
 +
 
 +
  return doorname         
 +
end
 +
</syntaxhighlight>
 +
 
 +
Create a copy of <code>generic_mapper>Map Script</code> and edit the following if code block at the listed lines to make use of the door names/change the unlock/open syntax to match the mud's command syntax.<syntaxhighlight lang="lua" line="1" start="2223">
 +
          if status and status > 1 then
 +
                local doorname = map.get_doorName(id, (exitmap[dir] or dir))
 +
                -- if locked, unlock door
 +
                if status == 3 then
 +
                    table.insert(walkPath,k,id)
 +
                    table.insert(walkDirs,k,"unlock " .. doorname .. " " .. (exitmap[dir] or dir))
 +
                    k = k + 1
 +
                end
 +
                -- if closed, open door
 +
                table.insert(walkPath,k,id)
 +
                table.insert(walkDirs,k,"open " .. doorname .. " " .. (exitmap[dir] or dir))
 +
                k = k + 1
 +
            end
 +
</syntaxhighlight>
 +
 
 +
==== Usage: ====
 +
As you're mapping, if you come across a door that's not named "door" (ie "gate" or "trapdoor" or even "doors"), use the command <code>add doorname <name> <direction></code> to add that data to the map's roomUserData.  When speedwalking with the map, the script will use this name to unlock locked doors, and open doors.  You don't need to add doors named "door" because the mapper will default to using that name if no name was added with the command.  This command must be used on both "sides" of the door, as each side can contain different doornames.
  
 
== Reinos de Leyenda ==
 
== Reinos de Leyenda ==
  
 +
Create a new script outside the generic_mapper folder with the following content:
  
<syntaxhighlight>
+
<syntaxhighlight lang="text">
 
map translate north norte n
 
map translate north norte n
 
map translate south sur s
 
map translate south sur s
Line 95: Line 453:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
== Aladon ==
+
== RetroMUD ==
 +
retromud.org:3000
  
Make a new trigger with this perl regex pattern:  
+
Disable the in-game line wrapping and let Mudlet do it for you instead - this'll help the mapper recognize exits that span over the course of two lines. You can do it with the in-game command: <code>set WIDTH 150</code>
  
<code>^\s*\[\s*Видимые выходы:\s*(.*)\]</code>
+
This breaks formatting on some menus like show skills, set it back when needed.
  
that does this:
+
Create a new script outside the generic_mapper folder and add these patterns to ignore to make sure the mapper doesn't get confused when you're not actually moving:
  
<code>raiseEvent("onNewRoom",matches[2] or "")</code>
+
map ignore .+ follows .+
 +
map ignore .+ starts using .+
 +
map ignore .+ arrives from .+
 +
map ignore .+ images of .+
  
Then enter the following in the input line:
+
If the game fails to capture room names because you get enviroment/flavor/etc lines after move command and before room name you can create a color trigger to capture them.
  
<syntaxhighlight>
+
Start by setting the color ingame with <code>color roomshort <color></code>, it can be any color as long as it's used only for this and doesn't match any other color *exactly*.
map translate north север с
+
To see the list of colors ingame type <code>color display</code>.
map translate south юг ю
 
map translate east восток в
 
map translate west запад з
 
map translate up вверх вв
 
map translate down вниз вн
 
</syntaxhighlight>
 
  
That's it! Now you can do <code>start mapping my first area</code>.
+
Create a new trigger group outside the generic_mapper folder and add a trigger called "room name".
  
== Federation2 ==
+
* Set it to color trigger and match foreground color with the one you chose ingame.
play.federation2.com: 30003
+
* Paste <code>map.prompt.room = matches[1]</code> in the Lua code field.
  
Add this pattern to Triggers->generic_Mapper->English Trigger Group->English Exit Triggers
+
== The Two Towers ==
 +
Host: t2tmud.org:9999
  
<code>[Ee]xits:\s(.*)</code>
+
Create a new trigger group outside the generic_mapper folder.
  
Define the prompt byː
+
=== Room Name and Exits Trigger ===
<syntaxhighlight>
+
Create a new trigger with regex pattern: ^(\X+)\(([\w\s,]+)\)\s*\[?([\w\s,]*)\]?
map prompt You can see %.+ exits:
 
</syntaxhighlight>
 
  
 +
Add this Lua code to the trigger. Note: The RGB colors help with room name detection. For the ones shown, the room_shorts color is set to bright yellow. The code excludes the room "Near a guard flet" because it's randomly inserted into the Lothlorien area. All rooms shown as either Lothlorien or Near a guard flet are set to "Lothlorien" and these triggers account for changing names.
  
Now you can do <code>start mapping my first area</code>.
+
<syntaxhighlight lang="lua">
 +
local dirs = {n = 'north', s = 'south', w = 'west', e = 'east', d = 'down', u = 'up', ne = 'northeast', nw = 'northwest', se = 'southeast', sw = 'southwest', enter = 'enter', out = 'out'}
 +
local exits, found_exits
 +
local combined = matches[3]
  
 +
selectCurrentLine()
 +
local r,g,b = getFgColor()
 +
if r == 255 and g == 255 and b == 0 then
 +
    for w in combined:gmatch("%a+") do
 +
        if dirs[w] then
 +
            found_exits = true
 +
            if not exits then
 +
              exits = dirs[w]
 +
            else
 +
              exits = exits .. " " .. dirs[w]
 +
            end
 +
         
 +
        else
 +
            found_exits=true
 +
            if not exits then
 +
                exits = w
 +
            else
 +
                exits = exits .. " " .. w
 +
            end
 +
        end
 +
  end
  
== Brutália ==
+
  if found_exits and matches[2] ~= "Near a guard flet" then
telnetbrutalia2.avantek.hu 4444
+
          map.prompt.exits = exits
 +
          map.prompt.room = matches[2]
 +
          cecho(matches[2])
 +
          raiseEvent("onNewRoom")
 +
          print(map.prompt.exits)
 +
  end
 +
end
 +
</syntaxhighlight>
  
Make a new trigger, with this perl regex pattern:  
+
=== RGB Value Display ===
 +
Create a new trigger with the same regex pattern as above to show RGB values for your room_short color:
  
<code>^.+kijáratot látsz: (.*)\.$</code>
+
<syntaxhighlight lang="lua">
 +
selectCurrentLine()
 +
local r,g,b = getFgColor()
 +
cecho("\nred " ..r.. " green " ..g.. " blue "..b)
 +
deselect()
 +
</syntaxhighlight>
  
That does this:
+
=== Vision Fail Trigger ===
 +
Create a copy of the English Vision Fail Trigger and add this pattern:
 +
^Near a guard flet
 +
=== Notes on Color Settings ===
 +
For any game where room color detection is used, you can create a trigger using the following to show you the rgb values for whatever color you have your room_short set to:
  
<code>raiseEvent("onNewRoom",matches[2] or "")</code>
+
<syntaxhighlight lang="lua">
 
+
selectCurrentLine()
Then add another trigger perl regex pattern:
+
local r,g,b = getFgColor()
 
+
cecho("\nred " ..r.. " green " ..g.. " blue "..b)
<code>Nem mehetsz abba az iranyba.</code>
+
deselect()
 
 
That does this:
 
 
 
<code>raiseEvent("onMoveFail")</code>
 
 
 
Then, enter the following to the input line:
 
<syntaxhighlight>
 
map translate north észak e
 
map translate south dél d
 
map translate east kelet k
 
map translate west nyugat n
 
map translate northwest északnyugat en
 
map translate northeast északkelet ek
 
map translate southwest délnyugat dn
 
map translate southeast délkelet dk
 
map translate up fel fe
 
map translate down le le
 
map translate out ki ki
 
map translate in be be
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Now you can do <code>start mapping my first area</code>.
+
This can help you ensure you're using the correct color values in your triggers.
  
== MysticalMud ==  
+
=== Maintenance and Updates ===
mysticalmud.org:5000
+
Remember not to edit the <code>generic_mapper</code package itself as updates to it will overwrite your changes. Instead, copy triggers out and edit the copy.
  
Add this pattern to Triggers->generic_Mapper->English Trigger Group->English Exit Triggers
+
=== Contributing ===
 +
If you have configurations for other MUDs that you'd like to add to this collection, please ensure they follow the same format as the existing entries:
  
<code>^\[Exits:\s*(.*)\]</code>
+
* Include the MUD's connection information
 +
* Provide example room/exit formatting if relevant
 +
* List all required triggers, scripts, and aliases
 +
* Include clear instructions for creating and placing new components
 +
* Document any game-specific commands or settings needed
 +
* Add troubleshooting notes for common issues
  
and add to the LUA code ABOVE the existing line:
 
<code>if (matches[2]) then matches[2] = matches[2]:gsub("."," %0"):sub(2) end</code>
 
 
Now you can do <code>start mapping my first area</code>.
 
  
== RetroMUD ==
+
[[Category:Mapping]]
retromud.org:3000
+
[[Category:Scripts]]
 
+
[[Category:Configuration]]
Disable the in-game line wrapping and let Mudlet do it for you instead - this'll help the mapper recognize exits that span over the course of two lines. You can do it with the in-game command: <code>set WIDTH 150</code>
 
 
 
You should also setup some patterns to ignore to make sure the mapper doesn't get confused when you're not actually moving:
 
 
 
map ignore .+ follows .+
 
map ignore .+ starts using .+
 
map ignore .+ arrives from .+
 
map ignore .+ images of .+
 

Latest revision as of 14:40, 19 January 2025

Introduction

This is a collection of triggers for the generic mapper script that are too dangerous to be enabled for all games and should only be added on a per-game basis. Eventually we'd like to add them to the generic mapper script when it's able to enable patterns on a per-game basis.

Important Note

When following these instructions, always create copies of triggers/scripts outside of the generic_mapper package before modifying them. This ensures your changes won't be lost when the package is updated. Do not modify the original package files directly.

3 Kingdoms / 3 Scapes

3k.org 3000 / 3200

You can create a color trigger to capture room name and exits.

First choose the color ingame with setcolor room_short <color>, it can be any color as long as it's used only for this and doesn't match any other color *exactly*. To see the list of colors ingame type ansi colors.

Next disable English Exits Trigger under generic_mapper > English Trigger Group

Next create a new trigger group outside the generic_mapper folder and add two items to it, room name and room exits.

  • room name
    • choose color trigger and set foreground color to the one you set ingame
    • paste
map.prompt.room = matches[1]

in the Lua code field.

You will have to create one for exits as well since sometimes they span over multiple lines and fail to get captured.

  • room exits
    • choose color trigger and set foreground color to the same color as room name
    • paste
mystring = matches[1]
map.prompt.exits = mystring:gsub([[.+%((.+)%).+]], "%1")

in the Lua code field.

Create a copy of English Failed Move Trigger from generic_mapper > English Trigger Group and add these patterns to it:

.+ only .+ may go in there.$
^You must be .+ to (?:pass|enter).*$
.+ won't let you go .*.$
^You can't head .*.$
^Sorry, but you must be .*.$
^You bump into the .+ (?:door|gate).$
^You are too .+ to (?:enter|pass).*.$
^A locked .* blocks your passage .*.$
^You jump back .*.$
.+ you .+ come back.$

There's probably a lot more...

Akanbar

akanbar.com:23

This section is for MUDs that share a resemblance with the below:

Balcony outside the Council Hall
You can see by the light of a torch you carry.
You stand on a wooden balcony, high in the tree tops, overlooking a small village of markets. You
cannot help but notice that there are no houses, helping to emphasise that this is somewhere that
people gather only, not somewhere that they live. The balcony itself forms the front of the Council
Hall, a wooden platform extending out from the south wall, a wide doorway leading inside the
hall. A low fence of wood and rope surrounds the platform on the three open sides, limiting any chance
of you falling off. A gap in the fence to your south provides access to a rope bridge linking
the balcony to a large wooden platform suspended in the branches of several trees. From this vantage
point you could no doubt be heard by anyone standing on that platform, almost as if you were
standing amongst them.
A brown leather tome lies here, grey writing across its cover reading "The Ways of the Clans of
Ysallyra". There are two clan warriors of Ysallyra here.
You can progress north (a closed door), east (an open door), south (a closed door) and down.
3120/3120h 390/390m 34xp >

Setup

The first thing that you will need to do is capture your prompt, this can be done with the following command:

map prompt %d+/%d+h %d+/%d+m %d+xp >

Additionally, there is an Ingame command that ensures that room exits will always start on a new line, I highly recommend enabling this as it assists the mapper significantly:

display room line

Triggers

Create a new trigger group outside the generic_mapper folder. Copy the "English Exits Trigger" from the English Trigger group and modify it as follows:

The English Exits Trigger contains a lot of lines that we don't really need, the following capture line is all that we need to capture basic exits:

You can progress (.*)\.

Slightly More complicated is when there are a lot of exits and they spill over to another line. Create a new trigger (don't modify the existing Multiline Exits Trigger) that looks like the following:

You can progress(.*\s.*[^.])                                  (perl regex line)
1                                                             (line spacer)
(.*)\.                                                        (perl regex line)

With the code:

local roomExits = string.trim(multimatches[1][2]) .. " " .. string.trim(multimatches[3][1])
raiseEvent("onNewRoom",roomExits or "")

With those two triggers, you should be set to start mapping.

Aladon

Create a new trigger group outside the generic_mapper folder and add a new trigger with this perl regex pattern:

^\s*\[\s*Видимые выходы:\s*(.*)\]

that does this:

raiseEvent("onNewRoom",matches[2] or "")

Then enter the following in the input line:

map translate north север с
map translate south юг ю
map translate east восток в
map translate west запад з
map translate up вверх вв
map translate down вниз вн

That's it! Now you can do start mapping my_first_area.

Ashes to Ashes/Alternate Illusions

timetoplaythegame.com:3333

This is for muds with multiline exits similar below:

Temple of Midgaard
   You are in the southern end of the temple hall in the Temple of Midgaard.
The temple has been constructed from giant marble blocks, eternal in
appearance, and most of the walls are covered by ancient wall paintings
picturing Gods, Giants and peasants.
   Large steps lead down through the grand temple gate, descending the huge
mound upon which the temple is built and ends on the temple square below.
To the west, you see the Reading Room.  The donation room is in a small
alcove to your east.
An automatic teller machine has been installed in the wall here.
An announcement board is mounted on the wall here.
Obvious exits:
North - By the Temple Altar
East  - Midgaard Donation Room
South - The Temple Square
West  - The Reading Room
Down  - The ABC's of Ashes to Ashes

Astana 498/498hp 1105/1105m 139/139v 0xp 0%>

Here are the steps:

  • Create a new trigger group outside the generic_mapper folder
  • On the generic_mapper -> English Trigger Group, disable the English Exits Trigger
  • Copy the disabled English Multi-Line Exits Trigger from the generic_mapper folder to your new trigger group
  • Change the trigger filter regex of English Multi-Line Exits Trigger to ^Obvious exits:
  • On the next item Exit Line Trigger, change the regex to ^([\w\s]+)\s*\-\s[\w ']+
  • We want to raise an event of onNewRoom when we're done capturing all the room exits:
    • add a new item after Exit Line Trigger and add a regex filter ^$
    • put the call raiseEvent("onNewRoom",matches[2] or "") on the new item

Avatar Mud

avatar.outland.org:3000

Create a new script called SetGMCPRoomName outside the generic_mapper folder:

Add User Event Handler: gmcp.Room.Info

function setGMCPRoomName() -- MUST match the 'name' above
  -- if map.getRoomAreaName ~= gmcp.Room.Info.zone then
    -- map.set_area(gmcp.Room.Info.zone)
  -- end
  map.prompt.room = gmcp.Room.Info.name
  map.prompt.exits = table.concat(table.keys(gmcp.Room.Info.exits), " ")
  raiseEvent("onNewRoom",map.prompt.exits)
end

That's it :) map away! Will update if any more things need to be tweaked - Added by Whiteheat - 9 April 2021

Brutália

telnetbrutalia2.avantek.hu 4444

Create a new trigger group outside the generic_mapper folder and add a new trigger with this perl regex pattern:

^.+kijáratot látsz: (.*)\.$

That does this:

raiseEvent("onNewRoom",matches[2] or "")

Then add another trigger perl regex pattern:

Nem mehetsz abba az iranyba.

That does this:

raiseEvent("onMoveFail")

Then, enter the following to the input line:

map translate north észak e
map translate south dél d
map translate east kelet k
map translate west nyugat n
map translate northwest északnyugat en
map translate northeast északkelet ek
map translate southwest délnyugat dn
map translate southeast délkelet dk
map translate up fel fe
map translate down le le
map translate out ki ki 
map translate in be be

Now you can do start mapping my first area.

COGG

cogg.contrarium.net:4001

Create a new trigger group outside the generic_mapper folder. Find the "English Trigger Group" in the generic_mapper package and disable it.

Create a new trigger called "Room Name Trigger". Use the pattern ^\[(.*)\] \(.*\).*? and set it to perl regex.

In the large script box, enter map.prompt.room = matches[2].

Create a new trigger called "Room Exits Trigger". This trigger has two patterns.

Pattern 1: ^Obvious (?:paths|exits):\s+(.*?), (?:an?|the|\.) . Perl regex.

Pattern 2: ^Obvious (?:paths|exits):\s+(.*(?:north|south|east|west|out))\. . Perl regex.

Into the script box: map.prompt.exits = string.gsub(matches[2], "'", "") .

Remember to make sure the "English Trigger Group" is disabled again if the package needs updating.

Federation2

play.federation2.com: 30003

Create a new script called gotRoomInfo outside the generic_mapper folder:

function gotRoomInfo(event, ...)
  map.prompt.room = gmcp.room.info.name
  map.prompt.exits = table.concat(table.keys(gmcp.room.info.exits), " ")
  map.prompt.hash = string.format("%s %s %d",
    gmcp.room.info.system,
    gmcp.room.info.area,
    gmcp.room.info.num
  )
  if map.mapping then
    map.set_area(gmcp.room.info.area)
  end
  raiseEvent("onNewRoom")
end

registerAnonymousEventHandler("gmcp.room.info", "gotRoomInfo")

In game type echo ... It is the closest thing to a prompt you will find

Next type find prompt

Create copies of these triggers from the generic_mapper folder and modify them:

English Failed Move Trigger ---> You will need to add lines for failed moves "there is a lot of them".

English Forced Move Trigger ---> Will need lines added as well. "Very important" or it will trash your map.

Now you can do start mapping

Kingdoms of the Lost

kotl.org: 2222

exit lines:

[inside: south->closed]

[field: north->closed *east *south->open west]

[field: *east west]

[city(very bright): north east south west up northwest]

Create a new trigger group outside the generic_mapper folder and add a trigger with this regex: \[.+: (.+)\] (regex101)

MysticalMud

mysticalmud.org:5000

Create a new trigger group outside the generic_mapper folder. Copy the English Exit Triggers from Triggers->generic_Mapper->English Trigger Group and add this pattern:

^\[Exits:\s*(.*)\]

and add to the LUA code ABOVE the existing line: if (matches[2]) then matches[2] = matches[2]:gsub("."," %0"):sub(2) end

Now you can do start mapping my first area.

Realm of Magic

realmofmagic.org:4000

This is for muds that look like below:

RealmofMagic Room display.png
A Peaceful Inn [ D ]
  The inn seems to be strong and finely built with many plaques and tapestries
adorning the walls. On either side of the inn there are very large delicately
crafted glass windows that look out onto the rest of Entrancity. You see a
dark, cherry wood desk sitting near the back of the northern wall. The desk is
cluttered with paperwork and many different types of writing tools.
There is a sign on top of the desk written in gold that should be 'read'.
There is a book with QUESTS on the cover, you should read the quests book.
An automatic teller machine has been installed in the wall here.
Anthony the wise is sitting at a table.
His eyes shine in a soft blue!
Janet the Innkeep is leaning on the front desk.
|572H 625M 582V >

It also adds the ability to save doornames for doors, and changes the speedwalk mapper function to use doornames and modifies the door open/unlock string to match the command syntax expected for this server. (ie open <doorname> <direction>)

Triggers:

In the generic_mapper trigger group, disable all language groups

Create a new trigger group for your mapping triggers (so they don't get deleted on generic_mapper package updates), and create the following (numbered) triggers:

  1. Trigger has two patterns. The first is a color pattern with the foreground color being ANSI 6 (Cyan). The second pattern is Regex: ^(.*?) (?:\(#\d+\) )?(?:\[ .*? ?\] )?\[ ?((?:\(?[NESWUD]\)?\s?)*)\] ?(?:Home: \d+)?$ This should match for both mortals and immortals. The script for this trigger:
    if not map.prompt.name_found then
      map.prompt.name_found = true
      map.prompt.room = multimatches[2][2]
      map.prompt.exits = string.gsub(multimatches[2][3], "%(%a%)%s?", "") --remove doors so unmapped playerhomes or unmapped doors don't mess up the map/following when immortal
    end
  2. Trigger is just a regex match: ^\|(-?)(\d+)H (\d+)M (\d+)V (.*)>$ with the script:
    raiseEvent("onPrompt")
    if map.prompt.name_found then
      map.prompt.name_found = false
      --The onPrompt event called above raises "onNewRoom" when exits are found. 
      --The following block will catch the infrequent rooms found with no listed exits.
      if map.prompt.exits == "" then
        raiseEvent("onNewRoom")
      end
      --Whem onRandomMove event wasn't following reliably, the below block was created to force 
      --the map to reorient its position after certain actions (entering portals, fleeing from combat, etc).
      if map.prompt.user_portaled then
        map.prompt.user_portaled = nil
        map.find_me()
      end
    end
  3. Trigger that matches the following lines and throws the onMoveFail event:
    1. Start of Line: As you step on something very slippery, you lose your
    2. Regex: ^(.*) seems to be closed.$
    3. Exact Match: Maybe you should get on your feet first?
    4. Exact Match: Alas, you cannot go that way...
    5. Exact Match: You would have to fly to go there!
    6. Exact Match: You need a boat or be able to swim to go there.
    7. Exact Match: That place is already full!
    8. Exact Match: No way! You're fighting for your life!
    9. Regex: ^There is no (.*) here.$
      raiseEvent("onMoveFail")
  4. Trigger that exact matches: It is pitch black... and throws the onVisionFail event:
    raiseEvent("onVisionFail")
  5. Trigger that exact matches the following lines and scripted to set the map.prompt.user_portaled variable. (tried to use the onRandomMove event, but it wasn't as reliable)
    1. You enter the portal.
    2. You flee head over heels.
    3. You skillfully retreat from battle.
      map.prompt.user_portaled = true

Aliases:

Create a new alias group outside the generic_mapper folder. Add an alias with pattern: ^add doorname (\w+) (north|south|east|west|up|down|n|s|e|w|u|d)$ and the script is:

map.add_doorName(matches[2], matches[3])

Scripts:

Create a new script outside the generic_mapper folder to add new mapping functions with the following code:

function map.add_doorName(name, dir)
  if map.mapping then
    name = name or ""
    dir = dir or ""
    if (name == "") or (dir == "") then return end
    local exits = {
      north = "north", south = "south", east = "east", 
      west = "west", up = "up", down = "down",
      n = "north", s = "south", e = "east",
      w = "west", u = "up", d = "down" }
    dir = string.lower(dir)
    if not exits[dir] then return end
  
    local dataKey = "doorname_"..exits[dir]
    name = string.lower(name)
    if name == "door" then
      clearRoomUserDataItem(map.currentRoom, dataKey)
    else
      setRoomUserData(map.currentRoom, dataKey, name)
    end
    map.echo("Added "..name.." as a doorname for "..dataKey.." in roomID: "..map.currentRoom)
  else
    map.echo("Not mapping",false,true)
  end
end

function map.get_doorName(roomID, dir)
  local doorkey = "doorname_"..dir
  local doorname = getRoomUserData(roomID, doorkey)
  if doorname == "" then doorname = "door" end
  
  return doorname           
end

Create a copy of generic_mapper>Map Script and edit the following if code block at the listed lines to make use of the door names/change the unlock/open syntax to match the mud's command syntax.

           if status and status > 1 then
                local doorname = map.get_doorName(id, (exitmap[dir] or dir))
                -- if locked, unlock door
                if status == 3 then
                    table.insert(walkPath,k,id)
                    table.insert(walkDirs,k,"unlock " .. doorname .. " " .. (exitmap[dir] or dir))
                    k = k + 1
                end
                -- if closed, open door
                table.insert(walkPath,k,id)
                table.insert(walkDirs,k,"open " .. doorname .. " " .. (exitmap[dir] or dir))
                k = k + 1
            end

Usage:

As you're mapping, if you come across a door that's not named "door" (ie "gate" or "trapdoor" or even "doors"), use the command add doorname <name> <direction> to add that data to the map's roomUserData. When speedwalking with the map, the script will use this name to unlock locked doors, and open doors. You don't need to add doors named "door" because the mapper will default to using that name if no name was added with the command. This command must be used on both "sides" of the door, as each side can contain different doornames.

Reinos de Leyenda

Create a new script outside the generic_mapper folder with the following content:

map translate north norte n
map translate south sur s
map translate east este e
map translate west oeste w
map translate northwest noroeste no
map translate northeast noreste ne
map translate southwest suroeste so
map translate southeast sureste se
map translate up arriba ar
map translate down abajo ab
map translate out fuera fu
map translate in dentro de

-- ensure normal prompt is setup in the game that matches this exactly, include the space in the end of the pattern:
map prompt ^PV: %d+/%d+ GP: %d+/%d+;

RetroMUD

retromud.org:3000

Disable the in-game line wrapping and let Mudlet do it for you instead - this'll help the mapper recognize exits that span over the course of two lines. You can do it with the in-game command: set WIDTH 150

This breaks formatting on some menus like show skills, set it back when needed.

Create a new script outside the generic_mapper folder and add these patterns to ignore to make sure the mapper doesn't get confused when you're not actually moving:

map ignore .+ follows .+
map ignore .+ starts using .+
map ignore .+ arrives from .+
map ignore .+ images of .+

If the game fails to capture room names because you get enviroment/flavor/etc lines after move command and before room name you can create a color trigger to capture them.

Start by setting the color ingame with color roomshort <color>, it can be any color as long as it's used only for this and doesn't match any other color *exactly*. To see the list of colors ingame type color display.

Create a new trigger group outside the generic_mapper folder and add a trigger called "room name".

  • Set it to color trigger and match foreground color with the one you chose ingame.
  • Paste map.prompt.room = matches[1] in the Lua code field.

The Two Towers

Host: t2tmud.org:9999

Create a new trigger group outside the generic_mapper folder.

Room Name and Exits Trigger

Create a new trigger with regex pattern: ^(\X+)\(([\w\s,]+)\)\s*\[?([\w\s,]*)\]?

Add this Lua code to the trigger. Note: The RGB colors help with room name detection. For the ones shown, the room_shorts color is set to bright yellow. The code excludes the room "Near a guard flet" because it's randomly inserted into the Lothlorien area. All rooms shown as either Lothlorien or Near a guard flet are set to "Lothlorien" and these triggers account for changing names.

local dirs = {n = 'north', s = 'south', w = 'west', e = 'east', d = 'down', u = 'up', ne = 'northeast', nw = 'northwest', se = 'southeast', sw = 'southwest', enter = 'enter', out = 'out'}
local exits, found_exits
local combined = matches[3]

selectCurrentLine()
local r,g,b = getFgColor() 
if r == 255 and g == 255 and b == 0 then
    for w in combined:gmatch("%a+") do
        if dirs[w] then
            found_exits = true
            if not exits then
              exits = dirs[w]
            else
              exits = exits .. " " .. dirs[w]
            end
           
        else 
            found_exits=true
            if not exits then
                exits = w
            else
                exits = exits .. " " .. w
            end
        end
  end

  if found_exits and matches[2] ~= "Near a guard flet" then
          map.prompt.exits = exits
          map.prompt.room = matches[2]
          cecho(matches[2])
          raiseEvent("onNewRoom")
          print(map.prompt.exits)
  end
end

RGB Value Display

Create a new trigger with the same regex pattern as above to show RGB values for your room_short color:

selectCurrentLine()
local r,g,b = getFgColor()
cecho("\nred " ..r.. " green " ..g.. " blue "..b)
deselect()

Vision Fail Trigger

Create a copy of the English Vision Fail Trigger and add this pattern:

^Near a guard flet

Notes on Color Settings

For any game where room color detection is used, you can create a trigger using the following to show you the rgb values for whatever color you have your room_short set to:

selectCurrentLine()
local r,g,b = getFgColor()
cecho("\nred " ..r.. " green " ..g.. " blue "..b)
deselect()

This can help you ensure you're using the correct color values in your triggers.

Maintenance and Updates

Remember not to edit the generic_mapper</code package itself as updates to it will overwrite your changes. Instead, copy triggers out and edit the copy.

Contributing

If you have configurations for other MUDs that you'd like to add to this collection, please ensure they follow the same format as the existing entries:

  • Include the MUD's connection information
  • Provide example room/exit formatting if relevant
  • List all required triggers, scripts, and aliases
  • Include clear instructions for creating and placing new components
  • Document any game-specific commands or settings needed
  • Add troubleshooting notes for common issues