WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Is it possible to evaluate macro condition through Lua code? (https://www.wowinterface.com/forums/showthread.php?t=45124)

AnrDaemon 11-11-12 05:00 PM

Is it possible to evaluate macro condition through Lua code?
 
Anyone know, if it is possible to evaluate macro condition through Lua code?
I'm speaking about conditions like [harm,nodead] you put in macro commands.

Clamsoda 11-11-12 05:27 PM

I apologize if I misinterpreted your question, but here is a response.

It is possible for LUA to utilize macro conditionals, consider the macro I use to open the character frame:

Code:

/run RunScript(SecureCmdOptionParse'[btn:2]ToggleCharacter("TokenFrame");ToggleCharacter("PaperDollFrame")')
The SecureCmdOptionParse allows you to utilize WoW macro conditionals with a bit more versatility.

Seerah 11-11-12 07:05 PM

If all you want is a Lua equivalent of macro conditionals for your addon code, then there is tons of API for all that stuff: http://wowprogramming.com/docs/api_categories

If you could be more specific, we could be more helpful. ;)

AnrDaemon 11-14-12 06:23 PM

That was about as specific, as I can get it. The SecureCmdOptionParse seems relevant, thank you.
If I understand it right, it doesn't do anything by itself, just evaluating the condition and return 2 strings, right?
The list of API categories doesn't help me much, unfortunately. :( I'm not very fluent in WoW API's overall. :(

Barjack 11-14-12 08:08 PM

Correct, it doesn't actually "do" anything, it simply evaluates the macro and returns what would be done based on its conditions. Actually executing it is another matter that requires you follow all the normal rules for executing secure commands.

AnrDaemon 11-15-12 09:52 AM

Thank you, Barjack, it is what I wanted to know.


All times are GMT -6. The time now is 09:10 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI