You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem? mapper area (text) was bothering me when it would tell me it didn't know about a room that was clearly in the db (since it showed up on the map... I looked through and understand that it's only going to tell about rooms that it can find a path to within the specified search depth. That's ok, but since sometimes you have a room name and not area (eg - in GQs) I wanted something to tell me the room vnum and area. Please provide any additional information below. This is my solution for that:
In the documentation:
mapper list --> list known rooms (with id, area) that match
In the Aliases:
<alias
match="^mapper list ([\w* %d/"]+)$"
enabled="y"
sequence="100"
script="map_list"
regexp="y"
In the functions:
-- map_list function by Spartacus
function map_list (name, line, wildcards)
-- ok, so if I want to lookup a room in my db, I don't want it only if the mapper can find a sw in a certain # of rooms.
-- if it is in the db, I want its vnum and area, so that I can figure out how to get there if the mapper does not know.
local rooms = {}
local count = 0
local line = ""
local area = ""
-- find matching rooms using FTS3
for row in db:nrows(string.format ("SELECT uid, name FROM rooms_lookup WHERE rooms_lookup MATCH %s", fixsql (wildcards [1]))) do
rooms [row.uid] = true
count = count + 1
for a in db:nrows(string.format ("SELECT area FROM rooms WHERE uid = '%s'", row.uid)) do
area = a.area
end -- for
line = string.format("(%s) %s is in area "%s"",row.uid, row.name, area)
print (line)
end -- finding room
print(count .. " rooms matched "" .. wildcards [1] .. """)
end -- map_list
I also added the print count line to map_area and map_find
From musidan@gmail.com on December 22, 2010 13:58:48
What steps will reproduce the problem? mapper area (text) was bothering me when it would tell me it didn't know about a room that was clearly in the db (since it showed up on the map... I looked through and understand that it's only going to tell about rooms that it can find a path to within the specified search depth. That's ok, but since sometimes you have a room name and not area (eg - in GQs) I wanted something to tell me the room vnum and area. Please provide any additional information below. This is my solution for that:
In the documentation:
mapper list --> list known rooms (with id, area) that match
In the Aliases:
<alias
match="^mapper list ([\w* %d/"]+)$"
enabled="y"
sequence="100"
script="map_list"
regexp="y"
In the functions:
-- map_list function by Spartacus
function map_list (name, line, wildcards)
-- ok, so if I want to lookup a room in my db, I don't want it only if the mapper can find a sw in a certain # of rooms.
-- if it is in the db, I want its vnum and area, so that I can figure out how to get there if the mapper does not know.
local rooms = {}
local count = 0
local line = ""
local area = ""
-- find matching rooms using FTS3
for row in db:nrows(string.format ("SELECT uid, name FROM rooms_lookup WHERE rooms_lookup MATCH %s", fixsql (wildcards [1]))) do
rooms [row.uid] = true
count = count + 1
for a in db:nrows(string.format ("SELECT area FROM rooms WHERE uid = '%s'", row.uid)) do
area = a.area
end -- for
line = string.format("(%s) %s is in area "%s"",row.uid, row.name, area)
print (line)
end -- finding room
print(count .. " rooms matched "" .. wildcards [1] .. """)
end -- map_list
I also added the print count line to map_area and map_find
Original issue: http://code.google.com/p/aardwolfclientpackage/issues/detail?id=30
The text was updated successfully, but these errors were encountered: