View Single Post
03-18-24, 11:56 AM   #5
Codger
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Mar 2021
Posts: 30
Working but clunky

Thank you for the help.
It's working now... had a bit of trouble with empty slots and used a clunky workaround by looking at the texture. I'm sure there must be a better way to detect an empty slot but haven't found it yet.
Here's what I have now...

Lua Code:
  1. local function getGearItemLvl(slotName)
  2.     local lvl = 0
  3.     local slotID, texture, checkRelic = GetInventorySlotInfo(slotName)
  4.     if (slotID ~= nil) then
  5.         if (texture ~= 136525) then
  6.             local itemLocation = ItemLocation:CreateFromEquipmentSlot(slotID)
  7.             if (itemLocation ~= nil) then
  8.                 lvl = C_Item.GetCurrentItemLevel(itemLocation)
  9.             end
  10.         end    
  11.     end
  12.     --print("getGearItemLvl("..slotName..") " .. "  slotID: " .. slotID .. "  itemlevel: " .. lvl)
  13.     return format("%s", lvl)
  14. end

Last edited by Codger : 03-22-24 at 10:20 AM.
  Reply With Quote