note, I only set up a set of aliases for n, s, e, and w; I figured I'd set the others up once I had the basics working.
Part 1
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<muclient>
<plugin
name="Two_Towers_Mapper_modified"
author="original: Nick Gammon, modifications: Merritt"
id="565a2ddd934aca9913894ad4"
language="Lua"
purpose="Mapper for SWmud"
save_state="y"
date_written="2010-08-30"
requires="4.51"
version="1.1"
>
</plugin>
<!-- Triggers -->
<triggers>
<trigger
enabled="n"
lines_to_match="10"
group="Mapper_Triggers"
keep_evaluating="y"
match="^(?P<roomdesc>\S.*\n(.*\n)*)(The only|There are .*) obvious exit(s:| is) (?P<exits>.*)\.\Z"
multi_line="y"
regexp="y"
script="process_room_description"
sequence="100"
>
</trigger>
<trigger
enabled="n"
group="Mapper_Triggers"
keep_evaluating="y"
match="(The only|There are .*) obvious exit(s:| is)"
regexp="y"
send_to="12"
sequence="200"
>
<send>
EnableTriggerGroup ("Mapper_Triggers", false)
Note ("Mapper_Triggers disabled")
</send>
</trigger>
</triggers>
<aliases>
<alias
match="^mapper find ([\w* %d/"]+)$"
enabled="y"
sequence="100"
script="map_find"
regexp="y"
>
</alias>
<alias
match="^n$"
enabled="y"
send_to="12"
sequence="100"
regexp="y"
>
<send>
EnableTriggerGroup ("Mapper_Triggers", true)
Note ("Mapper_Triggers enabled")
Send("n")
</send>
</alias>
<alias
match="^s$"
enabled="y"
send_to="12"
sequence="100"
regexp="y"
>
<send>
EnableTriggerGroup ("Mapper_Triggers", true)
Note ("Mapper_Triggers enabled")
Send("s")
</send>
</alias>
<alias
match="^e$"
enabled="y"
send_to="12"
sequence="100"
regexp="y"
>
<send>
EnableTriggerGroup ("Mapper_Triggers", true)
Note ("Mapper_Triggers enabled")
Send("e")
</send>
</alias>
<alias
match="^w$"
enabled="y"
send_to="12"
sequence="100"
regexp="y"
>
<send>
EnableTriggerGroup ("Mapper_Triggers", true)
Note ("Mapper_Triggers enabled")
Send("w")
</send>
</alias>
</aliases>
<!-- Script -->
<script>
<![CDATA[
local MAX_NAME_LENGTH = 60
local MUD_NAME = "SWmud"
require "mapper"
require "serialize"
require "copytable"
require "commas"
default_config = {
-- assorted colours
BACKGROUND_COLOUR = { name = "Background", colour = ColourNameToRGB "lightseagreen", },
ROOM_COLOUR = { name = "Room", colour = ColourNameToRGB "cyan", },
EXIT_COLOUR = { name = "Exit", colour = ColourNameToRGB "darkgreen", },
EXIT_COLOUR_UP_DOWN = { name = "Exit up/down", colour = ColourNameToRGB "darkmagenta", },
EXIT_COLOUR_IN_OUT = { name = "Exit in/out", colour = ColourNameToRGB "#3775E8", },
OUR_ROOM_COLOUR = { name = "Our room", colour = ColourNameToRGB "black", },
UNKNOWN_ROOM_COLOUR = { name = "Unknown room", colour = ColourNameToRGB "#00CACA", },
DIFFERENT_AREA_COLOUR = { name = "Another area", colour = ColourNameToRGB "#009393", },
MAPPER_NOTE_COLOUR = { name = "Messages", colour = ColourNameToRGB "lightgreen" },
ROOM_NAME_TEXT = { name = "Room name text", colour = ColourNameToRGB "#BEF3F1", },
ROOM_NAME_FILL = { name = "Room name fill", colour = ColourNameToRGB "#105653", },
ROOM_NAME_BORDER = { name = "Room name box", colour = ColourNameToRGB "black", },
AREA_NAME_TEXT = { name = "Area name text", colour = ColourNameToRGB "#BEF3F1",},
AREA_NAME_FILL = { name = "Area name fill", colour = ColourNameToRGB "#105653", },
AREA_NAME_BORDER = { name = "Area name box", colour = ColourNameToRGB "black", },
FONT = { name = get_preferred_font {"Dina", "Lucida Console", "Fixedsys", "Courier", "Sylfaen",} ,
size = 8
} ,
-- size of map window
WINDOW = { width = 400, height = 400 },
-- how far from where we are standing to draw (rooms)
SCAN = { depth = 30 },
-- speedwalk delay
DELAY = { time = 0.3 },
-- how many seconds to show "recent visit" lines (default 3 minutes)
LAST_VISIT_TIME = { time = 60 * 3 },
}
rooms = {}
valid_direction = {
n = "n",
s = "s",
e = "e",
w = "w",
u = "u",
d = "d",
ne = "ne",
sw = "sw",
nw = "nw",
se = "se",
north = "n",
south = "s",
east = "e",
west = "w",
up = "u",
down = "d",
northeast = "ne",
northwest = "nw",
southeast = "se",
southwest = "sw",
['in'] = "in",
out = "out",
} -- end of valid_direction
|