macro.args

From RPTools Wiki
Revision as of 04:31, 22 December 2008 by Cclouser (talk | contribs)
Jump to navigation Jump to search

The variable macro.args holds the value of the argument passed to a trusted macro via the MACRO() roll option. macro.args exists only within the macro that is called, and may be manipulated like any variable in a macro.

Examples

When a macro on a library token is called by another macro, the calling macro may pass one argument to the called macro:

<!-- Call the getDamage macro -->
[MACRO("getDamage@Lib:test"): damageDice]

In the example above, damageDice is the argument being passed to the macro getDamage, which resides on the Lib:test library token. Within the getDamage macro, the variable macro.args is automatically generated and assigned the value of damageDice.

<!-- getDamage Macro -->
[h:damageRoll = macro.args + 9]
You hit your target for [r:damageRoll] damage!