Thread Tools Display Modes
12-31-21, 03:58 PM   #1
zENK
A Murloc Raider
Join Date: Dec 2021
Posts: 5
Disband raid macro help

Hi,

Is there a way to make this disband raid macro work so it gets the name-realm from "player" as well? Currently when I use this macro some of my alts are still left in the group and have to manually remove them if they have the same name but are on a different realm, I'm using this macro to disband my group after summoning my alt army to different places. Also, is it possible to make it so it works for both party and raid?

Thanks

/run for i=1,GetNumGroupMembers() do if UnitName("raid"..i) ~= UnitName("player") then UninviteUnit("raid"..i, "reason") end end LeaveParty()

Last edited by zENK : 12-31-21 at 06:15 PM.
  Reply With Quote
12-31-21, 08:00 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
/run for i=1,GetNumGroupMembers() do if not UnitIsUnit("player", "raid"..i) then UninviteUnit("raid"..i) end end LeaveParty()
__________________
"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
12-31-21, 08:33 PM   #3
zENK
A Murloc Raider
Join Date: Dec 2021
Posts: 5
Originally Posted by Seerah View Post
/run for i=1,GetNumGroupMembers() do if not UnitIsUnit("player", "raid"..i) then UninviteUnit("raid"..i) end end LeaveParty()
Works for raid group but not while in party :/
  Reply With Quote
12-31-21, 08:39 PM   #4
zENK
A Murloc Raider
Join Date: Dec 2021
Posts: 5
Leatrix plus addon just added this feature into their addon so won't need help on this anymore. case closed ty for trying to help Seerah
  Reply With Quote
01-01-22, 01:53 PM   #5
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Just FYI, your original macro you posted would only work in raid also. Glad you got it figured out, though.
__________________
"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
01-01-22, 03:49 PM   #6
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
I'm a bit confused as to how your original macro even worked. On retail, UninviteUnit is supposed to take only name-realm and is hardware protected, as well as LeaveParty() moving to C_PartyInfo in 8.2.5 with the deprecated placeholder removed in 9.0. Maybe the act of hitting the macro is good for the whole loop, haven't really tried something like that, as well as a unit token still being allowed, but either you have your own LeaveParty() shortcut or an addon is providing it, or you're on one of the classic versions.

In any case, assuming you're on a legitimate WoW version, here are four versions of a macro that will disband a party or a raid, each version accounting for unit tokens, name-realm, and where the LeaveParty() function might be. The last one is the longest at 186 characters. As a side note, I added the third argument to UninviteUnit which should skip any confirmation dialogs, based on the way Blizzard uses it.

Code:
/run local n,u=4,"party" if IsInRaid() then n,u=40,"raid" end for i=1,n do if not UnitIsUnit(u..i,"player") then UninviteUnit(u..i,nil,1) end end LeaveParty()

/run local n,u=4,"party" if IsInRaid() then n,u=40,"raid" end for i=1,n do if not UnitIsUnit(u..i,"player") then UninviteUnit(GetUnitName(u..i,1),nil,1) end end LeaveParty()

/run local n,u=4,"party" if IsInRaid() then n,u=40,"raid" end for i=1,n do if not UnitIsUnit(u..i,"player") then UninviteUnit(u..i,nil,1) end end C_PartyInfo.LeaveParty()

/run local n,u=4,"party" if IsInRaid() then n,u=40,"raid" end for i=1,n do if not UnitIsUnit(u..i,"player") then UninviteUnit(GetUnitName(u..i,1),nil,1) end end C_PartyInfo.LeaveParty()
  Reply With Quote
01-01-22, 06:14 PM   #7
zENK
A Murloc Raider
Join Date: Dec 2021
Posts: 5
Originally Posted by Kanegasi View Post
I'm a bit confused as to how your original macro even worked. On retail, UninviteUnit is supposed to take only name-realm and is hardware protected, as well as LeaveParty() moving to C_PartyInfo in 8.2.5 with the deprecated placeholder removed in 9.0. Maybe the act of hitting the macro is good for the whole loop, haven't really tried something like that, as well as a unit token still being allowed, but either you have your own LeaveParty() shortcut or an addon is providing it, or you're on one of the classic versions.

In any case, assuming you're on a legitimate WoW version, here are four versions of a macro that will disband a party or a raid, each version accounting for unit tokens, name-realm, and where the LeaveParty() function might be. The last one is the longest at 186 characters. As a side note, I added the third argument to UninviteUnit which should skip any confirmation dialogs, based on the way Blizzard uses it.

Code:
/run local n,u=4,"party" if IsInRaid() then n,u=40,"raid" end for i=1,n do if not UnitIsUnit(u..i,"player") then UninviteUnit(u..i,nil,1) end end LeaveParty()

/run local n,u=4,"party" if IsInRaid() then n,u=40,"raid" end for i=1,n do if not UnitIsUnit(u..i,"player") then UninviteUnit(GetUnitName(u..i,1),nil,1) end end LeaveParty()

/run local n,u=4,"party" if IsInRaid() then n,u=40,"raid" end for i=1,n do if not UnitIsUnit(u..i,"player") then UninviteUnit(u..i,nil,1) end end C_PartyInfo.LeaveParty()

/run local n,u=4,"party" if IsInRaid() then n,u=40,"raid" end for i=1,n do if not UnitIsUnit(u..i,"player") then UninviteUnit(GetUnitName(u..i,1),nil,1) end end C_PartyInfo.LeaveParty()
I found that macro I posted here on another website, I didn't make it myself :P but your macros works great the way I wanted it to thanks! Now I have both a macro and an addon to do it for me incase the addon would ever break or something, just one thing I'm wondering about for the macros you posted. Is there something you can edit to avoid the "You aren't in a party" spam while using the macro in a raid group? https://imgur.com/a/vkTmVFc

Last edited by zENK : 01-01-22 at 10:50 PM.
  Reply With Quote
01-01-22, 10:44 PM   #8
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
There might be some weird delay with UninviteUnit on nonexistent members, causing something to happen after the loop. Normally, unit functions on nonexistent units are silently ignored.

In any of the versions, find this:

Code:
if not

replace with this:

Code:
if UnitExists(u..i) and not

I also thought about an edge case where the loop may miss someone because unit IDs in a group could get shuffled around.

In any of the versions, find this:

Code:
i=1,n

replace with this:

Code:
i=n,1,-1

Last edited by Kanegasi : 01-01-22 at 10:48 PM.
  Reply With Quote
01-02-22, 09:59 AM   #9
zENK
A Murloc Raider
Join Date: Dec 2021
Posts: 5
Thank you! This macro works great now

Code:
/run local n,u=4,"party" if IsInRaid() then n,u=40,"raid" end for i=n,1,-1 do if UnitExists(u..i) and not UnitIsUnit(u..i,"player") then UninviteUnit(u..i,nil,1) end end LeaveParty()

Last edited by zENK : 01-02-22 at 07:53 PM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Macro Help » Disband raid macro help

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