I'm trying to make a conditional which would show my bag bar only if I target my character. [target=player, exists]show;hide doesn't seem to be working and I thought that you guys might have a clue on what to do.
What you want to do isn't possible using macro conditionals.
[target=player, exists] show; hide means "if the player exists, then show, otherwise hide". The "target" condition specifies the target of the macro's action, eg. /cast [target=focus] Polymorph to cast Polymorph on your focus unit.
There is no macro condition for comparing your target to a specific unit. You can only check whether the target of the macro (by default, your target, though you can use the "target" condition to specify a different target, as in the Polymorph example) is friendly or hostile, with the "help" and "harm" conditions.
You could, however, write a small, separate addon to show or hide your bag bar depending on your current target:
local BagBar = Bartender4:GetModule("BagBar")
local f = CreateFrame("Frame")
local newstate = not not UnitIsUnit("player", "target") -- the "not not" forces it to be a boolean value
if newstate == state then return end -- quit if the state didn't change
state = newstate -- record the new state
BagBar:ToggleModule(state) -- toggle the BT4 BagBar module on/off based on the new state
Use http://addon.bool.no/ to turn the above code into an addon. Before downloading, click the "Show advanced (TOC) options" button and add this line in the additional box that appears, to make sure BT4 loads before your addon; otherwise you may get errors:
## Dependencies: Bartender4
__________________ Retired author of too many addons.
Message me if you're interested in taking over one of my addons. Donít message me about addon bugs or programming questions.