-
Posted by mosphet on Fri, 03 Jun 2011 11:04:07
I've spent hours debugging and I've given up and now I'm looking for help. I'm not sure if im an idiot or something was changed on blizzard's side that I've missed (Or both!)! Basically this function parses item's that are linked to me for our master looting addon. From what i've read if an item is not in cache it returns a nil value, and you can use GameTooltip:SetHyperlink() to force load it and pass back the result (This may have changed but I haven't found anything on this). This solution has not been working for me and sometimes people have to link an item to me twice for it to work. (Always works the second time if an lua error is returned the first)
The link below is the function.
http://pastebin.com/raw.php?i=3r6pE71i
Message: GameTooltip:SetHyperlink(): Unknown link type
(I'm not the best at LUA so if I made an obvious mistake please point it out)
-
Posted by jnwhiteh on Fri, 03 Jun 2011 11:38:42
- I don't appreciate you posting code with insults in it. Grow up.
- I don't know what the result of your pattern match for 'itemid' is, so I'd be guessing by giving you an answer.
- Obviously the SetHyperlink() method isn't liking the input you're giving it. I suggest you figure out what you are giving it and post more information.
-
Posted by mosphet on Fri, 03 Jun 2011 12:02:06
Changed the link and removed the comment. Sorry that joke comment offended you, wasn't really aimed at anyone directly. I just put that in because my guildies found it funny to keep linking spells and breaking the addon and I needed to fix it.
Anyway thanks for the reply. From asking around a bit GetItemInfo itself apparently queries the server for non-cached items, so I don't think I need to use the tooltip trick anymore. As for items not in the cache I could cancel the function and wait for the "GETITEMINFO_RECEIVED" event and call the function again once the data is in the cache. (Not sure how well this would work, but trying it out is all about the learning :D)
-
Posted by jnwhiteh on Fri, 03 Jun 2011 12:34:37
Changed the link and removed the comment. Sorry that joke comment offended you, wasn't really aimed at anyone directly. I just put that in because my guildies found it funny to keep linking spells and breaking the addon and I needed to fix it.
I understand that, I just find that sort of language very offensive, so it pushed a bit of a button.
Anyway thanks for the reply. From asking around a bit GetItemInfo itself apparently queries the server for non-cached items, so I don't think I need to use the tooltip trick anymore. As for items not in the cache I could cancel the function and wait for the "GETITEMINFO_RECEIVED" event and call the function again once the data is in the cache. (Not sure how well this would work, but trying it out is all about the learning :D)
Yeah, they did change how GetItemInfo() worked in 4.0 in the move towards more of a 'streamed' client, where data comes down from the server as needed. Let me know if you have any further questions!
-
Posted by mosphet on Fri, 03 Jun 2011 17:18:27
All working good now! seems it was just the 4.0 changes, thought I'd read most of it but apparently not. Thanks for the help :)