Thread Tools Display Modes
06-20-08, 12:46 AM   #1
Everglow
An Aku'mai Servant
 
Everglow's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 36
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
__________________
Everglow - Sisters of Elune/US
  Reply With Quote
06-20-08, 02:12 AM   #2
Tekkub
A Molten Giant
 
Tekkub's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 960
Originally Posted by Everglow View Post
Is there a way to force an item into the local cache
Set a tooltip. yourtooltip:SetHyperlink("item:"..itemid)
  Reply With Quote
06-20-08, 02:45 AM   #3
Mejloc
A Murloc Raider
Join Date: Mar 2008
Posts: 8
and you can extract the item id from the item link posted in your chat frame.
  Reply With Quote
06-20-08, 08:06 PM   #4
Everglow
An Aku'mai Servant
 
Everglow's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 36
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.
__________________
Everglow - Sisters of Elune/US
  Reply With Quote
06-21-08, 01:33 AM   #5
Everglow
An Aku'mai Servant
 
Everglow's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 36
Thumbs up solved

I actually resolved my problem by using GetLootSlotItem() to retrieve the itemLink
__________________
Everglow - Sisters of Elune/US
  Reply With Quote
06-21-08, 10:27 AM   #6
Mejloc
A Murloc Raider
Join Date: Mar 2008
Posts: 8
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.
  Reply With Quote
06-22-08, 01:02 AM   #7
Everglow
An Aku'mai Servant
 
Everglow's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 36
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.
__________________
Everglow - Sisters of Elune/US
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » GetItemInfo()

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off