WoW API: SecureCmdOptionParse
Jump to navigation
Jump to search
← WoW API < SecureCmdOptionParse
Evaluates macro options in the string and returns the appropriate sub-string or nil
result = SecureCmdOptionParse(cmd)
Arguments
- cmd
- String - the string to be parsed
Returns
- result
- String - the selected sub-string or nil
Example
local result = SecureCmdOptionParse("[mod:alt] Alt is down; Alt is not down")
Result
If the alt key is being held down when the above line is executed then result will be "Alt is down" otherwise it will be "Alt is not down"
Commands which don't meet any of the specified conditions will return nil. For example
local result = SecureCmdOptionParse("[nomod:alt] Alt is not down")
Will return nil if the alt key is held down while it's called and will return "Alt is not down" otherwise.
Details
- This command can be used to implement the same conditional processing that Blizzard's macro system uses. It is the same API they use and so supports all the same conditionals.
- Note that item links can not be part of the commands because they contain square brackets [], which get interpreted by the parser as modifiers.