Thread Tools Display Modes
08-26-06, 10:32 AM   #1
Tuller
A Warpwood Thunder Caller
 
Tuller's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 91
Whenever an event occurs, you have access to:
  • bar - What bar the event is being fired for
  • event - What event is being fired
  • Any args an event has. You can figure out what these are by looking at the events list

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.
Show() and Hide() are frame functions
Bongos functions will look like BBar.Funct, or BActionBar.Funct. I'll end up making a list of the useful ones soonish.

if i could make it so when my health is below a certain percent it shows the bar, also, instead of having a target it would set the alpha, when i enter /leave combat it would change the alpha, i almost got it to work, but it wouldnt switch back when i went out of combat, if i could have some help that would be awesome!
For health, you need to use the event UNIT_HEALTH. Scroll down a bit to find the event.
For combat, you need to make two scripts: One that fires on PLAYER_REGEN_DISABLED (in combat), PLAYER_REGEN_ENABLED (out of combat)

Last edited by Tuller : 08-26-06 at 10:40 AM.
  Reply With Quote
08-26-06, 10:55 AM   #2
Flarin
A Frostmaul Preserver
 
Flarin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 290
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.
  Reply With Quote
08-26-06, 01:26 PM   #3
backslash83
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 4
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
  Reply With Quote
08-27-06, 08:47 AM   #4
moniker
A Defias Bandit
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 3
Hunter range/melee page swap

Originally Posted by backslash83
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
I'm really looking forward to this functionality as well, if it's possible.

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
  Reply With Quote
08-27-06, 10:26 AM   #5
Tuller
A Warpwood Thunder Caller
 
Tuller's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 91
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)
I'll probably end up making a plugin to add those events. I'm fairly sure that its based on watching a skill for changes in usability.
  Reply With Quote
08-27-06, 11:36 AM   #6
Scae
A Deviate Faerie Dragon
Join Date: Jan 2006
Posts: 11
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?
  Reply With Quote
08-27-06, 12:57 PM   #7
aythya
A Kobold Labourer
Join Date: May 2006
Posts: 1
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.
  Reply With Quote
08-28-06, 05:53 PM   #8
moniker
A Defias Bandit
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 3
Originally Posted by Tuller
I'll probably end up making a plugin to add those events. I'm fairly sure that its based on watching a skill for changes in usability.
I think you're right, and I think this is how DAB handles it. I have to specify which of the buttons actions I want to do "range checking" on, and based on "in range" or "out of range", switch pages (in my case, the hunter's 'wing clip').

Thanks for considering adding this functionality!
  Reply With Quote
08-26-06, 02:39 PM   #9
Delsphynx
A Defias Bandit
Join Date: Apr 2006
Posts: 2
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?
  Reply With Quote
08-26-06, 03:29 PM   #10
Tuller
A Warpwood Thunder Caller
 
Tuller's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 91
Welcome to the land of conditionals
Code:
event: UNIT_HEALTH
action:
if arg1 == "target" then
    if UnitHealth("target") <= 20 then
        bar:Show()
    elseif not bar:IsShown() then
        bar:Hide()
    end
end
This event WILL still fire on every unit health event, but it won't do much on it. I'm going to end up upgrading the event system a bit so you can specify a group of bars like you can in slash commands.

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
action:
if arg1 == "target" then
    arg1 = UnitHealth("target")
    BScript.CallBarEvent("BONGOS_TARGET_HP_UPDATE")
end
Code:
event: BONGOS_TARGET_HP_UPDATE
action:
if arg1 <= 20 then
    bar:Show()
elseif not bar:IsShown() then
    bar:Hide()
end
  Reply With Quote
08-26-06, 03:34 PM   #11
Delsphynx
A Defias Bandit
Join Date: Apr 2006
Posts: 2
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
  Reply With Quote
08-27-06, 04:58 AM   #12
backslash83
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 4
ok i menaged to get an idea on how to do the range thingy, something like:

Code:
 
bar:      1
event:  [here is the problem]
action:
if IsActionInRange(100) then
    BActionBar.SetStanceOffset(1, 2)
else
   BActionBar.SetStanceOffset(1, 0)
end
Run at Load:  Checked
but i don't understand on witch event should it be checked and if the second BActionBar.SetStanceOffset il correct to switch the bar on it's original state.
  Reply With Quote
08-27-06, 01:07 PM   #13
darkforce898
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Feb 2005
Posts: 12


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
  Reply With Quote
08-27-06, 02:13 PM   #14
Tuller
A Warpwood Thunder Caller
 
Tuller's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 91
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.
You can't have more than 120 buttons, that's a blizzard limit. But I think you just want to make it so that if you're on a certain stance, then bar 1 and bar 2 don't change pages. Here's how that'll look:
Code:
if GetBonusBarOffset() == <whatever your default stance is> then
    BActionBar.SetStanceOffset(bar.id, 0)
else
    BActionBar.SetStanceOffset(bar.id, GetBonusBarOffset())
end
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
Bongos bug. I don't update the textures for bars that aren't shown when paging, and forgot to do it OnShow. I fixed it in 6.8.28.

Specifically, is there any way to show/hide bars on mouse enter/leave? Or show/hide bars on keybinding down/up?
I'm going to have to hardcode autohiding. The show on key press is something that can only be done via macros at this point, and I'm not absolutely sure how to do keypress events short of making keybindings for 120 bars.

Last edited by Tuller : 08-28-06 at 09:22 AM.
  Reply With Quote
09-03-06, 11:07 AM   #15
Arbiter
A Murloc Raider
Join Date: Mar 2005
Posts: 4
Is there any event to check wether i'm in raid or not ? i'm trying to create an event for bongos so 1 particular action bar (Which has all my raid macros) shows when in raid, but gets hidden when i'm out of raid or in a party.


Any ideas?
  Reply With Quote
09-05-06, 03:41 AM   #16
Minou
A Fallenroot Satyr
Join Date: Jan 2006
Posts: 27
How can I hide/show a bar when Player or Target gains a buff/debuff?

Bar 6
Action UNIT_AURA

if UNIT_AURA"Player"= "Demon Armor" then
BarShow()
else
BarHide()
end

Does not work

Could somebody post the correct syntax here please?
  Reply With Quote
09-07-06, 06:08 PM   #17
Tuller
A Warpwood Thunder Caller
 
Tuller's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 91
Originally Posted by Arbiter
Is there any event to check wether i'm in raid or not ? i'm trying to create an event for bongos so 1 particular action bar (Which has all my raid macros) shows when in raid, but gets hidden when i'm out of raid or in a party.


Any ideas?
There's a raid update events in the events listing.
GetNumRaidMembers() tells you how many people are currently in the raid you're in. Guess what 0 means

Could somebody post the correct syntax here please?
It should be identical to my shadow form switcher, using IsBuffActive("buffName")

Default Emergency bar
Tuller,

Totally new to this stuff, but I was hoping for a fast way to configure bongos to display a bar containing potions/bandages etc to pop up at a pre-defined health percentage. Maybe make the buttons enlarged etc to make them noticed and easier to activate. This would be a very cool feature that I am sure a ton of people would use.
On the event UNIT_HEALTH, check for UnitHealth("player") / UnitHealthMax("player") to be <= <percentage>

I'm a bit confused on how exactly things are supposed to be typed in for a script - do I type 'bar 2' and 'event blahblah' or just '2' and 'blahblah' etc.
just 2 and blahblah

Or is there a chance we could get some key events to check for and bind through the key binding interface?
I still need to look into keypress events.
  Reply With Quote
09-07-06, 08:27 PM   #18
OttoDestruct
A Defias Bandit
Join Date: Sep 2006
Posts: 3
Argh.. Alright I've tried for a couple hours and I'm still not getting this. Any help would be appreciated.

I've been looking at the other druid stuff and not getting anywhere. Heres what I want to do:
Shift to Catform: Change Bar1 and Bar2 to another bar. Shift out, change them back to the originals.
Shift to Bear: Same as Cat.

Just messing around I can get one bar to change, but I'm having trouble getting both to change, and implementing it for both forms.

Edit: SOMEONE PLEASE HELP? I'm about to go back to Discord, setup there is actually becoming simpler than Bongos .....

The script I'm using from a previous post:
Code:
if GetBonusBarOffset() == 0 then
    BActionBar.SetStanceOffset(bar.id, 0)
else
    BActionBar.SetStanceOffset(bar.id, GetBonusBarOffset())
end
Its changing, but not correctly for me when I shapeshift. Bear form works fine and changes bar 1 to bar 3, but Cat Form simply changes bar 1 into bar 2... I really have no idea what I'm doing.

Last edited by OttoDestruct : 09-08-06 at 09:56 AM.
  Reply With Quote
09-08-06, 08:41 AM   #19
Zephra
A Murloc Raider
Join Date: Aug 2006
Posts: 4
Originally Posted by Tuller
On the event UNIT_HEALTH, check for UnitHealth("player") / UnitHealthMax("player") to be <= <percentage>
ok ... i tried this.

Code:
if UnitHealth("player")/UnitHealthMax("player") <= 95 then

    bar:Show()

elseif not bar:IsShown() then

   bar:Hide()

end
but the bar will not hide after 95 percent and always stay open. I also noticed that when I log in the bar will apear and I have to manually hide it again.

Thanx Tuller
  Reply With Quote
09-08-06, 09:25 AM   #20
Arbiter
A Murloc Raider
Join Date: Mar 2005
Posts: 4
Originally Posted by Tuller
There's a raid update events in the events listing.
GetNumRaidMembers() tells you how many people are currently in the raid you're in. Guess what 0 means
Yea thanks it worked

created a script with the following:

Bar: 10
Event: RAID_ROSTER_UPDATE

Script:
Code:
if GetNumRaidMembers() <= 0 then

    bar:Hide()

else

    bar:Show()

end
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Released AddOns » Bongos - Scripting


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off