Thread Tools Display Modes
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
03-16-21, 12:45 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
When inspecting other players, not all information is readily available to your client. You have to wait for the "INSPECT_READY" event.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
03-16-21, 01:04 PM   #3
Arrzarr
A Defias Bandit
Join Date: Mar 2021
Posts: 2
Thanks,
That gives me somewhere further to start looking.
Arz
  Reply With Quote

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

Thread Tools
Display Modes

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