GetItemInfo()
Hello all you brilliant coders. I am trying to write a mod that stores loot distribution info in a SavedVariable DB when the user is Master Looter. all works fine except for one problem. GetItemInfo() does not seem to work if I have never "owned" the item in question. Just looking at it in the loot window doesn't seem to do the trick. Is there a way to force an item into the local cache, or some other way to get the following information: .. ?
1. (necessary info) rarity of the item 2. (helpful, but not critical info) item ID |
Quote:
|
and you can extract the item id from the item link posted in your chat frame.
|
Thanks Tekkub... I like your outside-the-box mind. btw, your mods are great.
Mejloc, that's what I'm parsing, and couldn't extract the info from the chat string. But thanks for the reply. |
solved
I actually resolved my problem by using GetLootSlotItem() to retrieve the itemLink :)
|
pattern = string.gsub(string.gsub(value, "(%%s)", "(.+)"), "(%%d)", "(.+)");
local start, fin, arg1, arg2, arg3 = string.find(msg, pattern) where value is i.e. LOOT_ITEM_SELF and msg is your loot event string. Depending which loot event type you got, arg? is different and contains the owner, item and amount. In case of LOOT_ITEM_SELF arg1 contains the itemlink, rest is nil. now you extract the needed info from the link. this is how i realized a simple item tracker. |
You can see the clean and simple way in the addon itself... MasterLewtLogger. It may not be quite as flexible, but it's fast and efficient.
|
All times are GMT -6. The time now is 10:07 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI