(somewhat offtopic) API / Lua documentation

Pimp your interface.

Moderator: Forum Administrators

Post Reply
Helistar
Honored
Posts: 102
Joined: Tue Sep 18, 2012 4:01 pm

(somewhat offtopic) API / Lua documentation

Post by Helistar » Wed Jan 14, 2015 5:09 am

Hello, apologies for the somewhat offtopic question. I'm looking a bit more deeply into weakaura customization, in particular stuff involving custom triggers and display. Is there an authoritative and up-to-date reference on the Blizzard Lua API? Searching with google I always end up on incomplete pages or information which is clearly outdated because it doesn't include the latest 6.0 changes, which I know first-hand from log analysis. I know that while my knowledge of combat logs can translate easily when dealing with stuff like COMBAT_EVENT_UNFILTERED, the addon API includes many extra events (target switch, mobs appearing, etc.) which I know nothing about.

Jeshu
Revered
Posts: 244
Joined: Tue Dec 14, 2010 5:34 pm

Re: (somewhat offtopic) API / Lua documentation

Post by Jeshu » Wed Jan 14, 2015 12:03 pm

There is no authoritative reference for the Blizzard API. Personally, I tend to use wowprogramming.com since the information there is usually pretty accurate, though it's not fully updated for WoD yet. Wowpedia is my main backup information site if wowprogramming is not up-to-date; in particular, their CLEU page is very good. Ultimately, if you really need to be sure how to do something, you can look at the Blizzard UI code to see how they do it themselves. You can find a mirror of the UI sources on GitHub.

User avatar
aggixx
Exalted
Posts: 2292
Joined: Fri Nov 25, 2011 7:49 pm
Contact:

Re: (somewhat offtopic) API / Lua documentation

Post by aggixx » Fri Jan 16, 2015 12:28 am

I basically do what Jeshu said. Looking at other addons that may be doing something similar to what you're trying to do is another good route as well, of course.
ImageImage

Helistar
Honored
Posts: 102
Joined: Tue Sep 18, 2012 4:01 pm

Re: (somewhat offtopic) API / Lua documentation

Post by Helistar » Mon Jan 19, 2015 5:56 am

Yes, this is what I started to do (and hit a post of yours on MMO Champion, BTW :)).

Overall, my objective is to learn a bit more about addons/lua/weakaura custom triggers (which provides a very good framework to "build a simple addon" without going through the entire developement process). Since I always have trouble with interrupting at the right time when I do target switches, I wanted to count the casts and have markers telling me if I should interrupt the next cast or not. Of course I'm sure I can head to curse and get an addon which does exactly that, or ask here and some of you can cook it up in 30 seconds, but in that case I learn nothing.....

So I've started and I'm almost there. Looking at how the feral bleed snapshots work and other stuff on the forums, I'm up to the point where I can:
- have the indicator appear if I'm in combat
- detect when the add I need to interrupt pops
- count the casts and output a message telling me if I should interrupt or not, with any possible logic (odd/even, etc.)

The only thing which is still not working is detecting when the add dies in order to reset the counter. And I'm quite positive that the error is in my code. I trap COMBAT_LOG_EVENT_UNFILTERED and check for an UNIT_DIED with a destination name which matches the add, but it does nothing. Even stranger, I tried to reset the counter on ANY UNIT_DIED event and it still does nothing (note that I'm doing this on Brackenspore, so there's a lot of stuff dying, including us :P), so it must be me doing something wrong, as I verified the combat log and the Fungal Flesh-Eater has a UNIT_DIED event. I'll keep trying more before I post here for more help.....

Jeshu
Revered
Posts: 244
Joined: Tue Dec 14, 2010 5:34 pm

Re: (somewhat offtopic) API / Lua documentation

Post by Jeshu » Tue Jan 20, 2015 6:24 pm

If you post the Lua code you are using, I'm happy to take a look. I don't use WA2, so you'll have to post the code, not the WA string. If the code is too long to put here, then throw it up on pastebin.com and copy the link to the pastebin here.

Helistar
Honored
Posts: 102
Joined: Tue Sep 18, 2012 4:01 pm

Re: (somewhat offtopic) API / Lua documentation

Post by Helistar » Wed Jan 21, 2015 5:20 am

I found the bug, which was (of course) a completely idiotic one...... I mean, there are no events called "UNIT_DIIED" :)

It more or less does what I want, after using it I also did some improvements. I'm wondering if there's a way to have it load exclusively for one boss fight, I can probably have a good guess if I check the initial events and shut everything down if the destName is never the right boss name, but I'm wondering if there may be a better approach.

I don't have the code here now, but if it's not a problem I can post it so that you can tell me how to improve it :)

Post Reply