getMacroLocation: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: ==Function getMacroLocation== {{ProposedChange}} Returns the location of the macro being executed via [macro():] . If the macro typed into chat, run by clicking on a...)
 
No edit summary
Line 5: Line 5:
===Usage===
===Usage===
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: libToken = getLocation()]
[h: libToken = getMacroLocation()]
</source>
</source>
===Examples===
===Examples===
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: libToken = getLocation()]
[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>

Revision as of 22:33, 1 December 2008

Function getMacroLocation

 Note: This refers to a proposed change that has not been implemented in the main code base yet.

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

Examples

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