google-code-export / aardwolfclientpackage

Automatically exported from code.google.com/p/aardwolfclientpackage
0 stars 0 forks source link

Mapper cexits filter - thisroom #188

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Your username on Aardwolf so I can contact you if more information is
necessary?
Mendaloth

What operating system are you using?
Windows XP

I often find myself in a room with cexits and wondering if I have it in my 
database.  I realize I could just readd it, and it won't create a duplicate, 
but I'd prefer to just have way to check quickly.  "mapper cexits here" is a 
long list for many areas and hard to narrow it down to the one room you are in.

I've added this to my local copy and it has been working for the short time 
I've been using it.

Here is the code I used:

<code language="lua">
local current_room = gmcpval("num")

   area = Trim(wildcards [1] or "")
   query = string.format("select uid, name, area, dir, touid from rooms inner join exits on rooms.uid = fromuid where lower(area) like %s and dir not in ('n','s','e','w','d','u') and fromuid not in ('*','**') order by area, uid", fixsql("%" .. area .. "%"))

   if area == "" then
      intro = "The following rooms have custom exits:"
   else
      if area == "here" then
         area = current_area
         query = string.format("select uid, name, area, dir, touid from rooms inner join exits on rooms.uid = fromuid where lower(area) is %s and dir not in ('n','s','e','w','d','u') and fromuid not in ('*','**') order by area, uid", fixsql(area))
         intro = "The following rooms in the current area have custom exits:"
      elseif area == "thisroom" then
         area = current_area
         query = string.format("select uid, name, area, dir, touid from rooms inner join exits on rooms.uid = fromuid where fromuid=%s and dir not in ('n','s','e','w','d','u') and fromuid not in ('*','**') order by area, uid", current_room, fixsql(area))
         intro = "The following custom exits are in this room:"
      else
         intro = string.format("The following rooms in areas partially matching '%s' have custom exits:",area)
      end
   end

</code>

Original issue reported on code.google.com by mendal...@gmail.com on 22 Nov 2012 at 10:06

GoogleCodeExporter commented 9 years ago
And just noticed didn't need the area = current_area....

Original comment by mendal...@gmail.com on 22 Nov 2012 at 10:07

GoogleCodeExporter commented 9 years ago
And just noticed info is available in mapper thisroom command, but still think 
this is useful addition.  Not much added code, I like the output of the cexits 
command better, and shows only the info I'm looking for.

Original comment by mendal...@gmail.com on 23 Nov 2012 at 3:07

GoogleCodeExporter commented 9 years ago

Original comment by Fiendi...@gmail.com on 5 Dec 2012 at 2:27