Thread Tools Display Modes
12-20-15, 11:51 PM   #1
briandknight
A Murloc Raider
Join Date: Apr 2011
Posts: 4
/click on working to click a "Buy" button within an addon frame

I've created a simple macro that uses the /click command to left mouse click the "Buy" button within an addon, but when I run the macro it does not work. I used /framestack to identify the button name. I am able to create other macros that use /click to left click on the standard auction house buy button (not in another addon). I did notice that /framestack shows the "Buy" button for the addon in the format FrameName.ButtonName while buttons from the standard WoW interface only have ButtonName (from what I have seen).

Here is what I have in the (non-working) macro:


/click ZA_Buy_Fame.FooterBuyButton


Any help is appreciated.
  Reply With Quote
12-21-15, 04:27 AM   #2
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
You can try /run ZA_Buy_Fame.FooterBuyButton:Click()

You can only /click a button with a global name, and the dot in the name means FooterBuyButton is actually a key in the ZA_Buy_Frame table.
  Reply With Quote
12-21-15, 04:47 AM   #3
briandknight
A Murloc Raider
Join Date: Apr 2011
Posts: 4
Thanks...

Thanks for your reply. Do you know if there's a way to implement a work around in the form of a script or small addon? The thing is I don't want to have to click on the "Buy" button a bunch of times when I'm buying a lot of the same item from the AH. The original plan was to bind the mouse scroll to the "/click Buy" macro. Maybe there is a way to make the keys from the ZA_Buy_Frame table accessible to the WoW scripting/addon functions?

Thanks for your help.
  Reply With Quote
12-21-15, 04:59 AM   #4
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Does the /run script from my previous post not work?
  Reply With Quote
12-21-15, 06:28 PM   #5
briandknight
A Murloc Raider
Join Date: Apr 2011
Posts: 4
/run script not working

No that doesn't work. Here is the LUA error message:

Message: [string "ZA_Buy_Fame.FooterBuyButton:Click()"]:1: attempt to index global 'ZA_Buy_Fame' (a nil value)

It's a "secure frame." Does that make a difference?
  Reply With Quote
12-21-15, 06:47 PM   #6
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,335
The frame name was misspelled, try:
/run ZA_Buy_Frame.FooterBuyButton:Click()

The frame being secure might mean that interacting with it is restricted if it actually ends up calling a protected function. This will be indicated by a popup saying the macro attempted to perform a restricted action. If that's the case, the only thing you can do is create your own button to mimic its code, give that a global name, and either a /click macro or link the new button directly to a keybind.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
12-21-15, 09:58 PM   #7
briandknight
A Murloc Raider
Join Date: Apr 2011
Posts: 4
That works!

That was it! It works now - Thank you for your help!
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » /click on working to click a "Buy" button within an addon frame


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