getMacroName: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Added MacroFunction template.)
(Updated to reflect current behavior.)
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{MacroFunction
{{MacroFunction
|name=getMacroName
|name=getMacroName
|version=1.3b48
|description=
|description=
Returns the name of the macro being executed via [[Macro:Roll:macro | [macro():] ]]. If the macro typed into chat, run by clicking on a [[macro button]], or run via the [[Token:popup menu| token popup menu]] then this function will return "chat".
Returns the label/name of the macro being executed. If this macro function is run directly from chat, then this function will return "chat".


|usage=
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: macroName = getMacroName()]
getMacroName()
</source>
</source>
|examples=
|examples=
Line 14: Line 15:
</source>
</source>
}}
}}
[[Category:Metamacro Function]]

Revision as of 17:16, 7 April 2020

getMacroName() Function

Introduced in version 1.3b48
Returns the label/name of the macro being executed. If this macro function is run directly from chat, then this function will return "chat".

Usage

getMacroName()

Examples

[h: macroName = getMacroName()]
[if(macroName == "chat", "You are running from chat", "You are running the macro called " + macroName)]