getMacroName: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
==Function getMacroName==
{{MacroFunction
|name=getMacroName
|version=1.3b48
|description=
Returns the label/name of the macro being executed. If this macro function is run directly from chat, then this function will return "chat".


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".
|usage=
 
<syntaxhighlight lang="mtmacro" line>
===Usage===
getMacroName()
<source lang="mtmacro" line>
</syntaxhighlight>
[h: macroName = getMacroName()]
|examples=
</source>
<syntaxhighlight lang="mtmacro" line>
===Examples===
<source lang="mtmacro" line>
[h: macroName = getMacroName()]
[h: macroName = getMacroName()]
[if(macroName == "chat", "You are running from chat", "You are running the macro called " + macroName)]
[if(macroName == "chat", "You are running from chat", "You are running the macro called " + macroName)]
</source>
</syntaxhighlight>
}}
[[Category:Metamacro Function]]

Latest revision as of 18:39, 14 March 2023

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)]