Wiki Links (Link to Wiki in Pop Ups)

Short Story Time (tldr; skip to large font):

I've been slowly trying to ween myself off grease monkey. Partially because I don't want to always be tied to Firefox and partially because mafia seems to overlap most of my old GM scripts (and mafia does it better).

Right now the only two GM scripts I'm still using are Mr. Script and the DrEvi1's Raid Log. While I have a special place in my heart for Mr. Script, I'm attempting to live without. I started by remaking the topmenu links (then I found the thread where someone else did that). But the smallest item I could not live without. Wiki Links.

Wiki Links
It's very basic. It just replaces the name of the item in the pop up to a link to the wiki.

This works on 4 of the pop up windows. Items, Effects, Skills, Familiars.

Here's an example:
wiki-link.png

Here's the link:
View attachment WikiLinks1.0.zip

Directions:
Just unzip the contents to the KoLmafia \Relay directory.
 

Theraze

Active member
How does this compare to the "Check Wiki for item descriptions" preference in the Browser tab?
 
Check Wiki for item descriptions brings your directly to the wiki when clicking on the item icon. Where my overlay still opens the normal kol popup description, yet gives you a link to see that item in the wiki if you choose.
 

Theraze

Active member
So, basically it's a "lookup <name>" which makes sense. Would seem to sort of make sense to either recode the current preference to work that way, or alternatively have that (the lookup available through clicking on the name) be the default and the preference just skips the official description page...

Also, from a quick check, seems like the lookup command may only work (properly) on items and effects... that familiars and skills, if you run a lookup, will give you a search page instead, which will likely have the right entry in it, but...

Edit: From looking at the way things work, may be able to add in FamiliarDatabase and SkillDatabase to the lookup command... not sure if there's anything else we want to bypass searching the wiki on. Also, not sure which order we'd want to put those in... Familiar/Skill/Item/Effect? Item/Effect/Skill/Familiar? Just depends on what you're most likely to be wanting info on when you do a manual lookup... If we do change defaults in any way, it'd work based on that specific database first, before shunting off into the search.
 
Last edited:

Bale

Minion
This is wonderful! I adore it!

Theraze, I support your interest in making a patch for this. It's just too sweet not to be part of mafia.
 

Theraze

Active member
I'll look into making a patch for that tonight and then I'll toss it into the Bug/Feature forum.

Do we want to add in more types to the "lookup" command? Currently it searches the effects database, searches the items database, and then throws your lookup string into the KoLwiki search. We could put familiars and/or skills into that list as well, if someone wants to give me an order for which groupings we want lookup to work on.

Alternatively, though not necessarily exclusively one way or the other, we could tweak things slightly and make a few more commands... ilookup, elookup, slookup, flookup... or put the letter at the end. But basically make commands that just check in a specific database and then kicks over to the wiki search after, so that if you're looking for a specific effect, you won't accidentally get shunted over to items or skills, even if one has the same name. If KoLmafia can't figure out what you're looking for in its database, it'll still redirect... but it won't do it without first failing its lookup.

An alternate way to do that lookup command thing might be to allow for doing lookup item (or items) <name of item>, lookup effect(s) <name of effect>, etc. The problem with this is that if the wily people at KoL ever release an item item or something like that, it'll look rather silly doing the lookup. :) However, if we allow for that, all it would need would be a check at the top of the "run" for WikiLookupCommand to check if the first word in parameters is "item", "items", "effect", "effects", etc. If so, can just set an int for which database to use... if nothing is set, use all. If something is set, just use that database. Easy.

Thinking things through, unless people have objections, I think I'll code that functionality into lookup... that you can specify which database you'd want to check. If people can give me a priority of which order to put the additional databases in, I'll add them to the normal lookup in that order. Otherwise, if you want to lookup skills or familiars, you have to specify that's what you're looking for. I'll try to spin two patches tonight: one for the pop-up window wiki links and one for the lookup command.
 

fronobulax

Developer
Staff member
So, basically it's a "lookup <name>" which makes sense. Would seem to sort of make sense to either recode the current preference to work that way, or alternatively have that (the lookup available through clicking on the name) be the default and the preference just skips the official description page...
I have a vague recollection that in the olden days when mafia versions were less than 10, something very much like that was in place. It was undone. The issues as I recall were: mafia did not handle the case where a new item was in game but not on the wiki very well; there were problems if an item had a special or escaped character in the name; people complained because they could not see the game text; and performance was notably worse for the folks on slow connections.

I'm not sure how many of these issues are still of concern today. I think mafia has solved the special characters problem in order to support the existing look at the wiki functionality. The performance issues will always be with us. People can see the game text on the wiki page. Finally, the wiki is actually getting updated faster than mafia.
 

Theraze

Active member
Well, if I can get the description parser to handle things properly for different types, I may go ahead with trying to put something together. It shouldn't actually slow anyone down, as all it does is pop a link to the Wiki generated off of the name, as is correct for the item... So for familiars, for example, each word is capitalized before the spaces are converted to underscores. The problem is that as it currently stands, it appears to actually parse everything using the same "test" function (in session/ConsequenceManager), making it difficult to figure out exceptions and actually make things work properly... As well, ICF's relay overrides include the desc_familiar, while that page is never specifically mentioned in the KoLmafia code, probably because with the way the system is written, I don't think there's actually a spot in-client to launch the description for the familiars...

Bottom line, making this automatic shouldn't slow anyone down, because it's not actually loading the pages it's just putting a link, generated on their client, onto the page. Same as ICF's work, but back-end.
Problem currently is deciding if "test" in session/ConsequenceManager or externalUpdate in StaticEntity (the location that eventually calls ConsequenceManager) or something earlier is what's needed to be poked. :)
 

fronobulax

Developer
Staff member
Bottom line, making this automatic shouldn't slow anyone down, because it's not actually loading the pages it's just putting a link, generated on their client, onto the page.
Since I wasn't clear, the previous laundry list of concerns applied to replacing the KoL page with the Wiki page when the description page was requested. Just adding a link to the KoL page is my preferred solution since it is an Opt In kind of thing (just don't press the link) and won't change anything significant for users who don't care.
 

Theraze

Active member
Ah... so those refer to making the current "relayAddsWikiLinks" preference the default? Makes sense... Yeah, I prefer to see the game description normally, but wiki more convenient wouldn't be a bad thing. :)
 

atrak

New member
Is there anyway to make the normal kol info a tooltip on mouseover? then when you click send you to the wiki?

I have this functionality in a greasemonkey script (can't remember which one right now) and its a preferable to having to close little windows all the time, saves a lot of time.
 

Bale

Minion
I remember that one from when I used Firefox and greasemonkey to play KoL! That was really neat. You are welcome to open a feature request. Make sure you describe it properly in your feature request. I'd recommend using a screenshot.
 
Top