Thread Tools Display Modes
08-30-14, 08:28 PM   #1
sirann
A Flamescale Wyrmkin
Join Date: Mar 2007
Posts: 142
Turning GUID from CLEU into the player name

I'm trying to write an addon that listens to CLEU, if the event is UNIT_DESTROYED --the event of totems and banners fading/cancelled, then it checks to see if the spellId associated with the destroyed event matches, then it checks who the caster of the totem/banner that went away was, which is only in GUID form. I then want to convert that GUID into a form recognizable by GetPlayerInfoByGUID(guid_from_CLEU) to pull their name, check it against a table filled with shamans or warrior names that were already created, and whisper some folks afterwards.

Right now I have: http://pastebin.com/HSYWqY6y which ive commented

I'm sure the problem is I'm trying to pass a hex 64 bit string into the GetPlayerInfoByGUID() function, but I have no idea how bit.band works or what parts of the hex string are needed.

Appreciate any help
  Reply With Quote
08-30-14, 08:39 PM   #2
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Well, for one thing if you have the sourceGUID in the combat log you also have the sourceName, making this a completely unnecessary step.

You may want to check if UNIT_DESTROYED is actually providing the source information of the unit that created it.

You might need to create a table that tracks who summoned a specific totem or banner so you can look up who created it when it despawns.

Last edited by semlar : 08-30-14 at 08:43 PM.
  Reply With Quote
08-30-14, 08:44 PM   #3
sirann
A Flamescale Wyrmkin
Join Date: Mar 2007
Posts: 142
I've checked with 23 args on UNIT_DESTROYED, no names. But, on the summon, the name and guid are there, so I can associate, and check that table.

I take it there are no string manipulations I can do, or is it just more effective to create a table?
  Reply With Quote
08-30-14, 08:53 PM   #4
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
If sourceName isn't in UNIT_DESTROYED then neither is the GUID, so you have nothing to go off of.

The destGUID should be the GUID of the totem being destroyed.

What I would do is create a table and when SPELL_SUMMON or whatever event creates these things fires, record the [destGUID] = sourceGUID or sourceName and when UNIT_DESTROYED occurs just look up the destGUID in the table to figure out who it belonged to.
  Reply With Quote
08-30-14, 09:06 PM   #5
sirann
A Flamescale Wyrmkin
Join Date: Mar 2007
Posts: 142
Just to clarify, sourceGUID IS in the UNIT_DESTROYED event, but not sourceName

Here's the summon, which has both:



arg5 is the sourceName and arg8 is the sourceGUID

Here's the destroy event, which only has guid:



arg7 is the sourceGUID. the guid changed because i relogged

But I'm going to listen to the summon event, set the table key equal to the name, and then use arg 7 from the destroyed event to get the value associated with the key (the player name)
  Reply With Quote
08-30-14, 09:19 PM   #6
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Originally Posted by sirann View Post

arg5 is the sourceName and arg8 is the sourceGUID
No.. arg4 is the source GUID and arg5 is the source name.

arg8 is the GUID of the searing totem, and the sourceGUID is nil in the second screenshot and I can only assume you made a typo because I'm pretty sure the sourceName argument should be an empty string, not what appears to be unit flags.

Open up /etrace and look at the enumerated args for the combat log event.

edit: The source name is completely missing from the second output so the arg numbers after it are all off. I guess when you try to print an empty string it just does nothing.

Last edited by semlar : 08-30-14 at 09:26 PM.
  Reply With Quote
08-30-14, 09:29 PM   #7
sirann
A Flamescale Wyrmkin
Join Date: Mar 2007
Posts: 142
I see what I have done. You are correct. I was wrong. I just saw a guid in both, and assumed it was the player, not the totem :/
  Reply With Quote
08-30-14, 10:36 PM   #8
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
You can always double-check with UnitGUID("player")
http://wowprogramming.com/docs/api/UnitGUID
__________________
"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

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Turning GUID from CLEU into the player name

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