getMacroLocation: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
==Function getMacroLocation==
{{MacroFunction
|name=getMacroLocation
|description=Returns the location 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 location 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=
 
===Usage===
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: libToken = getMacroLocation()]
[h: libToken = getMacroLocation()]
</source>
</source>
===Examples===
 
|example=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: libToken = getMacroLocation()]
[h: libToken = getMacroLocation()]
[if(libToken == "chat", "You are running from chat", "You are running from library token " + libToken)]
[if(libToken == "chat", "You are running from chat", "You are running from library token " + libToken)]
</source>
</source>
}}
[[Category:Metamacro Function]]

Revision as of 04:11, 7 March 2009

getMacroLocation() Function

Returns the location of the macro being executed via [macro():] . If the macro typed into chat, run by clicking on a macro button, or run via the token popup menu then this function will return "chat".

Usage

[h: libToken = getMacroLocation()]

Example

[h: libToken = getMacroLocation()]
[if(libToken == "chat", "You are running from chat", "You are running from library token " + libToken)]