Thread Tools Display Modes
Prev Previous Post   Next Post Next
03-16-21, 12:22 PM   #1
Arrzarr
A Defias Bandit
Join Date: Mar 2021
Posts: 2
Inspecting raid for trinket equipped

Afternoon all,
I've been trying to set up a weakaura that will show at a glance who has the Nathria group based trinkets equipped without having to go through inspecting the whole raid.

Below is what I've got so far, including some old variables that I haven't removed just yet.

When using this in a raid, I can tell that it's looping correctly and when i = my index, the Stone Legion Heraldry I'm wearing is detected correctly, but every other iteration of the loop returns nil.

Is that something which isn't possible with straight LUA as a guildie suggested to me or am I just missing something obvious?

Thanks,

Arrzarr.

Lua Code:
  1. function()
  2.     local SLH = "SLH Users: "
  3.     local CH = "\nCH Users: "
  4.     local returnValue
  5.     local equipped = false
  6.     local raiders = GetNumGroupMembers()
  7.     local itemID
  8.     local index
  9.     local name
  10.     local names = {}
  11.     local trinketIDs = ""
  12.     for i = 1, MAX_RAID_MEMBERS
  13.     do
  14.        
  15.         --This is inefficient but designed for readability to figure this out
  16.         index = "raid"..i
  17.         name = GetUnitName(index)
  18.        
  19.         --Check for Stone Legion Heraldry
  20.         itemId = GetInventoryItemID(index, 13)
  21.         if itemId == 184027 then SLH = SLH .. name .. " " end
  22.         itemId = GetInventoryItemID(index, 14)
  23.         if itemId == 184027 then SLH = SLH .. name .. " " end
  24.        
  25.         --Check for Cabalist's Hymnal
  26.         itemId = GetInventoryItemID(index, 13)
  27.         if itemId == 184028 then CH = CH .. name .. " " end
  28.         itemId = GetInventoryItemID(index, 14)
  29.         if itemId == 184028 then CH = CH .. name .. " " end
  30.        
  31.     end
  32.     returnValue = SLH .. CH
  33.     return returnValue
  34. end
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Inspecting raid for trinket equipped


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off