Minion Beta! - Help us test our new AddOn updater. Get it now!
Download
(2 Kb)
Download
Updated: 08-09-08 07:49 AM
Updated:08-09-08 07:49 AM
Created:unknown
Downloads:1,524
Favorites:3
MD5:

LibWombat

Version: 30000.4
by: Beladona [More]

This library endeavors to provide a callback function for combat log events. It basically handles the job of intercepting unfiltered combat events, and dispatching them to any callback functions you create. If a callback is not registered for a particular event, it doesn't process anything, thereby saving memory. Think of it as a filter for unfiltered combat events.

An example of how to use it is included in the file LibWombat.lua at the bottom. Feel free to expand on it as needed. The entire library is designed to work in a similar nature to :RegisterEvent

I wrote this addon for all of those people out there that were unsure of how to handle combat log events on their own. The purpose is to make it stupid easy to get the data you need, using a proven method everyone is used to using.

30000.4
---------------------------------------
* fixed a long comment error
* changed an unpack to a normal variable return for performance reasons
Post A Reply Comment Options
Unread 09-25-08, 10:46 PM  
Nikishin
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
BUG

In ruRU version (dunno about other versions) packing-unpacking args in "OnEvent" func loses some arguments.

Check eventtype == SPELL_CAST_FAILED, it passes only 6 args instead of 12. No info about spellID, spellName, spellSchool.

P.S. I figured where problem was
Code:
watcher:SetScript("OnEvent",function(...)
....
for i = 1,2 do table.remove(args,1); end <- HERE is the problem, tbh i dunno what can be wrong here =\
...

so, my solution is
Code:
watcher:SetScript("OnEvent",function(self, cleu, ...)
	local args = {...};
	local event = args[2];
	if (wombat.watched[event]) then
		for serial,callback in pairs(wombat.watched[event]) do callback(unpack(args)); end
	end
end);
no other code needs to be changed and it doesnt need to recode other addons using this one


PPS This bug also had been ruined UNIT_DIED event. I was wonder why no args was passed with this event =\
Last edited by Nikishin : 09-25-08 at 10:51 PM.
Nikishin is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: