macroLinkText

From RPTools Wiki
Revision as of 02:52, 9 March 2009 by Merkuri (talk | contribs) (Macros:Functions:macroLinkText moved to macroLinkText: Moved out of Macros namespace)
Jump to navigation Jump to search

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: link = macroLinkText(macroName)]
[r: link = macroLinkText(macroName, output)]
[r: link = macroLinkText(macroName, output, args)]
[r: link = macroLinkText(macroName, output, args, target)]
  • text is the text to display for the link.
  • macroName is the name of the macro to run when the link is clicked. The macroName 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 commas (defaults to impersonated)

Examples

To create the text that would go inside a form element as the 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 taht would go inside a form element as the action attribute and call the AddWeapon on the Lib:PC token which will act upon the current token

 [r:macroLinkText('AddWeapon@Lib:PC', 'none', '', currentToken())]