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() |
/run for i=1,GetNumGroupMembers() do if not UnitIsUnit("player", "raid"..i) then UninviteUnit("raid"..i) end end LeaveParty()
|
Quote:
|
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
|
Just FYI, your original macro you posted would only work in raid also. Glad you got it figured out, though.
|
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() |
Quote:
|
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 |
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() |
All times are GMT -6. The time now is 12:20 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI