#Can someone help me modify this post somehow?

21 messages · Page 1 of 1 (latest)

tired nacelle
#

can I somehow remove brackets for the name that is being displayed from items looted, in this code?


aura_env.exists = function(value)
    if value == nil or value == "" then return false end
    return true
end

aura_env.money = function(copper)     
    if not copper then copper = aura_env.moneyDiff() end
    if not copper or copper == 0 then return end
    local sign = "|cff00ff00+|r"
    if copper < 0 then 
        copper = -copper 
        sign =  "|cffff0000-|r"
    end
    
    return format("%s%s", sign, GetCoinTextureString(copper)), copper;
end

aura_env.get_currency_icon = function(copper)
    if (copper) then
        local copper_absolute = math.abs(copper)
        -- if copper
        if copper_absolute < 100 then return 133789 end
        -- if silver
        if copper_absolute < 10000 then return 133787 end
    end
    -- default (gold)
    return 133785
end

aura_env.moneyDiff = function()
    local diff = GetMoney() - aura_env.current_money;
    aura_env.current_money = GetMoney()
    return diff
end

aura_env.message = function(text,count, amount)
    if not text then return nil end
    return text..(count and ("|cff00ff00x"..count.."|r") or "")
end   

aura_env.currency = function(text, count, amount)
    if not text then return nil end
    local color = count and count > 0 and "|cff00ff00+" or "|cffff0000"
    return (count and (color.." "..count.."|r ") or "")
end```
#

idk

umbral spear
#

You're talking about the link?

tired nacelle
#

yES

#

Yes, there's some alterations to the code I'd like to do, but I have no idea how to do it, as this is not my weak aura

umbral spear
#

Well it's passing the item link straight out of the trigger. If you don't want a link then use the item name instead I guess

tired nacelle
#

but it's not tracking a spesiffic item, it tracks any and all items I loot

#

and money

umbral spear
#

...?

tired nacelle
#

I don't know any coding tho

#

all of that makes no sense to me, appart from very few things

umbral spear
#

If you just want it changing then ask the author.
If you want to learn how it's functioning then take the hints and try some stuff.

The issue isn't in the code you posted, it's in the trigger.
The issue is that it's using a link.
🔎

tired nacelle
#

can you somehow change it to just use the names instead?

umbral spear
#

You can, yes

tired nacelle
#

when I said you, I didn't mean "YOU" spesifically, just a way of asking if it can be done

umbral spear
#

I know. I'm just trying to nudge you to investigate.
Ask more questions if you like but go and poke around a bit yourself first

tired nacelle
#

It's quite hard to deep dive into ```function(allstates, track_event, event, params)
if not params then return end
local text,playerName,,,player,,,,,_,guid = unpack(params)
local itemLink, itemIcon, message, count, amount, questID, currencyId, shouldGlow, itemType
local name, realm = UnitFullName("player")

local targetPlayer = aura_env.exists(playerName) and playerName or player
local itsMe = targetPlayer == name or targetPlayer == name.."-"..realm
--SendChatMessage(originalPlayer, "WHISPER", nil, targetPlayer)

if event == "PLAYER_MONEY" then 
    local msg, copper = aura_env.money()
    message = msg
    itemIcon = aura_env.get_currency_icon(copper)
    shouldGlow = false
    
elseif event == "QUEST_CURRENCY_LOOT_RECEIVED" then
    questID, currencyId, count = select (1, unpack(params))
    if currencyId then
        local info =  C_CurrencyInfo.GetCurrencyInfo(currencyId)
        text = info.name
        amount = info.quantity
        itemIcon = info.iconFileID
        shouldGlow = false
        message = aura_env.currency(text,count,amount)
    end
    
elseif event == "QUEST_LOOT_RECEIVED" then
    questID, itemLink, count = select (1, unpack(params))
    if itemLink then 
        _, _, _, _, _, itemType, _, _, _, itemIcon = GetItemInfo(itemLink)
        message = aura_env.message(itemLink,count,amount)  
        shouldGlow = false      
    end        
    
elseif event=="CURRENCY_DISPLAY_UPDATE" then
    currencyId, amount, count = select(1,unpack(params))
    if currencyId then
        local info =  C_CurrencyInfo.GetCurrencyInfo(currencyId)
        text = info.name
        amount = info.quantity
        itemIcon = info.iconFileID
        shouldGlow = false
        if itemIcon and count ~=0 then
            message = aura_env.currency(text, count, amount)
        end            
    end        
    
elseif event == "CHAT_MSG_CURRENCY" then
    itemLink, count = string.match(text, "(|c.+|r) ?x?(%d*).?")
    local info = C_CurrencyInfo.GetCurrencyInfoFromLink(itemLink)
    text = info.name
    itemIcon = info.iconFileID        
    amount = info.quantity
    message = aura_env.message(itemLink, count, amount) 
    shouldGlow = false       
    
elseif event == "CHAT_MSG_LOOT" and (guid and guid == UnitGUID("player") or itsMe) then  
    itemLink, count = string.match(text, "(|c.+|r) ?x?(%d*).?")
    count = tonumber(count)
    if itemLink then
        local quality
        _, _, quality, _, _, itemType, _, _, _, itemIcon = GetItemInfo(itemLink)
        if quality and quality >= (aura_env.config.minQuality or 0) or itemType == "Quest" then
            amount = GetItemCount(itemLink, aura_env.config.countFromBank)
            message = aura_env.message(itemLink, count, amount)
            shouldGlow = itemType == "Quest"
        end            
    else
        message = text
    end
end

if not itemIcon then itemIcon = 133784 end

if message then 
    allstates[#allstates+1] = {
        show = true,
        changed = true,
        progressType = "timed",
        duration = (aura_env.config.duration or 5),
        expirationTime = GetTime() + (aura_env.config.duration or 5),
        autoHide = true,
        name = message,
        icon = itemIcon,
        link = itemLink,
        shouldGlow = shouldGlow
    }
end

return true

end

umbral spear
#

Well which event that's being tracked do you think is most relevant?

tired nacelle
#

under trigger 3?

umbral spear
#

You just posted a trigger function.