FlexBar Advanced Topics - Events, Delays and Conditions

Advanced Topics - Events, Delays and Conditions

Introduction: In addition to very configurable buttons, FlexBar keeps track of dozens of different game states and raises an event (think trigger) when they change. This can be gaining a target, losing a buff, getting poisoned, changing forms, losing health. Many of these events can come from many different sources - health events can come from you ('player') your pet ('pet') your group mates ('party1', 'party2', 'party3', 'party4') or your target ('target'). In FlexBar parlance this is the Target of the event. It's not the best way to refer to it, but it's what I started with and we're stuck with it :)

Taking action on these events is the core of what makes flexbar so versatile - you can have your combat buttons show only when you need them, you can create r-click button menus, pop-bars and a whole slew of other things by taking actions on events.

To further enhance this capability, FlexBar can incorporate a delay in executing the command and can decide to execute/not execute based on game conditions at the time of the event.

Examples: Popbar, Combat Sensitive Buttons, R-Click menus, Buff-warnings:

PopBar (use the Scripts editor to do this example

Group Button=1-12 Anchor=1
VerticalGroup Group=1 Width=4
Show Group=1 On='MouseEnterGroup' Target=1
Hide Group=1 On='MouseLeaveGroup' Target=1

This will create a 4 button wide, 3 button high group that will popup when you mouse over it and hide when you mouse away from it. In order to move it you'll want to type /flexbar show group=1 and move it with the handle without mousing into it - as once you do it will hide on the way out and you won't be able to grab the handle).

Combat Sensitive Buttons - or show only when I might be in a fight:

Group Button=1-12 Anchor=1
VerticalGroup Group=1 Width=6
Show Group=1 On='StartCombat' Target='player'
Show Group=1 On='GainTarget' Target=['hostile' 'neutral']
Show Group=1 On='TargetReactionChanged' Target=['hostile' 'neutral']
Hide Group=1 On='EndCombat' Target='Player'

Right Click Menus - a single button that pops a radial menu when Right-clicked. The menu disappears when a button is clicked or the mouse leaves the group

Group Button=1-7 Anchor=1
CircleGroup Group=1
Show Button=8
MoveRel Button=8 Trgbtn=7
Group Button=1-8 Anchor=8
Hide Button=1-7
Advanced Button=8 State='on'
Show Button=1-7 On='RightButtonClick' Target=8
Hide Button=1-7 On='LeftButtonClick' Target=1-7
Hide Button=1-7 On='RightButtonClick' Target=1-7
Hide Button=1-7 On='MouseLeaveGroup' Target=8

This will create an 8 button group with 7 buttons hidden - when you right click the visible button, the others will pop up in a circle over it. Drag the group by the visible button.

Buff Warnings - Ever get tired of realizing in the middle of a fight that you've been doing it without Blessing of Might up?

Put Blessing of Might on button 1

Show Button=1 On='LoseBuff' Target='Blessing of Might'
Hide Button=1 On='GainBuff' Target='Blessing of Might'

Delays: Sometimes we want to take an action a set amount of time after an event. An example of this is that, after a dodge Overpower is usable, but only for a set amount of time (4 seconds or so). To handle this we might put Overpower on button 1 then

/flexbar Show Button=1 on='TargetCombat' Target='Dodge'

/flexbar Hide Button=1 on='TargetCombat' Target='Dodge' In=40

In= is the delay in tenths of a second.

Conditions: Because of the nature of events, you are given only one at a time - there is no event for when an ability is both in range and has enough mana. To do this we must check the other condition on the event:

/Flexbar Show Button=1 On='EnoughMana' Target=1 If='InRange<1>'

/Flexbar Show Button=1 On='NowInRange' Target=1 If='EnoughMana<1>'

Note that we have to put a command in for both events we are interested in to cover the 2 circumstances (1. We were already in range and just gained enough mana for the ability and 2. We already had enough mana and just moved into range).

Order of Execution: If you look in the event list (either in the event editor or through /flexbar listevents) you will see that they are in a specific order - this is the order that the commands are processed in on a given event -- the lower numbered commands will be processed first.

Also, events > delay > condition is the order in a command:

IE: /flexbar show button=1 on='losttarget' in=5 if='manabelow50<"player">' will process as follows:

1. When you first type it in, an event is added to the event list.

2. When the event fires, the command is sent to the command processor without the on= on it, at this time it executes any delay

3. At the end of the delay the command checks the If= condition -- if it is true at this time, the command executes.

Commands that can be executed On=, If=, In=

"show", "hide", "fade", "shade", "scale", "moveabs", "moverel", "movetomouse", "remap", "echo", "use", "runscript", "runmacro", "text", "text2", "raise", "settexture", "shadetext", "shadetext2"