View Single Post
05-28-06, 07:59 AM   #4
Aileen
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 28
Originally Posted by Echo5ive
My problem appears to be that the event doesn't pass on any arguments whatsoever.
Are you sure? Try:

Code:
function WangFu:CHAT_MSG_COMBAT_FACTION_CHANGE()
	ace:print(arg1)
end
I was working on a faction addon for a little while before SCT got the faction info in it, and this is an example what I used:

Code:
function Foo:Enable()
  self:RegisterEvent("CHAT_MSG_COMBAT_FACTION_CHANGE", "FactionChange")
end

function Foo:FactionChange()
  local _, _, faction, change, direction = strfind(arg1, "Your reputation with (.+) has .+. %((%d+) reputation (.+)%")
  if faction then
    self:Msg("You have %s %d reputation with %s.", direction, change, faction)
  end
end
This would look for something like "Your reputation with Timbermaw Hold has increased. (25 reputation gained)" and print out "You have gained 25 reputation with Timbermaw Hold."
  Reply With Quote