WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Who is trading with me? (https://www.wowinterface.com/forums/showthread.php?t=5065)

EmGooser 06-10-06 12:59 AM

Who is trading with me?
 
I have having an issue finding a function or event that will tell me WHO is trading with me if they open the trade up. Wow wiki tells me that TRADE_REQUEST no longer works (and I have tryed it too). Does anyone know of a way to tell who is trading with the player? The onyl way I can think of doing it without a function or event would be to read the text in the trade window somehow, but I dont know the frame's name nor the object that would be under.

Thanks in andvance for anyone that can help.

Em

ZeroKnowledge 06-11-06 01:07 PM

You can use the "TRADE_SHOW"-Event. The name of the player who is trading with you is UnitName("NPC").

Code:

function WhoIsTrading_OnLoad()
  this->RegisterEvent("TRADE_SHOW");
end

function WhoIsTrading_OnEvent()
  if(event == "TRADE_SHOW") then
    DEFAULT_CHAT_FRAME:AddMessage("Trader: " .. UnitName("NPC"));
  end
end


EmGooser 06-12-06 04:57 PM

thanks. I will give it a shot tonight


All times are GMT -6. The time now is 01:18 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI