WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Script to check how many people are inside my party/raid? (https://www.wowinterface.com/forums/showthread.php?t=55848)

Encoresx 11-14-17 04:41 PM

Script to check how many people are inside my party/raid?
 
Title! Need to make an if statement in my addon that swaps some stuff around.

aallkkaa 11-14-17 05:15 PM

https://wow.gamepedia.com/API_GetNumGroupMembers

Encoresx 11-15-17 03:00 AM

Thanks!

So here's what I got:

local z=GetNumGroupMembers()
if z <=5 then
CompactUnitFrameProfiles_ActivateRaidProfile("Primary") else
CompactUnitFrameProfiles_ActivateRaidProfile("Mucho") end

I placed this into an addon and it doesn't seem to work - do I need it in a loop or?

Tim 11-15-17 04:52 AM

Not sure why you need custom coding like this, you can set profiles in the raid setup window to handle group sizes, etc.

However, you could try something like this..

Code:

local eHandler = CreateFrame("Frame")
eHandler:RegisterEvent("GROUP_ROSTER_UPDATE")
eHandler:SetScript("OnEvent", function()

  local gn = GetNumGroupMembers()

  if (gn <= 5) then
      CompactUnitFrameProfiles_ActivateRaidProfile("Primary")
  else
      CompactUnitFrameProfiles_ActivateRaidProfile("Mucho")
  end

end)


Encoresx 11-15-17 08:18 AM

Need it because blizzard method doesn't work, raid profiles don't get swapped automatically based on how many people are inside the party/raid.

I'll give it a try later on and report if it works, ty!


All times are GMT -6. The time now is 02:53 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI