macroLinkText: Difference between revisions
Jump to navigation
Jump to search
Verisimilar (talk | contribs) m (Added version.) |
Verisimilar (talk | contribs) mNo edit summary |
||
Line 3: | Line 3: | ||
|version=1.3b48 | |version=1.3b48 | ||
|description= | |description= | ||
Creates the text that would appear in a HTML tag for a link which will run the specified macro when clicked on. This is useful for callbacks in | Creates the text that would appear in a HTML tag for a link which will run the specified macro when clicked on. This is useful for callbacks in {{func|dialog}}s or {{func|frame}}s. If you just want to send a click-able link to someone use {{func|macroLink}}. | ||
|usage= | |usage= | ||
Line 18: | Line 18: | ||
macroLinkText(macroName, output, args, target) | macroLinkText(macroName, output, args, target) | ||
</source> | </source> | ||
'''Parameters''' | |||
{{param|macroName|The name of the macro to run when the link is clicked. The {{code|macroName}} is in the standard macro reference format (e.g. {{code|Macro@Lib:Token}})}} | |||
{{param|output|Who the output of the macro should go to, values are (defaults to {{code|none}}):}} | |||
** {{code|self}} - Display only to person who clicked on the link. | |||
** | ** {{code|gm}} - Display to GM. | ||
** | ** {{code|all}} - Everyone (acts like a {{code|/say}}) | ||
** | ** {{code|none}} - Discard any output. | ||
** | {{param|args|Any arguments to be passed to the macro when it is called.}} | ||
{{param|target|Which tokens to run the macro on. Target can be one or more of the following separated by commas (defaults to {{code|impersonated}}):}} | |||
** {{code|impersonated}} - The impersonated [[Token]]. | |||
** | ** {{code|selected}} - The selected [[Token]]/s. | ||
** | ** [[Token ID]] - The {{code|id}} of a [[Token]]. | ||
** | |||
|examples= | |examples= | ||
To create the text that would go inside a form element as the | To create the text that would go inside a form element as the {{code|action}} attribute, and that will call a macro named {{code|Test}} on the [[Library Token]] named {{code|Lib:Test}}: | ||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
[r: macroLinkText("Test@Lib:Test","", "gm")] | [r: macroLinkText("Test@Lib:Test","", "gm")] | ||
</source> | </source> | ||
Returns | Returns: {{code|macro://Test@Lib:Test/gm/impersonated?}} | ||
To create the text | To create the text that would go inside a form element as the {{code|action}} attribute and call the {{code|AddWeapon}} on the [[Library Token]] named {{code|Lib:PC}} which will act upon the [[Current Token]]: | ||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
[r:macroLinkText('AddWeapon@Lib:PC', 'none', '', currentToken())] | |||
</source> | </source> | ||
Returns: {{code|macro://AddWeapon@Lib:PC/none/#ID#?}} where {{code|#ID#}} is the {{code|id}} of the [[Current Token]]. | |||
|also= | |||
{{func|macroLink}} | |||
}} | }} | ||
[[Category:Miscellaneous Function]] | [[Category:Miscellaneous Function]] |
Revision as of 08:12, 10 April 2009
macroLinkText() Function
• Introduced in version 1.3b48
Creates the text that would appear in a HTML tag for a link which will run the specified macro when clicked on. This is useful for callbacks in dialog()s or frame()s. If you just want to send a click-able link to someone use macroLink().
Usage
macroLinkText(macroName)
macroLinkText(macroName, output)
macroLinkText(macroName, output, args)
macroLinkText(macroName, output, args, target)
Parameters
macroName
- The name of the macro to run when the link is clicked. ThemacroName
is in the standard macro reference format (e.g.Macro@Lib:Token
)output
- Who the output of the macro should go to, values are (defaults tonone
):self
- Display only to person who clicked on the link.gm
- Display to GM.all
- Everyone (acts like a/say
)none
- Discard any output.
args
- Any arguments to be passed to the macro when it is called.target
- Which tokens to run the macro on. Target can be one or more of the following separated by commas (defaults toimpersonated
):
Examples
To create the text that would go inside a form element as the
Returns:
action
attribute, and that will call a macro named Test
on the Library Token named Lib:Test
:
[r: macroLinkText("Test@Lib:Test","", "gm")]
Returns: macro://Test@Lib:Test/gm/impersonated?
To create the text that would go inside a form element as the action
attribute and call the AddWeapon
on the Library Token named Lib:PC
which will act upon the Current Token:
[r:macroLinkText('AddWeapon@Lib:PC', 'none', '', currentToken())]
macro://AddWeapon@Lib:PC/none/#ID#?
where #ID#
is the id
of the Current Token.