It looks like I should have re-read the first posts in this thread first. :)
The “kxwt_” messages make mapping much more reliable. You need to turn it on:
set kxwt on
Then the kxwt messages (which are omitted from output) give you a vnum and room description.
Then use the triggers below, instead of the ones in my previous post.
See http://www.gammon.com.au/pasting for how to copy from below and paste into your world file.
<triggers>
<!-- kxwt messages -->
<trigger
custom_colour="2"
enabled="y"
match="^kxwt_([a-zA-Z]+)( .*)?$"
omit_from_output="y"
regexp="y"
send_to="12"
sequence="1"
>
<send>
local command = "%1"
local params = Trim ("%2")
function callmap (...)
check (CallPlugin ("99c74b2685e425d3b6ed6a7d", unpack ({ ... }) ))
end -- callmap
-- vnum
if command == "rvnum" then
vnum = string.match (params, "^(%d+)") -- not local, save for later
if vnum then
callmap ("deduce_line_type", "description") -- start deducing descriptions
callmap ("deduce_line_type", "room_name") -- start deducing room names
end
return
-- room short description
elseif command == "rshort" then
callmap ("set_line_type_contents", "room_name", params)
return
-- area name
elseif command == "area" then
local areanumber, areaname = string.match (params, "^(%d+) (.*)$")
if areanumber and vnum and areaname then
callmap ("set_area_name", areaname)
-- UID is unique if you use the area number and the room number
callmap ("set_uid", areanumber .. "/" .. vnum) -- see: http://www.gammon.com.au/forum/?id=14420
end -- if
return
end -- if
</send>
</trigger>
<!-- Room names -->
<trigger
back_colour="8"
bold="y"
enabled="y"
keep_evaluating="y"
match="*"
match_back_colour="y"
match_bold="y"
match_inverse="y"
match_italic="y"
match_text_colour="y"
send_to="12"
sequence="100"
text_colour="15"
>
<send> function callmap (...)
check (CallPlugin ("99c74b2685e425d3b6ed6a7d", unpack ({ ... }) ))
end -- callmap
callmap ("set_line_type", "room_name") -- this is a room name
callmap ("do_not_deduce_line_type", "room_name") -- so don't try to deduce them
callmap ("deduce_line_type", "description") -- start deducing descriptions
</send>
</trigger>
<!-- Prompts -->
<trigger
enabled="y"
match="<*>*"
send_to="12"
sequence="100"
>
<send>
function callmap (...)
check (CallPlugin ("99c74b2685e425d3b6ed6a7d", unpack ({ ... }) ))
end -- callmap
callmap ("set_line_type", "prompt") -- this is a prompt
callmap ("do_not_deduce_line_type", "prompt") -- so don't deduce prompts
callmap ("do_not_deduce_line_type", "description") -- descriptions follow room names
</send>
</trigger>
<!-- Exits -->
<trigger
enabled="y"
match="[Exits: *]"
match_bold="y"
match_inverse="y"
match_italic="y"
match_text_colour="y"
send_to="12"
sequence="100"
text_colour="15"
>
<send>
function callmap (...)
check (CallPlugin ("99c74b2685e425d3b6ed6a7d", unpack ({ ... }) ))
end -- callmap
callmap ("set_line_type", "exits", "%1")
callmap ("do_not_deduce_line_type", "exits")
callmap ("do_not_deduce_line_type", "description")
</send>
</trigger>
</triggers>
|