Foo.lua
Code:
function Foo_OnLoad(self)
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
SLASH_HUNT1 = "/hunt"
SlashCmdList["HUNT"] = function(msg)
if hunted == nil then
SendChatMessage("You haven't killed any monsters", "SAY");
else
SendChatMessage("Number of killing blows: "..hunted, "SAY");
end
end
end
function Foo_OnEvent(self,event,...)
local timestamp, type = ...
if type == "PARTY_KILL" then
hunted = ( hunted or 0 ) + 1 --in case hunted isnt declared yet
end
end
Foo.xml
Code:
<Frame name="Foo_Frame">
<Scripts>
<OnLoad>
Foo_OnLoad(self);
</OnLoad>
<OnEvent>
Foo_OnEvent(self, event, ...);
</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