View Single Post
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