View Single Post
09-28-10, 01:59 PM   #5
Xubera
A Cobalt Mageweaver
 
Xubera's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 207
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
__________________
Chat Consolidate is the solution to any out of control trade chat. Ignore lines, throttle chat, consolidate posts!Follow the link to find out how!

▲ ▲ WoWInterface wont let me triforce >.>
  Reply With Quote