Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mapper list #30

Closed
fiendish opened this issue Feb 14, 2014 · 1 comment
Closed

mapper list #30

fiendish opened this issue Feb 14, 2014 · 1 comment

Comments

@fiendish
Copy link
Owner

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

@fiendish
Copy link
Owner Author

From Fiendi...@gmail.com on December 27, 2010 00:16:19

added in r259

Status: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant