getMacroButtonIndex: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: ==Function getMacroButtonIndex== '''Introduced in MapTool 1.3b50''' Returns the index of the macro button that was clicked on for the token. The macro button must have the auto execute ...)
 
No edit summary
Line 1: Line 1:
==Function getMacroButtonIndex==
{{MacroFunction
|name=getMacroButtonIndex
|version=1.3b50
|description=Returns the index of the macro button that was clicked on for the token. The macro button must have the auto execute check box selected. If the macro is not running from a token macro button then -1 is returned.


 
|usage=
 
'''Introduced in MapTool 1.3b50'''
Returns the index of the macro button that was clicked on for the token. The macro button must have the auto execute check box selected. If the macro is not running from a token macro button then -1 is returned.
 
===Usage===
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: ind = getMacroButtonIndex()]
[h: ind = getMacroButtonIndex()]
</source>
</source>


 
|example=
===Examples===
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: ind = getMacroButtonIndex()]
[h: ind = getMacroButtonIndex()]
</source>
</source>


Returns
If the macro is not run from an auto execute macro button on a token it returns:
  -1 if the macro is not run from an auto execute macro button on a token, or a non negative number which is the index of the button.
  -1
Otherwise it returns a non negative number which is the index of the button.  
}}
[[Category:Metamacro Function]]

Revision as of 04:01, 7 March 2009

getMacroButtonIndex() Function

Introduced in version 1.3b50
Returns the index of the macro button that was clicked on for the token. The macro button must have the auto execute check box selected. If the macro is not running from a token macro button then -1 is returned.

Usage

[h: ind = getMacroButtonIndex()]

Example

[h: ind = getMacroButtonIndex()]

If the macro is not run from an auto execute macro button on a token it returns:

 -1 
Otherwise it returns a non negative number which is the index of the button.