Originally Posted by Walkerbo
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
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).