Detecting buffs/debuffs: Is this still possible from an addon?
Hello!
I've never written anything in Lua before so obviously nothing for WoW but I have a pretty solid background in C (I study mathematics but I do a lot of programming for simulations) so I thought I'd give writing my own "addon" a shot. Basically what I want to do is lay the groundwork for a system to detect events and react depending on what it is. The basic idea would be something like this:
[Action] happens to [Something] with [Some Parameters] then do [Something]
An obvious one would be to detect if Player gets a debuff, check which one it is, and if it's breakable with Hand of Freedom, alert the player.
Obviously there's a way to detect buffs and debuffs (a lot of addons do it) but is there a event-way to handle them? I'm probably phrasing this really badly, but I feel like Blizzard might've added some kind of restriction to stop people from automating the game process too much.
Looking through WoWWiki I found some basic documentation for the UnitAura API which lets me grab my buffs. There is also the UNIT_AURA event which returns a UnitAura ID. I'm assuming this would work? Listening for a UNIT_AURA even, grab the UnitAura ID, check what it is and react accordingly?
First time doing this so any tip welcomed. Just wondering if this was a good way to go.
Thanks!
|