Cancel a spell cast
Hi all
I have a list of spells, (hearthstones), that I want to cancel during it's cast. This is a secure action so I have set up the button as a SecureActionButtonTemplate. Lua Code:
I have been banging away for the last few days trying to get this working. Is there a way to stop a cast? |
You're replacing SecureActionButtonTemplate's OnClick handler, which makes it no longer work.
Also calling :Click() taints the execution and throws a protected call error. |
Hi SDPhantom
Ok, so the hidden button onclick overrides the SecureActionButtonTemplate, that makes sense. I have removed the onclick from the hidden button, (I only added the onclick to test if the button was indeed being clicked). Now with the b.hiddenSpellStopButton:Click() I do not understand what you mean. I have tested the code and it throws no errors at all. If I should not use b.hiddenSpellStopButton:Click() how do I click the button to stop the cast? |
Quote:
If you could click secure buttons from code in response to events then what's the point. "how do I click the button to stop the cast?" You click it with your mouse or press a keybind. |
Quote:
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. Quote:
|
Hi SDPhantom and Dridzt
Yes, it does make sense that the virtual click does not work against a hardware click, I should have seen that for myself. @SDPhantom thanks for the detailed explanation, it really does help. Cheers all |
All times are GMT -6. The time now is 12:07 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI