Thread Tools Display Modes
11-10-23, 06:14 AM   #1
glupikreten
A Theradrim Guardian
Join Date: Apr 2009
Posts: 60
GetItemInfo from GetLootRollItemInfo

Hi,



I have this function:

Lua Code:
  1. local fr = CreateFrame('Frame', nil, UIParent)
  2. fr:RegisterEvent('START_LOOT_ROLL')
  3. fr:RegisterEvent('CONFIRM_LOOT_ROLL')
  4. fr:SetScript(
  5.     'OnEvent',
  6.     function(self, event, id)
  7.         if not id then
  8.             return
  9.         end
  10.         local _, name, _, quality, bop, _, _, canDE = GetLootRollItemInfo(id)
  11.         if quality == 2 and autoroll then
  12.             ConfirmLootRoll(id, canDE and 3 or 2)
  13.             ChatFrame7:AddMessage('Autoroll on item: ' .. (name))
  14.         end
  15.     end
  16. )

Is it possible to add itemLevel into it as a condition.

I tried GetItemInfo(name) but name can be used only if item is equped or in bag...

Anyone knows how to get to the item like you can do it on tooltip with :GetItem().

Is it WOTLK client.

Thank you
  Reply With Quote
11-10-23, 01:10 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 6,007
Not sure whether this will work in wrath classic but worth a try.

https://warcraft.wiki.gg/wiki/API_GetLootRollItemLink
This function takes the same input but one of the outputs is the item id.

Which you can then use with

https://warcraft.wiki.gg/wiki/API_GetItemInfo
Which returns the itemLevel which can then use to filter out as you need.
__________________


All Level 70 Characters:
Demon Warlock
Resto Druid
Disc Priest
Resto Shaman
Survival Hunter
Augment Evoker
Frost Mage
Vengence Demon Hunter
Rogue ( was subtlety )

Brewmaster Monk (TR)
Prot Paladin (TR)
Blood Death Knight ( TR)

As you can see I am missing a warrior

And .. I don't have all the allied races covered. Time Runner time when it happens again

  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » GetItemInfo from GetLootRollItemInfo


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