Fizzwidget Linkerator

Have you ever wanted to tell your friends about some impressive loot you saw another adventurer using? Share your regret about the quest reward you foolishly didn't choose? Spread word to your guild of what your raiding party found? Now you can do so easily with my latest gizmo! Not only does it help you keep track of all the items you encounter, Linkerator makes it super-easy to tell your friends about them in full detail!

Features:

Automatically remembers item links you come across (some of which you might not even see!)... in chat channels, in your inventory and bank, on other players, in loot messages, etc. (Unlike some addons which do this, Linkerator doesn't keep a database of full names for all items; for most items, it just makes sure your WoW client caches the data.)

Allows you to insert an item link in chat by merely typing its name in brackets. (i.e., type `/g [swift razzashi raptor]` to send a message to your guild with a clickable link for the mount they likely won't see often.)

Since there are some cases of different items which have the same name, you can type the name followed by something distinctive about the item in parentheses (e.g. `[punctured voodoo doll (druid)]` or `[warblade of the hakkari (off)]`) if you're looking for a specific match -- you can use any item attribute that shows up in that item's tooltip. (This only works if the variant you're looking for is in your WoW client's cache, however.) Alternately, if you know the item ID of a specific item, you can type it in brackets (preceded by a pound sign) to link it (e.g. `[#18473]` to get the Hunter variant of [Royal Seal of Eldre'thalas]).

Note: I created Linkerator as a replacement for LootLink/ItemsMatrix/KC_Items/etc. for myself because I never used the features of such addons that allow you to search for items based on their attributes. (So, keeping those addons installed meant I was using up a lot of memory with data I'd never search.) The only think Linkerator does that other link-database addons generally don't is allow you to type out links in chat... given that I donĚt use other link-database addons, I'm not particularly interested in adding this feature to them -- bug their authors if you want to use those addons and get the link-typing feature. They're welcome to borrow my code for it.

v. 3.1 - 2009/04/18
- Updated TOC to indicate compatibility with WoW Patch 3.1.
- Linkerator now avoids performing CPU-intensive link searches on text sent to chat by macros or other addons if the text in brackets is only a number (e.g. `Hateful Strike --> Grunkk [23423]`). To "linkify" by item ID number in a macro, use the format `[item:43593]` or `[#43593]`.
- We also no longer attempt to "linkify" text sent to custom chat channels (such as the hidden channels used by some other addons).
- Fixed an issue where Linkerator would sometimes fail to avoid "linkifying" text in certain chat commands (e.g. `/script`) as intended.

v. 3.0 - 2008/10/14
- Updated for compatibility with WoW Patch 3.0 and Wrath of the Lich King.
- It's now possible to retrieve item links given a known item ID (using `/link <number>`) even if the item is not in your client's local cache. Items unknown by the server will return no results.
- Includes preliminary support for spell links -- they're now returned in `/link` search results but not for as-you-type linking. More spell, talent, quest, and achievement link features will follow in future releases.

Replacing ChatFrameEditBox with ChatFrame1EditBox will only fix it if you're on the General (or whatever happens to be your first) chat tab. If you're on a custom tab there will be no error, but it won't autocomplete your links. I've coded a fix that restores it to its 3.3.3 level of function and am waiting on the go ahead from Gazmik before posting it anywhere.

Originally posted by Hirsute Replacing ChatFrameEditBox with ChatFrame1EditBox will only fix it if you're on the General (or whatever happens to be your first) chat tab. If you're on a custom tab there will be no error, but it won't autocomplete your links. I've coded a fix that restores it to its 3.3.3 level of function and am waiting on the go ahead from Gazmik before posting it anywhere.

Originally posted by AnrDaemon Quite expected.
What is the proper way of dealing with this issue?

It's a bit involved to be all posted here from my notes at the moment (wife is WoWing on the computer my changes are on at the moment), but essentially:

On the OnLoad for the addon, where he hooks the ChatFrameEditBox, a few changes need to happen:

1)Outside that function, make FLT_Orig_ChatEdit_OnChar a table.

2)Inside that function, loop through the existing chat frames (with for i=1,NUM_CHAT_WINDOWS) and hook each existing chat frame's edit box (_G["ChatFrame"..i.."EditBox"]), storing the original in FLT_Orig_ChatEdit_OnChar.i. Inside FLT_ChatEdit_OnChar, get the index of the current chat frame with string.match(FCF_GetCurrentChatFrame().editBox:GetName(),"%d+") and change the second if statement to

Code:

if (FLT_Orig_ChatEdit_OnChar.<whatever variable you stored that index in>) then return FLT_Orig_ChatEdit_OnChar.ChatFrameIndex(self, text); end

You're experienced enough with code that you should be able to sort out any remaining errors.

ps - If you want it to pick up added frames without a UI Reload, you'll need to register the addon's frame for UPDATE_CHAT_WINDOWS and hook new frames' edit boxes there. I haven't figured out the best way to do that yet, as it actually seems like the OnChar scripts for the standard frames are nil. The problem with this being that simply looping through all the frames when UPDATE_CHAT_WINDOWS fires and hooking anything that you don't have a script stored in FLT_Orig_ChatEdit_OnChar for will result in you storing FLT_ChatEditOnChar for everything that was initially nil. I'm wondering if comparing non-nil scripts to FLT_Orig_ChatEdit_OnChar before storing them as originals will work. For example, something like:

Code:

if not FLT_Orig_ChatEdit_OnChar.ChatFrameIndex and _G["ChatFrame"..ChatFrameIndex.."EditBox"]:GetScript("OnChar") ~= FLT_ChatEdit_OnChar then ... end

But I thought of that after my wife started this raid, so I haven't had a chance to test it yet.

Scratch that, turns out that FCF_GetCurrentChatFrame() only every returns ChatFrame10, for whatever reason.

Looping through the chat frames when hooking does seem to take care of the problem there, though.

Not the best solution here, but the only way I could figure out to do this:
Create the following helper function:

Code:

local function GetFocusedChatFrame()
local c = DEFAULT_CHAT_FRAME.editBox
for i=1,NUM_CHAT_WINDOWS do
local n,_,_,_,_,_,s,_,_,_ = GetChatWindowInfo(i)
if n and s then c = _G["ChatFrame"..i.."EditBox"] end
end
return c
end

Well, I've waited a few days for Fizzwidget to respond to my email, and haven't heard anything. He doesn't list a license for his addons anywhere that I can find, and I'm sure there are people out there who would like this information, so I'm posting the diff between his file and my working one below. I don't have time to support this addon myself, so if you don't know what to do with a diff file, please don't be mad when I don't walk you through the process. If you do know what to do with a diff file, copy the text in the code block below and paste it into its own file, "linkerator-chat-fix.diff"

There are countless ingredients that make up the human body and mind, like all the components that make up me as an individual with my own personality. Sure, I have a face and voice to distinguish myself from others, but my thoughts and memories are unique only to me, and I carry a sense of my own destiny. Each of those things are just a small part of it. I collect information to use in my own way. All of that blends to create a mixture that forms me and gives rise to my conscience.

Hirsute posted a patchfile as code, that much is clear, however he didn't tell what program he used for making the diff nor did it specify the format. It does look like the unified format and a normal gnu patch should do.

Originally posted by Livanamako Hirsute posted a patchfile as code, that much is clear, however he didn't tell what program he used for making the diff nor did it specify the format. It does look like the unified format and a normal gnu patch should do.

You can use notepad++ and modify the file by hand.
I did that but now i get a new error. It seems that there is an conflict with another, though linkerator works fine.

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.