I'm sorry for the double post and the late reply - only just got to testing this. This doesn't appear to work. I'm new with events and don't fully understand how they're used in WoWLUA.
Here's my code -
Foo.lua
Code:
if event == "PARTY_KILL" then
hunted=hunted+1
end
slash_command.lua
Code:
SLASH_HUNT1 = "/hunt"
SlashCmdList["HUNT"] = function(msg, editBox)
if hunted == nil then
SendChatMessage("You haven't killed any monsters");
else
SendChatMessage(hunted, "SAY");
end
end
Foo.xml
Code:
<Frame name="Foo_Frame">
<Scripts>
<OnLoad>
Foo_OnLoad();
</OnLoad>
<OnEvent>
Foo_OnEvent(self, event, ...); -- The ... parameter passes all arguments that would otherwise be implicitly sent prior to 3.0.
-- As of 3.0, you will need to explicitly send these arguments (as done here).
</OnEvent>
</Scripts>
</Frame>
AutoLoot1.toc
Code:
## Interface:
## Title: Hunt Tracker
## Author: Surgeon
## Version: 1.00.0
## URL: N/A
## DefaultState: Enabled
## LoadOnDemand: 0
## SavedVariablesPerCharacter: hunted
Foo.lua
Foo.xml
slash_command.lua
Could someone tell me why it isn't working? Thanks (: