After days of reading, I've decided to work on my first WOW AddOn. I'm trying to create one to prompt the user when she opens a vendor window and the vendor sells a recipe they can learn but do not already know.
As of right now, I've got the NewRecipe.toc, NewRecipe.xml and NewRecipe.lua.
My XML looks something like this:
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
<Script file="NewRecipe.lua" />
<Frame name="NewRecipe_core">
<Scripts>
<OnLoad>
this:RegisterEvent("VARIABLES_LOADED");
</OnLoad>
<OnEvent>
if(event=="VARIABLES_LOADED")then
NewRecipe_init();
elseif(event=="MERCHANT_SHOW")then
NewRecipe_popup();
end;
</OnEvent>
</Scripts>
</Frame>
</Ui>
My Lua looks something like this:
Code:
function NewRecipe_init()
SendChatMessage("Loaded.", "SAY");
end;
function NewRecipe_popup()
SendChatMessage("Popup.", "SAY");
end;
If I call "/console reloadui," I see the message displayed by NewRecipe_init(); however, when I talk to a vendor, the function doesn't fire.
I know that those SendChatMessage functions probably aren't the best thing to use, but I'm just trying to detect an event fire.
Any suggestions?