Log in

View Full Version : Conditional action bar paging



zenga
06-15-2011, 08:03 AM
A while ago Maat posted his (contested) way to deal with procs on his ret paladins. If I understand it correct, an addon takes care of the proc, and as long as it's not active he has an extra layer over the button on the actionbar (which was based on his atramedes shield clicker addon (http://wow.curse.com/downloads/wow-addons/details/atramedesshieldclicker.aspx)). Once the proc matches the conditions, the layer gets removed and he generated a predefined mouseclick to fire off the proc. And this mouseclick is what was considered a violation of the ToS. I don't want to reopen this debate, but the idea was pretty slick.

This got me thinking: if there is a way to track procs and based on that let other UI elements react to it, would it be possible to alter the state of an actionbar?

Let's say you have an actionbar A that is the default one. 10 buttons from 1,2,3..0
You put your dps macro in slots 1,2,3,4,5
for example
/castsequence Lighning Bolt, Lightning Bolt
/cast Lava Burst

Now you have Maat's addon that checks your stack of lighning shield orbs. As long as the stack is below 7 it does nothing. Once above it "sends" a signal to for example bartender (or any actionbar mod) that pages the actionbar to it's alternative state.
this could look like:
In slots 1-4 you have earth shock (which will consume all your lightning orbs at once), in slot 5 your normal dps macro.

Your main dps key in Isboxer is setup to include 1,2,3,4,5 on every press. It means that if you just recast an ability that triggered the shock cooldown, it should still fire off your normal dps macro in slot 5. But chances are higher if it's not on CD that it will be triggered before the dps macro since both 1,2,3,4 are earth shock. This is at least how I understood the DK 'priority trick'.

I never really digged into this concept as I know too little about Lua and the wow api. But can some expert shine his/her light on this, and if it's actually possible?

If so this could allow us to set up a nearly perfect dps rotation based on procs for many specs.

Alge
06-15-2011, 09:43 AM
http://wowprogramming.com/docs/api/ChangeActionBarPage

The bad news is that ChangeActionBarPage() cannot be called during combat.

zenga
06-15-2011, 06:43 PM
Aha, cheers for pointing that out. Out of curiosity, how does bartender alters actionbars then during combat (or is that an innate feature that follows the 'form/stance'?)

Jafula
06-15-2011, 06:56 PM
I think what you want to do would be crossing the line into _bad_ automation.

Blizzard has a different set of code for things addons can do in combat. These are called secure templates. This gives addons the ability to do some things that they would not normally be able to do using normal wow api outside of combat. These are designed to stop bad automation, but still give some flexibility to what can be done. My guess is that bartender uses those.

http://wowprogramming.com/docs/secure_template

zenga
06-15-2011, 07:52 PM
I don't really get it to be honest. With the default blizzard interface I have 'actionbar button 1' tied to 1. During combat I can iterate through different states of this actionbar, and the first slot in this bar will always be linked to 1. The same can be done with Bartender.

Are you saying that only a hotkey can page the actionbar, and not by calling it through the any lua code (during combat)? Since bartender seems to use their own set of keybinds I was under the impression that there should be at least a 'call' possible to alter the state.

So lets forget about bartender, there is no way to iterate through the default actionbar(s) by calling it in combat?

Alge
06-15-2011, 08:32 PM
Are you saying that only a hotkey can page the actionbar, and not by calling it through the any lua code (during combat)?

Yes, in combat the action (paging the actionbar) must be initiated by the user, not the result of testing some variable in an addon.

For bartender to change the actionbar it must use the SecureActionButtonTemplate, which enforces the concept that the action must be tied to a user action. Secure templates allow addons to still have access to API functions that could be used for making bots but restricts them to being tied directly to user actions, which means bots cannot be written using the WoW API.

An example of an API function which is not protected is Follow. This is why you can make an addon to auto-follow after combat or to follow strobe. If Blizzard decided to protect this function in the API, the only way to follow would be as a result of a user action.