1. #1

    SetInventoryItem no longer a function?

    With the release of 10.0.2 my addon has started to fail with an error "Attempt to call function SetInventoryItem (a nil value)". I'm using it to get the current repair cost of the player's gear. I can't find any references showing that it has been removed, but maybe I'm not looking in the right places. Can anybody confirm if that function has been removed or is changed?

    The link from wowpedia to https://github.com/Ketho/wow-ui-sour...tInventoryItem makes it look like the function is still in game, just not sure why it's giving me a nil error when I try to call it.

    Any help appreciated.
    Author of Instance Profit Tracker
    Find out how much gold you earn soloing raids and dungeons

    Curse | GitHub
    WowInterface

  2. #2

  3. #3
    That looks like what I was missing. Thanks!
    Author of Instance Profit Tracker
    Find out how much gold you earn soloing raids and dungeons

    Curse | GitHub
    WowInterface

  4. #4
    In case anybody finds this thread looking for the same answer, the working lua code I used was:

    local totalRepairCost = 0;
    for slotName, slotID in pairs(Enum.InventoryType) do
    local hasItem, repairCost;
    hasItem = C_TooltipInfo.GetInventoryItem("player", slotID)
    if hasItem then
    TooltipUtil.SurfaceArgs(hasItem) --we use this function to put the data in a neat readable format for us
    repairCost = hasItem.repairCost
    end
    if ((repairCost) and (repairCost > 0)) then
    totalRepairCost = totalRepairCost + repairCost;
    end
    end
    Author of Instance Profit Tracker
    Find out how much gold you earn soloing raids and dungeons

    Curse | GitHub
    WowInterface

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •