WoWInterface (
-   Lua/XML Help (
-   -   Party members with server name? (

Zax 02-18-20 09:24 AM

Party members with server name?

Is there a way to retreive party members' name with realm name (something like "Leroy-KirinTor")?
API GetHomePartyInfo() only returns names.


Fizzlemizz 02-18-20 09:47 AM

If the realm return is nil then they are on your realm (GetRealmName)

Zax 02-18-20 10:08 AM

OK, so if I well understand, the only way is to loop on GetHomePartyInfo() result?
I can't check right now but what happen if, let's say, "Leroy" from Kirin Tor, and "Leroy" from Aggramar are in the same party?

Fizzlemizz 02-18-20 12:09 PM

A general idea.

local unit = "player"
local name = UnitName(unit)
local realm = GetRealmName()
print(unit, name, "from", realm)
for i=1, 4 do
        unit = "party"..i
        if UnitExists(unit) then
                name, realm = UnitName(unit)
                if not realm then
                        realm = GetRealmName()
                print(unit, name, "from", realm)

SDPhantom 02-18-20 02:37 PM

If you want the normalized name for your realm (used for whisper targets), you can use GetNormalizedRealmName(). Normalized realm names generally have spaces removed. I don't know if special characters like hyphens and apostrophes are removed as well.

Zax 02-19-20 07:29 AM

Thank you for your answers :)

I finally use: name, realm = UnitFullName(unit), in order to have the "condensed" form of server name, without space.

All times are GMT -6. The time now is 06:42 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI