Difference between revisions of "Generic mapper package"

From Mudlet
Jump to navigation Jump to search
(initial creation)
 
 
(33 intermediate revisions by 2 users not shown)
Line 19: Line 19:
 
= Usage =
 
= Usage =
  
Type `map basics` or `map help` in game to get started.
+
Type <code>map basics</code> or <code>map help</code> in game to get started.
  
 
See also: [https://forums.mudlet.org/viewtopic.php?f=13&t=6105 Mudlet Forums]
 
See also: [https://forums.mudlet.org/viewtopic.php?f=13&t=6105 Mudlet Forums]
 +
 +
There are also some Youtube videos of getting started in the mapper.
 +
 +
[https://www.youtube.com/watch?v=m6nqwbvEJXc Mudlet Generic Mapper Tutorial]
 +
 +
[https://www.youtube.com/watch?v=Kjckwn1ZyrI Automapping in Mudlet]
  
 
== Commands ==
 
== Commands ==
Line 44: Line 50:
  
 
This command shows a map window, as specified by the window configs set
 
This command shows a map window, as specified by the window configs set
via the <link: window>map window command</link>. It isn't necessary to use this method to
+
via the [[Generic_mapper_package#Map_Window|map window command]]. It isn't necessary to use this method to
 
show a map window to use this script, any map window will work.
 
show a map window to use this script, any map window will work.
  
Line 127: Line 133:
 
pattern will be removed from the list.
 
pattern will be removed from the list.
  
Example: <syntaxhighlight = "lua">map ignore ^You are hungry%.$</syntaxhighlight> - match exactly one line
+
Example: <syntaxhighlight lang="lua">map ignore ^You are hungry%.$</syntaxhighlight>
<syntaxhighlight = "lua">map ignore ^The clock strikes %d+%.$</syntaxhighlight> - match a number
+
: to match exactly one line
<syntaxhighlight = "lua">map ignore ^You walk %a+%.$</syntaxhighlight> - match a word, e.g. east
+
<syntaxhighlight lang="lua">map ignore ^The clock strikes %d+%.$</syntaxhighlight>
 +
: to match a number
 +
<syntaxhighlight lang="lua">map ignore ^You walk %a+%.$</syntaxhighlight>
 +
: to match a word, e.g. east
  
 
=== Move Method ===
 
=== Move Method ===
Line 147: Line 156:
 
This command displays a linked list of all areas in the map. When
 
This command displays a linked list of all areas in the map. When
 
clicked, the rooms in the selected area will be displayed, as if the
 
clicked, the rooms in the selected area will be displayed, as if the
'map rooms' command had been used with that area as an argument.
+
<code>map rooms</code> command had been used with that area as an argument.
  
 
=== Map Rooms ===
 
=== Map Rooms ===
Line 165: Line 174:
 
<syntaxhighlight lang="lua">map mode <lazy, simple, normal, or complex></syntaxhighlight>
 
<syntaxhighlight lang="lua">map mode <lazy, simple, normal, or complex></syntaxhighlight>
  
This command changes the current mapping mode, which determines what
+
This command changes the current mapping mode, which determines what happens when new rooms are added to the map.
happens when new rooms are added to the map.
 
  
In lazy mode, connecting exits aren't checked and a room is only added if
+
* In lazy mode, connecting exits aren't checked and a room is only added if there isn't an adjacent room with the same name.
there isn't an adjacent room with the same name.
 
  
In simple mode, if an adjacent room has an exit stub pointing toward the
+
* In simple mode, if an adjacent room has an exit stub pointing toward the newly created room, and the new room has an exit in that direction, those stubs are connected in both directions.
newly created room, and the new room has an exit in that direction,
 
those stubs are connected in both directions.
 
  
In normal mode (default), the newly created room is connected to the room you left
+
* In normal mode (default), the newly created room is connected to the room you left from, so long as it has an exit leading in that direction.
from, so long as it has an exit leading in that direction.
 
  
In complex mode, none of the exits of the newly connected room are
+
* In complex mode, none of the exits of the newly connected room are connected automatically when it is created.
connected automatically when it is created.
 
  
 
=== Add Door ===
 
=== Add Door ===
Line 247: Line 250:
 
name is given, but spaces before or after the semicolon are optional.
 
name is given, but spaces before or after the semicolon are optional.
  
Example: <syntaxhighlight = "lua">map path main street ; newbie town</syntaxhighlight>
+
Example: <syntaxhighlight lang="lua">map path main street ; newbie town</syntaxhighlight>
  
 
=== Map Character ===
 
=== Map Character ===
Line 277: Line 280:
 
does are provided.
 
does are provided.
  
<syntaxhighlight = "lua">speedwalk_delay</syntaxhighlight> - When using the speedwalk function of the script,
+
<syntaxhighlight lang="lua">speedwalk_delay</syntaxhighlight>
this is the amount of time the script waits after either sending
+
: when using the speedwalk function of the script, this is the amount of time the script waits after either sending a command or, if speedwalk_wait is set, after arriving in a new room, before the next command is sent. This may be any number 0 or higher.
a command or, if speedwalk_wait is set, after arriving in a new
 
room, before the next command is sent. This may be any number 0
 
or higher.
 
  
<syntaxhighlight = "lua">speedwalk_wait</syntaxhighlight> - When using the speedwalk function of the script,
+
<syntaxhighlight lang="lua">speedwalk_wait</syntaxhighlight>
this indicates if the script waits for your character to move
+
: when using the speedwalk function of the script, this indicates if the script waits for your character to move into a new room before sending the next command. This may be true or false.
into a new room before sending the next command. This may be true
 
or false.
 
  
<syntaxhighlight = "lua">speedwalk_random</syntaxhighlight> - When using the speedwalk function of the script
+
<syntaxhighlight lang="lua">speedwalk_random</syntaxhighlight>
with a speedwalk_delay value, introduces a randomness to the wait
+
: when using the speedwalk function of the script with a speedwalk_delay value, introduces a randomness to the wait time by adding some amount up to the speedwalk_delay value. This may be true or false.
time by adding some amount up to the speedwalk_delay value. This
 
may be true or false.
 
  
<syntaxhighlight = "lua">stretch_map</syntaxhighlight> - When adding a new room that would overlap an existing
+
<syntaxhighlight lang="lua">stretch_map</syntaxhighlight>
room, if this is set the map will stretch out to prevent the
+
: when adding a new room that would overlap an existing room, if this is set the map will stretch out to prevent the overlap, with all rooms further in the direction moved getting pushed one further in that direction. This may be true or false.
overlap, with all rooms further in the direction moved getting
 
pushed one further in that direction. This may be true or false.
 
  
<syntaxhighlight = "lua">max_search_distance</syntaxhighlight> - When mapping, this is the maximum number of
+
<syntaxhighlight lang="lua">max_search_distance</syntaxhighlight>
rooms that the script will search in the movement direction for a
+
: when mapping, this is the maximum number of rooms that the script will search in the movement direction for a matching room before deciding to create a new room. This may be false, or any positive whole number. This can also be set to 0, which is the same as setting it to false.
matching room before deciding to create a new room. This may be
 
false, or any positive whole number. This can also be set to 0,
 
which is the same as setting it to false.
 
  
<syntaxhighlight = "lua">search_on_look</syntaxhighlight> - When this is set, using the "look" command causes
+
<syntaxhighlight lang="lua">search_on_look</syntaxhighlight>
the map to verify your position using the room name and exits
+
: when this is set, using the "look" command causes the map to verify your position using the room name and exits seen following using the command. This may be true or false.
seen following using the command. This may be true or false.
 
  
<syntaxhighlight = "lua">clear_lines_on_send</syntaxhighlight> - When this is set, any time a command is sent,
+
<syntaxhighlight lang="lua">clear_lines_on_send</syntaxhighlight>
any lines stored from the game used to search for the room name
+
: when this is set, any time a command is sent, any lines stored from the game used to search for the room name are cleared. This may be true or false.
are cleared. This may be true or false.
 
  
<syntaxhighlight = "lua">mode</syntaxhighlight> - This is the default mapping mode on startup, and defines how
+
<syntaxhighlight lang="lua">mode</syntaxhighlight>
new rooms are added to the map. May be "lazy", "simple",
+
: this is the default mapping mode on startup, and defines how new rooms are added to the map. May be "lazy", "simple", "normal" or "complex".
"normal" or "complex".
 
  
<syntaxhighlight = "lua">download_path</syntaxhighlight> - This is the path that updates are downloaded from.
+
<syntaxhighlight lang="lua">download_path</syntaxhighlight>
This may be any web address where the versions.lua and
+
: this is the path that updates are downloaded from. This may be any web address where the versions.lua and generic_mapper.xml files can be downloaded from.
generic_mapper.xml files can be downloaded from.
 
  
<syntaxhighlight = "lua">prompt_test_patterns</syntaxhighlight> - This is a table of default patterns checked
+
<syntaxhighlight lang="lua">prompt_test_patterns</syntaxhighlight>
when using the "find prompt" command. The patterns in this table
+
: this is a table of default patterns checked when using the "find prompt" command. The patterns in this table should start with a '^', and be written to be used with the Lua string library. Most importantly, '%' is used as the escape character instead of '\' as in trigger regex patterns.
should start with a '^', and be written to be used with the Lua
 
string library. Most importantly, '%' is used as the escape
 
character instead of '\' as in trigger regex patterns.
 
  
<syntaxhighlight = "lua">custom_exits</syntaxhighlight> - This is a table of custom exit directions and their
+
<syntaxhighlight lang="lua">custom_exits</syntaxhighlight>
relevant extra pieces of info. Each entry should have the short
+
: this is a table of custom exit directions and their relevant extra pieces of info. Each entry should have the short direction as the keyword for a table containing first the long direction, then the long direction of the reverse of this direction, and then the x, y, and z change in map position corresponding to the movement. As an example: us = {'upsouth', 'downnorth', 0, -1, 1}
direction as the keyword for a table containing first the long
 
direction, then the long direction of the reverse of this
 
direction, and then the x, y, and z change in map position
 
corresponding to the movement. As an example: us = {'upsouth',
 
'downnorth', 0, -1, 1}
 
  
<syntaxhighlight = "lua">custom_name_search</syntaxhighlight> - When this is set, instead of running the default
+
<syntaxhighlight lang="lua">custom_name_search</syntaxhighlight>
function name_search, a user-defined function called
+
: when this is set, instead of running the default function name_search, a user-defined function called 'mudlet.custom_name_search' is used instead. This may be true or false.
'mudlet.custom_name_search' is used instead. This may be true or false.
 
  
<syntaxhighlight = "lua">use_translation</syntaxhighlight> - When this is set, the lang_dirs table is used to
+
<syntaxhighlight lang="lua">use_translation</syntaxhighlight>
translate movement and status commands in some other language
+
: when this is set, the lang_dirs table is used to translate movement and status commands in some other language into the English used by the script. This may be true or false.
into the English used by the script. This may be true or false.
 
  
<syntaxhighlight = "lua">debug</syntaxhighlight> - When this is set, the script will start in debug mode. This
+
<syntaxhighlight lang="lua">debug</syntaxhighlight>
may be true or false.
+
: when this is set, the script will start in debug mode. This may be true or false.
  
 
=== Map Window ===
 
=== Map Window ===
Line 353: Line 330:
 
and what each one does are provided.
 
and what each one does are provided.
  
<syntaxhighlight = "lua">x</syntaxhighlight> - This is the x position of the map window, and should be a
+
<syntaxhighlight lang="lua">x</syntaxhighlight>
positive number of pixels or a percentage of the screen width.
+
: this is the x position of the map window, and should be a positive number of pixels or a percentage of the screen width.
  
<syntaxhighlight = "lua">y</syntaxhighlight> - This is the y position of the map window, and should be a
+
<syntaxhighlight lang="lua">y</syntaxhighlight>
positive number of pixels or a percentage of the screen height.
+
: this is the y position of the map window, and should be a positive number of pixels or a percentage of the screen height.
  
<syntaxhighlight = "lua">w</syntaxhighlight> - This is the width of the map window, and should be a positive
+
<syntaxhighlight lang="lua">w</syntaxhighlight>
number of pixels or a percentage of the screen width.
+
: this is the width of the map window, and should be a positive number of pixels or a percentage of the screen width.
  
<syntaxhighlight = "lua">h</syntaxhighlight> - This is the height of the map window, and should be a positive
+
<syntaxhighlight lang="lua">h</syntaxhighlight>
number of pixels or a percentage of the screen height.
+
: this is the height of the map window, and should be a positive number of pixels or a percentage of the screen height.
  
<syntaxhighlight = "lua">origin</syntaxhighlight> - This is the corner from which the window position is
+
<syntaxhighlight lang="lua">origin</syntaxhighlight>
measured, and may be 'topright', 'topleft', 'bottomright', or
+
: this is the corner from which the window position is measured, and may be 'topright', 'topleft', 'bottomright', or 'bottomleft'.
'bottomleft'.
 
  
<syntaxhighlight = "lua">shown</syntaxhighlight> - This determines if the map window is shown immediately upon
+
<syntaxhighlight lang="lua">shown</syntaxhighlight>
connecting to the game. This may be true or false. If you intend
+
: this determines if the map window is shown immediately upon connecting to the game. This may be true or false. If you intend to have some other script control the map window, this should be set to false.
to have some other script control the map window, this should be
 
set to false.
 
  
 
=== Map Translate ===
 
=== Map Translate ===
<syntaxhighlight lang="lua">map translate <english direction> <translated long direction>
+
<syntaxhighlight lang="lua">map translate <english direction> <translated long direction> <translated short direction></syntaxhighlight>
<translated short direction></syntaxhighlight>
 
  
This command sets direction translations for the script to use, either
+
This command sets direction translations for the script to use, either for commands entered to move around, or listed exits the game shows when you enter a room. Available directions: north, south, east, west, northwest, northeast, southwest, southeast, up, down, in, and out. Also you can customize special commands sent to mud like 'look'.
for commands entered to move around, or listed exits the game shows when
 
you enter a room. Available directions: north, south, east, west,
 
northwest, northeast, southwest, southeast, up, down, in, and out.
 
Also you can customize special commands sent to mud like 'look'.
 
  
 
=== Map Basics (quick start guide) ===
 
=== Map Basics (quick start guide) ===
Line 411: Line 380:
 
=== Room Find ===
 
=== Room Find ===
 
<syntaxhighlight lang="lua">room find <room name></syntaxhighlight>
 
<syntaxhighlight lang="lua">room find <room name></syntaxhighlight>
<syntaxhighlight = "lua">rf <room name></syntaxhighlight>
+
<syntaxhighlight lang="lua">rf <room name></syntaxhighlight>
  
 
This command will search all rooms and return a list of matches.
 
This command will search all rooms and return a list of matches.
Line 417: Line 386:
 
=== Room Look ===
 
=== Room Look ===
 
<syntaxhighlight lang="lua">room look [roomID]</syntaxhighlight>
 
<syntaxhighlight lang="lua">room look [roomID]</syntaxhighlight>
<syntaxhighlight = "lua">rl [roomID]</syntaxhighlight>
+
<syntaxhighlight lang="lua">rl [roomID]</syntaxhighlight>
  
 
This command will display detailed information about the current room.
 
This command will display detailed information about the current room.
Line 424: Line 393:
 
=== Showpath ===
 
=== Showpath ===
 
<syntaxhighlight lang="lua">showpath <roomID></syntaxhighlight>
 
<syntaxhighlight lang="lua">showpath <roomID></syntaxhighlight>
<syntaxhighlight = "lua">showpath <fromID> <toID></syntaxhighlight>
+
<syntaxhighlight lang="lua">showpath <fromID> <toID></syntaxhighlight>
  
 
This command displays a path from your current room to the roomID specified.
 
This command displays a path from your current room to the roomID specified.
Line 435: Line 404:
 
optional filter to return a list containing those words.
 
optional filter to return a list containing those words.
  
Example: <syntaxhighlight = "lua">spe list worm warp</syntaxhighlight>
+
Example: <syntaxhighlight lang="lua">spe list worm warp</syntaxhighlight>
  
 
=== Feature List ===
 
=== Feature List ===
Line 447: Line 416:
 
This command will create a new area and automatically give it an ID.
 
This command will create a new area and automatically give it an ID.
  
Example: <syntaxhighlight = "lua">area add My City</syntaxhighlight> - create a new area called My City
+
Example: <syntaxhighlight lang="lua">area add My City</syntaxhighlight>
 +
: create a new area called My City
  
 
=== Area Delete ===
 
=== Area Delete ===
Line 460: Line 430:
 
you an ability to pause it at any time by doing 'cancel area deletion'.
 
you an ability to pause it at any time by doing 'cancel area deletion'.
  
Example: <syntaxhighlight = "lua">area delete My City</syntaxhighlight> - create a new area called My City
+
Example: <syntaxhighlight lang="lua">area delete My City</syntaxhighlight>
 +
: delete an area called My City
  
 
=== Cancel Area Deletion ===
 
=== Cancel Area Deletion ===
Line 476: Line 447:
 
This command will rename the current area you're in to the new name.
 
This command will rename the current area you're in to the new name.
  
Example: <syntaxhighlight = "lua">area rename My City</syntaxhighlight> - call the area you're in My City from now on
+
Example: <syntaxhighlight lang="lua">area rename My City</syntaxhighlight>
 +
: call the area you're in My City from now on
  
 
=== Arealock ===
 
=== Arealock ===
Line 485: Line 457:
 
not attempt to speedwalk or go through any of the rooms in the area.
 
not attempt to speedwalk or go through any of the rooms in the area.
  
Example: <syntaxhighlight = "lua">arealock City</syntaxhighlight>
+
Example: <syntaxhighlight lang="lua">arealock City</syntaxhighlight>
  
 
=== Room Coordinates ===
 
=== Room Coordinates ===
 
<syntaxhighlight lang="lua">room coords [v<roomID>] <x> <y> <z></syntaxhighlight>
 
<syntaxhighlight lang="lua">room coords [v<roomID>] <x> <y> <z></syntaxhighlight>
<syntaxhighlight = "lua">rc [v<roomID>] <x> <y> <z></syntaxhighlight>
+
<syntaxhighlight lang="lua">rc [v<roomID>] <x> <y> <z></syntaxhighlight>
  
This command will move a room to the new map coordinates. x,y and z will
+
This command will move a room to the new map coordinates. x,y and z will specify the new location of the room. The room ID is optional, it'll move the current room if you don't provide one.
specify the new location of the room. The room ID is optional, it'll move
 
the current room if you don't provide one.
 
  
Example: <syntaxhighlight = "lua">rc nw</syntaxhighlight> - move the room to be nw of the current location
+
Example: <syntaxhighlight lang="lua">rc nw</syntaxhighlight>
<syntaxhighlight = "lua">rc v34 w</syntaxhighlight> - move the room ID 34 west, note the letter 'v' in the command
+
: move the room to be nw of the current location
<syntaxhighlight = "lua">rc 1 -5 10</syntaxhighlight> - move the current room to those exact coordinates
+
<syntaxhighlight lang="lua">rc v34 w</syntaxhighlight>
<syntaxhighlight = "lua">rc v12 8 3 -8</syntaxhighlight> - move the room #12 to 8x, 3y and -8z
+
: move the room ID 34 west, note the letter 'v' in the command
<syntaxhighlight = "lua">rc 14x 5y</syntaxhighlight> - move the current room to be at 14x and 5y, but the
+
<syntaxhighlight lang="lua">rc 1 -5 10</syntaxhighlight>
same z-level you're on. You can include all three of x, y, z coordinates
+
: move the current room to those exact coordinates
or only one as you wish
+
<syntaxhighlight lang="lua">rc v12 8 3 -8</syntaxhighlight>
 +
: move the room #12 to 8x, 3y and -8z
 +
<syntaxhighlight lang="lua">rc 14x 5y</syntaxhighlight>
 +
: move the current room to be at 14x and 5y, but the same z-level you're on. You can include all three of x, y, z coordinates or only one as you wish
  
 
=== Room Delete ===
 
=== Room Delete ===
 
<syntaxhighlight lang="lua">room delete <direction|roomID></syntaxhighlight>
 
<syntaxhighlight lang="lua">room delete <direction|roomID></syntaxhighlight>
<syntaxhighlight = "lua">rld <direction|roomID></syntaxhighlight>
+
<syntaxhighlight lang="lua">rld <direction|roomID></syntaxhighlight>
  
 
This command will delete a room given a relative direction or roomID.
 
This command will delete a room given a relative direction or roomID.
  
Example: <syntaxhighlight = "lua">rld</syntaxhighlight> - current room, will delete the room you're currently in
+
Example: <syntaxhighlight lang="lua">rld</syntaxhighlight>
<syntaxhighlight = "lua">rld n</syntaxhighlight> - relative direction, will delete the room that's north of you
+
: current room, will delete the room you're currently in
<syntaxhighlight = "lua">rld 513</syntaxhighlight> - using roomID, will delete the room with ID 513
+
<syntaxhighlight lang="lua">rld n</syntaxhighlight>
 +
: relative direction, will delete the room that's north of you
 +
<syntaxhighlight lang="lua">rld 513</syntaxhighlight>
 +
: using roomID, will delete the room with ID 513
  
 
=== Room Weight ===
 
=== Room Weight ===
 
<syntaxhighlight lang="lua">room weight [direction|roomID] <weight></syntaxhighlight>
 
<syntaxhighlight lang="lua">room weight [direction|roomID] <weight></syntaxhighlight>
<syntaxhighlight = "lua">rw [direction|roomID] <weight></syntaxhighlight>
+
<syntaxhighlight lang="lua">rw [direction|roomID] <weight></syntaxhighlight>
  
This command updates the weight of a room, making it more or less
+
This command updates the weight of a room, making it more or less desirable to travel through.  Direction or roomID is optional and
desirable to travel through.  Direction or roomID is optional and
 
 
defaults to the current room.
 
defaults to the current room.
  
Example: <syntaxhighlight = "lua">rw 10</syntaxhighlight> - will set the room weight of the room you're standing in to 10
+
Example: <syntaxhighlight lang="lua">rw 10</syntaxhighlight>
<syntaxhighlight = "lua">rw n 4</syntaxhighlight> - relative direction, will set the room weight of the room that's
+
: will set the room weight of the room you're standing in to 10
to the north of you to four
+
<syntaxhighlight lang="lua">rw n 4</syntaxhighlight>
<syntaxhighlight = "lua">rw 2343 2</syntaxhighlight> - using roomID, will set the room weight of room 2343 to 2
+
: relative direction, will set the room weight of the room that's to the north of you to four
 +
<syntaxhighlight lang="lua">rw 2343 2</syntaxhighlight>
 +
: using roomID, will set the room weight of room 2343 to 2
  
 
=== Room Weight Exit ===
 
=== Room Weight Exit ===
Line 537: Line 514:
 
side as well. Use 'rl' to check exit weights.
 
side as well. Use 'rl' to check exit weights.
  
Example: <syntaxhighlight = "lua">rwe 1 n</syntaxhighlight> will set the weight of the exit north to 1
+
Example: <syntaxhighlight lang="lua">rwe 1 n</syntaxhighlight>  
<syntaxhighlight = "lua">rwe 2434 0 e</syntaxhighlight> - will reset the exit weight of an east exit that
+
: will set the weight of the exit north to 1
leads out from the 2434 room
+
<syntaxhighlight lang="lua">rwe 2434 0 e</syntaxhighlight>
 +
: will reset the exit weight of an east exit that leads out from the 2434 room
  
 
=== Room Link ===
 
=== Room Link ===
 
<syntaxhighlight lang="lua">room link [roomID] <direction> [one]</syntaxhighlight>
 
<syntaxhighlight lang="lua">room link [roomID] <direction> [one]</syntaxhighlight>
<syntaxhighlight = "lua">rlk [roomID] <direction> [one]</syntaxhighlight>
+
<syntaxhighlight lang="lua">rlk [roomID] <direction> [one]</syntaxhighlight>
  
This command will link a room given a direction and optional roomID.
+
This command will link a room given a direction and optional roomID. You can also add 'one' at the end of the command to make it be a one-way
You can also add 'one' at the end of the command to make it be a one-way
 
 
link.
 
link.
  
Example: <syntaxhighlight = "lua">rlk n</syntaxhighlight> - relative direction, will link if exists
+
Example: <syntaxhighlight lang="lua">rlk n</syntaxhighlight>  
a room to the north of this one to your current location
+
: relative direction, will link if exists a room to the north of this one to your current location
<syntaxhighlight = "lua">rlk 351 n</syntaxhighlight> - exact roomID and direction, will
+
<syntaxhighlight lang="lua">rlk 351 n</syntaxhighlight>
link the current room to room #351 via a north exit
+
: exact roomID and direction, will link the current room to room #351 via a north exit
<syntaxhighlight = "lua">rlk n one</syntaxhighlight> - will make an exit north one-way
+
<syntaxhighlight lang="lua">rlk n one</syntaxhighlight>
 +
: will make an exit north one-way
  
 
=== Room Unlink ===
 
=== Room Unlink ===
 
<syntaxhighlight lang="lua">room unlink <direction></syntaxhighlight>
 
<syntaxhighlight lang="lua">room unlink <direction></syntaxhighlight>
<syntaxhighlight = "lua">urlk <direction></syntaxhighlight>
+
<syntaxhighlight lang="lua">urlk <direction></syntaxhighlight>
  
 
Unlink a room given a direction.  This function will unlink
 
Unlink a room given a direction.  This function will unlink
 
exits both ways, or one way if there is no incoming exit.
 
exits both ways, or one way if there is no incoming exit.
  
Example: <syntaxhighlight = "lua">urlk nw</syntaxhighlight> - relative direction, will unlink to the
+
Example: <syntaxhighlight lang="lua">urlk nw</syntaxhighlight>
northwest, and from the northwest room to the southeast
+
: relative direction, will unlink to the northwest, and from the northwest room to the southeast
  
 
=== Room Door ===
 
=== Room Door ===
Line 575: Line 553:
  
  
Example: <syntaxhighlight = "lua">rd n</syntaxhighlight> - add a one-way door north from the current room
+
Example: <syntaxhighlight lang="lua">rd n</syntaxhighlight>
<syntaxhighlight = "lua">rd 23 w closed</syntaxhighlight> - add a closed door leading west in room 23
+
: add a one-way door north from the current room
<syntaxhighlight = "lua">rd n clear</syntaxhighlight> - remove the door to the north from the current
+
<syntaxhighlight lang="lua">rd 23 w closed</syntaxhighlight>
room on this side only
+
: add a closed door leading west in room 23
 +
<syntaxhighlight lang="lua">rd n clear</syntaxhighlight>
 +
: remove the door to the north from the current room on this side only
  
 
=== Room Character ===
 
=== Room Character ===
 
<syntaxhighlight lang="lua">rcc <character|clear> [roomID]</syntaxhighlight>
 
<syntaxhighlight lang="lua">rcc <character|clear> [roomID]</syntaxhighlight>
  
This command will assign a single character, letter or number to the
+
This command will assign a single character, letter or number to the current room, or an optional given room.  Using clear will remove any characters.
current room, or an optional given room.  Using clear will remove any
 
characters.
 
  
Example: <syntaxhighlight = "lua">rcc $</syntaxhighlight> - put the dollar sign in the current room  
+
Example: <syntaxhighlight lang="lua">rcc $</syntaxhighlight>
(e.g. to indicate a shop or bank)
+
: put the dollar sign in the current room (e.g. to indicate a shop or bank)
<syntaxhighlight = "lua">rcc C 234</syntaxhighlight> - put the letter C onto room 234
+
<syntaxhighlight lang="lua">rcc C 234</syntaxhighlight>
<syntaxhighlight = "lua">rcc clear</syntaxhighlight> - remove any letter from the current
+
: put the letter C onto room 234
room
+
<syntaxhighlight lang="lua">rcc clear</syntaxhighlight>
 +
:remove any letter from the current room
  
 
=== Special Exits ===
 
=== Special Exits ===
 
<syntaxhighlight lang="lua">exit special <direction|roomID> <command></syntaxhighlight>
 
<syntaxhighlight lang="lua">exit special <direction|roomID> <command></syntaxhighlight>
<syntaxhighlight = "lua">spe <direction|roomID> <command></syntaxhighlight>
+
<syntaxhighlight lang="lua">spe <direction|roomID> <command></syntaxhighlight>
  
 
This command will link two rooms via custom or special exit/script.
 
This command will link two rooms via custom or special exit/script.
  
Example: <syntaxhighlight = "lua">spe n push rock</syntaxhighlight> - relative direction, will go to
+
Example: <syntaxhighlight lang="lua">spe n push rock</syntaxhighlight>
the room that's north of you by doing 'push rock'
+
: relative direction, will go to the room that's north of you by doing 'push rock'
<syntaxhighlight = "lua">spe 125 pull lever</syntaxhighlight> - will go to room 125 from the
+
<syntaxhighlight lang="lua">spe 125 pull lever</syntaxhighlight>
current one by pulling a lever
+
: will go to room 125 from the current one by pulling a lever
  
You can also specify a script to do code for you, by starting the exit
+
You can also specify a script to do code for you, by starting the exit command with script.
command with script.
 
  
Example: <syntaxhighlight = "lua">spe 125 script: sendAll("pull lever", "enter gate")</syntaxhighlight>
+
Example: <syntaxhighlight lang="lua">spe 125 script: sendAll("pull lever", "enter gate")</syntaxhighlight>
  
 
=== Remote Special Exits ===
 
=== Remote Special Exits ===
Line 614: Line 592:
 
This command will add a special exit between two remote rooms.
 
This command will add a special exit between two remote rooms.
  
Example: <syntaxhighlight = "lua">spe 125 560 push rock</syntaxhighlight> - will link room 125 to room 560 with
+
Example: <syntaxhighlight lang="lua">spe 125 560 push rock</syntaxhighlight>
the command 'push rock'
+
: will link room 125 to room 560 with the command 'push rock'
  
 
=== Clear Special Exits ===
 
=== Clear Special Exits ===
 
<syntaxhighlight lang="lua">exit special clear <direction|roomID></syntaxhighlight>
 
<syntaxhighlight lang="lua">exit special clear <direction|roomID></syntaxhighlight>
<syntaxhighlight = "lua">spe clear <direction|roomID></syntaxhighlight>
+
<syntaxhighlight lang="lua">spe clear <direction|roomID></syntaxhighlight>
  
This command will clear all special exits from the current, relative or
+
This command will clear all special exits from the current, relative or given roomID.
given roomID.
 
  
Example: <syntaxhighlight = "lua">spe clear</syntaxhighlight> - delete all special exits in the room you're currently in
+
Example: <syntaxhighlight lang="lua">spe clear</syntaxhighlight>
<syntaxhighlight = "lua">spe clear n</syntaxhighlight> - delete all special exits in the room that's north of you
+
: delete all special exits in the room you're currently in
<syntaxhighlight = "lua">spe clear 513</syntaxhighlight> - delete all special exits in room #513
+
<syntaxhighlight lang="lua">spe clear n</syntaxhighlight>
 +
: delete all special exits in the room that's north of you
 +
<syntaxhighlight lang="lua">spe clear 513</syntaxhighlight>
 +
: delete all special exits in room #513
  
 
=== Room Area ===
 
=== Room Area ===
 
<syntaxhighlight lang="lua">room area [v<roomID>] <area name|areaID></syntaxhighlight>
 
<syntaxhighlight lang="lua">room area [v<roomID>] <area name|areaID></syntaxhighlight>
  
This command moves the current room to another area or a given optional
+
This command moves the current room to another area or a given optional room.
room.
 
  
Example: <syntaxhighlight = "lua">room area My New Area</syntaxhighlight> - move the room you're in to 'My New Area'.
+
Example: <syntaxhighlight lang="lua">room area My New Area</syntaxhighlight>
<syntaxhighlight = "lua">room area v123 My New Area</syntaxhighlight> - move room 123 to My New Area
+
: move the room you're in to 'My New Area'.
<syntaxhighlight = "lua">room area 44</syntaxhighlight> - move the current room to the area ID 44
+
<syntaxhighlight lang="lua">room area v123 My New Area</syntaxhighlight>
 +
: move room 123 to My New Area
 +
<syntaxhighlight lang="lua">room area 44</syntaxhighlight>
 +
: move the current room to the area ID 44
  
 
=== Room Label ===
 
=== Room Label ===
 
<syntaxhighlight lang="lua">room label [roomID] [fgColor] [bgColor] <message></syntaxhighlight>
 
<syntaxhighlight lang="lua">room label [roomID] [fgColor] [bgColor] <message></syntaxhighlight>
  
This command adds a label to the current or specified room.  Foreground
+
This command adds a label to the current or specified room.  Foreground and background color are optional.
and background color are optional.
 
  
Example: <syntaxhighlight = "lua">room label My Label</syntaxhighlight> - adds a 'My Label' label to the current room
+
Example: <syntaxhighlight lang="lua">room label My Label</syntaxhighlight>
<syntaxhighlight = "lua">room label 342 My Label</syntaxhighlight> - adds a label to room #342
+
: adds a 'My Label' label to the current room
<syntaxhighlight = "lua">room label green My Label</syntaxhighlight> - adds a green label with a transparent
+
<syntaxhighlight lang="lua">room label 342 My Label</syntaxhighlight>
background to the current room
+
: adds a label to room #342
<syntaxhighlight = "lua">room label green black My Label</syntaxhighlight> - adds a label with a green
+
<syntaxhighlight lang="lua">room label green My Label</syntaxhighlight>
foreground and black background to the current room
+
: adds a green label with a transparent background to the current room
<syntaxhighlight = "lua">room label 34 green black My Label</syntaxhighlight> - adds a label with a green
+
<syntaxhighlight lang="lua">room label green black My Label</syntaxhighlight>
foreground and black background to room #34
+
: adds a label with a green foreground and black background to the current room
 +
<syntaxhighlight lang="lua">room label 34 green black My Label</syntaxhighlight>
 +
: adds a label with a green foreground and black background to room #34
  
 
=== Area Labels ===
 
=== Area Labels ===
Line 658: Line 641:
 
This command displays all labels in a given area, with a link to delete.
 
This command displays all labels in a given area, with a link to delete.
  
Example: <syntaxhighlight = "lua">area label My Area</syntaxhighlight>
+
Example: <syntaxhighlight lang="lua">area label My Area</syntaxhighlight>
  
 
=== Feature Create ===
 
=== Feature Create ===
 
<syntaxhighlight lang="lua">feature create <feature> [char <room character>]</syntaxhighlight>
 
<syntaxhighlight lang="lua">feature create <feature> [char <room character>]</syntaxhighlight>
  
This command will create a new map feature for use on rooms. You can
+
This command will create a new map feature for use on rooms. You can also optionally add a character mark to the feature, which will be set
also optionally add a character mark to the feature, which will be set
+
when a map feature is added to a room. Note: Map feature names are not allowed to contain numbers.
when a map feature is added to a room. Note: Map feature names are not
 
allowed to contain numbers.
 
  
Example: <syntaxhighlight = "lua">feature create A Nexus Point char N</syntaxhighlight> - creates a new feature
+
Example: <syntaxhighlight lang="lua">feature create A Nexus Point char N</syntaxhighlight>
'A Nexus Point' with an assigned room character 'N'
+
: creates a new feature 'A Nexus Point' with an assigned room character 'N'
  
 
=== Room Create Feature ===
 
=== Room Create Feature ===
 
<syntaxhighlight lang="lua">room create feature [v<room id>] <feature></syntaxhighlight>
 
<syntaxhighlight lang="lua">room create feature [v<room id>] <feature></syntaxhighlight>
<syntaxhighlight = "lua">rcf [v<room id>] <feature></syntaxhighlight>
+
<syntaxhighlight lang="lua">rcf [v<room id>] <feature></syntaxhighlight>
  
This command will add a created map feature to the room. If the map
+
This command will add a created map feature to the room. If the map feature is associated with a character mark, it will be set on the room
feature is associated with a character mark, it will be set on the room
+
and existing marks get overwritten. The room number to add the feature to can be given with the optional argument (note: there is no space
and existing marks get overwritten. The room number to add the feature
 
to can be given with the optional argument (note: there is no space
 
 
between the v and the ID).
 
between the v and the ID).
  
Example: <syntaxhighlight = "lua">rcf A Nexus Point</syntaxhighlight> - add the feature 'A Nexus Point' to
+
Example: <syntaxhighlight lang="lua">rcf A Nexus Point</syntaxhighlight>
the current room
+
: add the feature 'A Nexus Point' to the current room
<syntaxhighlight = "lua">rcf v123 A Nexus Point</syntaxhighlight> - add the feature 'A Nexus Point'
+
<syntaxhighlight lang="lua">rcf v123 A Nexus Point</syntaxhighlight>
to room #123
+
: add the feature 'A Nexus Point' to room #123
  
 
=== Room Delete Feature ===
 
=== Room Delete Feature ===
 
<syntaxhighlight lang="lua">room delete feature [v<room id>] <feature></syntaxhighlight>
 
<syntaxhighlight lang="lua">room delete feature [v<room id>] <feature></syntaxhighlight>
<syntaxhighlight = "lua">rdf [v<room id>] <feature></syntaxhighlight>
+
<syntaxhighlight lang="lua">rdf [v<room id>] <feature></syntaxhighlight>
  
This command removes a map feature from the room. If the map feature is
+
This command removes a map feature from the room. If the map feature is associated with a character mark and its set on the room, a random
associated with a character mark and its set on the room, a random
+
character mark from the other map features on the room is chosen to replace it. The room number to delete the feature from can be given with
character mark from the other map features on the room is chosen to
+
the optional argument (note: there is no space between the v and the ID).
replace it. The room number to delete the feature from can be given with
 
the optional argument (note: there is no space between the v and the
 
ID).
 
  
Example: <syntaxhighlight = "lua">rdf v123 A Nexus Point</syntaxhighlight> - removes the feature 'A Nexus Point'
+
Example: <syntaxhighlight lang="lua">rdf v123 A Nexus Point</syntaxhighlight>
from the room #123
+
: removes the feature 'A Nexus Point' from the room #123
  
 
=== Feature Delete ===
 
=== Feature Delete ===
Line 705: Line 681:
 
This command deletes a global map feature and removes it from all rooms.
 
This command deletes a global map feature and removes it from all rooms.
  
Example: <syntaxhighlight = "lua">feature delete A Nexus Point</syntaxhighlight> - removes the global feature
+
Example: <syntaxhighlight lang="lua">feature delete A Nexus Point</syntaxhighlight>
'A Nexus Point' and removes it from all rooms
+
: removes the global feature 'A Nexus Point' and removes it from all rooms
  
 
== Events ==
 
== Events ==
Line 763: Line 739:
 
= Examples =
 
= Examples =
  
<!-- Usage details. -->
+
== Prompt Pattern Matching ==
TODO
+
 
 +
Pattern matching (used with <code>map prompt</code> and also <code>map ignore</code> commands) uses [https://www.lua.org/pil/20.2.html Lua pattern matching] (as opposed to regex matching used in Aliases or Triggers).  While similar there are a few key differences, notably the use of percentage character (<code>%</code>).
 +
 
 +
'''Character Classes'''
 +
 
 +
. all characters
 +
%a letters
 +
%c control characters
 +
%d digits
 +
%l lower case letters
 +
%p punctuation characters
 +
%s space characters
 +
%u upper case letters
 +
%w alphanumeric characters
 +
%x hexadecimal digits
 +
%z the character with representation 0
 +
 
 +
'''Modifiers'''
 +
 
 +
+ 1 or more repetitions, as many times as possible
 +
* 0 or more repetitions, as many times as possible
 +
- also 0 or more repetitions, as few times as possible
 +
? optional (0 or 1 occurrence)
 +
 
 +
Therefore to match a basic prompt such as;
 +
 
 +
<123hp 456mana 789moves>
 +
 
 +
we would use this pattern
 +
 
 +
<%d+hp %d+mana %d+moves>
 +
 
 +
You can use a percentage character (<code>%</code>) to escape (ignore) certain special characters.  Special characters in Lua patterns are <code>( ) . % + - * ? [ ^ $</code>
 +
 
 +
Hp: 123(200) Mp: 456(500) Mv: 789(1000) Xp: 54321
 +
Hp: %d+%(%d+%) Mp: %d+%(%d+%) Mv: %d+%(%d+%) Xp: %d+$
 +
 
 +
{{note}} Watch for spaces at the end of your prompt, they can trick you up.
 +
 
 +
{{note}} ^ and $ can be used to match a start of a line, and the end of a line.
 +
 
 +
{{note}} You can test your patterns on the command line.  It will return matching patterns or nothing if no match is found.
 +
 
 +
lua string.match(aString, pattern)
 +
lua string.match("50%", "%d+%%")
 +
 
 +
More examples;
 +
 
 +
103/103HP | 113/121STA | 105/105ST | 115/115FO | Abid, late at night >
 +
%d+/%d+HP | %d+/%d+STA | %d+/%d+ST | %d+/%d+FO | .+ >
  
 
= Helpful Additions =
 
= Helpful Additions =
{generic_mapper_additions}
+
 
 +
Some helpful Mudleteers have provided some ways to modify generic_mapper for their games.  See [[Generic_Mapper_Additions|Generic Mapper Additions]] for more ideas.

Latest revision as of 11:47, 9 November 2024

Game non-mud specific
By Mudlet Community
Download none, included in Mudlet (source code available here)
Dependencies Mudlet 4.17 for full command availability

Description

This script allows for semi-automatic mapping using the included triggers. While different games can have dramatically different ways of displaying information, some effort has been put into giving the script a wide range of potential patterns to look for, so that it can work with minimal effort in many cases. The script locates the room name by searching up from the detected exits line until a prompt is found or it runs out of text to search, clearing saved text each time a prompt is detected or a movement command is sent, with the room name being set to the last line of text found. An accurate prompt pattern is necessary for this to work well, and sometimes other text can end up being shown between the prompt and the room name, or on the same line as the room name, which can be handled by providing appropriate patterns telling the script to ignore that text. Below is an overview of the included commands and important events that this script uses to work. Additional information on each command or event is available in individual help files.

Usage

Type map basics or map help in game to get started.

See also: Mudlet Forums

There are also some Youtube videos of getting started in the mapper.

Mudlet Generic Mapper Tutorial

Automapping in Mudlet

Commands

Map Save

map save

This command creates a copy of the current map and stores it in the profile folder as map.dat. This can be useful for creating a backup before adding new content, in case of problems, and as a way to share an entire map at once.

Map Load

map load <optional download address>

This command replaces the current map with the map stored as map.dat in the profile folder. Alternatively, if a download address is provided, a map is downloaded from that location and loaded to replace the current map. If no filename is given with the download address, the script tries to download map.dat. If a filename is given it MUST end with .dat.

Map Show

map show

This command shows a map window, as specified by the window configs set via the map window command. It isn't necessary to use this method to show a map window to use this script, any map window will work.

Map Export

map export <area name>

This command creates a file containing all the informatino about the named area and stores it in the profile folder, with a file name based on the area name. This file can then be imported, allowing for easy sharing of single map areas. The file name will be the name of the area in all lower case, with spaces replaced with underscores, and a .dat file extension.

Map Import

map import <area name>

This command imports a file from the profile folder with a name matching the name of the file, and uses it to create an area on the map. The area name used can be capitalized or not, and may have either spaces or underscores between words. The actual area name is stored within the file, and is not set by the area name used in this command.

Start Mapping

start mapping [area name]

This command instructs the script to add new content to the map when it is seen. When first used, an area name is mandatory, so that an area is created for new rooms to be placed in. If used with an area name while the map shows the character within a room on the map, that room will be moved to be in the named area, if it is not already in it. If used without an area name, the room is not moved, and mapping begins in the area the character is currently located in.

Stop Mapping

stop mapping

This command instructs the script to stop adding new content until mapping is resumed at a later time. The map will continue to perform other functions.

Find Prompt

find prompt

This command instructs the script to begin searching newly arriving text for something that matches one of its known prompt patterns. If one is found, that pattern will be set as the current prompt pattern. This should typically be the first command used to set up this script with a new profile. If your prompt appears after using this command, but there is no message saying that the prompt has been found, it will be necessary to use the map prompt command to manually set a pattern.

Map Prompt

map prompt <prompt pattern>

This command manually sets a prompt pattern for the script to use. Because of the way this script works, the prompt pattern should match the entire prompt, so that if the text matching the pattern were removed, the line with the prompt would be blank. The patterns must be of the type used by the Lua string library. If you are unsure about what pattern to use, seek assistance on the Mudlet Forums or the Mudlet Discord channel.

Map Debug

map debug

This command toggles the map script's debug mode on or off when it is used. Debug mode provides some extra messages to help with setting up the script and identifying problems to help with troubleshooting. If you are getting assistance with setting up this script, using debug mode may make the process faster and easier.

Map Ignore

map ignore <ignore pattern>

This command adds the given pattern to a list the script maintains to help it locate the room name. Any text that might appear after a command is sent to move and before the room name appears, or after the prompt and before the room name if several movement commands are sent at once, should have an ignore pattern added for it.

If the given pattern is already in the list of ignore patterns, that pattern will be removed from the list.

Example:

map ignore ^You are hungry%.$
to match exactly one line
map ignore ^The clock strikes %d+%.$
to match a number
map ignore ^You walk %a+%.$
to match a word, e.g. east

Move Method

map movemethod <movement word>

This command will add a movement method for the script to look for when moving between rooms. If your game has methods such as "walk north", "swim south" or similar, add "walk" or "swim" as necessary. For single room movement only.

If the given method is already in the list of movement methods, that method will be removed from the list.

Map Areas

map areas

This command displays a linked list of all areas in the map. When clicked, the rooms in the selected area will be displayed, as if the map rooms command had been used with that area as an argument.

Map Rooms

map rooms <area name>

This command shows a list of all rooms in the area, with the roomID and the room name, as well as a count of how many rooms are in the area total. Note that the area name argument is not case sensitive.

Set Area

set area <area name>

This command move the current room into the named area, creating the area if needed.

Map Mode

map mode <lazy, simple, normal, or complex>

This command changes the current mapping mode, which determines what happens when new rooms are added to the map.

  • In lazy mode, connecting exits aren't checked and a room is only added if there isn't an adjacent room with the same name.
  • In simple mode, if an adjacent room has an exit stub pointing toward the newly created room, and the new room has an exit in that direction, those stubs are connected in both directions.
  • In normal mode (default), the newly created room is connected to the room you left from, so long as it has an exit leading in that direction.
  • In complex mode, none of the exits of the newly connected room are connected automatically when it is created.

Add Door

add door <direction> [none|open|closed|locked] [yes|no]

This command places a door on the exit in the given direction, or removes it if "none" is given as the second argument. The door status is set as given by the second argument, default "closed". The third argument determines if the door is a one-way door, default "no".

Add Portal

add portal [-f] <entry command>

This command creates a special exit in the current room that is entered by using the given entry command. The given entry command is then sent, moving to the destination room. If the destination room matches an existing room, the special exit will link to that room, and if not a new room will be created. If the optional "-f" argument is given, a new room will be created for the destination regardless of if an existing room matches the room seen when arriving at the destination.

Shift

shift <direction>

This command moves the current room one step in the direction given, on the map.

Merge Rooms

merge rooms

This command combines all rooms that share the same coordinates and the same room name into a single room, with all of the exits preserved and combined.

Clear Moves

clear moves

This command clears the script's queue of movement commands, and is intended to be used after you attempt to move while mapping but the movement is prevented in some way that is not caught and handled by a trigger that raises the onMoveFail event.

Set Exit

set exit <direction> <destination roomID>

This command sets the exit in the current room in the given direction to connect to the target room, as specified by the roomID. This is a one-way connection.

Map Me

map me

This command forces the script to look at the currently captured room name and exits, and search for a potentially matching room, moving the map if applicable. Note that this command is generally never needed, as the script performs a similar search any time the room name and exits don't match expectations.

Map Path

map path <room name> [; area name]

This command tries to find a walking path from the current room to the named room. If an area name is given, only rooms within that area that is given are checked. Neither the room name nor the area name are case sensitive, but otherwise an exact match is required. Note that a semicolon is required between the room name and area name, if an area name is given, but spaces before or after the semicolon are optional.

Example:

map path main street ; newbie town

Map Character

map character <name>

This command tells the script what character is currently being used. Setting a character is optional, but recall locations and prompt patterns are stored by character name, so using this command allows for easy switching between different setups. The name given is stored in map.character. The name is a case sensitive exact match. The value of map.character is not saved between sessions, so this must be set again if needed each time the profile is opened.

Map Recall

map recall

This command tells the script that the current room is the recall point for the current character, as stored in map.character. This information is stored in map.save.recall[map.character], and is remembered between sessions.

Map Config

map config <setting> <optional value>

This command changes any of the available configurations listed below. If no value is given, and the setting is either 'on' or 'off', then the value is switched. When naming a setting, spaces can be used in place of underscores. Details of what options are available and what each one does are provided.

speedwalk_delay
when using the speedwalk function of the script, this is the amount of time the script waits after either sending a command or, if speedwalk_wait is set, after arriving in a new room, before the next command is sent. This may be any number 0 or higher.
speedwalk_wait
when using the speedwalk function of the script, this indicates if the script waits for your character to move into a new room before sending the next command. This may be true or false.
speedwalk_random
when using the speedwalk function of the script with a speedwalk_delay value, introduces a randomness to the wait time by adding some amount up to the speedwalk_delay value. This may be true or false.
stretch_map
when adding a new room that would overlap an existing room, if this is set the map will stretch out to prevent the overlap, with all rooms further in the direction moved getting pushed one further in that direction. This may be true or false.
max_search_distance
when mapping, this is the maximum number of rooms that the script will search in the movement direction for a matching room before deciding to create a new room. This may be false, or any positive whole number. This can also be set to 0, which is the same as setting it to false.
search_on_look
when this is set, using the "look" command causes the map to verify your position using the room name and exits seen following using the command. This may be true or false.
clear_lines_on_send
when this is set, any time a command is sent, any lines stored from the game used to search for the room name are cleared. This may be true or false.
mode
this is the default mapping mode on startup, and defines how new rooms are added to the map. May be "lazy", "simple", "normal" or "complex".
download_path
this is the path that updates are downloaded from. This may be any web address where the versions.lua and generic_mapper.xml files can be downloaded from.
prompt_test_patterns
this is a table of default patterns checked when using the "find prompt" command. The patterns in this table should start with a '^', and be written to be used with the Lua string library. Most importantly, '%' is used as the escape character instead of '\' as in trigger regex patterns.
custom_exits
this is a table of custom exit directions and their relevant extra pieces of info. Each entry should have the short direction as the keyword for a table containing first the long direction, then the long direction of the reverse of this direction, and then the x, y, and z change in map position corresponding to the movement. As an example: us = {'upsouth', 'downnorth', 0, -1, 1}
custom_name_search
when this is set, instead of running the default function name_search, a user-defined function called 'mudlet.custom_name_search' is used instead. This may be true or false.
use_translation
when this is set, the lang_dirs table is used to translate movement and status commands in some other language into the English used by the script. This may be true or false.
debug
when this is set, the script will start in debug mode. This may be true or false.

Map Window

map window <setting> <value>

This command changes any of the available configurations listed below, which determine the appearance and positioning of the map window when the 'map show' command is used. Details of what options are available and what each one does are provided.

x
this is the x position of the map window, and should be a positive number of pixels or a percentage of the screen width.
y
this is the y position of the map window, and should be a positive number of pixels or a percentage of the screen height.
w
this is the width of the map window, and should be a positive number of pixels or a percentage of the screen width.
h
this is the height of the map window, and should be a positive number of pixels or a percentage of the screen height.
origin
this is the corner from which the window position is measured, and may be 'topright', 'topleft', 'bottomright', or 'bottomleft'.
shown
this determines if the map window is shown immediately upon connecting to the game. This may be true or false. If you intend to have some other script control the map window, this should be set to false.

Map Translate

map translate <english direction> <translated long direction> <translated short direction>

This command sets direction translations for the script to use, either for commands entered to move around, or listed exits the game shows when you enter a room. Available directions: north, south, east, west, northwest, northeast, southwest, southeast, up, down, in, and out. Also you can customize special commands sent to mud like 'look'.

Map Basics (quick start guide)

Mudlet Mapper works in tandem with a script, and this generic mapper script needs to know 2 things to work: - <dim_grey>room name</syntaxhighlight> $ROOM_NAME_STATUS ($ROOM_NAME) - <dim_grey>exits</syntaxhighlight> $ROOM_EXITS_STATUS ($ROOM_EXITS)

1. <link: start mapping>start mapping <optional area name></link> If both room name and exits are good, you can start mapping! Give it the area name you're currently in, usually optional but required for the first one. 2. <link: find prompt>find prompt</link> Room name or exits aren't recognised? Try this command then. It will make the script start looking for a prompt using several standard prompt patterns. If a prompt is found, you will be notified, if not, you will need to set a prompt pattern yourself using <link: prompt>map prompt</link>. Reach out to the <urllink: https://discord.gg/kuYvMQ9>Mudlet community</urllink> for help, we'd be happy to help you figure it out! 3. <link: debug>map debug</link> This toggles debug mode. When on, messages will be displayed showing what information is captured and a few additional error messages that can help with getting the script fully compatible with your game. 4. <link: 1>map help</link> This will bring up a more detailed help file, starting with the available help topics.

Room Find

room find <room name>
rf <room name>

This command will search all rooms and return a list of matches.

Room Look

room look [roomID]
rl [roomID]

This command will display detailed information about the current room. Optionally a roomID can be provided.

Showpath

showpath <roomID>
showpath <fromID> <toID>

This command displays a path from your current room to the roomID specified. If two roomID's are specifed it will display a path from a remote room to another room.

Special Exits List

spe list [filter]

This command displays a list of all known special exits. You can alternatively provide an optional filter to return a list containing those words.

Example:

spe list worm warp

Feature List

feature list

This command displays a list of all map features created via feature create and the associated room characters.

Area Add

area add <area name>

This command will create a new area and automatically give it an ID.

Example:

area add My City
create a new area called My City

Area Delete

area delete <area name>

This command will delete the given area. If the area is really big (thousands of rooms), deleting it at once would take a really long while and freeze your Mudlet while doing so. To combat the unpleasant experience, the script breaks up area deletion into batches of rooms (100 by default). While this still heavily impacts Mudlets performance, it allows you to see a progress meter of how far it has gotten and gives you an ability to pause it at any time by doing 'cancel area deletion'.

Example:

area delete My City
delete an area called My City

Cancel Area Deletion

cancel area deletion

This comand will stop an area deletion that has started. This will NOT restore deleted rooms - it merely pauses the process, so you can resume it with 'area delete' later on. You can type this in while Mudlet is deleting an area - it'll take a short while for letters to show up, but they will eventually.

Area Rename

area rename <name>

This command will rename the current area you're in to the new name.

Example:

area rename My City
call the area you're in My City from now on

Arealock

arealock [filter]

This command displays a list of areas you can lock/unlock, you can also give it an area name to filter by. If an area is locked the mapper will not attempt to speedwalk or go through any of the rooms in the area.

Example:

arealock City

Room Coordinates

room coords [v<roomID>] <x> <y> <z>
rc [v<roomID>] <x> <y> <z>

This command will move a room to the new map coordinates. x,y and z will specify the new location of the room. The room ID is optional, it'll move the current room if you don't provide one.

Example:

rc nw
move the room to be nw of the current location
rc v34 w
move the room ID 34 west, note the letter 'v' in the command
rc 1 -5 10
move the current room to those exact coordinates
rc v12 8 3 -8
move the room #12 to 8x, 3y and -8z
rc 14x 5y
move the current room to be at 14x and 5y, but the same z-level you're on. You can include all three of x, y, z coordinates or only one as you wish

Room Delete

room delete <direction|roomID>
rld <direction|roomID>

This command will delete a room given a relative direction or roomID.

Example:

rld
current room, will delete the room you're currently in
rld n
relative direction, will delete the room that's north of you
rld 513
using roomID, will delete the room with ID 513

Room Weight

room weight [direction|roomID] <weight>
rw [direction|roomID] <weight>

This command updates the weight of a room, making it more or less desirable to travel through. Direction or roomID is optional and defaults to the current room.

Example:

rw 10
will set the room weight of the room you're standing in to 10
rw n 4
relative direction, will set the room weight of the room that's to the north of you to four
rw 2343 2
using roomID, will set the room weight of room 2343 to 2

Room Weight Exit

rwe [roomID] <weight> <exit>

This command updates the weight of a room exit, where weight is a positive number (default for exits is 0). Setting a higher weight will make the exit be less likely to be used. The exit can be a cardinal direction of either n,e,s,w,ne,se,sw,ne,up,down,in,out or the exact special exit text (including the script: part). This alias sets a weight one way only, so if you want to set it both ways, use it on the opposite side as well. Use 'rl' to check exit weights.

Example:

rwe 1 n
will set the weight of the exit north to 1
rwe 2434 0 e
will reset the exit weight of an east exit that leads out from the 2434 room

Room Link

room link [roomID] <direction> [one]
rlk [roomID] <direction> [one]

This command will link a room given a direction and optional roomID. You can also add 'one' at the end of the command to make it be a one-way link.

Example:

rlk n
relative direction, will link if exists a room to the north of this one to your current location
rlk 351 n
exact roomID and direction, will link the current room to room #351 via a north exit
rlk n one
will make an exit north one-way

Room Unlink

room unlink <direction>
urlk <direction>

Unlink a room given a direction. This function will unlink exits both ways, or one way if there is no incoming exit.

Example:

urlk nw
relative direction, will unlink to the northwest, and from the northwest room to the southeast

Room Door

rd [roomID] <direction> <open|closed|locked|clear>

Will create a door from the current room to a direction specified. Door status can be open or o, closed or c, locked or l, clear or gone. To delete a room, use clear or gone. Setting doors is one-way - to set two-way doors, use the alias from the opposite direction.


Example:

rd n
add a one-way door north from the current room
rd 23 w closed
add a closed door leading west in room 23
rd n clear
remove the door to the north from the current room on this side only

Room Character

rcc <character|clear> [roomID]

This command will assign a single character, letter or number to the current room, or an optional given room. Using clear will remove any characters.

Example:

rcc $
put the dollar sign in the current room (e.g. to indicate a shop or bank)
rcc C 234
put the letter C onto room 234
rcc clear
remove any letter from the current room

Special Exits

exit special <direction|roomID> <command>
spe <direction|roomID> <command>

This command will link two rooms via custom or special exit/script.

Example:

spe n push rock
relative direction, will go to the room that's north of you by doing 'push rock'
spe 125 pull lever
will go to room 125 from the current one by pulling a lever

You can also specify a script to do code for you, by starting the exit command with script.

Example:

spe 125 script: sendAll("pull lever", "enter gate")

Remote Special Exits

spev <fromID> <toID> <command>

This command will add a special exit between two remote rooms.

Example:

spe 125 560 push rock
will link room 125 to room 560 with the command 'push rock'

Clear Special Exits

exit special clear <direction|roomID>
spe clear <direction|roomID>

This command will clear all special exits from the current, relative or given roomID.

Example:

spe clear
delete all special exits in the room you're currently in
spe clear n
delete all special exits in the room that's north of you
spe clear 513
delete all special exits in room #513

Room Area

room area [v<roomID>] <area name|areaID>

This command moves the current room to another area or a given optional room.

Example:

room area My New Area
move the room you're in to 'My New Area'.
room area v123 My New Area
move room 123 to My New Area
room area 44
move the current room to the area ID 44

Room Label

room label [roomID] [fgColor] [bgColor] <message>

This command adds a label to the current or specified room. Foreground and background color are optional.

Example:

room label My Label
adds a 'My Label' label to the current room
room label 342 My Label
adds a label to room #342
room label green My Label
adds a green label with a transparent background to the current room
room label green black My Label
adds a label with a green foreground and black background to the current room
room label 34 green black My Label
adds a label with a green foreground and black background to room #34

Area Labels

area labels <area name>

This command displays all labels in a given area, with a link to delete.

Example:

area label My Area

Feature Create

feature create <feature> [char <room character>]

This command will create a new map feature for use on rooms. You can also optionally add a character mark to the feature, which will be set when a map feature is added to a room. Note: Map feature names are not allowed to contain numbers.

Example:

feature create A Nexus Point char N
creates a new feature 'A Nexus Point' with an assigned room character 'N'

Room Create Feature

room create feature [v<room id>] <feature>
rcf [v<room id>] <feature>

This command will add a created map feature to the room. If the map feature is associated with a character mark, it will be set on the room and existing marks get overwritten. The room number to add the feature to can be given with the optional argument (note: there is no space between the v and the ID).

Example:

rcf A Nexus Point
add the feature 'A Nexus Point' to the current room
rcf v123 A Nexus Point
add the feature 'A Nexus Point' to room #123

Room Delete Feature

room delete feature [v<room id>] <feature>
rdf [v<room id>] <feature>

This command removes a map feature from the room. If the map feature is associated with a character mark and its set on the room, a random character mark from the other map features on the room is chosen to replace it. The room number to delete the feature from can be given with the optional argument (note: there is no space between the v and the ID).

Example:

rdf v123 A Nexus Point
removes the feature 'A Nexus Point' from the room #123

Feature Delete

feature delete <feature>

This command deletes a global map feature and removes it from all rooms.

Example:

feature delete A Nexus Point
removes the global feature 'A Nexus Point' and removes it from all rooms

Events

onNewRoom Event

This event is raised to inform the script that a room has been detected. When raised, a string containing the exits from the detected room should be passed as a second argument to the raiseEvent function, unless those exits have previously been stored in map.prompt.exits.

onMoveFail Event

This event is raised to inform the script that a move was attempted but the character was unable to move in the given direction, causing that movement command to be removed from the script's movement queue.

onForcedMove Event

This event is raised to inform the script that the character moved in a specified direction without a command being entered. When raised, a string containing the movement direction must be passed as a second argument to the raiseEvent function.

The most common reason for this event to be raised is when a character is following someone else.

onRandomMove Event

This event is raised to inform the script that the character has moved in an unknown direction. The script will compare the next room seen with rooms that are adjacent to the current room to try to determine the best match for where the character has gone.

In some situations, multiple options are equally viable, so mistakes may result. The script will automatically keep verifying positioning with each step, and automatically correct the shown location on the map when possible.

onVisionFail Event

This event is raised to inform the script that some or all of the room information was not able to be gathered, but the character still successfully moved between rooms in the intended direction.

onPrompt Event

This event can be raised when using a non-conventional setup to trigger waiting messages from the script to be displayed. Additionally, if map.prompt.exits exists and isn't simply an empty string, raising this event will cause the onNewRoom event to be raised as well. This functionality is intended to allow people who have used the older version of this script to use this script instead, without having to modify the triggers they created for it.

Examples

Prompt Pattern Matching

Pattern matching (used with map prompt and also map ignore commands) uses Lua pattern matching (as opposed to regex matching used in Aliases or Triggers). While similar there are a few key differences, notably the use of percentage character (%).

Character Classes

.	all characters
%a	letters
%c	control characters
%d	digits
%l	lower case letters
%p	punctuation characters
%s	space characters
%u	upper case letters
%w	alphanumeric characters
%x	hexadecimal digits
%z	the character with representation 0

Modifiers

+	1 or more repetitions, as many times as possible
*	0 or more repetitions, as many times as possible
-	also 0 or more repetitions, as few times as possible
?	optional (0 or 1 occurrence)

Therefore to match a basic prompt such as;

<123hp 456mana 789moves>

we would use this pattern

<%d+hp %d+mana %d+moves>

You can use a percentage character (%) to escape (ignore) certain special characters. Special characters in Lua patterns are ( ) . % + - * ? [ ^ $

Hp: 123(200) Mp: 456(500) Mv: 789(1000) Xp: 54321
Hp: %d+%(%d+%) Mp: %d+%(%d+%) Mv: %d+%(%d+%) Xp: %d+$

Note Note: Watch for spaces at the end of your prompt, they can trick you up.

Note Note: ^ and $ can be used to match a start of a line, and the end of a line.

Note Note: You can test your patterns on the command line. It will return matching patterns or nothing if no match is found.

lua string.match(aString, pattern)
lua string.match("50%", "%d+%%")

More examples;

103/103HP | 113/121STA | 105/105ST | 115/115FO | Abid, late at night >
%d+/%d+HP | %d+/%d+STA | %d+/%d+ST | %d+/%d+FO | .+ >

Helpful Additions

Some helpful Mudleteers have provided some ways to modify generic_mapper for their games. See Generic Mapper Additions for more ideas.