Skip to content

Instantly share code, notes, and snippets.

@orlp
Forked from anonymous/chat.lua
Created December 16, 2010 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orlp/744141 to your computer and use it in GitHub Desktop.
Save orlp/744141 to your computer and use it in GitHub Desktop.
local addmsg = ChatFrame1.AddMessage
local function hook(frame, text, ...)
if text:find(gsub(ERR_AUCTION_SOLD_S,'%%s', '')) then -- "A buyer has been found for your auction of %s."
local itemname = text:match(gsub(ERR_AUCTION_SOLD_S, '%%s', '(.+)'))
text = "|cffef4341"..BUTTON_LAG_AUCTIONHOUSE.."|r - |cffBCD8FF"..ITEM_SOLD_COLON.."|r "
local _, solditem = GetItemInfo(itemname)
if solditem then
text = text..solditem
else
text = text..itemname
end
end
return addmsg(frame, text, ...)
end
for i = 1, NUM_CHAT_WINDOWS do
_G["ChatFrame"..i].AddMessage = hook
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment