Thread Tools Display Modes
11-14-17, 04:41 PM   #1
Encoresx
A Deviate Faerie Dragon
Join Date: Oct 2017
Posts: 11
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.
  Reply With Quote
11-14-17, 05:15 PM   #2
aallkkaa
A Warpwood Thunder Caller
 
aallkkaa's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2017
Posts: 98
https://wow.gamepedia.com/API_GetNumGroupMembers
  Reply With Quote
11-15-17, 03:00 AM   #3
Encoresx
A Deviate Faerie Dragon
Join Date: Oct 2017
Posts: 11
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?
  Reply With Quote
11-15-17, 04:52 AM   #4
Tim
A Rage Talon Dragon Guard
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 308
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)
  Reply With Quote
11-15-17, 08:18 AM   #5
Encoresx
A Deviate Faerie Dragon
Join Date: Oct 2017
Posts: 11
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!

Last edited by Encoresx : 11-15-17 at 08:20 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Script to check how many people are inside my party/raid?

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