WoWInterface

WoWInterface (http://www.wowinterface.com/forums/index.php)
-   Macro Help (http://www.wowinterface.com/forums/forumdisplay.php?f=140)
-   -   Only works when at the Auction House (http://www.wowinterface.com/forums/showthread.php?t=42324)

Aanson 01-09-12 07:14 PM

Only works when at the Auction House
 
I would like to create a macro that only works when I'm using the auctionhouse. I'm hoping that I don't need to settle for [nocombat].

I've tried this:

Code:

/click [target=Auctioneer, exists] MacaroonButton70
.. but it doesn't seem to work.

Anyone got any ideas on how I can achieve this? Am I missing something easy?

Thanks in advance :)

Phanx 01-10-12 01:30 AM

The "target=*" macro condition only supports (a) unit tokens like "player" or "focus", or (b) names of characters in your current party or raid.

You could try this:
Code:

/cleartarget
/target Auctioneer
/click [exists] MacaroonButton70

However, a better solution would probably be to modify whatever macrotext code is on MacaroonButton70 to only run if the auction house was open. If you need help with that, or aren't sure if it's even possible, you'll have to post the button's macrotext.

SDPhantom 01-10-12 07:19 AM

Quote:

Originally Posted by Phanx (Post 250768)
The "target=*" macro condition only supports (a) unit tokens like "player" or "focus", or (b) names of characters in your current party or raid.

"target=*" isn't a conditional really. It sets which unit to apply the conditionals to, and if applicable, who to act on. This is not a target comparison check of any kind and such functionality doesn't exist within the macro system. Blizzard has added the "@*" alias for this to try to solve the ambiguity of the syntax of this macro option.

Phanx 01-10-12 10:49 PM

True, that's not the intended use, but it is the only way to accomplish some things. My action bar addon (also Macaroon) can use macro conditionals to define bar states. In order to create a bar state that shows only when I am dead, I have to do [@player, dead] which is the short version of [target=player, dead]. If you simply use [dead] it will show the bar when my current target is dead, which is not the desired functionality.

Also, I think the @unit alias for target=unit was added more because of the extreme limitations on the length of macros, than as an attempt to clarify the meaning. Length is also the reason they added bar as an alias for actionbar and form as an alias for stance (though the latter was also added because the average player probably does not realize that druid forms are considered stances by the game/macro engine).

Aanson 01-11-12 02:29 AM

I use extensive Macro branching to minimize the amount of work required to change something that is used by more than one button. MacaroonButton503 ,for example, is in all of my combat macros and works perfectly, printing "Combat gear equipped successfully" only if that is actually the case. If I were to get an upgrade for my Bloodthirsty Pyrium Helm, (which is likely lol) it would be a nightmare changing all my buttons! With Macro branching I just need to change 1.

MacaroonButton503:

Code:

/stopmacro [noequipped:Fishing Poles]
/run SetTracking(1,false)
/run SetTracking(2,true)
/run SetTracking(3,true)
/equip Obsidium Cleaver
/equip Elementium Earthguard
/equip Bloodthirsty Pyrium Helm
/in 2 /stopmacro [Equipped:Fishing Poles]
/run print("Combat gear equipped successfully")


Anyhoo, I've had a little inspiration from Phanx's suggestion and I've ended up with...

Code:

/cleartarget [@target, dead] [@target, noharm] [@target, help]
/stopmacro [combat] [@target, harm] [@target, dead]
/target Auctioneer
/stopmacro [noexists]
/click AuctionsCancelAuctionButton
/click StaticPopup1Button1
/run print("Attempted to cancel auction")

With the /cleartarget command and the /stopmacro [noexists] command after /target auctioneer, a friendly target will only stick if it has "auctioneer" in it's name which is perfect!

Cheers mate.

Aanson 01-11-12 02:35 AM

Then again...
 
Don't get me wrong though Phanx, if there's a way to make the button only work when the AH is open like
Code:

/run if AuctionFrame:IsVisible() then...
i'd much prefer that! I did try messing about with the idea for a bit without success.

SDPhantom 01-11-12 01:11 PM

Quote:

Originally Posted by Phanx (Post 250801)
Also, I think the @unit alias for target=unit was added more because of the extreme limitations on the length of macros, than as an attempt to clarify the meaning.

They had many reasons to make the alias, and both of those were listed. The one I posted was more of the reason they chose @ over any other identifier.



Quote:

Originally Posted by Aanson (Post 250808)
MacaroonButton503:
Code:

/stopmacro [noequipped:Fishing Poles]
/run SetTracking(1,false)
/run SetTracking(2,true)
/run SetTracking(3,true)
/equip Obsidium Cleaver
/equip Elementium Earthguard
/equip Bloodthirsty Pyrium Helm
/in 2 /stopmacro [Equipped:Fishing Poles]
/run print("Combat gear equipped successfully")


Anyhoo, I've had a little inspiration from Phanx's suggestion and I've ended up with...

Code:

/cleartarget [@target, dead] [@target, noharm] [@target, help]
/stopmacro [combat] [@target, harm] [@target, dead]
/target Auctioneer
/stopmacro [noexists]
/click AuctionsCancelAuctionButton
/click StaticPopup1Button1
/run print("Attempted to cancel auction")


The first macro, the /in command provided by an addon would error trying to call /stopmacro because it's a secure command. Also the way macros are run, the line after it would execute immediately anyway.

The second macro doesn't guarantee in any way whether or not the user has the AH up. You can run the macro right outside the building (the auctioneers still in view of the client) and the entire macro would still run.



Quote:

Originally Posted by Aanson (Post 250809)
Don't get me wrong though Phanx, if there's a way to make the button only work when the AH is open like
Code:

/run if AuctionFrame:IsVisible() then...
i'd much prefer that! I did try messing about with the idea for a bit without success.

This'll be more specific and only run if the Blizzard_AuctionUI addon is loaded and opened to the auctions tab.
Code:

/run if AuctionFrameAuctions and AuctionFrameAuctions:IsVisible() then AuctionsCancelAuctionButton:Click();StaticPopup1Button1:Click(); end


All times are GMT -6. The time now is 06:57 PM.

vBulletin © 2014, Jelsoft Enterprises Ltd
©2012 ZAM Network LLC