getMacroName: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page GetMacroName to getMacroName: Converting page titles to lowercase)
No edit summary
 
Line 6: Line 6:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
getMacroName()
getMacroName()
</source>
</syntaxhighlight>
|examples=
|examples=
<source lang="mtmacro" line>
<syntaxhighlight 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]]
[[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)]