Theraze
Active member
Was some pondering happening on the Relay board and I thought I might put together a patch that allows for doing a lookup for a specific type of item. This may not always pull up the right item in case of familiars with same-named monsters, the Black Cat in particular being the one I tried, but even if it fails in that way, the pages have a redirect to the proper familiar page. Worst case, if you try to do a lookup that's obviously wrong, like "lookup effect o.a.f." it will just do a regular search, as it would have before. However, "lookup item o.a.f." gives you the familiar item, while "lookup familiar o.a.f." does now give you the familiar itself. This change only catches the lookup command if the first word is one of the following: effect, effects, familiar, familiars, item, items, skill, skills. If the first word is anything else, it just passes the lookup through normally. As well, it currently doesn't add the familiar or skill database to normal searches, only using them if they're requested especially.
I used ifs because the category names were different lengths, and I didn't necessarily want to break off the first word if it wasn't actually a category search. startsWith let me match a variable length string, and all I needed to know for that was the string I was matching and what it was matching against. After I matched the specific string, I then removed that string (and its trailing space) from the parameters, and passed the trimmed string to the search.
Edit: As an additional change, to add in searching through the familiar and skill databases, all that needs to be added is to put
into the beginning of their checks, before the current
sections. I left those out for now from the default search, because that wasn't existing functionality, and I wasn't sure about primacy... which order people wanted them in.
Edit: This version is not what you actually want. The better version that actually will do Familiar lookups is below... Pulling this download after 3 looks.
I used ifs because the category names were different lengths, and I didn't necessarily want to break off the first word if it wasn't actually a category search. startsWith let me match a variable length string, and all I needed to know for that was the string I was matching and what it was matching against. After I matched the specific string, I then removed that string (and its trailing space) from the parameters, and passed the trimmed string to the search.
Edit: As an additional change, to add in searching through the familiar and skill databases, all that needs to be added is to put
Code:
lookuptype == 0 ||
Code:
lookuptype == 2 (or 4)
Edit: This version is not what you actually want. The better version that actually will do Familiar lookups is below... Pulling this download after 3 looks.

Last edited: