Reply
Thread Tools Display Modes
Unread 01-09-12, 07:14 PM   #1
Aanson
A Flamescale Wyrmkin
Join Date: Aug 2009
Posts: 123
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
__________________
__________________
Aanson is offline   Reply With Quote
Unread 01-10-12, 01:30 AM   #2
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,391
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.
Phanx is offline   Reply With Quote
Unread 01-10-12, 07:19 AM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,025
Originally Posted by Phanx View Post
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.
__________________
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
SDPhantom is offline   Reply With Quote
Unread 01-10-12, 10:49 PM   #4
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,391
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).

Last edited by Phanx : 01-10-12 at 10:51 PM.
Phanx is offline   Reply With Quote
Unread 01-11-12, 02:29 AM   #5
Aanson
A Flamescale Wyrmkin
Join Date: Aug 2009
Posts: 123
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 is offline   Reply With Quote
Unread 01-11-12, 02:35 AM   #6
Aanson
A Flamescale Wyrmkin
Join Date: Aug 2009
Posts: 123
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.
__________________
__________________
Aanson is offline   Reply With Quote
Unread 01-11-12, 01:11 PM   #7
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,025
Originally Posted by Phanx View Post
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.



Originally Posted by Aanson View Post
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.



Originally Posted by Aanson View Post
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 I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 01-11-12 at 01:14 PM.
SDPhantom is offline   Reply With Quote
Reply

Go BackWoWInterface » AddOns, Compilations, Macros » Macro Help » Only works when at the Auction House

Thread Tools
Display Modes

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