#Show custom text from Trigger

5 messages · Page 1 of 1 (latest)

bitter ingot
#

there's various ways. you can put those into aura_env such as aura_env.profession = order.profession and then in Name Info put a function that returns aura_env.profession, then you can use %n in display tab.

if you want to use all 3 as separate text replacements then it might be better to convert your trigger to Trigger State Updater (TSU). it would look something like this:

function(allstates,event)
    
    if event == "CRAFTINGORDERS_UPDATE_PERSONAL_ORDER_COUNTS" then 
        local orders=C_CraftingOrders.GetPersonalOrdersInfo()
        local profession, numOrders, profession
        for i, order in ipairs(orders) do
            profession = order.profession
            numOrders = order.numPersonalOrders
            professionName = order.professionName
            
        end
        allstates[""] = {
            show = true,
            changed = true,
            profession = profession,
            numOrders = numOrders,
            professionName = professionName
        }
        return true
        
    end 
end 

then you can use %profession %numOrders etc in display. note that the aura will only show on that event, if you also want it to show when you log in/close WA options you can add or event == "STATUS"

steady juniper
bitter ingot
#

true, i guess create the states inside the loop then

steady juniper
#
function(allstates, event)
  if event == "CRAFTINGORDERS_UPDATE_PERSONAL_ORDER_COUNTS" or event == "STATUS" then
    local orders = C_CraftingOrders.GetPersonalOrdersInfo()
    allstates:RemoveAll()
    if type(orders) == "table" then
      for i, order in ipairs(orders) do
        allstates:Update(i, {
          profession = order.profession,
          numOrders = order.numPersonalOrders,
          professionName = order.professionName
        }
      end
    end
  end
end
bitter ingot
#

put the aura in a dynamic group