View Single Post
02-25-23, 04:35 PM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by Walkerbo View Post
Now with the b.hiddenSpellStopButton:Click() I do not understand what you mean.
:Click() calls the OnClick handler for the button. Being a SecureActionButton, the stock handler would read the button's attributes to perform a protected action. Normally, this is to respond to a user click, which can be simulated also with a click-style keybind. Direct interaction from the user means the OnClick handler runs from a secure state and it runs as normal. However, when called from an addon using any means carries the addon's insecure status and any protected action that the button would take would be blocked.

The specific function that would throw the protected action error in this case would be RunMacroText() called from FrameXML\SecureTemplates.lua:468.

Disregarding that, /stopcasting calls SpellStopCasting(), which is also a protected function.



Originally Posted by Walkerbo View Post
If I should not use b.hiddenSpellStopButton:Click() how do I click the button to stop the cast?
As Dridzt explained, you can't without the user directly interacting with the button. It's an intentional limitation to prevent addons from automating gameplay (aka botting).
__________________
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