getMacroLocation: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Text replacement - "<source" to "<syntaxhighlight") |
||
(9 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
= | {{MacroFunction | ||
|name=getMacroLocation | |||
Returns the location of the macro being executed | |version=1.3b48 | ||
|description= | |||
Returns the location of the macro being executed, the return value will be {{code|"chat"}}, {{code|"global"}}, {{code|"campaign"}} or the label of the token the macro resides on (e.g. {{code|"Lib:Utilities"}} or {{code|"Token:Orc"}}.) Standard PC and NPC tokens will have their label prefixed with {{code|Token:}}. | |||
|usage= | |||
< | <syntaxhighlight lang="mtmacro" line> | ||
getMacroLocation() | |||
</ | </syntaxhighlight> | ||
< | |example= | ||
[h: | <syntaxhighlight lang="mtmacro" line> | ||
[if( | [h: MacroLocation = getMacroLocation()] | ||
</ | [if(MacroLocation == "chat", "You are running from chat", "You are running from "+MacroLocation] | ||
</syntaxhighlight> | |||
|changes= | |||
{{change|1.3b51|Now accurately reports where the macro button resides.}} | |||
}} | |||
[[Category:Metamacro Function]] |
Latest revision as of 23:59, 14 March 2023
getMacroLocation() Function
• Introduced in version 1.3b48
Returns the location of the macro being executed, the return value will be
"chat"
, "global"
, "campaign"
or the label of the token the macro resides on (e.g. "Lib:Utilities"
or "Token:Orc"
.) Standard PC and NPC tokens will have their label prefixed with Token:
.Usage
getMacroLocation()
Example
[h: MacroLocation = getMacroLocation()]
[if(MacroLocation == "chat", "You are running from chat", "You are running from "+MacroLocation]
Version Changes
- 1.3b51 - Now accurately reports where the macro button resides.