Page 1 of 1

searchRoomExact() ?

Posted: Fri Mar 26, 2021 3:44 pm
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.

Re: searchRoomExact() ?

Posted: Sun Mar 28, 2021 6:12 am
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.

Re: searchRoomExact() ?

Posted: Mon Mar 29, 2021 11:40 am
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.

Re: searchRoomExact() ?

Posted: Mon Mar 29, 2021 12:40 pm
by Vadi
Fair enough, glad you got it sorted!

Re: searchRoomExact() ?

Posted: Thu Apr 01, 2021 5:24 am
by Vadi
We missed this - but searchRoom accepts a flag for an exact match: https://wiki.mudlet.org/w/Manual:Lua_Fu ... searchRoom

Re: searchRoomExact() ?

Posted: Thu Apr 01, 2021 8:39 pm
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 :)

Re: searchRoomExact() ?

Posted: Thu Apr 01, 2021 9:14 pm
by Vadi
Yep, it is kept in sync automatically.