Thread Tools Display Modes
11-11-12, 05:00 PM   #1
AnrDaemon
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 156
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.
  Reply With Quote
11-11-12, 05:27 PM   #2
Clamsoda
A Frostmaul Preserver
Join Date: Nov 2011
Posts: 269
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.
  Reply With Quote
11-11-12, 07:05 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
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.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
11-14-12, 06:23 PM   #4
AnrDaemon
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 156
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.
  Reply With Quote
11-14-12, 08:08 PM   #5
Barjack
A Black Drake
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 89
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.
  Reply With Quote
11-15-12, 09:52 AM   #6
AnrDaemon
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 156
Thank you, Barjack, it is what I wanted to know.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Is it possible to evaluate macro condition through Lua code?

Thread Tools
Display Modes

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