macroLinkText: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
==Function macroLinkText==
==Function macroLinkText==


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 [[Macro:Roll:dialog|[dialog(...): ...] ]] or [[Macro:Roll:frame|[frame(...): ...]]]. If you just want to send a click-able link to someone use the [[Macro:Functions:macroLink|macroLink]] function.
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 [[Macro:Roll:dialog|[dialog(...): ...] ]] or [[Token:library_token|[frame(...): ...]]]. If you just want to send a click-able link to someone use the [[Macro:Functions:macroLink|macroLink]] function.




Line 17: Line 17:
* ''text'' is the text to display for the link.
* ''text'' is the text to display for the link.
* ''macro'' is the name of the macro to run when the link is clicked.
* ''macro'' is the name of the macro to run when the link is clicked.
The macro is in the same format that is used for [[Macros:Roll:macro |[macro(...): ...] ]]
The macro is in the same format that is used for [[Macros:Branching_and_Looping#MACRO_Option |[macro(...): ...] ]]
e.g. Test@Lib:test
e.g. Test@Lib:test
* ''output'' contains who the output of the macro should go to, values are (defaults to none)
* ''output'' contains who the output of the macro should go to, values are (defaults to none)
Line 31: Line 31:


===Examples===
===Examples===
To create the text that would go inside a tag for link that will call a macro called Test on the [[Token:LibToken|Lib:Token]] named Lib:Test that says "''click on me''" and displays the output to the GM.
To create the text that would go inside a tag for link that will call a macro called Test on the [[Token:library_token|Library Token]] named Lib:Test that says "''click on me''" and displays the output to the GM.
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[r: macroLinkText("click on me", "Test@Lib:Test","", "gm")]
[r: macroLinkText("click on me", "Test@Lib:Test","", "gm")]

Revision as of 04:34, 23 December 2008

Function macroLinkText

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(...): ...] or [frame(...): ...]. If you just want to send a click-able link to someone use the macroLink function.



Usage

[r: = macroLinkText(macro)]
[r: = macroLinkText(macro, output, args)]
[r: = macroLinkText(macro, output, args)]
[r: = macroLinkText(macro, output, args, target)]


  • text is the text to display for the link.
  • macro is the name of the macro to run when the link is clicked.

The macro is in the same format that is used for [macro(...): ...] e.g. Test@Lib:test

  • output contains who the output of the macro should go to, values are (defaults to none)
    • 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 ",")

Examples

To create the text that would go inside a tag for link that will call a macro called Test on the Library Token named Lib:Test that says "click on me" and displays the output to the GM.

[r: macroLinkText("click on me", "Test@Lib:Test","", "gm")]

Returns

   macro://click on me/Test@Lib:Test/gm?