• 0

    posted a message on [string "--[[ Error in ' Talents\Items' ]]return fun..."]:59: attempt to concatenate local 'ilvl' (a nil value)

    Hello everyone, I hope you can help me.
    After much research, I achieved this weakaura that makes me see my talents, legendary and trinkets on the screen. However, I'm having trouble with the error quoted in the title, can anyone give me a hint to solve?

    I'll send the error and the "body" of the aura here.

     

    Lua error:

     

    Message: [string "--[[ Error in ' Talents\Items' ]]return fun..."]:59: attempt to concatenate local 'ilvl' (a nil value)
    Time: 01/21/18 00:41:49
    Count: 1
    Stack: [string "--[[ Error in ' Talents\Items' ]]return fun..."]:59: attempt to concatenate local 'ilvl' (a nil value)
    Interface\SharedXML\SharedBasicControls.lua:208: in function <Interface\SharedXML\SharedBasicControls.lua:207>
    [C]: ?
    [string "--[[ Error in ' Talents\Items' ]]return fun..."]:59: in function `triggerFunc'
    Interface\AddOns\WeakAuras\GenericTrigger.lua:521: in function <Interface\AddOns\WeakAuras\GenericTrigger.lua:515>
    Interface\AddOns\WeakAuras\GenericTrigger.lua:605: in function `ScanEvents'
    Interface\AddOns\WeakAuras\GenericTrigger.lua:656: in function <Interface\AddOns\WeakAuras\GenericTrigger.lua:643>

    Locals: errorMessage = "[string "--[[ Error in ' Talents\Items' ]]return fun..."]:59: attempt to concatenate local 'ilvl' (a nil value)"
    DisplayMessageInternal = <function> defined @Interface\SharedXML\SharedBasicControls.lua:191
    MESSAGE_TYPE_ERROR = 0

     

    WA:

     

    function(states)
    for k,v in pairs(states) do
    v.show = false
    v.change = true
    end

    local level = UnitLevel("player")
    local talents = aura_env.getNumTalents(level)
    for i = 1, talents do
    states[i] = states[i] or {}
    local state = states[i]
    local column = nil
    for j = 1, 3 do
    if select(4, GetTalentInfo(i, j, 1)) then
    column = j
    end
    end
    if column then
    local _, name, icon = GetTalentInfo(i, column, 1)
    --print(name ,icon)
    state.index = i
    state.name = name
    state.icon = icon
    state.changed = true
    state.resort = true
    state.show = true
    end
    end
    local legendary = 5
    local slots = 15
    for o = 1, slots do
    local itemId = GetInventoryItemLink("player", o)
    if itemId then
    local name, _, quality, ilvl = GetItemInfo(itemId)
    local icon = GetItemIcon(itemId)
    if quality == legendary then
    local index = talents + o
    states[index] = states[index] or {}
    local state = states[index]
    state.name = aura_env.color[quality]..name.." ("..ilvl..")|r"
    state.icon = icon
    state.index = index
    state.changed = true
    state.show = true
    state.resort = true
    end
    end
    end
    for e = 1, 2 do
    local trinketSlot = 12 + e
    local itemId = GetInventoryItemLink("player", trinketSlot)
    if itemId then
    local name, _, quality, ilvl = GetItemInfo(itemId)
    local icon = GetItemIcon(itemId)
    if quality ~= legendary then
    local index = talents + slots + e
    states[index] = states[index] or {}
    local state = states[index]
    state.name = aura_env.color[quality]..name.." ("..ilvl..")|r"
    state.icon = icon
    state.index = index
    state.changed = true
    state.show = true
    state.resort = true
    end
    end
    end
    return true
    end

     

    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.