searchRoomExact() ?

Post Reply
visionok
Posts: 22
Joined: Thu Mar 04, 2021 8:50 am

searchRoomExact() ?

Post by visionok »

Has searchRoomExact() been implemented yet? I'm using v4.11.1, when I enter the following in command line
lua searchRoomExact("Entrance")
I get an error:
[ERROR:] object:<run lua code> function:<Alias4>
<[string "return searchRoomExact("Entrance")"]:1: attempt to call global 'searchRoomExact'
(a nil value)>

searchRoom() works, but it's not as useful because I only want an exact match.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: searchRoomExact() ?

Post by Vadi »

Mm no, someone added it to the documentation by accident whereas the function really came from another script - https://wiki.mudlet.org/w/IRE_mapping_s ... hRoomExact.

That said this is an obvious signal that such a function is desired ;)

Could you help take the function from the script here http://ire-mudlet-mapping.github.io/ire ... mapper.xml and add it to https://github.com/Mudlet/Mudlet/blob/d ... /Other.lua as a utility function? Then the next Mudlet update will have it.

visionok
Posts: 22
Joined: Thu Mar 04, 2021 8:50 am

Re: searchRoomExact() ?

Post by visionok »

I'm really not sure how to do what you asked, although it is something that I ought to learn.

It explains why the package I'm using Aardwolf Mudlet Module had code that used searchRoomExact() commented out.

In the meantime I have resolved this problem by using the database - I have already made a database of all the rooms. I use this to display a list of rooms in the area which can be clicked on to go to that room - so since I have a database of rooms I just do a query for an exact match.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: searchRoomExact() ?

Post by Vadi »

Fair enough, glad you got it sorted!

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: searchRoomExact() ?

Post by Vadi »

We missed this - but searchRoom accepts a flag for an exact match: https://wiki.mudlet.org/w/Manual:Lua_Fu ... searchRoom

visionok
Posts: 22
Joined: Thu Mar 04, 2021 8:50 am

Re: searchRoomExact() ?

Post by visionok »

Great, thanks!

One thing I've been meaning to ask about the documentation is that quite a bit of the content is duplicated across different pages. Eg the mapper functions are listed in:

https://wiki.mudlet.org/w/Manual:Lua_Functions
https://wiki.mudlet.org/w/Manual:Mapper_Functions

(and maybe elsewhere as well), are these kept in sync automatically?

So I went into the code to add those two flags (setting both to true), it turns out that in some places it was already using those flags, so it seems @jieiku knew about this "undocumented" feature :)

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: searchRoomExact() ?

Post by Vadi »

Yep, it is kept in sync automatically.

Post Reply