Bongos - Scripting
With WoW 2.0 (The Burning Crusade), things like showing, hiding, and moving action buttons in combat will most likely no longer work. In response to this, I have the scripting functionality from Bongos
Note: This thread is a work in progress. Ask questions :) "I want to make another actionbar change when I change stances." "I want to make an actionbar hide when I have no target." "I want to make all bongos bars become transparent when I'm in town." "I want to make <bar> do <action> when <event> happens." With the release of Bongos 6.8.23, all of those things are now possible via scripting. Scripting is a feature intended for advanced users. You're going to want to know a bit about Lua, the WoW API, in game events, and the code of Bongos itself. Writing a Script Open up the options menu, and go to the scripts tab. You'll see three sections: bar, event, and action. Bar - The barID we want listening for the event, or "all" for all bongos bars. You can figure out a bar's ID, if the bar is shown, by unlocking bar positions. bags is for the bag bar, 1 for the actionbar 1, menu for the menu bar, etc. You can also specify a group of bars, ex bags menu key for the menu, bags and key bars, and a range of bars, ex 1-10 for actionbars 1 through 10. Event - What event we're watching for. A good list of events can be found at the wiki Action - What we do when the specified event happens. This part is written in Lua. You have access to the normal globals for an event (event, arg1, arg2, etc), as well as the bar the event is being called for (bar). Run At Load - This checkbox makes the given action run right after all bars have been created. Saving - Click the save button. Code will only be saved if there were no errors in it. Useful Bongos Stuff bar
BBar - These functions work on all Bongos bars (action, class, bags, etc)
BActionBar - These functions only work on action bars.
BProfile - These functions are used for loading and saving Bongos layouts. I don't have an exact time, but I would suggest not frequently loading profiles
BScript - These functions are used to define event actions for Bongos completely in Lua.
Examples Making the second actionbar switch when you shapeshift/change stances: Code:
bar: 2 Code:
bar: 1 Code:
bar: 10 Code:
bar: 10 |
This is beautiful, Tuller. :)
Please bear with me as I'm a newb at this and don't have access right now to my WoW machine. With the examples you list, are the functions SetStanceOffset(), Show() and Hide() specific to Bongos or are they Blizz/WoW functions? I don't see them at the Wiki but then I might not be looking in the right place. If they are Bongo specific, do you have a list of functions available? In the second example with the target/hide, I know that bar is a reference to the bar the event has occurred on - are there other globals you have available for use here? Again, forgive me if my questions are dumb, just started replaying WoW after a year off and probably trying to learn too much at a time. :) |
Nice, this is one thing i was lookin to use in Bongos, but i was wondering if instead of just hiding the bar, i could changes it's transperancy?
|
Quote:
|
Quote:
|
Whenever an event occurs, you have access to:
Quote:
Bongos functions will look like BBar.Funct, or BActionBar.Funct. I'll end up making a list of the useful ones soonish. Quote:
For combat, you need to make two scripts: One that fires on PLAYER_REGEN_DISABLED (in combat), PLAYER_REGEN_ENABLED (out of combat) |
I will try this myself, I am curious to see the effect with my Troll- I think I regen a little while still in combat.
|
I'have just a question, is there a way to make one bar switch page when the target in in melee range and then switch back when he leaves melee range, i'm just waiting for this to switch from dab to bongos even with my hunter
|
Is it correct to assume that the UNIT_HEALTH event would cause a script to be fired any time a unit health changes - meaning, target health, your health, party health, raid health, etc. etc.?
What I'm trying to figure out is an eloquent way to have a button appear when, say, something can be Executed. The script itself is pretty straightforward, using UnitHealth("target") < 20. The part I can't get past is how to set up the event to run the script. What I really need is an event for the target's health changing, only. It just seems there has to be a way to do that, without tying in to every unit health change that is happening. Maybe I'm assuming that lots of unit health event firings is a performance issue, and it really isn't that bad? |
Welcome to the land of conditionals :)
Code:
event: UNIT_HEALTH It's possible to do custom events via the function BScript.CallBarEvent(event), and here's how the previous code would probably look like using one: Code:
event: UNIT_HEALTH Code:
event: BONGOS_TARGET_HP_UPDATE |
Aaah, so that is how you would use the arguments passed from the event. Simple!
This is great for me, because aside from setting up some really cool UIs, it is also teaching me a lot about events and such, how they fire, and all that jazz. This is cool :) |
ok i menaged to get an idea on how to do the range thingy, something like:
Code:
|
Hunter range/melee page swap
Quote:
I took a look at the events, but I don't see one that would fire when in range/out of range, as I guess it depends on a particular action. If I'm missing it, please correct me! If there isn't, is there any way we could get a couple of custom events? Maybe something like: BONGOS_IN_RANGE_ATTACK (for melee) BONGOS_IN_RANGE_SHOOT (for ranged) Thanks! moniker |
Quote:
|
I love the new ability to page a bar other than the main bar on stance changes.
However. With bar 1 paging to bar 7, 8, 9 on stance changes. Followed by bar 2 paging to 3, 4, 5. Meaning 8 bars are taken up by stance changes. Leaving two. Now, I wondered if there's a way to get more bars out of my setup (well, just need one more really). Seems a waste to have 1 and 2 essentially empty and *just* used to paging, rather than being used for the first stance with two bars following for other stances. Is this possible? Or is that just the way? |
This is great. I switched from flex to bongos a while ago to have something a little more light weight, and I've been missing some of it's functionality.
Specifically, is there any way to show/hide bars on mouse enter/leave? Or show/hide bars on keybinding down/up? I've looked at the event api wiki, and don't really see anything that would do that by default, without really digging into the bongo's xml. |
found a bug, related to scripting i think. i can still use the buttons but all the icons are gone, if i move the spell, the icon reapeers |
Quote:
Code:
if GetBonusBarOffset() == <whatever your default stance is> then Quote:
Quote:
|
but i dont use paging, i only use show on target, and it happens everytime i log out
|
Is it possible if you could post a screenshot of the scripting GUI with a function script in it?
I'm trying to make the following code run: bar: class event: PLAYER_REGEN_DISABLED action: BBar.SetAlpha(class, 0.5) BBar.SetAlpha(9, 1) Run at Load: Checked I receive the following error: Interface\AddOns\Bongos\bar.lua:262:attempt to index local `bar'(a string value) Using the following code results in the same error: bar: 9 event: PLAYER_REGEN_ENABLED action: BBar.SetAlpha(9, 0.5) BBar.SetAlpha(class, 1) Run at Load: Checked |
All times are GMT -6. The time now is 12:40 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI