From faa6041445f9ee14b7cd5cea470aae8f157470c6 Mon Sep 17 00:00:00 2001
From: Kenneth VanderLinde Note that only the output of the macro is discarded when the macro is aborted any changes made to macros will not be undone.\
Common uses for this function are\
\
+
\
If you prefer to display an error message when exiting the macro see the assert() function.\
\
Usage\
@@ -36,12 +36,12 @@ If you prefer to display an error message when exiting the macro see the The following line can be used to protect macros that only the GM should run\
[h: abort(isGM())]The following line can be used to silently end a macro that can only be run from a Trusted Macro\ +
The following line can be used to silently end a macro that can only be run from a Trusted Macro\
\[h: abort(isTrusted())]When aborting a macro called from another macro (for example, a library token), all macros are aborted, not just the one executing.\ -
Since 1.5.0 you can change that behaviour by using macro.catchAbort.\ +
When aborting a macro called from another macro (for example, a library token), all macros are aborted, not just the one executing.\ +
Since 1.5.0 you can change that behaviour by using macro.catchAbort.\
\<!-- Call the getAmmo library macro -->\
@@ -63,7 +63,7 @@ You have [r:macro.return] arrows."14"\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\This function will not assign any initiative value to the tokens, you can use the setInitiative() function\
+
This function will not assign any initiative value to the tokens, you can use the setInitiative() function\
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\This function will not assign any initiative value to the tokens, you can use the setInitiative()\
+
This function will not assign any initiative value to the tokens, you can use the setInitiative()\
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\This function will not assign any initiative value to the tokens, you can use the setInitiative()\
+
This function will not assign any initiative value to the tokens, you can use the setInitiative()\
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\AllowDuplicates - If false (default) then will not add the token if it is already in the initiative list. If true (1) an additional entry will be added to the initiative list (so there could be multiple initiative entries for the same token).value - The initiative value to set. If included, the initiative will be set even if the token is already on the initiative list and duplicates are not allowed.id - The token id of the token to add to the initiative. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to add to the initiative. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.return - Returns 1 if added to the initiative, 0 if did not.[h: addToInitiative()]\
[h: setInitiative(1d20)]\
[h: sortInitiative()]\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\id - The token id or name of the token to effect, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id or name of the token to effect, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\id - The token id of the token for which to turn off all light sources, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token for which to turn off all light sources, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\dialog is not open then the function has no effect.\ -
The most common use for this function is closing a dialog based from a macro that is run when clicking on a link or button for the\ -dialog that has no close button.\ +
dialog is not open then the function has no effect.\ +
The most common use for this function is closing a dialog based from a macro that is run when clicking on a link or button for the\ +dialog that has no close button.\
\ -NOTE In later versions of maptool (tested in b74) this works only for dialogs opened with [dialog():]. Frames cant be closed with this. But there is a new analog function available for that, too. See closeFrame()[h: closeDialog("CharacterSheet")]\
Assuming a dialog called "Name Entry" has been created without the input flag but containing a form. In the macro called when the\ -form is submitted you can use the following logic to check that the "name" field is not blank and close the dialog.\ +
Assuming a dialog called "Name Entry" has been created without the input flag but containing a form. In the macro called when the\ +form is submitted you can use the following logic to check that the "name" field is not blank and close the dialog.\
\[h, if(listGet(macro.args, "name")), code: {\
@@ -1660,7 +1660,7 @@ form is submitted you can use the following logic to check that the "name" field
frame is not open then the function has no effect.\
The most common use for this function is closing a frame based from a macro that is run when clicking on a link or button for the\ frame that has no close button.\
\ -NOTE this function can not close dialogs opened with [dialog():]. Use closeDialog() for that.Window > Overlays menu, they still run in the background unless you use this function to close them.\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\id - The id or name of the token to copy.numCopies - The number of copies to create, defaults to 1fromMap - The name of the map to copy from, defaults to the current map.updates - a JSON Object that contains updates to be made to the copied Tokens.updates - a JSON Object that contains updates to be made to the copied Tokens.You can use an empty string ("") for fromMap for the current map as of b54.\
The return type of this function is determined by the number of copies that you are making. If you are only creating a single\ -copy of the token then a string containing the Tokens id, if you are making more than one copy then a JSON Array\ -containing the Token ids of all the newly created Tokens is returned.\ +copy of the token then a string containing the Tokens id, if you are making more than one copy then a JSON Array\ +containing the Token ids of all the newly created Tokens is returned.\
\updates is a JSON Object that can contain one or more of the following fields. Field names are case-sensitive.\
+
updates is a JSON Object that can contain one or more of the following fields. Field names are case-sensitive.\
name - The name of the new Token.label - The label for the new Token.gmName - The GM name for the new Token.layer - The layer for the new Token. By default, changing the layer of a new token will also change its shape. Tokens changed to the Object or Background layer will become top-down tokens. For tokens moved to the Token or Hidden layer, MapTool will attempt to determine their shape based on their image.name - The name of the new Token.label - The label for the new Token.gmName - The GM name for the new Token.layer - The layer for the new Token. By default, changing the layer of a new token will also change its shape. Tokens changed to the Object or Background layer will become top-down tokens. For tokens moved to the Token or Hidden layer, MapTool will attempt to determine their shape based on their image.forceShape - when the layer field is set, setting this to false(0) will disable the automatic change of shape.x - The X Co-ordinate for the new Token. Default is 0.y - The Y Co-ordinate for the new Token. Default is 0.x - The X Co-ordinate for the new Token. Default is 0.y - The Y Co-ordinate for the new Token. Default is 0.useDistance - 1 (true) or 0 (false). Determines if the "Distance Per Cell" measurement for the map is used for the x,y coordinates. Unused if neither x nor y is specified. Default is false. Use 1 (true) for tokens that are not snap-to-grid and must be placed by pixel position instead of grid cell position.facing - Sets the facing for the Token. If the Token is on the background or object layer this sets the rotation.size - Sets the size of the Token. The list of sizes is dependent on the type of grid.facing - Sets the facing for the Token. If the Token is on the background or object layer this sets the rotation.size - Sets the size of the Token. The list of sizes is dependent on the type of grid.delta - Use relativeto instead of delta starting in 1.9.0. 1 (true) or 0 (false). Indicates whether the x,y coordinates are relative to the position of the original token. Added in 1.3b77. To be considered deprecated in 1.9.0relativeto - A string defining what the x and y parameters should be relative to. Can be "map" for absolute positioning, "source" for the token to be copied, or "current" for the Current Token. Defaults to "map". To be added in 1.9.0relativeto - A string defining what the x and y parameters should be relative to. Can be "map" for absolute positioning, "source" for the token to be copied, or "current" for the Current Token. Defaults to "map". To be added in 1.9.0tokenImage / tokenPortrait / tokenHandout - Changes the coresponding image. Value can be either an assetId or an image token name. Added in 1.3b77.The values for all of these fields are evaluated so all text within {} or [] goes through the standard macro processing. There is currently no way to modify the new token from inside these macro commands, however.\
When the name is not changed using the updates parameter, the new name for the token follows the naming method for cut and paste.\
-This function can copy Tokens in the token, hidden, object, and background layers. If you do not override the destination using the\
+This function can copy Tokens in the token, hidden, object, and background layers. If you do not override the destination using the\
layer field of updates then the new copies are made in the same layer as the source. Likewise if x and y are not specified then these locations are the same as the source.\
\
@@ -1942,7 +1942,7 @@ This function can copy \
The source token was configured as a Top Down token for this effect, otherwise the This example shows using the new This example shows using the new Make three copies of the currently selected token on the current map. Place the first copy two grid cells to the right of the Current Token.\
+ Make three copies of the currently selected token on the current map. Place the first copy two grid cells to the right of the Current Token.\
\
\
facing setting would produce a facing arrow\
-for Tokens on the token or hidden layers.\
+for Tokens on the token or hidden layers.\
relativeto parameter available in 1.9.0. Specifying "map" means all x,y coordinates are treated as absolute coordinates on the map. Specifying "source" places copied tokens relative to the position of the token that is beingc copied. Specifying "current" places copied tokens relative to the Current Token. x and y are measured in grid cells if useDistance is false (the default) or in pixels if true.\
+ relativeto parameter available in 1.9.0. Specifying "map" means all x,y coordinates are treated as absolute coordinates on the map. Specifying "source" places copied tokens relative to the position of the token that is beingc copied. Specifying "current" places copied tokens relative to the Current Token. x and y are measured in grid cells if useDistance is false (the default) or in pixels if true.\
[h: x = 0]\
@@ -1982,7 +1982,7 @@ for Tokens
}" ]\
[h: copyToken(currentToken(), 3, "", updates)]
\
\
also\
@@ -2004,7 +2004,7 @@ for Tokens
0 and 12, which is th
label - The label for the macro button.command - The command to run when the macro button is clicked, or the macro is called.props - A String Property List or JSON Object containing the properties for the button.\
-applyToSelected - Should the macro be applied to the selected tokens.autoExecute - If the macro will be automatically executed when the button is clicked, accepts true(1) or false(0).color - The name of the color for the button.command - The command for the macro (only when using JSON version of function).fontColor - The name of the font color for the button.fontSize - The size of the font for the button.includeLabel - If the label will be output when the button is clicked. Accepts true(1) or false(0).group - The name of the group that the button belongs to.sortBy - The sort by value of the macro button.label - The label for the button.maxWidth - The maximum width of the button.minWidth - The minimum width of the button.playerEditable - Is the button player editable, accepts true(1) or false(0).tooltip - The tool tip for the macro button.compare - Takes a JSON Array which can contain one or more of the following keywords (only usable with JSON version of the function).\
+ props - A String Property List or JSON Object containing the properties for the button.\
+applyToSelected - Should the macro be applied to the selected tokens.autoExecute - If the macro will be automatically executed when the button is clicked, accepts true(1) or false(0).color - The name of the color for the button.command - The command for the macro (only when using JSON version of function).fontColor - The name of the font color for the button.fontSize - The size of the font for the button.includeLabel - If the label will be output when the button is clicked. Accepts true(1) or false(0).group - The name of the group that the button belongs to.sortBy - The sort by value of the macro button.label - The label for the button.maxWidth - The maximum width of the button.minWidth - The minimum width of the button.playerEditable - Is the button player editable, accepts true(1) or false(0).tooltip - The tool tip for the macro button.compare - Takes a JSON Array which can contain one or more of the following keywords (only usable with JSON version of the function).\
applyToSelected - Use the macro applyToSelected for common macro comparisons.autoExecute - Use the macro autoExec for common macro comparisons.command - Use the macro command for common macro comparisons.group - Use the macro group for common macro comparisons.includeLabel - Use the macro includeLabel for common macro comparisons.sortPrefix - Use the macro sortPrefix for common macro comparisons.delim - The delimiter used in the String Property List that is sent to the props parameter, defaults to ";". If you are sending a JSON Object to the props parameter, and using the id parameter, you can set this to "json".id - The token id of the token that the macro is created on. Note: This parameter can only be used in a Trusted Macro.
delim - The delimiter used in the String Property List that is sent to the props parameter, defaults to ";". If you are sending a JSON Object to the props parameter, and using the id parameter, you can set this to "json".id - The token id of the token that the macro is created on. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ @@ -2130,7 +2130,7 @@ createMacro(props, id, mapname)\ "autoExecute=true;color=red;fontColor=white", ";") ]\
Will create the following buttons on the current token.\ -File:createMacros.png\ +File:createMacros.png\
\Note that if you want to provide a macro command in the command section, you will have issues with quotations as you cannot use double quotes " inside, so macro commands need to be with single ' quotes.\
\ @@ -2169,7 +2169,7 @@ createTable.summary = \ \\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\[r:id = currentToken()]Rolls 5 times a d6 and returns these as sorted list as well as the total.\ -
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\ignoreOutput - If the defined function should ignore all output and only return the value of macro.return, defaults to false(0).newScope - If the defined function should create a new variable scope when executed, defaults to true(1). A new variable scope means that the defined function can only read the variables of the macro that called it; if you do not create a new scope the defined function can read, update, and create variables in its parent's variable scope. Updating variables in the parent's scope includes over-writing any parameters that a parent might have stored within arg(), if a user-defined function that does not create a new scope is called within another user-defined function.Interactions between the ignoreOutput parameter and the macro.return special variable:\
+
Interactions between the ignoreOutput parameter and the macro.return special variable:\
ignoreOutput is 0 then any output is the return value and macro.return has the value assigned.ignoreOutput is 0 then any output is the return value and macro.return has the value assigned.ignoreOutput is 1 then the return value is the value assigned to macro.return and macro.return has the value assigned.ignoreOutput is 1 then the return value is the value assigned to macro.return and macro.return has the value assigned.ignoreOutput is 0 then that output is the return value and macro.return is empty.ignoreOutput is 0 then that output is the return value and macro.return is empty.ignoreOutput is 1 then the return value and macro.return are empty.ignoreOutput is 1 then the return value and macro.return are empty.getDefinedFunctions(),\ arg(),\ argCount(),\ -
onCampaignLoad\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\id - the id string or name of a specific token to deselect (the examples below use the token name, but token IDs are also valid); if left blank all currently selected tokens are deselected.tokens - a String List of tokens to deselect.delim - Specifies the delimiter used in the string list that is supplied. If the delimiter is "json", then the value for list may be a JSON Array instead. Note: if using a JSON Array or String List, delim must be specified.tokens - a String List of tokens to deselect.delim - Specifies the delimiter used in the string list that is supplied. If the delimiter is "json", then the value for list may be a JSON Array instead. Note: if using a JSON Array or String List, delim must be specified.[h:deselectTokens("Adventurer")]To deselect a list of Tokens using a String List:\ +
To deselect a list of Tokens using a String List:\
\[h:deselectTokens("Adventurer, Orc 2, Goblin 1", 0, ",")]Rolls 5 times a d6 and returns these as sorted list as well as the total.\ -
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\shapesList - A JSON Array of JSON objects, one of the latter for each MBL shape.shapesList - A JSON Array of JSON objects, one of the latter for each MBL shape.The shapes can be one of "Rectangle", "Circle", "Polygon" or "Cross".\
"points" - JSON Array of 2 or more "x", "y" coordinates."points" - JSON Array of 2 or more "x", "y" coordinates.\ Optional arguments\ @@ -2892,7 +2892,7 @@ TODO: Add image of results.
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\shapesList - A JSON Array of JSON objects, one of the latter for each VBL shape.shapesList - A JSON Array of JSON objects, one of the latter for each VBL shape.The shapes can be one of "Rectangle", "Circle", "Polygon" or "Cross".\
"points" - JSON Array of 2 or more "x", "y" coordinates."points" - JSON Array of 2 or more "x", "y" coordinates.\ Optional arguments\ @@ -3048,11 +3048,11 @@ and a square (note that this square does not have the dimensions 200x200 [h:drawVBL(objectArrary)]
results in:
\


3 and 30, with a high
3 and 30, with a low
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\[h: setNotes(evalMacro('[r,macro("CreateNotes@Lib:Notes"): ""]'))]Sets the Notes of a Token to the output of the CreateNotes macro located on the Lib:Notes Library Token.\
+
[h: setNotes(evalMacro('[r,macro("CreateNotes@Lib:Notes"): ""]'))]Sets the Notes of a Token to the output of the CreateNotes macro located on the Lib:Notes Library Token.\
[r: evalMacro("[h: TestVar1 = 5][h: TestVar2 = 10][TestVar1+TestVar2]")]Returns 15\
[h: TestVar3 = 10]\
[h: TestVar4 = 20]\
@@ -3681,7 +3681,7 @@ execFunction.summary = \
\
\
\
- Note: This function can only be used in a Trusted Macro\
+ Note: This function can only be used in a Trusted Macro\
\
\
• Introduced in version 1.5.7\
@@ -3732,7 +3732,7 @@ execLink.summary = \
\
\
\
- Note: This function can only be used in a Trusted Macro\
+ Note: This function can only be used in a Trusted Macro\
\
\
• Introduced in version 1.3b55\
@@ -3827,7 +3827,7 @@ execMacro.summary = \
\
\
\
- Note: This function can only be used in a Trusted Macro\
+ Note: This function can only be used in a Trusted Macro\
\
\
• Introduced in version 1.3b49\
@@ -3854,7 +3854,7 @@ The advantage of this function over eval()
\
Examples\
\
- [h: setNotes(evalMacro('[r,macro("CreateNotes@Lib:Notes"): ""]'))]Sets the Notes of a Token to the output of the CreateNotes macro located on the Lib:Notes Library Token.\
+
[h: setNotes(evalMacro('[r,macro("CreateNotes@Lib:Notes"): ""]'))]Sets the Notes of a Token to the output of the CreateNotes macro located on the Lib:Notes Library Token.\
[r: evalMacro("[h: TestVar1 = 5][h: TestVar2 = 10][TestVar1+TestVar2]")]Returns 15\
[h: TestVar3 = 10]\
[h: TestVar4 = 20]\
@@ -3920,7 +3920,7 @@ Returns a number than is usually between 5 and 50, wit
\
See Also\
\
- For another method of rolling dice, see Dice Expressions.\
+ For another method of rolling dice, see Dice Expressions.\
\
\
@@ -3964,7 +3964,7 @@ Returns a number than is between 0 and 5.\
\
See Also\
\
- For another method of rolling dice, see Dice Expressions.\
+ For another method of rolling dice, see Dice Expressions.\
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\-5 and 5.\
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\-5 and 5.\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\delim - The delimiter to use for the String List. If the value is json then a JSON Array is returned.delim - The delimiter to use for the String List. If the value is json then a JSON Array is returned.[h: maps = getAllMapDisplayNames()]To get the display names of all of the maps in a JSON Array\ +
To get the display names of all of the maps in a JSON Array\
\[h: maps = getAllMapDisplayNames("json")]\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\delim - The delimiter to use for the String List. If the value is json then a JSON Array is returned.delim - The delimiter to use for the String List. If the value is json then a JSON Array is returned.[h: maps = getAllMapNames()]To get the names of all of the maps in a JSON Array\ +
To get the names of all of the maps in a JSON Array\
\[h: maps = getAllMapNames("json")]\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\getAllPlayerNames()\ getAllPlayerNames(delim)\
If delim is specified then it is used to separate the values in the list; if it is not specified then it defaults to ",". When delim is the string "json" the return value will be in the form of a JSON Array.\
+
If delim is specified then it is used to separate the values in the list; if it is not specified then it defaults to ",". When delim is the string "json" the return value will be in the form of a JSON Array.\
"," is used."json" then a JSON Array is returned."," is used."json" then a JSON Array is returned.type - The name of the property set to be retrieved. Defaults to all defined token property sets. Use "*" or "" when using a delimiter to get all sets.delim - The delimiter to be used in the list of names returned. Default is ,If type is specified then the string list contains the property names for that token property type, otherwise it will contain the token property names for all token property types. If delim is specified then it is used to separate the values in the string list, if it is not specified then it defaults to ','.\ +
If type is specified then the string list contains the property names for that token property type, otherwise it will contain the token property names for all token property types. If delim is specified then it is used to separate the values in the string list, if it is not specified then it defaults to ','.\
\Campaign Properties<br>\
[h: props = getAllPropertyNames()]\
[foreach(name, props, "<br>"): name]PC Properties<br>\
[h: props=getAllPropertyNames("PC")]\
[foreach(name, props, "<br>"): name]Get the Basic properties in a JSON Array:\ +
Get the Basic properties in a JSON Array:\
\[r: props=getAllPropertyNames("Basic","json")]value - The value of the setting to set, true(1) or false(0).id - OPTIONAL: The token id of the token for which you want to set this setting, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - OPTIONAL: The token id of the token for which you want to set this setting, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
name - The name of the bar.id - The token id of the token to get the bar value from, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to get the bar value from, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.bar.name special variable\
+ The bar.name special variable\
<img src='[r:getBarImage("Mana", 0, 0.5)]'></img>\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\units - If set to false(0), the coordinate is a location on the grid in number of cells. Defaults to true(1), where the coordinate is in number of Pixels (in other words 0:distance in cells, 1: distance in pixels)'.id - The id of the token to move, defaults to the Current Token.id - The id of the token to move, defaults to the Current Token.mapname - The name of the map to find the token. Defaults to the current map.\ @@ -5244,13 +5244,13 @@ The exception to this is when the token is 'Freesize' AND 'Snapped to Grid' AND
5 units, and left 10 units.\
+ 5 units, and left 10 units.\
[h: CurrentX = getTokenX()]\
[h: CurrentY = getTokenY()]\
[h: NewX = CurrentX + 5]\
[h: NewY = CurrentY - 10]\
[h: moveToken(NewX, NewY)]Moves the Current Token down 5 cells, and left 10 cells.\
+
Moves the Current Token down 5 cells, and left 10 cells.\
[h: CurrentX = getTokenX(0)]\
[h: CurrentY = getTokenY(0)]\
@@ -5352,7 +5352,7 @@ getDrawingEraser.summary = \
\
\
\
- Note: This function can only be used in a Trusted Macro\
+ Note: This function can only be used in a Trusted Macro\
\
\
• Introduced in version 1.5.0\
@@ -5398,11 +5398,11 @@ getDrawingInfo.summary = \
\
\
\
- Note: This function can only be used in a Trusted Macro\
+ Note: This function can only be used in a Trusted Macro\
\
\
• Introduced in version 1.5.2\
- Returns extensive information about the specified drawing. The information is returned as a JSON object.\
+ Returns extensive information about the specified drawing. The information is returned as a JSON object.\
\
Usage\
\
@@ -5622,7 +5622,7 @@ getDrawingLayer.summary = \
\
\
\
- Note: This function can only be used in a Trusted Macro\
+ Note: This function can only be used in a Trusted Macro\
\
\
• Introduced in version 1.5.0\
@@ -5668,7 +5668,7 @@ getDrawingOpacity.summary = \
\
\
\
- Note: This function can only be used in a Trusted Macro\
+ Note: This function can only be used in a Trusted Macro\
\
\
• Introduced in version 1.5.0\
@@ -5714,7 +5714,7 @@ getDrawingProperties.summary = \
\
\
\
- Note: This function can only be used in a Trusted Macro\
+ Note: This function can only be used in a Trusted Macro\
\
\
• Introduced in version 1.5.0\
@@ -5774,7 +5774,7 @@ getTokenDrawOrder(id, mapname)\
Parameter\
\
id - The id of the token to move, defaults to the Current Token.id - The id of the token to move, defaults to the Current Token.mapname - The name of the map to find the token. Defaults to the current map.\ @@ -5808,7 +5808,7 @@ getEnvironmentVariable.summary = \ \
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\"," is used."json" then a JSON Array is returned."," is used."json" then a JSON Array is returned.getExposedTokenNames()\ getExposedTokenNames(delim)\
If delim is specified then it is used as the delimiter that separates the token names.\ +
If delim is specified then it is used as the delimiter that separates the token names.\
\[h: names = getExposedTokenNames()]\
[r: foreach(name, names, "<br>"): name]The following example will return the exposed tokens from the TOKEN layer only.\ @@ -5899,7 +5899,7 @@ getExposedTokenNames(delim)\
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\getExposedTokenNames()\ getExposedTokenNames(delim)\
If delim is specified then it is used as the delimiter that separates the token ids.\ +
If delim is specified then it is used as the delimiter that separates the token ids.\
\[h: ids = getExposedTokens()]\
[r: foreach(id, ids "<br>"): id]\ @@ -5956,7 +5956,7 @@ getFillColor.summary = \ \
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\getFindCount(id)\
The id is the id value returned by strfind().\ +
The id is the id value returned by strfind().\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\id - The token id of the token that has its GM Name returned, defaults to the Current Token.id - The token id of the token that has its GM Name returned, defaults to the Current Token.mapname - The name of the map to find the token. Defaults to the current map.\ @@ -6104,7 +6104,7 @@ getGMName(id, mapname)\
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\id - The token id of the token to get the GM notes from. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to get the GM notes from. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ @@ -6404,7 +6404,7 @@ match 2, group 2 start = 10 \
"#RRGGBB" or "None" if the token has no Halo."#RRGGBB" or "None" if the token has no Halo.id - The token id of the token which has its halo color returned, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token which has its halo color returned, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
<span style="color:[r: getHalo()]">Halo Color Text</span>image:Map you can do the following:\
+ image:Map you can do the following:\
<img src="[r: getImage('image:Map')]"></img>Alternatively this can be used to retrieve a normal token:\
\ @@ -6493,7 +6493,7 @@ Error handling on duplicates should be pointed out.\id - The token id of the token to get the initiative value from. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to get the initiative value from. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token if the id parameter is used. Defaults to the current map.id - The token id of the token to get the initiative hold value from. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to get the initiative hold value from. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token if the id parameter is used. Defaults to the current map.Hide NPCs and the token's Visible To Owner Only flags, among others. (This is new in 1.3b78. Prior versions didn't have the check for trusted context at all.)Hide NPCs and the token's Visible To Owner Only flags, among others. (This is new in 1.3b78. Prior versions didn't have the check for trusted context at all.)[h: json = getInitiativeList() ]\
[r, foreach(item, json, "<br>"), code: {\
[r: item]: [r:json.get(json,item)]\
@@ -7135,7 +7135,7 @@ tokens: An Array of Objects for Each Token in List\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\id - The token id of the token that has its Token Label returned, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token that has its Token Label returned, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
\
\
@@ -7266,7 +7266,7 @@ getLastPath.summary = \
The Map Layer will be one of:\ +
The Map Layer will be one of:\
\TOKENGM also known as HiddenOBJECTBACKGROUNDid - The token id of the token which has its Map Layer returned, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token which has its Map Layer returned, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ @@ -7317,7 +7317,7 @@ getLayer(id, mapname)\
[getLibProperty("init")]To get the "init" token property from the library token if the library token has such a property. If not, use a default value of "default".\ +
To get the "init" token property from the library token if the library token has such a property. If not, use a default value of "default".\
\[result = getLibProperty("init")]\
[IF(result == ""): result = "default" ]To get the "init" token property from a library token called "lib:Attacks" use\ +
To get the "init" token property from a library token called "lib:Attacks" use\
\[getLibProperty("init", "lib:Attacks")]When token properties are created during campaign, they are persistent in the MapTool campaign, regardless of whether they are editable in the Edit Token window. In other words, even though a property is removed from the campaign properties, it remains available to macros. getLibPropertyNames will return all token properties that exist or have ever existed in the particular campaign, even if users cannot directly edit those properties (i.e., they do not appear in the token's properties when you double click on a token). To get only properties that are currently visible and editable, use getAllPropertyNames().\
delim - The delimiter used to separate the values in the String List, defaults to ",". Returns a JSON Array if set to "json".id - The token id of the token which has its property names returned, defaults to the Current Token. This parameter may be * or this to indicate the current Lib token that this macro is executing on. Note: This parameter can only be used in a Trusted Macro.
delim - The delimiter used to separate the values in the String List, defaults to ",". Returns a JSON Array if set to "json".id - The token id of the token which has its property names returned, defaults to the Current Token. This parameter may be * or this to indicate the current Lib token that this macro is executing on. Note: This parameter can only be used in a Trusted Macro.
type - The light source type, (e.g. "Generic", "D20"). If set to "*", all light sources are returned. Defaults to "*".delim - The delimiter used to separate values in the string list. If set to "json", a JSON Array is returned. Defaults to ",".id - The token id of the token to change the light sources, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
delim - The delimiter used to separate values in the string list. If set to "json", a JSON Array is returned. Defaults to ",".id - The token id of the token to change the light sources, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.[getLights()]To get a string list of the light sources that the current token has on with the light source type of "Generic".\ +
To get a string list of the light sources that the current token has on with the light source type of "Generic".\
\[getLights("Generic")]\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\-1 is returned.-1 is returned.[h: ind = getMacroButtonIndex()]ind is set to -1. Otherwise ind is set to a non-negative number which is the index of the button.ind is set to -1. Otherwise ind is set to a non-negative number which is the index of the button.index - The index of the macro button which will have the command returned.id - The token id of the token that the function is executed on. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token that the function is executed on. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ @@ -7624,7 +7624,7 @@ getMacroGroup.summary = \ \
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\label - The label for the macro buttons to return.delim - The delimiter used to separate the values in the String List which defaults to "," if not specified. This function returns a JSON Object if "json" is specified.id - The token id of the token that the function is executed on. Note: This parameter can only be used in a Trusted Macro.
delim - The delimiter used to separate the values in the String List which defaults to "," if not specified. This function returns a JSON Object if "json" is specified.id - The token id of the token that the function is executed on. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ @@ -7776,7 +7776,7 @@ getMacroName.summary = \
index - The index of the macro button.delim - The delimiter used to separate the values in the string property list which defaults to ";" if not specified. This function returns a JSON Object if "json" is specified.id - The token id of the token that the function is executed on. Note: This parameter can only be used in a Trusted Macro.
index - The index of the macro button.delim - The delimiter used to separate the values in the string property list which defaults to ";" if not specified. This function returns a JSON Object if "json" is specified.id - The token id of the token that the function is executed on. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ @@ -7823,9 +7823,9 @@ getMacroProps(index, delim, id, mapname)\
minWidth - The minimum width of the button.playerEditable - Is the button player editable, accepts true(1) or false(0).tooltip - The tool tip for the macro button.compare - A JSON Array of the selected Macro Commonality options.\
+ compare - A JSON Array of the selected Macro Commonality options.\
applyToSelected - Use the macro applyToSelected for common macro comparisons.autoExecute - Use the macro autoExec for common macro comparisons.command - Use the macro command for common macro comparisons.group - Use the macro group for common macro comparisons.includeLabel - Use the macro includeLabel for common macro comparisons.sortPrefix - Use the macro sortPrefix for common macro comparisons.metadata - A JSON Object holding the metadata key/value pairs for the macro.\
+ metadata - A JSON Object holding the metadata key/value pairs for the macro.\
uuid -commandChecksum -propsChecksum -\ @@ -7847,7 +7847,7 @@ getMacroProps(index, delim, id, mapname)\
delim - The delimiter used to separate the values in the String List, a JSON array is returned if "json" is specified as the delimiter. Defaults to ","id - The token id of the token that the function is executed on. Note: This parameter can only be used in a Trusted Macro.
delim - The delimiter used to separate the values in the String List, a JSON array is returned if "json" is specified as the delimiter. Defaults to ","id - The token id of the token that the function is executed on. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.[h: macroLabels = getMacros()]\
[foreach(macro, macroLabels, "<br>"): macro]pattern - A regular expression(regex) that represents the pattern the properties should match.lib - The name of the Library Token that is checked for properties that match, defaults to the Library Token the macro is running on.delim - The delimiter used in the String List that is returned, defaults to ",". Returns a JSON Array if "json" is specified.lib - The name of the Library Token that is checked for properties that match, defaults to the Library Token the macro is running on.delim - The delimiter used in the String List that is returned, defaults to ",". Returns a JSON Array if "json" is specified.Type:Item Name (for example Weapon:Longsword), you could use the following code to loop through\
+ Type:Item Name (for example Weapon:Longsword), you could use the following code to loop through\
all the weapons.\
\[foreach(item, getMatchingLibProperties("Weapon:.*", "Lib:Items")): {\
@@ -8026,7 +8026,7 @@ getMatchingLibProperties.summary = \
pattern - A regular expression(regex) that represents the pattern the properties should match.delim - The delimiter used in the String List that is returned, defaults to ",". Returns a JSON Array if "json" is specified.id - The token id of the token that is checked for properties that match the given pattern, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
pattern - A regular expression(regex) that represents the pattern the properties should match.delim - The delimiter used in the String List that is returned, defaults to ",". Returns a JSON Array if "json" is specified.id - The token id of the token that is checked for properties that match the given pattern, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.Inv:Category:. For example Inv:Weapon:Longsword.\
+ Inv:Category:. For example Inv:Weapon:Longsword.\
Then to loop through all of the inventory properties you could use\
\[foreach(item, getMatchingProperties("Inv:.*")): {\
@@ -8092,7 +8092,7 @@ getMatchingProperties(pattern, delim, id, mapname)\
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\id - The token id of the token to name, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to name, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.id - The token id of the token to get the notes from. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to get the notes from. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ @@ -8417,7 +8417,7 @@ getNotes(id, mapname)\
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\"," is used.json then a json array is returned."," is used.json then a json array is returned.getNPC()\ getNPC(delim)\
delim is the delimiter used to separate the values in the string list which defaults to "," if not specified.\
+
delim is the delimiter used to separate the values in the string list which defaults to "," if not specified.\
[h: ids = getNPC()]\
[foreach(id, ids, "<br>"): id]\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\"," is used.json then a JSON Array is returned."," is used.json then a JSON Array is returned.[h: macros = getNPCNames()]\ [h: macros = getNPCNames(delim)]\
delim is the delimiter used to separate the values in the string list which defaults to "," if not specified.\
+
delim is the delimiter used to separate the values in the string list which defaults to "," if not specified.\
[h: names = getNPCNames()]\
[foreach(name, names, "<br>"): name]\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\"," is used.json then a json array is returned."," is used.json then a json array is returned.getNPC()\ getNPC(delim)\
delim is the delimiter used to separate the values in the string list which defaults to "," if not specified.\
+
delim is the delimiter used to separate the values in the string list which defaults to "," if not specified.\
[h: ids = getNPC()]\
[foreach(id, ids, "<br>"): id]\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\"," is used.json then a json array is returned."," is used.json then a json array is returned.player - The player for which you want to retrieve the owned tokens, defaults to the current player.delim - the delimiter used to separate the values in the string list which defaults to "," if not specified.delim - the delimiter used to separate the values in the string list which defaults to "," if not specified.mapname - The name of the map to find the tokens. Defaults to the current map.[h: ids = getOwned(getPlayerName())]\
[foreach(id, ids, "<br>"): id]\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\"," is used.json then a json array is returned."," is used.json then a json array is returned.player - The player for which you want to retrieve the owned tokens, defaults to the current player.delim - the delimiter used to separate the values in the string list which defaults to "," if not specified.delim - the delimiter used to separate the values in the string list which defaults to "," if not specified.mapname - The name of the map to find the tokens. Defaults to the current map.[h: names = getOwnedNames(getPlayerName())]\
[foreach(name, names, "<br>"): name]true ( 1 ) if the Visible to Owners Only flag is set on a Token otherwise returns false ( 0 ).
+getOwnerOnlyVisible.description = Returns true ( 1 ) if the Visible to Owners Only flag is set on a Token otherwise returns false ( 0 ).
getOwnerOnlyVisible.summary = \
id - The token id of token that has its player visibility checked, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of token that has its player visibility checked, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
\
\
@@ -8757,7 +8757,7 @@ getOwnerOnlyVisible.summary = \
delim - The delimiter used to separate the values in the String List, defaults to ",". If set to "json", this function will return a JSON Array instead of a String List.id - The token id of the token which has its owners returned, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
delim - The delimiter used to separate the values in the String List, defaults to ",". If set to "json", this function will return a JSON Array instead of a String List.id - The token id of the token which has its owners returned, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.[h: names = getOwners()]\
[foreach(name, names, "<br>"): name]\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\"," is used.json then a JSON Array is returned."," is used.json then a JSON Array is returned.getPC()\ getPC(delim)\
delim is the delimiter used to separate the values in the string list which defaults to "," if not specified.\
+
delim is the delimiter used to separate the values in the string list which defaults to "," if not specified.\
[h: ids = getPC()]\
[foreach(id, ids, "<br>"): id]\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\"," is used.json then a JSON Array is returned."," is used.json then a JSON Array is returned.getPCNames()\ getPCNames(delim)\
delim is the delimiter used to separate the values in the string list which defaults to "," if not specified.\
+
delim is the delimiter used to separate the values in the string list which defaults to "," if not specified.\
[h: names = getPCNames()]\
[foreach(name, names, "<br>"): name]\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\"," is used.json then a JSON Array is returned."," is used.json then a JSON Array is returned.getPC()\ getPC(delim)\
delim is the delimiter used to separate the values in the string list which defaults to "," if not specified.\
+
delim is the delimiter used to separate the values in the string list which defaults to "," if not specified.\
[h: ids = getPC()]\
[foreach(id, ids, "<br>"): id]\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\NULL) or not defined, an empty string ("") is returned.NULL) or not defined, an empty string ("") is returned.property - The property that has its value returned. For referencing the literal name of the property (for instance, if you wish to get the property Constitution configured in Campaign Properties), enclose the property name in quotes. If using a variable whose value is the name of the property, do not enclose the variable name in quotes.id - The token id or name of the token that has its property value returned, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id or name of the token that has its property value returned, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map."") is returned."") is returned.name - The name of the property to get the default value of.propType - The token type to get the property from. Defaults to the token type of the Current Token.propType - The token type to get the property from. Defaults to the token type of the Current Token.delim - The delimiter used to separate the values in the String List, defaults to ",". Returns a JSON Array if set to "json".id - The token id of the token which has its property names returned, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
delim - The delimiter used to separate the values in the String List, defaults to ",". Returns a JSON Array if set to "json".id - The token id of the token which has its property names returned, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.[h: names = getPropertyNames()]\
[foreach(name, names, "<br>"): name]\ @@ -9225,7 +9225,7 @@ getPropertyNames(delim, id, mapname)\
delim - The delimiter used to separate the values in the String List, defaults to ",". Returns a JSON Array if set to "json".id - The token id of the token which has its property names returned, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
delim - The delimiter used to separate the values in the String List, defaults to ",". Returns a JSON Array if set to "json".id - The token id of the token which has its property names returned, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.[h: names = getPropertyNamesRaw()]\
[foreach(name, names, "<br>"): name]\ @@ -9279,7 +9279,7 @@ getPropertyNamesRaw(delim, id, mapname)\
id - The token id of the token which has its Property Type returned, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token which has its Property Type returned, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ @@ -9326,7 +9326,7 @@ getPropertyType(id, mapname)\
"" if the property is empty.
+getRawProperty.description = Gets the unevaluated value of a token property , returns "" if the property is empty.
getRawProperty.summary = \
"" if the property is empty. This will not return the property's default value."" if the property is empty. This will not return the property's default value."," is used.json then a JSON Array is returned."," is used.json then a JSON Array is returned.getSelected()\ getSelected(delim)\
delim is the delimiter used to separate the values in the string list which defaults to "," if not specified.\
+
delim is the delimiter used to separate the values in the string list which defaults to "," if not specified.\
[h: ids = getSelected()]\
[foreach(id, ids, "<br>"): id]\ @@ -9489,7 +9489,7 @@ getSelected(delim)\
"," is used.json then a JSON Array is returned."," is used.json then a JSON Array is returned.getSelectedNames()\ getSelectedNames(delim)\
delim is the delimiter used to separate the values in the string list which defaults to "," if not specified.\
+
delim is the delimiter used to separate the values in the string list which defaults to "," if not specified.\
[h: names = getSelectedNames()]\
[foreach(name, names, "<br>"): name]\ @@ -9532,7 +9532,7 @@ getSelectedNames(delim)\
id - The id of the token to have the State set. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The id of the token to have the State set. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ @@ -9573,7 +9573,7 @@ getSightType(mapname)\
The sizes returned are:\
\FineDiminutiveTinySmallMediumLargeHugeGargantuanColossalid - The token id of the token which has its Size returned, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token which has its Size returned, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.uri - The uri/url of the audio source to edit. If set to "*", a JSON Array containing the properties of all audio sources is returned. Defaults to "*".uri - The uri/url of the audio source to edit. If set to "*", a JSON Array containing the properties of all audio sources is returned. Defaults to "*".Properties returned for streams: nicknames, uri, cycleCount, volume, startTime, stopTime, currentTime, totalTime, bufferTime, currentCount, status.\
\ @@ -9669,7 +9669,7 @@ getSoundProperties(uri)\"," is used.json then a JSON Array is returned."," is used.json then a JSON Array is returned.getSpeechNames()\ getSpeechNames(delim)\
delim is the delimiter used to separate the values in the string list which defaults to "," if not specified.\
+
delim is the delimiter used to separate the values in the string list which defaults to "," if not specified.\
[h: names = getSpeech()]\
[foreach(name, names, "<br>"): name]\ @@ -9731,7 +9731,7 @@ getSpeechNames(delim)\
true ( 1 ) or false ( 0 ).
+getState.description = Checks whether the specified State is active on a token, returning true ( 1 ) or false ( 0 ).
getState.summary = \
state - The name of the state to check for.id - The token id of the token to check for the state. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to check for the state. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.<img src='[r:getStateImage("Dead")]'></img>uri - The uri/url of the audio source to edit. If set to "*", a JSON Array containing the properties of all audio sources is returned. Defaults to "*".uri - The uri/url of the audio source to edit. If set to "*", a JSON Array containing the properties of all audio sources is returned. Defaults to "*".Properties returned for streams: nicknames, uri, cycleCount, volume, startTime, stopTime, currentTime, totalTime, bufferTime, currentCount, status.\
\ @@ -9859,7 +9859,7 @@ getSoundProperties(uri)\[h: weapon = "name=longsword; damage=1d8; maxdamage=8"]\
Name of Weapon: [r: getStrProp(weapon, "name")]Returns Name of Weapon: longsword.\
-
To get the minimum damage from a weapon string property list with a default value should the key not exist\ +
To get the minimum damage from a weapon string property list with a default value should the key not exist\
\[h: weapon = "name=longsword; damage=1d8; maxdamage=8"]\
Minimum damage of Weapon: [r: getStrProp(weapon, "mindamage", 1)]Returns Minimum damage of Weapon: 1.\
-
To get the damage from a weapon string property list where the field delimiter is a colon. The default is 1d3 (note that a default value must be provided in order to specify the delimiter).\ +
To get the damage from a weapon string property list where the field delimiter is a colon. The default is 1d3 (note that a default value must be provided in order to specify the delimiter).\
\[h: weapon = "name=longsword: damage=1d8: maxdamage=8"]\
Damage of Weapon: [r: getStrProp(weapon, "damage", "1d3", ":")]\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\getTableNames()\ getTableNames(delim)\
If delim is specified then it is used to separate the values in the list; if it is not specified then it defaults to ",". When delim is the string "json" the return value will be in the form of a JSON Array.\
+
If delim is specified then it is used to separate the values in the list; if it is not specified then it defaults to ",". When delim is the string "json" the return value will be in the form of a JSON Array.\
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\id - The id of the token to move, defaults to the Current Token.id - The id of the token to move, defaults to the Current Token.mapname - The name of the map to find the token. Defaults to the current map.\ @@ -10408,7 +10408,7 @@ getTokenFacing(id, mapname)\ Parameters\
\id - The id of the token to get the facing from, defaults to the current token.Note: This parameter can only be used in a Trusted Macro.
id - The id of the token to get the facing from, defaults to the current token.Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.Returns\
@@ -10432,7 +10432,7 @@ The angle in degrees or "" if no facing has been set\
Returns:\
\
\
\
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\size - OPTIONAL: The size the image should be returned as. If a blank string "", no size adjustment is done. Defaults to "".id - OPTIONAL: The token id of the token for which you want to retrieve the token handout image, defaults to the Current Token.id - OPTIONAL: The token id of the token for which you want to retrieve the token handout image, defaults to the Current Token.mapname - OPTIONAL: The name of the map to find the token. Defaults to the current map.<img src='[r:getTokenHandout()]'></img>\
\
@@ -10577,7 +10577,7 @@ getTokenHeight(id, mapname)\
Parameter\
id - The token id of the token to check for its height, defaults to the Current Token.id - The token id of the token to check for its height, defaults to the Current Token.mapname - The name of the map to find the token. Defaults to the current map.
Result
\
@@ -10613,7 +10613,7 @@ The token's boundary (image) height in pixels.\
size - OPTIONAL: The size in pixels the image should be returned as. If a blank string "", no size adjustment is done. Defaults to "".id - OPTIONAL: The token id of the token for which you want to retrieve the token image, defaults to the Current Token.id - OPTIONAL: The token id of the token for which you want to retrieve the token image, defaults to the Current Token.mapname - OPTIONAL: The name of the map to find the token. Defaults to the current map.<img src='[r:getTokenImage()]'></img>To get the image of any token using its id and the token roll option.\ +
To get the image of any token using its id and the token roll option.\
\[h, token(tokenId): imgAsset = getTokenImage()]scale , xOffset , and yOffset values in either a JSON Object or String Property List .
+getTokenLayoutProps.description = Return the Token Layout scale , xOffset , and yOffset values in either a JSON Object or String Property List .
getTokenLayoutProps.summary = \
scale, xOffset, and yOffset values in either a JSON Object or String Property List. These values represent the positioning of the token image within the Layout portion of the Config tab in the Edit Token Dialog.scale, xOffset, and yOffset values in either a JSON Object or String Property List. These values represent the positioning of the token image within the Layout portion of the Config tab in the Edit Token Dialog.delim - The delimiter of the String Property List. If set to json, the function will instead return a Json Object. Defaults to ,.id - The token id of the token to name, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to name, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\delim - The delimiter used to separate the values in the String List that is returned, defaults to ",". If "json" is specified, a JSON Array is returned instead of a String List.conditions - A JSON Object that contains various conditions that the tokens must fullfill. All conditions are optional.\
-setStates - A JSON array of states the token must have or a single state name as a string. Any token which does not contain all of these states in the true condition will be removed from the returned list.unsetStates - A JSON array of states the token must not have or a single state name as a string.npc - If the token must be a NPC, set to true(1) or false(0).pc - If the token must be a PC, set to true(1) or false(0).propertyType - A JSON array of token types or a single token type as a string. Only tokens of a type included in the array will be returned.selected - If the token must be selected, set to true(1) or false(0).impersonated - If the token must be impersonated, set to true(1) or false(0).current - If the token must be the current token, set to true(1) or false(0).owned - A JSON Array containing player names. All tokens that have at least one of the listed players as owner will be returned. Alternatively, a string containing one of the following options:\
+ delim - The delimiter used to separate the values in the String List that is returned, defaults to ",". If "json" is specified, a JSON Array is returned instead of a String List.conditions - A JSON Object that contains various conditions that the tokens must fullfill. All conditions are optional.\
+setStates - A JSON array of states the token must have or a single state name as a string. Any token which does not contain all of these states in the true condition will be removed from the returned list.unsetStates - A JSON array of states the token must not have or a single state name as a string.npc - If the token must be a NPC, set to true(1) or false(0).pc - If the token must be a PC, set to true(1) or false(0).propertyType - A JSON array of token types or a single token type as a string. Only tokens of a type included in the array will be returned.selected - If the token must be selected, set to true(1) or false(0).impersonated - If the token must be impersonated, set to true(1) or false(0).current - If the token must be the current token, set to true(1) or false(0).owned - A JSON Array containing player names. All tokens that have at least one of the listed players as owner will be returned. Alternatively, a string containing one of the following options:\
self - tokens owned by the current playernotself - tokens not owned by the current playerothers - tokens owned by any player, but not owned by the current playerany - tokens owned by any playernone - tokens not owned by any playersingle - tokens owned by a single playermultiple - tokens owned by more than one playerbyall - tokens owned by all playersnotbyall - tokens not owned by all playersvisible - If the token is visible in the current client's view. Set to true(1) or false(0).\
layer - A JSON array of layer names, or a single layer name as a string. Note that a token not on any of the listed layers will be removed from the list returned.mapName - The name of the map to get the tokens from. Defaults to the current map.range - A JSON object with range conditions, all range conditions are optional.\
token - The id or name of the source token that the distance is measured from, defaults to the current token.\
@@ -10839,7 +10839,7 @@ getTokenNames(delim, conditions)\
[h: names = getTokenNames()]\
[foreach(name, names, "<br>"): name][h: cond = '{ range: {upto:2, distancePerCell:0}, npc:1 }']\
[h: names = getTokenNames("json", cond)]id - The token id of the token to check for its height, defaults to the Current Token.id - The token id of the token to check for its height, defaults to the Current Token.mapname - The name of the map to find the token. Defaults to the current map.
Result
\
@@ -10989,7 +10989,7 @@ getTokenNativeWidth(id, mapname)\
Parameters\
id - The token id of the token to check for its width, defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to check for its width, defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.
Result
\
@@ -11047,7 +11047,7 @@ getTokenOpacity(id, mapname)\
Parameters\
id - OPTIONAL: The token id of the token for which you want to retrieve the opacity, defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
id - OPTIONAL: The token id of the token for which you want to retrieve the opacity, defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
mapname - OPTIONAL: The name of the map to find the token. Defaults to the current map.size - OPTIONAL: The size the picture should be returned as. If a blank string "", no size adjustment is done. Defaults to "".id - OPTIONAL: The token id of the token for which you want to retrieve the token image, defaults to the Current Token.id - OPTIONAL: The token id of the token for which you want to retrieve the token image, defaults to the Current Token.mapname - OPTIONAL: The name of the map to find the token. Defaults to the current map.<img src='[r:getTokenPortrait()]'></img>id - The token id of the token to retrieve the rotation angle. Defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to retrieve the rotation angle. Defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.Result
\
@@ -11166,7 +11166,7 @@ The function returns the token's rotation as a numeric value measured in degrees
[h: switchToken("Troll")]\
[r: token.name] - [r: r = getTokenRotation()]
Relation to Token Facing
When the facing is defined, the relation between a token's rotation and the token's facing can be expressed as\
\rotation = -(facing + 90)\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\delim - The delimiter used to sepearate the values in the String List that is returned, defaults to ",". If "json" is specified, a JSON Array is returned instead of a String List.conditions - A JSON Object that contains various conditions that the tokens must fullfill. All conditions are optional.\
-setStates - A JSON array of states the token must have or a single state name as a string. Any token which does not contain all of these states in the true condition will be removed from the returned list.unsetStates - A JSON array of states the token must not have or a single state name as a string.npc - If the token must be a NPC, set to true(1) or false(0).pc - If the token must be a PC, set to true(1) or false(0).propertyType - A JSON array of token types or a single token type as a string. Only tokens of a type included in the array will be returned.selected - If the token must be selected, set to true(1) or false(0).impersonated - If the token must be impersonated, set to true(1) or false(0).current - If the token must be the current token, set to true(1) or false(0).owned - A JSON Array containing player names. All tokens that have at least one of the listed players as owner will be returned. Alternatively, a string containing one of the following options:\
+ delim - The delimiter used to sepearate the values in the String List that is returned, defaults to ",". If "json" is specified, a JSON Array is returned instead of a String List.conditions - A JSON Object that contains various conditions that the tokens must fullfill. All conditions are optional.\
+setStates - A JSON array of states the token must have or a single state name as a string. Any token which does not contain all of these states in the true condition will be removed from the returned list.unsetStates - A JSON array of states the token must not have or a single state name as a string.npc - If the token must be a NPC, set to true(1) or false(0).pc - If the token must be a PC, set to true(1) or false(0).propertyType - A JSON array of token types or a single token type as a string. Only tokens of a type included in the array will be returned.selected - If the token must be selected, set to true(1) or false(0).impersonated - If the token must be impersonated, set to true(1) or false(0).current - If the token must be the current token, set to true(1) or false(0).owned - A JSON Array containing player names. All tokens that have at least one of the listed players as owner will be returned. Alternatively, a string containing one of the following options:\
self - tokens owned by the current playernotself - tokens not owned by the current playerothers - tokens owned by any player, but not owned by the current playerany - tokens owned by any playernone - tokens not owned by any playersingle - tokens owned by a single playermultiple - tokens owned by more than one playerbyall - tokens owned by all playersnotbyall - tokens not owned by all playersvisible - If the token is visible in the current client's view. Set to true(1) or false(0).\
layer - A JSON array of layer names, or a single layer name as a string. Only tokens on one of the listed layers will be returned. By default, tokens on the Token and Hidden layers are returned.mapName - The name of the map to get the tokens from. Defaults to the current map.range - A JSON object with range conditions, all range conditions are optional.\
token - The id or name of the source token that the distance is measured from, defaults to the current token.\
@@ -11250,7 +11250,7 @@ The movement metric in range specifies the movement metric use, the metric can b
[foreach(id, ids, "<br>"): id][r:getTokens(",", json.set("{}", "layer", json.append("[]","TOKEN","HIDDEN","OBJECT","BACKGROUND")))][h: cond = '{ "range": {"upto":2, "distancePerCell":0, "token":"' +getSelected()+ '"}, "npc":1}']\
[h: ids = getTokens("json", cond)]id - The token id of the token to check for the shape, defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to check for the shape, defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.Result
\
@@ -11370,7 +11370,7 @@ The function returns the token's shape as a string value: "TOP_DOWN"\
-getTokenStates.description = Returns the valid states in the campaign settings in either a String List or JSON Array .
+getTokenStates.description = Returns the valid states in the campaign settings in either a String List or JSON Array .
getTokenStates.summary = \
true(1) for the token.true(1) for the token.delim - Specifies the delimiter used in the string list that is returned, default is ",". If the value is set to json, the function returns a JSON array instead.groupName - Specifies the name of the group to get the states for. If set to "*", get all states.id - The id of the token to get the states set to true(1). If the parameter is not used, instead returns all valid states in the campaign settings. Note: This parameter can only be used in a Trusted Macro.
id - The id of the token to get the states set to true(1). If the parameter is not used, instead returns all valid states in the campaign settings. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map where the token is. Set to the current map by default.[h: states = getTokenStates()]To get a JSON Array of the valid Token States in the campaign.\ +
To get a JSON Array of the valid Token States in the campaign.\
\[h: states = getTokenStates("json")]To get a JSON Array of the valid Token States in the Damage group in the campaign in 1.3b55 or later.\ +
To get a JSON Array of the valid Token States in the Damage group in the campaign in 1.3b55 or later.\
\[h: states = getTokenStates("json", "Damage")]To get a JSON Array of the Token States set to true(1) for the "Dragon" token:\
+
To get a JSON Array of the Token States set to true(1) for the "Dragon" token:\
[h: states = getTokenStates("json", "*", "Dragon")]\ @@ -11439,7 +11439,7 @@ getTokenVBL.summary = \ \
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\id - OPTIONAL: The token id of the token for which you want to get the VBL. Defaults to the Current Token.id - OPTIONAL: The token id of the token for which you want to get the VBL. Defaults to the Current Token.\ Example:\ @@ -11476,7 +11476,7 @@ getTokenVBL.summary = \
id - The token id of the token to check for its width, defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to check for its width, defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.
Result
\
@@ -11563,7 +11563,7 @@ getTokenX(units, id, mapname)\
units - If set to false(0), the coordinate is a location on the grid in number of cells. Defaults to true(1), where the coordinate is in number of Pixels (in other words 0:distance in cells, 1: distance in pixels)'.id - The id of the token to move, defaults to the Current Token.id - The id of the token to move, defaults to the Current Token.mapname - The name of the map to find the token. Defaults to the current map.\ @@ -11595,13 +11595,13 @@ The exception to this is when the token is 'Freesize' AND 'Snapped to Grid' AND
5 units, and left 10 units.\
+ 5 units, and left 10 units.\
[h: CurrentX = getTokenX()]\
[h: CurrentY = getTokenY()]\
[h: NewX = CurrentX + 5]\
[h: NewY = CurrentY - 10]\
[h: moveToken(NewX, NewY)]Moves the Current Token down 5 cells, and left 10 cells.\
+
Moves the Current Token down 5 cells, and left 10 cells.\
[h: CurrentX = getTokenX(0)]\
[h: CurrentY = getTokenY(0)]\
@@ -11651,7 +11651,7 @@ getTokenY(units, id, mapname)\
\
units - If set to false(0), the coordinate is a location on the grid in number of cells. Defaults to true(1), where the coordinate is in number of Pixels (in other words 0:distance in cells, 1: distance in pixels)'.id - The id of the token to move, defaults to the Current Token.id - The id of the token to move, defaults to the Current Token.mapname - The name of the map to find the token. Defaults to the current map.\ @@ -11683,13 +11683,13 @@ The exception to this is when the token is 'Freesize' AND 'Snapped to Grid' AND
5 units, and left 10 units.\
+ 5 units, and left 10 units.\
[h: CurrentX = getTokenX()]\
[h: CurrentY = getTokenY()]\
[h: NewX = CurrentX + 5]\
[h: NewY = CurrentY - 10]\
[h: moveToken(NewX, NewY)]Moves the Current Token down 5 cells, and left 10 cells.\
+
Moves the Current Token down 5 cells, and left 10 cells.\
[h: CurrentX = getTokenX(0)]\
[h: CurrentY = getTokenY(0)]\
@@ -11725,7 +11725,7 @@ getVBL.summary = \
\
\
\
- Note: This function can only be used in a Trusted Macro\
+ Note: This function can only be used in a Trusted Macro\
\
\
• Introduced in version 1.3b90\
@@ -11764,7 +11764,7 @@ getVBL.summary = \
\
See Also\
\
- \
+ \
true ( 1 ) if the visible to players flag is set on a Token otherwise returns false ( 0 ).
+getVisible.description = Returns true ( 1 ) if the visible to players flag is set on a Token otherwise returns false ( 0 ).
getVisible.summary = \
true(1) if the visible to players flag is set on a Token otherwise returns false(0). The visible to players flag has two meanings, on a normal Token players will only be able to see the Token if it is set (when all other things like Fog of War etc are taken into account). If it is a Library Token then it determines if players can call Macros using [macro():].true(1) if the visible to players flag is set on a Token otherwise returns false(0). The visible to players flag has two meanings, on a normal Token players will only be able to see the Token if it is set (when all other things like Fog of War etc are taken into account). If it is a Library Token then it determines if players can call Macros using [macro():].id - The token id of token that has its player visibility checked, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of token that has its player visibility checked, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
\
\
@@ -11921,7 +11921,7 @@ getVisible.summary = \
delim - The delimiter to use for the String List. If the value is json then a JSON Array is returned.delim - The delimiter to use for the String List. If the value is json then a JSON Array is returned.[h: maps = getVisibleMapNames()]To get the display names of all of the player visible maps in a JSON Array\ +
To get the display names of all of the player visible maps in a JSON Array\
\[h: maps = getVisibleMapNames("json")]delim - The delimiter to use for the String List. If the value is json then a JSON Array is returned.delim - The delimiter to use for the String List. If the value is json then a JSON Array is returned.[h: maps = getVisibleMapNames()]To get the names of all of the player visible maps in a JSON Array\ +
To get the names of all of the player visible maps in a JSON Array\
\[h: maps = getVisibleMapNames("json")]"," is used.json then a JSON Array is returned."," is used.json then a JSON Array is returned."," is used.json then a JSON Array is returned."," is used.json then a JSON Array is returned.\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\"," is used.json then a JSON Array is returned."," is used.json then a JSON Array is returned.[h: ids = getWithState("Dead")]\
[foreach(id, ids, "<br>"): id]\ @@ -12145,7 +12145,7 @@ getWithState(state, delim)\
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\"," is used.json then a JSON Array is returned."," is used.json then a JSON Array is returned.[h: names = getWithStateNames("Dead")]\
[foreach(name, names, "<br>"): name]\ @@ -12329,7 +12329,7 @@ gt.summary = \
type - The light source type, (e.g. "Generic", "D20"). If "*" is entered, all light sources types are checked. Defaults to "*".name - the name of the light source. If "*" is entered, all light sources names are checked. Defaults to "*".id - The token id of the token which is checked for light sources, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
name - the name of the light source. If "*" is entered, all light sources names are checked. Defaults to "*".id - The token id of the token which is checked for light sources, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.true ( 1 ) if a macro button with the specified label exists on the Current Token .
+hasMacro.description = Returns true ( 1 ) if a macro button with the specified label exists on the Current Token .
hasMacro.summary = \
label - The label of the macro to check for.id - The token id of the token that the function is executed on. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token that the function is executed on. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ @@ -12443,7 +12443,7 @@ hasMacro(label, id, mapname)\
true ( 1 ) if the Token Property with the specified name exists on a Token .
+hasProperty.description = Returns true ( 1 ) if the Token Property with the specified name exists on a Token .
hasProperty.summary = \
true(1) if the Token Property with the specified name exists on a Token. The function will return true if the token possesses the specified property, even if that property is not defined in the token's current property type.true(1) if the Token Property with the specified name exists on a Token. The function will return true if the token possesses the specified property, even if that property is not defined in the token's current property type.name - The name of the Token Property which is checked for on the token.id - The token id of the token which is checked for the Token Property, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
name - The name of the Token Property which is checked for on the token.id - The token id of the token which is checked for the Token Property, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ @@ -12485,7 +12485,7 @@ hasProperty(name, id, mapname)\
id - The id of the token to return the sight. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The id of the token to return the sight. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\
@@ -12566,7 +12566,7 @@ Returns a number than is between 5 and 50 for the hero
See Also\
\
5 and 50 for the hero
See Also\
\
\
+For another method of rolling dice, see Dice Expressions.\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\XPath - The XPath expression to evaluate against the XML statblock.id - The id of the token. Defaults to the Current Token.delim - Coming in 1.8. Custom delimiter for the returned results. Defaults to ", ". If equal to "json", a JSON Array will be returned instead of a String List.delim - Coming in 1.8. Custom delimiter for the returned results. Defaults to ", ". If equal to "json", a JSON Array will be returned instead of a String List.Returns the requested data.\
\ @@ -13073,7 +13073,7 @@ herolab.XPath(XPath, id, "json")\ \Human Neutral Good 1Sometimes the data desired from herolab contains commas or is otherwise incompatible with the String List format and default (comma) separator. In the following example, the list of spells retrieved includes one called "Delay Poison, Communal" - as we see in the default output, this element would be incompatible with the standard String List format.\ +
Sometimes the data desired from herolab contains commas or is otherwise incompatible with the String List format and default (comma) separator. In the following example, the list of spells retrieved includes one called "Delay Poison, Communal" - as we see in the default output, this element would be incompatible with the standard String List format.\
\[h: vXPath = "/document/public/character/spellsmemorized/spell[contains(@name,'De')]/@name"]\
Default: [r: herolab.XPath(vXPath)]<br />\
@@ -13094,7 +13094,7 @@ When dealing with more complicated text elements with potential delimiter confli
See Also\
\
\
\
Version Changes\
@@ -13149,7 +13149,7 @@ Returns a number than is between 5 and 50 for the hero
See Also\
\
\
+For another method of rolling dice, see Dice Expressions.condition - What is tested to determine is the trueExpr or falseExpr will be executed. This follows the standard rules for conditions that can be found in the Branching and Looping article.condition - What is tested to determine is the trueExpr or falseExpr will be executed. This follows the standard rules for conditions that can be found in the Branching and Looping article.trueExpr - A section of code that is returned if condition is true(1).falseExpr - A section of code that is returned if condition is false(0).property set to 0
Example 5: Usually its better to use the roll option version [if():]. Sometimes it's pretty handy to use the version documented here, since you can easily embed it in loops and expressions.\
+
Example 5: Usually its better to use the roll option version [if():]. Sometimes it's pretty handy to use the version documented here, since you can easily embed it in loops and expressions.\
Let's say you want to check if one of a player's tokens has Initiative, you could do it this like this:\
\ @@ -13371,7 +13371,7 @@ This function doesn't have the parentheses limit that the roll option has:\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\Output:\
\ -

TEXT
Parameters\
\
\
- inputField - A string containing various 'sub-parameters' that set the type and options of each inputField; requires at least one inputField but will accept a reasonably large amount. The inputFields can be set using a series of individual parameters, or as one or more String Lists. If a String List is used, the delimiter must be "##". This allows, among other things, for more dynamic input menus, with the number and type of input requests customized to the circumstances. Normally, each line is described by a string, wrapped in quotes, and the strings are separated by commas. The input function looks for unquoted commas to determine which strings are intended to be read as line entries. The function, however, can also recognize ## as a denotation of such a line break. Since this denotation can be surrounded by quotes more easily, it is possible to have a single string, wrapped in quotes, describe multiple input requests. The strings can be compiled in any number of ways: for instance using listAppend() and setting the delimiter to "##". Strings involving these ##'s can be intermixed with other standard strings. See the example below. \
+ inputField - A string containing various 'sub-parameters' that set the type and options of each inputField; requires at least one inputField but will accept a reasonably large amount. The inputFields can be set using a series of individual parameters, or as one or more String Lists. If a String List is used, the delimiter must be "##". This allows, among other things, for more dynamic input menus, with the number and type of input requests customized to the circumstances. Normally, each line is described by a string, wrapped in quotes, and the strings are separated by commas. The input function looks for unquoted commas to determine which strings are intended to be read as line entries. The function, however, can also recognize ## as a denotation of such a line break. Since this denotation can be surrounded by quotes more easily, it is possible to have a single string, wrapped in quotes, describe multiple input requests. The strings can be compiled in any number of ways: for instance using listAppend() and setting the delimiter to "##". Strings involving these ##'s can be intermixed with other standard strings. See the example below. \
\
You declare the 'sub-parameters' of each inputField in the following manner:\
\
@@ -13610,7 +13610,7 @@ Note that there are no built-in mechanisms for input validation for TEXT
ICONSIZE=nnn - The size the icons; defaults to ICONSIZE=50. All icons are stretched to fit a square this size. If the asset URL points to an image that is not square, some distortion will occur. \
TEXT=FALSE - No text is shown in the list entries next to the icons; defaults to TEXT=TRUE, and is ignored if no icon is set. \
SPAN=TRUE - Causes the prompt to be hidden and allows the inputField to span the width of the dialog; defaults to SPAN=FALSE. If hidden the prompt text is used as a tooltip. \
- DELIMITER=, - The delimiter used in the list; defaults to the comma ,. The delimiter cannot contain empty spaces. If set to JSON, a JSON Array should be provided instead. \
+ DELIMITER=, - The delimiter used in the list; defaults to the comma ,. The delimiter cannot contain empty spaces. If set to JSON, a JSON Array should be provided instead. \
\
\
\
@@ -13638,7 +13638,7 @@ Note that there are no built-in mechanisms for input validation for TEXT
SELECT=nnn - Sets the initially selected radio button (the first item is number 0); defaults to SELECT=0. \
VALUE=STRING - The variable is assigned the string contents of the selected item instead of the index; defaults to VALUE=NUMBER. \
SPAN=TRUE - Causes the prompt to be hidden and allows the inputField to span the width of the dialog; defaults to SPAN=FALSE. If hidden the prompt text is used as title placed in the border of the radio button group. \
- DELIMITER=, - The delimiter used in the list; defaults to the comma ,. The delimiter cannot contain empty spaces. If set to JSON, a JSON Array should be provided instead. \
+ DELIMITER=, - The delimiter used in the list; defaults to the comma ,. The delimiter cannot contain empty spaces. If set to JSON, a JSON Array should be provided instead. \
\
\
\
@@ -13662,14 +13662,14 @@ Note that there are no built-in mechanisms for input validation for TEXT
\
PROPS\
\
- Creates a bordered sub-area containing multiple text boxes, one for each entry in a String Property List stored in value. The variableName is assigned a new string property containing all the entries with their updated values.\
+
Creates a bordered sub-area containing multiple text boxes, one for each entry in a String Property List stored in value. The variableName is assigned a new string property containing all the entries with their updated values.\
\
\
PROPS Options\
\
\
SETVARS=SUFFIXED - Makes a variable assignment for each of the sub-values, with an underscore appended to the name; defaults to SETVARS=NONE. \
- SETVARS=UNSUFFIXED - Makes variable assignments to unmodified variable names. SUFFIXED is usually preferred, unless you are not using variable names that match Token Properties or if you specifically intend to overwrite them. \
+ SETVARS=UNSUFFIXED - Makes variable assignments to unmodified variable names. SUFFIXED is usually preferred, unless you are not using variable names that match Token Properties or if you specifically intend to overwrite them. \
SPAN=TRUE - Causes the prompt to be hidden and allows the inputField to span the width of the dialog; defaults to SPAN=FALSE. If hidden the prompt text is used as title placed in the border of the PROPS group. \
WIDTH=nnn - Sets the width of the input box; defaults to WIDTH=14. \
TYPE=JSON - Result returned in variableName will be a JSON object instead of string property. \
@@ -13678,7 +13678,7 @@ Note that there are no built-in mechanisms for input validation for TEXT
\
TAB\
\
- Creates a tab for a tabbed dialog box. The variableName variable gets assigned a String Property List containing all the variable assignments made on this tab. Since some of the variables may be property strings themselves, the tab property string uses the non-default delimiter "##". When using tabs, the first inputField must be a TAB.\
+
Creates a tab for a tabbed dialog box. The variableName variable gets assigned a String Property List containing all the variable assignments made on this tab. Since some of the variables may be property strings themselves, the tab property string uses the non-default delimiter "##". When using tabs, the first inputField must be a TAB.\
\
\
TAB Options\
@@ -13709,7 +13709,7 @@ Note that there are no built-in mechanisms for input validation for TEXT
Displays:\
\
\
@@ -13732,7 +13732,7 @@ Note that there are no built-in mechanisms for input validation for TEXT
Displays:\
\
\
@@ -13752,11 +13752,11 @@ Note that there are no built-in mechanisms for input validation for TEXT
Displays:\
\
\
- Note that the prompt section for each list contains a list of items, or a variable containing a String List (e.g., the variable imgList). In the first list, the ICON and ICONSIZE options are set, because that list contains image asset URLs for token images. In the second two lists, the VALUE=STRING option is set so that the value in the corresponding variable is the actual string (e.g. "Sneak Attack") rather than the index of the list item.\
+
Note that the prompt section for each list contains a list of items, or a variable containing a String List (e.g., the variable imgList). In the first list, the ICON and ICONSIZE options are set, because that list contains image asset URLs for token images. In the second two lists, the VALUE=STRING option is set so that the value in the corresponding variable is the actual string (e.g. "Sneak Attack") rather than the index of the list item.\
\
\
Input using using the DELIMITER option for LIST.\
@@ -13791,7 +13791,7 @@ You chose: [r: color] [r: meat] with [r: sauce]\
inptext\
)]\
In this example, variables SPD1-SPD9 and CMSL are called earlier from a token and represent spells per day for spell levels 1-9 and the maximum spell level accessible by the token at the moment for the class in question. The macro is intended to allow manual changing of the number of spells per day for the token, but the input is cleaned up and prevents complications by not allowing for inputs to spell levels beyond what is available. The first line in the input is a standard string, followed by a comma. The second is a "##"-containing string set by the [foreach():] function above, which will contain just the number of input requests, separated by ##'s, needed in the situation.\
+
In this example, variables SPD1-SPD9 and CMSL are called earlier from a token and represent spells per day for spell levels 1-9 and the maximum spell level accessible by the token at the moment for the class in question. The macro is intended to allow manual changing of the number of spells per day for the token, but the input is cleaned up and prevents complications by not allowing for inputs to spell levels beyond what is available. The first line in the input is a standard string, followed by a comma. The second is a "##"-containing string set by the [foreach():] function above, which will contain just the number of input requests, separated by ##'s, needed in the situation.\
\ 5. Dynamic Variable Example, by aliasmask. Uses strformat to create the property names and json.evaluate to put in default values.\ @@ -13916,7 +13916,7 @@ If you really want to go full monty on the tooltip INSIDE the input, here's an e This is the result:\
\ \ @@ -13942,7 +13942,7 @@ This can simply be done with the<html><img> tags. Howe
[h:input("junk|<html><img src='"+replace(getTokenHandout(), ":", ":")+"' height=90 width=90></img></html>|-|LABEL|SPAN=TRUE")]\
<html><img> tags. Howe
[r,token(me), if(picChoice == 2): "<img src='"+getTokenHandout(picSize)+"'></img>"]\
<html><img> tags. Howe
true ( 1 ) if the specified Token Bar on the Current Token is visible, or false ( 0 ) if it is not.
+isBarVisible.description = Returns true ( 1 ) if the specified Token Bar on the Current Token is visible, or false ( 0 ) if it is not.
isBarVisible.summary = \
true(1) if the specified Token Bar on the Current Token is visible, or false(0) if it is not.true(1) if the specified Token Bar on the Current Token is visible, or false(0) if it is not.bar - A string that contains the name of the bar that has its visibility checked.id - The token id of the token which has its bar checked, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token which has its bar checked, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.bar.name special variable\
+ The bar.name special variable\
true ( 1 ) if a Token is a NPC or false ( 0 ) if it is not.
+isNPC.description = Returns true ( 1 ) if a Token is a NPC or false ( 0 ) if it is not.
isNPC.summary = \
id - The token id of the token which has its NPC status checked, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token which has its NPC status checked, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.true ( 1 ) if a Token has the Owned by All check box checked.
+isOwnedByAll.description = Returns true ( 1 ) if a Token has the Owned by All check box checked.
isOwnedByAll.summary = \
id - The token id of the token which has its Owned by All status checked, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token which has its Owned by All status checked, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.Anyone can edit me if the Current Token has the Owned by All check box checked.\
+ Anyone can edit me if the Current Token has the Owned by All check box checked.\
[r, if(isOwnedByAll()): "Anyone can edit me"]true ( 1 ) if the given Player is an owner of a specific Token .
+isOwner.description = Returns true ( 1 ) if the given Player is an owner of a specific Token .
isOwner.summary = \
player - The name of the player to check for ownership, defaults to the Current Player.id - The token id of the token which is checked for ownership, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
player - The name of the player to check for ownership, defaults to the Current Player.id - The token id of the token which is checked for ownership, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.You can edit me. if the Current Player is an owner of the Current Token.\
+ You can edit me. if the Current Player is an owner of the Current Token.\
[r, if(isOwner()): "You can edit me."]Returns Azhrei can edit me. if the given Player is an owner of the given Token.\
+
Returns Azhrei can edit me. if the given Player is an owner of the given Token.\
[h: id = getSelected() ]\
[r, if(isOwner("Azhrei", id)): "Azhrei can edit me."]true ( 1 ) if a Token is a PC or false ( 0 ) if it is not.
+isPC.description = Returns true ( 1 ) if a Token is a PC or false ( 0 ) if it is not.
isPC.summary = \
id - The token id of the token which has its PC status checked, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token which has its PC status checked, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.true ( 1 ) if the Token Property for a specific Token is empty.
+isPropertyEmpty.description = Returns true ( 1 ) if the Token Property for a specific Token is empty.
isPropertyEmpty.summary = \
true(1) if the Token Property for a specific Token is empty. A Token Property is considered empty if it is NULL; if an empty string ("") has been assigned to it, it is not considered empty.\
+ true(1) if the Token Property for a specific Token is empty. A Token Property is considered empty if it is NULL; if an empty string ("") has been assigned to it, it is not considered empty.\
Note: If the token type sets a default value, this function will still see the property as empty. Try using json.isEmpty().property - The name of the property that has its value checked.id - The token id of the token that has its value checked, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token that has its value checked, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.true ( 1 ) if a Token is snapped to grid or false ( 0 ) if it is not.
+isSnapToGrid.description = Returns true ( 1 ) if a Token is snapped to grid or false ( 0 ) if it is not.
isSnapToGrid.summary = \
id - The token id of the token which has its snapToGrid status checked, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token which has its snapToGrid status checked, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.x - Then tokens x coordinate. Always in map units, not grid .y - Then tokens x coordinate. Always in map units, not grid .id - The check for visibility is performed from token id. Note: This parameter can only be used in a Trusted Macro.
id - The check for visibility is performed from token id. Note: This parameter can only be used in a Trusted Macro.
true ( 1 ) if the JSON Object contains the specified key, or if the JSON Array contains the specified value.
+json.contains.description = Returns true ( 1 ) if the JSON Object contains the specified key, or if the JSON Array contains the specified value.
json.contains.summary = \
true(1) if the JSON Object contains the specified key, or if the JSON Array contains the specified value.true(1) if the JSON Object contains the specified key, or if the JSON Array contains the specified value.object - The JSON Object to test for the key.object - The JSON Object to test for the key.key - The key to check the object for.array - The JSON Array to test for the value.array - The JSON Array to test for the value.value - The value to check the array for.a contains the key "b":\
+ a contains the key "b":\
[h:a=json.fromStrProp("a=1;b=44;c=12")]\
[json.contains(a,"b")]Returns true(1)\
-
Check if the JSON Object a contains the key "z":\
+
Check if the JSON Object a contains the key "z":\
[h:a=json.fromStrProp("a=1;b=44;c=12")]\
[json.contains(a,"z")]Returns false(0)\
-
Check if the JSON Array a contains the value "b":\
+
Check if the JSON Array a contains the value "b":\
[h:a=json.fromList("1,b,3,d")]\
[json.contains(a,"b")]true(1)0 is returned. The index for the JSON Array starts at 0.0 is returned. The index for the JSON Array starts at 0.array - The JSON Array to search.array - The JSON Array to search.value - The value to count the occurrences of.start - The index to start searching from, if not specified it defaults to 0.2array - A JSON Array to get the difference of.object - A JSON Object to get the difference of.array - A JSON Array to get the difference of.object - A JSON Object to get the difference of.\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\delim =\
-unspecified: a standard string list is returned, with its default "," delimiter."json": a JSON Array is returned."x": a string list is returned with "x" used as a delimiter.unspecified: a standard string list is returned, with its default "," delimiter."json": a JSON Array is returned."x": a string list is returned with "x" used as a delimiter.strList - The String List that is converted to a JSON Array.delim - The delimiter used in the String List, defaults to ",".strList - The String List that is converted to a JSON Array.delim - The delimiter used in the String List, defaults to ",".["a",1,"g",4]array - The JSON Array to retrieve the element from.array - The JSON Array to retrieve the element from.index - The numerical index of the element you want returned.start - The starting index of the element you wish the slice to begin at.end - The ending index of the element you wish the slice to end at.object - The JSON Object to retrieve the element from.key - The name of a field that should be returned. This parameter can exist more than once, if it does then a JSON Object is returned with all the specified elements.object - The JSON Object to retrieve the element from.key - The name of a field that should be returned. This parameter can exist more than once, if it does then a JSON Object is returned with all the specified elements.When extracting slices:
\
Negative numbers can be used as the offsets from the end of the array. -1 is the last element in the array, -2 is the second to last, and so on. If the element specified by the start index and the element specified by the end index are located in reverse order in array (so reading from left to right end comes before start), then the array slice is returned in reverse order compared to array (because fetching from start to end means reading backwards).
\
@@ -15126,8 +15126,8 @@ ERROR b) -- java.lang.ArrayIndexOutOfBoundsException, the last valid index is 2\
\
-1 is returned. All JSON Array indexes start at 0.-1 is returned. All JSON Array indexes start at 0.array - The JSON Array to search.value - The value to find the index of in the JSON Array.array - The JSON Array to search.value - The value to find the index of in the JSON Array.start - The index to start searching from, if not specified it defaults to 0.2array - A JSON Array used in the intersection.object - A JSON Object used in the intersection.array - A JSON Array used in the intersection.object - A JSON Object used in the intersection.true ( 1 ) if all of the JSON Object keys or JSON Array values are contained within the first JSON Object or JSON Array .
+json.isSubset.description = Returns true ( 1 ) if all of the JSON Object keys or JSON Array values are contained within the first JSON Object or JSON Array .
json.isSubset.summary = \
true(1) if all of the JSON Object keys or JSON Array values are contained within the first JSON Object or JSON Array.true(1) if all of the JSON Object keys or JSON Array values are contained within the first JSON Object or JSON Array.firstArray - The JSON Array that must contain all of the values of the subsequent JSON Arrays for this function to return true(1).array - A JSON Array with values that are tested to be within the firstArray.firstObject - The JSON Object that must contain all of the keys of the subsequent JSON Objects for this function to return true(1).object - A JSON Object with keys that are tested to be within the firstObject.firstArray - The JSON Array that must contain all of the values of the subsequent JSON Arrays for this function to return true(1).array - A JSON Array with values that are tested to be within the firstArray.firstObject - The JSON Object that must contain all of the keys of the subsequent JSON Objects for this function to return true(1).object - A JSON Object with keys that are tested to be within the firstObject.\
\
@@ -15347,7 +15347,7 @@ json.isSubset.summary = \
For JSON Arrays the value returned is that of all the JSON Arrays concatenated together.\ +
For JSON Arrays the value returned is that of all the JSON Arrays concatenated together.\
\ -For JSON Objects the value returned is a JSON Object with all of the keys from all of the JSON Objects set, if any key is specified in more than one JSON Object then the value for the last specified JSON Object is used.array - A JSON Array.object - A JSON Object.array - A JSON Array.object - A JSON Object.[r: json.merge("[1,2]", "[3,4]", "[1,2]")]Returns: [1,2,3,4,1,2]\
-
Merge two JSON Objects with no matching keys:\ +
Merge two JSON Objects with no matching keys:\
\[r: json.merge("{a:1, b:2}", "{c:10, d:7}")]Returns: {"a":1,"b":2,"c":10,"d":7} \
-
Merge three JSON Objects with a matching key, a:\
+
Merge three JSON Objects with a matching key, a:\
[r: json.merge("{a:1, b:2}", "{c:10, d:7}", "{a:11, z:7}")]{"a":11,"b":2,"c":10,"d":7,"z":7} {"a":11,"b":2,"c":10,"d":7,"z":7} json.merge() to work correctly with JSON Objects.json.merge() to work correctly with JSON Objects.json - The json element in which the JSON Array is nested.path - The path to the JSON Array.json - The json element in which the JSON Array is nested.path - The path to the JSON Array.value - The value to add to the array.json - The json element in which the JSON Object is nested.path - The path to the JSON Object.key - The key of the JSON Object.json - The json element in which the JSON Object is nested.path - The path to the JSON Object.key - The key of the JSON Object.value - The value to associated with the key.$ at the beginning of the requested path. To do so, you must escape the dollar sign like this: \$.path.to.read. The json.path functions support both dot, Monsters.Orc.Attacks, and bracket, ['Monsters']['Orc']['Attacks'], notation.\
+ $ at the beginning of the requested path. To do so, you must escape the dollar sign like this: \$.path.to.read. The json.path functions support both dot, Monsters.Orc.Attacks, and bracket, ['Monsters']['Orc']['Attacks'], notation.\
For detailed information on how to specify the path, please read the JsonPath ReadMe.json - The json data to get the values from.path - The path of the value(s) to retrieve.config - A String containing configuration options separated by a comma. The options can include\
-ALWAYS_RETURN_LIST - Always return the results in a JSON Array, even when the path is definite.AS_PATH_LIST - Return a JSON Array of path strings representing the path of the evaluation hits.DEFAULT_PATH_LEAF_TO_NULL - Return null when the given path almost exists but ends with a JSON Object key that is missing. Without this configuration, a definite path will return an error. With this configuration, an indefinite path will include null in the JSON Array if the key is missing. Without this configuration or if any other kind of nonexistent path structure is provided, an indefinite path will simply not match and return an empty JSON Array or less results in the JSON Array.REQUIRE_PROPERTIES - When an indefinite path is evaluated and ends in a key, all matching JSON Objects must have that key, otherwise an error is returned. This are the cases where DEFAULT_PATH_LEAF_TO_NULL will return null instead.SUPPRESS_EXCEPTIONS - Suppress all exceptions when evaluating paths. If ALWAYS_RETURN_LIST is also used return an empty list. Otherwise return null.ALWAYS_RETURN_LIST - Always return the results in a JSON Array, even when the path is definite.AS_PATH_LIST - Return a JSON Array of path strings representing the path of the evaluation hits.DEFAULT_PATH_LEAF_TO_NULL - Return null when the given path almost exists but ends with a JSON Object key that is missing. Without this configuration, a definite path will return an error. With this configuration, an indefinite path will include null in the JSON Array if the key is missing. Without this configuration or if any other kind of nonexistent path structure is provided, an indefinite path will simply not match and return an empty JSON Array or less results in the JSON Array.REQUIRE_PROPERTIES - When an indefinite path is evaluated and ends in a key, all matching JSON Objects must have that key, otherwise an error is returned. This are the cases where DEFAULT_PATH_LEAF_TO_NULL will return null instead.SUPPRESS_EXCEPTIONS - Suppress all exceptions when evaluating paths. If ALWAYS_RETURN_LIST is also used return an empty list. Otherwise return null.See the Jayway javadoc page for more info.\
\ @@ -15728,7 +15728,7 @@ which returns["Troll"]. Note the use of bracket notation for the p
json - The json element in which the JSON Array is nested.path - The path to the element in the JSON Array.json - The json element in which the JSON Array is nested.path - The path to the element in the JSON Array.value - The value to change.firstArray - The JSON Array to remove the occurrences from.array - The JSON Arrays to get the occurrences from.firstObject - The JSON Object to remove the occurrences from.object - The JSON Objects to get the occurrences from.firstArray - The JSON Array to remove the occurrences from.array - The JSON Arrays to get the occurrences from.firstObject - The JSON Object to remove the occurrences from.object - The JSON Objects to get the occurrences from.\
\
@@ -15894,7 +15894,7 @@ json.removeFirst.summary = \
"") to represent a new JSON Array or JSON Object."") to represent a new JSON Array or JSON Object.jarr - The JSON Array that has an index's value set.jarr - The JSON Array that has an index's value set.index - The numeric index which has its value set.jobj - The JSON Object that has a key's value set.jobj - The JSON Object that has a key's value set.key - The named key which has its value set.value - The content that is set to the index or key. {"a":5}\
{"a":5, "b":8}\
[8, 3]\
-To save the new value in the JSON Array or JSON Object so that you can reference it later in a macro, you must set the array equal to the result of json.set().\ +
To save the new value in the JSON Array or JSON Object so that you can reference it later in a macro, you must set the array equal to the result of json.set().\
[myArray = json.append("", 1, 2, 3)]\
[myArray = json.set(myArray, 0, 5)]\
[myArray]Returns\ @@ -16092,7 +16092,7 @@ json.sort.summary = \
json.sort(array, direction)\
If you have a JSON Array that contains JSON Objects\ +
If you have a JSON Array that contains JSON Objects\
\json.sort(array, direction, key1, ..., keyN)\
@@ -16104,15 +16104,15 @@ json.sort.summary = \
array - The JSON array to sort.direction - Defaults to "ascending", acceptable values:\
"ascending""descending""ascend""descend""asc""desc""a""d"key1, ..., keyN - The keys in the JSON Objects contained within the JSON Array used for sorting. All JSON Objects must contain these fields.key1, ..., keyN - The keys in the JSON Objects contained within the JSON Array used for sorting. All JSON Objects must contain these fields.[json.sort("[1,4,5,6,2,1,9,20,1]")]Produces [1,1,1,2,4,5,6,9,20]\
-
Sorting a JSON Array containing strings.\ +
Sorting a JSON Array containing strings.\
\[json.sort("['Hero', 'Dragon', 'Elf', 'Wolf', 'Mage', 'Eagle', 'Troll']")]Produces ["Dragon","Eagle","Elf","Hero","Mage","Troll","Wolf"]\
@@ -16153,7 +16153,7 @@ json.sort.summary = \
true ( 1 ) if all of the JSON Object keys or JSON Array values are contained within the first JSON Object or JSON Array .
+json.subset.description = Returns true ( 1 ) if all of the JSON Object keys or JSON Array values are contained within the first JSON Object or JSON Array .
json.subset.summary = \
true(1) if all of the JSON Object keys or JSON Array values are contained within the first JSON Object or JSON Array.true(1) if all of the JSON Object keys or JSON Array values are contained within the first JSON Object or JSON Array.firstArray - The JSON Array that must contain all of the values of the subsequent JSON Arrays for this function to return true(1).array - A JSON Array with values that are tested to be within the firstArray.firstObject - The JSON Object that must contain all of the keys of the subsequent JSON Objects for this function to return true(1).object - A JSON Object with keys that are tested to be within the firstObject.firstArray - The JSON Array that must contain all of the values of the subsequent JSON Arrays for this function to return true(1).array - A JSON Array with values that are tested to be within the firstArray.firstObject - The JSON Object that must contain all of the keys of the subsequent JSON Objects for this function to return true(1).object - A JSON Object with keys that are tested to be within the firstObject.\
\
@@ -16194,7 +16194,7 @@ json.subset.summary = \
Return values are\
\ -ARRAY - The object is a JSON Array.OBJECT - The object is a JSON Object.UNKNOWN - It is neither a JSON Array nor JSON Object.ARRAY - The object is a JSON Array.OBJECT - The object is a JSON Object.UNKNOWN - It is neither a JSON Array nor JSON Object.array - The JSON Arrays to union.object - The JSON Objects to union.array - The JSON Arrays to union.object - The JSON Objects to union.array - The JSON Array to return only unique values from.array - The JSON Array to return only unique values from.["Hero", "Dragon"], and you use getPCNames() to return the names of\
-the PC Tokens, you could use the following code to generate a JSON Array that contains the values in both JSON Arrays with no value present more than once.\ +
["Hero", "Dragon"], and you use getPCNames() to return the names of\
+the PC Tokens, you could use the following code to generate a JSON Array that contains the values in both JSON Arrays with no value present more than once.\
\[h: names1 = '["Hero", "Dragon"]']\
[h: names2 = getNPCNames()]\
@@ -16544,7 +16544,7 @@ Returns a number than is between 2 and 20, with a high
\
See Also\
\
- For another method of rolling dice, see Dice Expressions.\
+ For another method of rolling dice, see Dice Expressions.\
3 and 30, with a low
listAppend(list, value, delim)\
If delim is not specified then the default value of ',' is used to separate the values in the string list\ +
If delim is not specified then the default value of ',' is used to separate the values in the string list\
\list - The String List that is checked for occurrences of the value.value - The value to search the String List for occurrences.delim - The delimiter that separates the values in the String List; defaults to ",".list - The String List that is checked for occurrences of the value.value - The value to search the String List for occurrences.delim - The delimiter that separates the values in the String List; defaults to ",".2listCount(list, delim)\
If delim is not specified then the default value of ',' is used as the value separator in the string list\ +
If delim is not specified then the default value of ',' is used as the value separator in the string list\
\listDelete(list, index, delim)\
If delim is not specified then the default value of ',' is used as the value separator in the string list\ +
If delim is not specified then the default value of ',' is used as the value separator in the string list\
\listFind(list, value, delim)\
If delim is not specified then the default value of ',' is used as the value separator in the string list\ +
If delim is not specified then the default value of ',' is used as the value separator in the string list\
\listGet(list, index, delim)\
If delim is not specified then the default value of ',' is used as the value separator in the string list\ +
If delim is not specified then the default value of ',' is used as the value separator in the string list\
\"," is used. The index for lists starts at 0."," is used. The index for lists starts at 0.[r: listReplace("This, isnt, a , test", 1, "is")]Returns This, is, a, Test\
-
Example using a String List with a non-default delimiter:
[r: listReplace("This: isnt: a: test", 1, "is", ":")]Returns This: is: a: test\
-
Example using a String List stored in a variable:
[h: ListVar = "This, is, a, great, test"]\
+Example using a String List with a non-default delimiter:
[r: listReplace("This: isnt: a: test", 1, "is", ":")]Returns This: is: a: test\
+
Example using a String List stored in a variable:
[h: ListVar = "This, is, a, great, test"]\
[h: ListVar = listReplace(ListVar, 3, "silly")]\
[r: ListVar]
\
Returns: This, is, a, silly, test\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\

\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\Some notes on the auto execution
\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.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."gm-self" - Display to GM and the person executing the link."list" - Displays to a list of players. When the output is set to "list" then the macro link expects the args parameter to be a JSON Object, that contains a field called mlOutputList which is a JSON Array containing the players to send the output to."self" - Display only to person who clicked on the link."gm" - Display to GM."all" - everyone (acts like a /say)."none" - discard any output."gm-self" - Display to GM and the person executing the link."list" - Displays to a list of players. When the output is set to "list" then the macro link expects the args parameter to be a JSON Object, that contains a field called mlOutputList which is a JSON Array containing the players to send the output to.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"):\
-Test on the Library Token named Lib:Test that says "Click on me!" and displays the output to the GM.\
+ Test on the Library Token named Lib:Test that says "Click on me!" and displays the output to the GM.\
[r: macroLink("Click on me!", "Test@Lib:Test", "gm", "count=6", "impersonated")]<ahref="macro://Test@Lib:Test/gm/impersonated?count=6;">Click on me!</a>[h: outputTo = '["Fred", "Barney", "gm"]']\
[h: args = json.set("{}", "mlOutputList", outputTo)]\
[r: macroLink("Click on me!", "Test@Lib:Test", "list", args)]Took 4 points of damage.<!-- [r: macroLink("Update Character Sheet", "Update Character Sheet@Lib:Test")] -->This is a link that is user created to send several variables to the AttackMacro. Each variable must be separated by a & sign. Spaces within text must be replaced with a + sign. Plus sign can't be sent, you might want to use the html code for plus sign (&27;) instead of +.\
@@ -17714,7 +17714,7 @@ macroLinkText.summary = \
macroLinkText() Function\
\
macroName - The name of the macro to run when the link is clicked. The macroName 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 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.gm-self - Display to GM and the person executing the link.list - Displays to a list of players. When the output parameter is "list" then the macro link expects the args parameter to be a JSON Object, that contains a field called mlOutputList which is a JSON Array containing the players to send the output to.self - Display only to person who clicked on the link.gm - Display to GM.all - Everyone (acts like a /say)none - Discard any output.gm-self - Display to GM and the person executing the link.list - Displays to a list of players. When the output parameter is "list" then the macro link expects the args parameter to be a JSON Object, that contains a field called mlOutputList which is a JSON Array containing the players to send the output to.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):\
-action attribute, and that will call a macro named Test on the Library Token named Lib:Test:\
+ 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:\
+
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())]Returns: macro://AddWeapon@Lib:PC/none/#ID#? where #ID# is the id of the Current Token.\
+
Returns: macro://AddWeapon@Lib:PC/none/#ID#? where #ID# is the id of the Current Token.\
Sending to multiple players and the GM in 1.3b55\
\[h: outputTo = '["Fred", "Barney", "gm"]']\
@@ -17852,7 +17852,7 @@ markdownToHTML(string, type)\
[frame5("Notes", "title=" + token.name): {<br>\
[r: markdownToHTML(getNotes())]\
}]\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\token is in an array of cell coordinates like the one received from getLastPath() or the onTokenMove event's macro.args .
+movedOverToken.description = Is used to check if the location of the target token is in an array of cell coordinates like the one received from getLastPath() or the onTokenMove event's macro.args .
movedOverToken.summary = \
token is in an array of cell coordinates like the one received from getLastPath() or the onTokenMove event's macro.args.\
+ token is in an array of cell coordinates like the one received from getLastPath() or the onTokenMove event's macro.args.\
x - The X coordinate to move the token to.y - The Y coordinate to move the token to.units - If set to false(0), the coordinates are a location on the grid in cells. Defaults to true(1), where the coordinates are in Distance Per Cell pixels.id - The id string of the token to move, defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
id - The id string of the token to move, defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
\
\5 units, and left 10 units.\
+ 5 units, and left 10 units.\
[h: CurrentX = getTokenX()]\
[h: CurrentY = getTokenY()]\
[h: NewX = CurrentX + 5]\
[h: NewY = CurrentY - 10]\
[h: moveToken(NewX, NewY)]Moves the Current Token down 5 cells, and left 10 cells.\
+
Moves the Current Token down 5 cells, and left 10 cells.\
[h: CurrentX = getTokenX(0)]\
[h: CurrentY = getTokenY(0)]\
@@ -18834,7 +18834,7 @@ moveTokenFrom.summary = \
\
\
\
- Note: This function can only be used in a Trusted Macro\
+ Note: This function can only be used in a Trusted Macro\
\
\
• Introduced in version 1.3b54\
@@ -18852,7 +18852,7 @@ moveTokenFromMap(id, map, x, y, z)\
Parameters\
\
id - The token id or a JSON Array of token ids of the token/s to move.id - The token id or a JSON Array of token ids of the token/s to move.map - A string containing the name of the map that the token is moved from.x - The X coordinate of the current map that the token should be moved to. Defaults to 0.y - The Y coordinate of the current map that the token should be moved to. Defaults to 0.\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\id - The token id or a JSON Array of token ids of the token/s to move.id - The token id or a JSON Array of token ids of the token/s to move.map - A string containing the name of the map that the token is moved from.x - The X coordinate of the current map that the token should be moved to. Defaults to 0.y - The Y coordinate of the current map that the token should be moved to. Defaults to 0.\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\id - The token id or a JSON Array of token ids of the token/s to move.id - The token id or a JSON Array of token ids of the token/s to move.map - A string containing the name of the map that the token is moved to.x - The X coordinate of the map that the token should be moved to. Default to 0.y - The Y coordinate of the map that the token should be moved to. Default to 0.\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\onInitiativeChangeRequest (and onInitiativeChange) events, so it is possible that the change will be blocked. See the Guide to Initiative Events for more details. This function will return the offset of the token that has initiative after this function completes, whether the change proceeded as requested or not.onInitiativeChangeRequest (and onInitiativeChange) events, so it is possible that the change will be blocked. See the Guide to Initiative Events for more details. This function will return the offset of the token that has initiative after this function completes, whether the change proceeded as requested or not.eval(), redefining the standard MapTool eval() -- oldFunction() can be used in the user-defined function to call the original function. When a user-defined function redefines an existing function, it keeps track of the function that it redefined. Due to this tracking, it is possible to redefine a function multiple times and oldFunction() will always reference the previous function in the chain.\
-Note: Do not rely on a specific order in the function chain unless you are sure that the functions will be redefined in that order. Calls to defineFunction() within onCampaignLoad macros on different Library Tokens are not executed in any standard order.Dice: 5, 4, 19, 6, 3, Maximum: 19\
See Also\
\
- For another method of rolling dice, see Dice Expressions.\
+ For another method of rolling dice, see Dice Expressions.\
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\onInitiativeChangeRequest (and onInitiativeChange) events, so it is possible that the change will be blocked. See the Guide to Initiative Events for more details. This function will return the offset of the token that has initiative after this function completes, whether the change proceeded as requested or not.onInitiativeChangeRequest (and onInitiativeChange) events, so it is possible that the change will be blocked. See the Guide to Initiative Events for more details. This function will return the offset of the token that has initiative after this function completes, whether the change proceeded as requested or not.\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\id - The token id of the token to be removed from the initiative. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to be removed from the initiative. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.return - Returns 1 if removed from the initiative, 0 if did not.[h: removeFromInitiative("Dragon")]\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\25 and 50.5 [2, 1, 2, 4] - the first die produced a 2, which was r
property - The name of the property to reset.id - The token id of the token which has its property reset, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token which has its property reset, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ @@ -20039,7 +20039,7 @@ resetProperty(property, id, mapname)\
id parameter option.mapname parameter option.\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\id - The token id of the token to reset, defaults to the Current Token.id - The token id of the token to reset, defaults to the Current Token.mapName - Optional map name to find the token. Defaults to current map.\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\tableName - A string containing the name of the Table.entriesToReset - Since 1.8. Identifies specific entries to be reset. Can be a String List using the provided delim (defaults to "," if no delim provided), or a JSON Array if delim is "json".delim - Since 1.8. Custom delimiter for the `entriesToReset` param. Defaults to ",". Should be "json" if entriesToReset is a JSON Array instead of a String List.entriesToReset - Since 1.8. Identifies specific entries to be reset. Can be a String List using the provided delim (defaults to "," if no delim provided), or a JSON Array if delim is "json".delim - Since 1.8. Custom delimiter for the `entriesToReset` param. Defaults to ",". Should be "json" if entriesToReset is a JSON Array instead of a String List.If this table is set to Pick Once, then the Ace and Two of Clubs can be reset with any of:\
[h:resetTablePicks("Standard", "0,1")]\
[h:resetTablePicks("Standard", "0@1", "@")]\
-[h:resetTablePicks("Standard", json.append("", 0, 1), "json")]\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\return() is 0 then the return is happening. If the first argument to return() is non zero then the macro continues. The optional second argument of return() defines if there is a value that should be returned to a calling macro. Any other output is discarded when using return().\
+ return() is 0 then the return is happening. If the first argument to return() is non zero then the macro continues. The optional second argument of return() defines if there is a value that should be returned to a calling macro. Any other output is discarded when using return().\
Common uses for this function are\
\Rolls 5 times a d6 and returns these as sorted list as well as the total.\ -
XdYaZlW. For other methods of rolling dice, see Dice Expressions.XdYaZlW. For other methods of rolling dice, see Dice Expressions.XdYaZuW. For other methods of rolling dice, see Dice Expressions.XdYaZuW. For other methods of rolling dice, see Dice Expressions.XdYsZlW. For other methods of rolling dice, see Dice Expressions.XdYsZlW. For other methods of rolling dice, see Dice Expressions.XdYsZuW. For other methods of rolling dice, see Dice Expressions.XdYsZuW. For other methods of rolling dice, see Dice Expressions.XdYlZ. For other methods of rolling dice, see Dice Expressions.XdYlZ. For other methods of rolling dice, see Dice Expressions.XdYuZ. For other methods of rolling dice, see Dice Expressions.XdYuZ. For other methods of rolling dice, see Dice Expressions.id - the id string or token name of a specific token to select (the examples below use token names, but IDs are also permitted); if left blank all visible tokens are selected.add - if the value of add is true(1), the selections will be added to the current set of selected tokens; if the value is false(0) currently selected tokens will be deselected before new tokens are selected. Defaults to false.tokens - a String List of tokens to select.delim - Specifies the delimiter used in the string list that is supplied. If the delimiter is "json", then the value for tokens may be a JSON Array instead. Note: if using a JSON Array or String List, both add and delim must be specified.tokens - a String List of tokens to select.delim - Specifies the delimiter used in the string list that is supplied. If the delimiter is "json", then the value for tokens may be a JSON Array instead. Note: if using a JSON Array or String List, both add and delim must be specified.[h:selectTokens("Adventurer")]To select a list of Tokens using a String List, replacing the current selection\ +
To select a list of Tokens using a String List, replacing the current selection\
\[h:selectTokens("Adventurer, Orc 2, Goblin 1", 0, ",")]To select a list of Tokens using a JSON Array, adding the specified tokens to the current set of selected Tokens:\ +
To select a list of Tokens using a JSON Array, adding the specified tokens to the current set of selected Tokens:\
\[h:selectTokens("['Adventurer', 'Orc 2', 'Goblin 1']", 1, "json")]\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\id - The token id or name of the token that has its z-order changed, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id or name of the token that has its z-order changed, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.[h: sendToBack()]Sends all of the selected tokens to the lowest z-order.\
\ @@ -21316,7 +21316,7 @@ This function is rarely used because a simple assignment to a variable name cantrue ( 1 )) or off ( false ( 0 )).
+setAllStates.description = Sets all of the States of a Token to on ( true ( 1 )) or off ( false ( 0 )).
setAllStates.summary = \
value - If all states should be set on or off, true(1) or false(0).id - The id of the token that should have its States set. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The id of the token that should have its States set. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.[h: setAllStates(1)]Set all Token States off\ +
Set all Token States off\
\[h: setAllStates(0)]value - The value of the setting to set, true(1) or false(0).id - OPTIONAL: The token id of the token for which you want to set this setting, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - OPTIONAL: The token id of the token for which you want to set this setting, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\name - The name of the bar.value - The value of the bar. Should be between 0 and 1.id - The token id of the token which has its bar set, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token which has its bar set, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.bar.name special variable\
+ The bar.name special variable\
bar - A string that contains the name of the bar that has its visibility set.value - The visibility value of the bar, either 0 or 1.id - The token id of the token which has its bar visibility set, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token which has its bar visibility set, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.[h: setBarVisible("Health", 1)]Hide "health" bar for the Current Token.\ +
Hide "health" bar for the Current Token.\
\[h: setBarVisible("Health", 0)]bar.name special variable\
+ The bar.name special variable\
[h: setCurrentInitiative(3)]Clear current initiative (any number that is not a valid token offset will work).\
\ @@ -21578,7 +21578,7 @@ setCurrentMap.summary = \WARNING: This function changes an internal variable used by MapTool to keep track of which map is current and this change takes place immediately. However, changes to tokens are queued up and only occur when the macro finishes execution (well, sort of). The end result is that if a token is being modified on map "A" and your macro calls setCurrentMap() to switch to map "B", when the macro finishes and the token changes are executed they will be processing a token on map B! If there was no such token on map B a new one will be created, thus mysteriously duplicating tokens!\
Therefore, do NOT modify any token properties, states, names, notes, or any other token-specific values after calling setCurrentMap(). Or make sure that the first thing your macro does is call setCurrentMap() so that all tokens accessed later will be on the map that is current when the macro finishes.\
\ -Search http://forums.rptools.net/ forsetCurrentMap to find some discussion threads on this topic.setCurrentMap to find some discussion threads on this topic.\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\The Map Layer is one of:\ +
The Map Layer is one of:\
\TOKENGM also known as HiddenOBJECTBACKGROUND\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\name - A string that is set as the GM Name on the token.id - The token id of the token that has its GM Name set. Defaults to the Current Token.id - The token id of the token that has its GM Name set. Defaults to the Current Token.mapname - The name of the map to find the token. Defaults to the current map.New GM Name.\
+ New GM Name.\
[h: setGMName("New GM Name")]Sets the GM Name of all selected tokens to New GM Name.\
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\notes - The GM notes to set on the token.id - The token id of the token to set the GM notes on. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to set the GM notes on. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.color - The color to set the Halo to, valid values are:\
+ color - The color to set the Halo to, valid values are:\
"Black""Green""Yellow""Orange""Red""Cyan""Magenta""White""#RRGGBB""None"id - The token id of the token that has its Halo set by this function. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token that has its Halo set by this function. Note: This parameter can only be used in a Trusted Macro.
[h: setHalo("None")]To set the Halo for the Current Token to red.\ +
To set the Halo for the Current Token to red.\
\[h: setHalo("Red")]To set the Halo from the Current Token to a custom color\ +
To set the Halo from the Current Token to a custom color\
\[h: setHalo("#33AAFF")]state - Boolean - true to enable sight, false to disableid - The id of the token to set the sight of. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The id of the token to set the sight of. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.[h: setHasSight(1)]\ @@ -22060,7 +22060,7 @@ Returns: Empty String.
value - The initiative value to set. If included, the initiative will be set even if the token is already on the initiative list.id - The token id of the token to have its initiative set. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to have its initiative set. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.value - The initiative hold value to set.id - The token id of the token to set the initiative hold. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to set the initiative hold. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ @@ -22144,7 +22144,7 @@ setInitiativeHold(value, id, mapname)\
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\label - The string that the Token Label is set to.id - The token id of the token that has its label set, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
label - The string that the Token Label is set to.id - The token id of the token that has its label set, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
\
\
@@ -22215,7 +22215,7 @@ setLabel.summary = \
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\The Map Layer is one of:\ +
The Map Layer is one of:\
\TOKENGM also known as HiddenOBJECTBACKGROUNDlayer - The layer to move the Token to.id - The token id of the token which has its layer set, defaults to the Current Token.layer - The layer to move the Token to.id - The token id of the token which has its layer set, defaults to the Current Token.forceshape - If true(1), change the token shape type to TOP_DOWN if the layer is OBJECT, and to a shape reflecting its image if the layer is TOKEN. Defaults to true(1).mapname - The name of the map to find the token. Defaults to the current map.[h: setLibProperty("defaultStrength", 10)]Set a property on a specifig Library Token.\ +
Set a property on a specifig Library Token.\
\[h: setLibProperty("defaultStrength", 10, "Lib:Character")]false(0) then the light source is turned off; otherwise, it is turned on.false(0) then the light source is turned off; otherwise, it is turned on.type - The light source type, (e.g. "Generic", "D20").name - The name of the light source.name - The name of the light source.value - If true(1) sets the light on, if false(0) turns it off.id - The token id of the token to change the light sources, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to change the light sources, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\index - The index of the macro button.label - The label of the macro button.props - A String Property List or JSON Object containing the properties for the button.\
-applyToSelected - Should the macro be applied to the selected tokens.autoExecute - If the macro will be automatically executed when the button is clicked, accepts true(1) or false(0).color - The name of the color for the button.command - The command for the macro (only when using JSON version of function).fontColor - The name of the font color for the button.fontSize - The size of the font for the button.includeLabel - If the label will be output when the button is clicked. Accepts true(1) or false(0).group - The name of the group that the button belongs to.sortBy - The sort by value of the macro button.label - The label for the button.maxWidth - The maximum width of the button.minWidth - The minimum width of the button.playerEditable - Is the button player editable, accepts true(1) or false(0).tooltip - The tool tip for the macro button.compare - Takes a JSON Array which can contain one or more of the following keywords (only usable with JSON version of the function).\
+ props - A String Property List or JSON Object containing the properties for the button.\
+applyToSelected - Should the macro be applied to the selected tokens.autoExecute - If the macro will be automatically executed when the button is clicked, accepts true(1) or false(0).color - The name of the color for the button.command - The command for the macro (only when using JSON version of function).fontColor - The name of the font color for the button.fontSize - The size of the font for the button.includeLabel - If the label will be output when the button is clicked. Accepts true(1) or false(0).group - The name of the group that the button belongs to.sortBy - The sort by value of the macro button.label - The label for the button.maxWidth - The maximum width of the button.minWidth - The minimum width of the button.playerEditable - Is the button player editable, accepts true(1) or false(0).tooltip - The tool tip for the macro button.compare - Takes a JSON Array which can contain one or more of the following keywords (only usable with JSON version of the function).\
applyToSelected - Use the macro applyToSelected for common macro comparisons.autoExecute - Use the macro autoExec for common macro comparisons.command - Use the macro command for common macro comparisons.group - Use the macro group for common macro comparisons.includeLabel - Use the macro includeLabel for common macro comparisons.sortPrefix - Use the macro sortPrefix for common macro comparisons.delim - The delimiter used in the String Property List that is sent to the props parameter, defaults to ";" and can be omitted if you are sending a JSON Object to the props parameter. If you are sending a JSON Object to the props parameter, and using the id parameter, you can set this to "json".id - The token id of the token that the macro button is located on. Note: This parameter can only be used in a Trusted Macro.
delim - The delimiter used in the String Property List that is sent to the props parameter, defaults to ";" and can be omitted if you are sending a JSON Object to the props parameter. If you are sending a JSON Object to the props parameter, and using the id parameter, you can set this to "json".id - The token id of the token that the macro button is located on. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\name - The name to set on the current token.id - The token id of the token which has its name set. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token which has its name set. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ @@ -22785,7 +22785,7 @@ setName(name, id, mapname)\
notes - The notes to set on the token.id - The token id of the token to set the notes on. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to set the notes on. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ @@ -22822,7 +22822,7 @@ See also getNotes\
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\id - The token id of the token which has its NPC status set, defaults to the Current Token.id - The token id of the token which has its NPC status set, defaults to the Current Token.mapname - The name of the map to find the token. Defaults to the current map.\ @@ -22897,7 +22897,7 @@ setOwnedByAll(owned, id, mapname)\
\owned - The value of the setting to set, true(1) or false(0).id - The token id of the token which has its Owned by All status set, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token which has its Owned by All status set, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.ownerName - The player name to set the ownership on the token. Ownership is not constrained to the client names currently connected, but only currently connected clients appear in the Token Editor Dialog. This parameter is a String. An empty string here is treated as an empty JSON array (see next parameter).ownerNames - The player names to set the ownership on the token. Ownership is not constrained to the client names currently connected, but only currently connected clients appear in the Token Editor Dialog. This parameter is a JSON Array.id - The token id of the token which has its owners changed, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
ownerName - The player name to set the ownership on the token. Ownership is not constrained to the client names currently connected, but only currently connected clients appear in the Token Editor Dialog. This parameter is a String. An empty string here is treated as an empty JSON array (see next parameter).ownerNames - The player names to set the ownership on the token. Ownership is not constrained to the client names currently connected, but only currently connected clients appear in the Token Editor Dialog. This parameter is a JSON Array.id - The token id of the token which has its owners changed, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.[h: setOwner("Frank")]To change the owners of the Current Token to a list of three players use:\ +
To change the owners of the Current Token to a list of three players use:\
\[h: setOwner("['Peter', 'Paul', 'Mary']")]or:\
\[h: list = json.append("[]", "Peter", "Paul", "Mary")]\
[h: setOwner(list)]To make all current players owners of the Current Token use:\ +
To make all current players owners of the Current Token use:\
\[h: setOwner(getAllPlayerNames("json"))]To remove all owners of the Current Token use:\ +
To remove all owners of the Current Token use:\
\[h: setOwner("")]or:\
\[h: setOwner("[]")]To display the current owners of the Current Token as checkboxes, then accept the user's changes to apply back onto the token, use the following. Note that this example does not provide for adding owners to the list, only removing them. (Adding owners would require the use of getAllPlayerNames() and would make this example even more complex.)\ +
To display the current owners of the Current Token as checkboxes, then accept the user's changes to apply back onto the token, use the following. Note that this example does not provide for adding owners to the list, only removing them. (Adding owners would require the use of getAllPlayerNames() and would make this example even more complex.)\
\[h: names = getOwners("json")]\
[h: input = "tab0 | OwnerList || TAB"]\
@@ -23010,7 +23010,7 @@ setOwner(ownerNames, id, mapname)\
true ( 1 )), otherwise resets it to false ( 0 ).
+setOwnerOnlyVisible.description = Sets the Visible to Owners Only flag on a Token if the value passed in is non-zero( true ( 1 )), otherwise resets it to false ( 0 ).
setOwnerOnlyVisible.summary = \
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\true(1)), otherwise resets it to false(0).true(1)), otherwise resets it to false(0).visible - The state of owner only visibility, true(1) or false(0).id - The token id of the token which has its owner only visibility set, defaults to the Current Token.id - The token id of the token which has its owner only visibility set, defaults to the Current Token.\
\
@@ -23052,7 +23052,7 @@ setOwnerOnlyVisible.summary = \
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\id - The token id of the token which has its PC status set, defaults to the Current Token.id - The token id of the token which has its PC status set, defaults to the Current Token.mapname - The name of the map to find the token. Defaults to the current map.\ @@ -23114,7 +23114,7 @@ setPenColor.summary = \ \
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\property - A string containing the name of the property that has its value set.value - The value that the property is set to.id - The token id of the token which has its property set, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token which has its property set, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.Health to the value of 10 on the Current Token.\
+ Health to the value of 10 on the Current Token.\
[h: setProperty("Health", 10)]Sets a property named Fatigue to the value of 5 on the selected token.\
type - The property type to set on the token.id - The token id of the token which has its property type set, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token which has its property type set, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ @@ -23312,7 +23312,7 @@ setPropertyType(type, id, mapname)\
type - The type of sight to set.id - The id of the token to set the sight. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The id of the token to set the sight. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.\ @@ -23353,7 +23353,7 @@ setSightType(type, id, mapname)\
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\size - The Token Size to set the token to.id - The token id of the token which will have its Token Size set. Defaults to the Current Token.size - The Token Size to set the token to.id - The token id of the token which will have its Token Size set. Defaults to the Current Token.mapname - The name of the map to find the token. Defaults to the current map.false(0) then the State is unset if it is non-zero(true(1)) then it is set.false(0) then the State is unset if it is non-zero(true(1)) then it is set.state - The name of the state to set on the token.value - The value of the state to set, true(1) or false(0).id - The id of the token to have the State set. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The id of the token to have the State set. Defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.[h: setState("Dead", 1)]To reset the "Dead" Token State on the Current Token\ +
To reset the "Dead" Token State on the Current Token\
\[h: setState("Dead", 0)]propList - The String Property List affected by this function.key - The key in the specified String Property List that will have its value set.propList - The String Property List affected by this function.key - The key in the specified String Property List that will have its value set.value - The value that the specified key will be set to.[h: weapon = "name=longsword; damage=1d8; maxdamage=8"]\
[h: weapon = setStrProp(weapon, "value", 10)]\
[r: weapon]Returns "name=longsword ; damage=1d8 ; maxdamage=8 ; value=10 ; "\
-
Change the value of a key in an existing String Property List:\ +
Change the value of a key in an existing String Property List:\
\[h: weapon = "name=longsword; damage=1d8; maxdamage=8"]\
[h: weapon = setStrProp(weapon, "damage", "1d6")]\
@@ -23544,7 +23544,7 @@ setTableAccess.summary = \
\
\
\
- Note: This function can only be used in a Trusted Macro\
+ Note: This function can only be used in a Trusted Macro\
\
\
• Introduced in version 1.4.0.1\
@@ -23592,7 +23592,7 @@ setTableEntry.summary = \
\
\
\
- Note: This function can only be used in a Trusted Macro\
+ Note: This function can only be used in a Trusted Macro\
\
\
• Introduced in version 1.4.0.1\
@@ -23620,7 +23620,7 @@ setTableEntry(tableName, roll, result, imageId)\
See Also\
\
\
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\z - The Z coordinate to set the draw order to.id - The id of the token to move, defaults to the Current Token.id - The id of the token to move, defaults to the Current Token.mapname - The name of the map to find the token. Defaults to the current map.\ @@ -23936,7 +23936,7 @@ setTokenFacing.summary = \ \
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\id - OPTIONAL: The token id of the token for which you want to set the handout, defaults to the Current Token.id - OPTIONAL: The token id of the token for which you want to set the handout, defaults to the Current Token.mapname - OPTIONAL: The name of the map to find the token. Defaults to the current map.\ @@ -24075,7 +24075,7 @@ setTokenHeight(size, id, mapname)\
\size - grid size of the tokenid - The token id of the token to set its height. Defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to set its height. Defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.assetId - The Asset ID for an image.imageToken - The name of an image token e.g. "image:myimage"id - OPTIONAL: The token id of the token for which you want to set the image, defaults to the Current Token.id - OPTIONAL: The token id of the token for which you want to set the image, defaults to the Current Token.mapname - OPTIONAL: The name of the map to find the token. Defaults to the current map.scale - The scale of the token layout. If an empty string, the scale is not changed.xOffset - The xOffset of the token layout. If an empty string, the xOffset is not changed. Negative values shift the image left.yOffset - The yOffset of the token layout. If an empty string, the yOffset is not changed. Negative values shift the image up.id - The token id of the token to name, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to name, defaults to the Current Token. Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.The xOffset and yOffset values must be integers.\
@@ -24261,7 +24261,7 @@ setTokenOpacity(value, id, mapname)\
value - The value of the opacity to set, ranging from 0.0 (completely transparent) to 1.0 (completely opaque). This must be a floating point value with leading zero if less than 1.0.id - OPTIONAL: The token id of the token for which you want to retrieve the opacity, defaults to the Current Token.id - OPTIONAL: The token id of the token for which you want to retrieve the opacity, defaults to the Current Token.mapname - OPTIONAL: The name of the map to find the token. Defaults to the current map.Returns\ @@ -24291,7 +24291,7 @@ The opacity value that was set.\
id - OPTIONAL: The token id of the token for which you want to set the portrait, defaults to the Current Token.id - OPTIONAL: The token id of the token for which you want to set the portrait, defaults to the Current Token.mapname - OPTIONAL: The name of the map to find the token. Defaults to the current map.\ @@ -24359,7 +24359,7 @@ setTokenShape(shape, id, mapname)\
\shape - String value: "TOP_DOWN", "CIRCLE", "SQUARE", "FIGURE".id - The token id of the token to set to a new shape, defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to set to a new shape, defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.
Result
\
@@ -24401,7 +24401,7 @@ The function returns the token's shape as a string value: "TOP_DOWN"\
-setTokenSnapToGrid.description = Sets the "snap to" behaviour for the Current Token or a specified token.
+setTokenSnapToGrid.description = Sets the "snap to" behaviour for the Current Token or a specified token.
setTokenSnapToGrid.summary = \
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\vbl - A JSON object containing the vbl to be added to the token. Use getTokenVBL() to get VBL from another token.id - OPTIONAL: The token id of the token for which you want to set this setting, defaults to the Current Token.id - OPTIONAL: The token id of the token for which you want to set this setting, defaults to the Current Token.[r: finalVblData = "{'shape':'none'}"]\
[r: setTokenVBL(finalVblData)]Auto-generate VBL for the Current Token\ +
Auto-generate VBL for the Current Token\
\[h: options = json.set("{}", "shape", "auto", "sensitivity", 10, "inverse", 0, "level", 2, "method", "DOUGLAS_PEUCKER_SIMPLIFIER", "r", 0, "g", 0, "b", 0, "a", 255)]\
[h: setTokenVBL(options)]size - grid size of the tokenid - The token id of the token to set its width. Defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
id - The token id of the token to set its width. Defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
mapname - The name of the map to find the token. Defaults to the current map.true ( 1 )), otherwise resets it to false ( 0 ).
+setVisible.description = Sets the Visible to Players flag on a Token if the value passed in is non-zero( true ( 1 )), otherwise resets it to false ( 0 ).
setVisible.summary = \
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\true(1)), otherwise resets it to false(0). The Visible to Players flag has two meanings, on a normal Token players will only be able to see the Token if it is set (when all other things like Fog of War etc are taken into account). If it is a Library Token then it determines if players can call Category:Macros using the [macro(...): ...] roll option.true(1)), otherwise resets it to false(0). The Visible to Players flag has two meanings, on a normal Token players will only be able to see the Token if it is set (when all other things like Fog of War etc are taken into account). If it is a Library Token then it determines if players can call Category:Macros using the [macro(...): ...] roll option.visible - The state of visibility, true(1) or false(0).id - The token id of the token which has its player visibility set, defaults to the Current Token.id - The token id of the token which has its player visibility set, defaults to the Current Token.\
\
@@ -24723,7 +24723,7 @@ showTextLabels.summary = \
\
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\reverseOrder parameter is 1, this order is reversed - blank values come first, and any non-numeric strings (in ascending lexical order) come before numbers (in ascending order).sortInitiative()sortInitiative(0)sortInitiative(1)



\
\
strfind() is used to match a pattern against an input string and extract all of the capture groups. The function returns an id which can be used with other functions to extract the information. The supplied pattern is a regular expression.\
+ strfind() is used to match a pattern against an input string and extract all of the capture groups. The function returns an id which can be used with other functions to extract the information. The supplied pattern is a regular expression.\
Functions related to strfind():\
Both matchNo and groupNo start at 1, the special group number 0 returns the whole pattern match.\
"(" parenthesis ")". Group 1 returns the string that matches the first regex statement in (), 2 returns the second, etc.0 and 12, which is th
"14"\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\In practice, "the remainder of the Macro" is the same as the variable scope. Thus, if a macro is running as a user defined function (see defineFunction() ) with a new scope, switchToken will only apply until the end of the current macro. Once control passes back to the calling macro, the Current Token reverts back to what it was before the external macro was called ( as a function ).\ +
In practice, "the remainder of the Macro" is the same as the variable scope. Thus, if a macro is running as a user defined function (see defineFunction() ) with a new scope, switchToken will only apply until the end of the current macro. Once control passes back to the calling macro, the Current Token reverts back to what it was before the external macro was called ( as a function ).\ If a defineFunction() does not create a new variable scope for the called macro, then effects of switchToken persist when control passes back to the calling macro.
\ Note: You cannot switch to a token on a different map.name - A string containing the name of the table.row - The row of the table that should be returned.name - A string containing the name of the table.row - The row of the table that should be returned.name - A string containing the name of the table.row - The row of the table that should have the image asset returned.name - A string containing the name of the table.row - The row of the table that should have the image asset returned.size - The size the image asset returned should be. If the image is not square, this will be the size of the height."tbl1" using default roll:\
+ "tbl1" using default roll:\
<image src='[r: tableImage("tbl1")]'></image>Example 1: Display the first image from table "tbl1":\
+
Example 1: Display the first image from table "tbl1":\
<image src='[r: tableImage("tbl1", 1)]'></image>Example 2: Display one of the first four images, resized to 40 pixels tall, from "tbl1", chosed randomly:\
@@ -25856,8 +25856,8 @@ tbl(name, row)\
Parameters\
name - A string containing the name of the table.row - The row of the table that should be returned.name - A string containing the name of the table.row - The row of the table that should be returned.name - A string containing the name of the table.row - The row of the table that should have the image asset returned.name - A string containing the name of the table.row - The row of the table that should have the image asset returned.size - The size the image asset returned should be. If the image is not square, this will be the size of the height."tbl1" using default roll:\
+ "tbl1" using default roll:\
<image src='[r: tableImage("tbl1")]'></image>Example 1: Display the first image from table "tbl1":\
+
Example 1: Display the first image from table "tbl1":\
<image src='[r: tableImage("tbl1", 1)]'></image>Example 2: Display one of the first four images, resized to 40 pixels tall, from "tbl1", chosed randomly:\
@@ -25949,7 +25949,7 @@ toggleFoW.summary = \
\
\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\\ - Note: This function can only be used in a Trusted Macro\ + Note: This function can only be used in a Trusted Macro\
\value - The value of the setting to set:\
0 transfer normal (blue) VBL to token (yellow) VBL1 transfer token (yellow) VBL to normal (blue) VBLdelete - Defines if the transferred VBL is deleted from the source.id - OPTIONAL: The token id of the token for which you want to set this setting, defaults to the Current Token.id - OPTIONAL: The token id of the token for which you want to set this setting, defaults to the Current Token.0 and 5.0 and 5.Consider reviewing http://en. - * wikipedia.org/wiki/CJK_characters before making changes. And - * http://www.scarfboy.com/coding/unicode-tool is also a really cool site. + * Consider reviewing https://en.wikipedia.org/wiki/CJK_characters before making changes. And + * https://unicode.scarfboy.com/ is also a really cool site. */ if (Locale.CHINA.equals(Locale.getDefault())) { // The following font name appears to be "Sim Sun". It can be downloaded - // from here: http://fr.cooltext.com/Fonts-Unicode-Chinese + // from here: https://fr.cooltext.com/Fonts-Unicode-Chinese Font f = new Font("\u65B0\u5B8B\u4F53", Font.PLAIN, 12); FontUIResource fontRes = new FontUIResource(f); for (Iterator
\nickname - The nickname of the file. For example, "tense music"uri - The URI/URL of the file. For example, http://www.mywebsite/mysong.mp3 or file:/C:/mysong.mp3uri - The URI/URL of the file. For example, https://www.mywebsite/mysong.mp3 or file:/C:/mysong.mp3preload - A string indicating if the audio should be pre-loaded or not. If set to "clip", preloads it as a clip. If set to "stream", preloads it as a stream. Any other string does not preload the audio source.cycleCount - Set the default number of times the audio should play. If set to -1, the file is played continuously.volume - Set the default volume the audio is to be played at. Can range from 0 to 1.[defineAudioSource("no sorrow", "http://erinmcnamee.com.hostbaby.com/files/07_No_Sorrow__Banish_Misfortune.mp3", "stream", -1, 0.5)][defineAudioSource("no sorrow", "https://erinmcnamee.com.hostbaby.com/files/07_No_Sorrow__Banish_Misfortune.mp3", "stream", -1, 0.5)]The source can now be played as\
\[playStream("no sorrow")]+ = '1 or more'* = '0 or more'Have a look here for an overview.\ +
Have a look here for an overview.\
\Second important thing to know is that a group is defined by '('parenthesis')': (group1)(group2)(etc.), where group '0' returns the entire "match" result.\
'0' returns the ENTIRE match.().Here a link to test your regex statements (remember that for this applet you only use one \ while in MT you need \\.\
+
Here a link to test your regex statements (remember that for this applet you only use one \ while in MT you need \\.\
\
\
@@ -12811,7 +12811,7 @@ herolab.getStatBlock.summary = \
herolab.getStatBlock(type)\ herolab.getStatBlock(type,id)\
Note: The different formats may or may not contain the same information but it does reflects what is stored in the portfolio. If you find missing information, in the XML statblock for instance, you will need to report that to [Wolf Lair].\ +
Note: The different formats may or may not contain the same information but it does reflects what is stored in the portfolio. If you find missing information, in the XML statblock for instance, you will need to report that to [Wolf Lair].\
\\ Parameters\ @@ -19314,7 +19314,7 @@ playClip(uri, cycleCount, volume)\ Parameter\
\uri - The uri/url of the file. For example, http://www.mywebsite/mysong.mp3 or file:/C:/mysong.mp3uri - The uri/url of the file. For example, https://www.mywebsite/mysong.mp3 or file:/C:/mysong.mp3cycleCount - The number of times the audio should play. If set to 0, the file is cached but not played; if set to -1, the file is played continuously. Defaults to 1.volume - The volume the audio is to be played at. Can range from 0 to 1. Defaults to 1.[playClip(macro.args)]To play the song, the GM can then use execLink:\
\ -[H: songUrl = "http://erinmcnamee.com.hostbaby.com/files/07_No_Sorrow__Banish_Misfortune.mp3"]\
+[H: songUrl = "https://erinmcnamee.com.hostbaby.com/files/07_No_Sorrow__Banish_Misfortune.mp3"]\
[H: audioByte = macroLinkText("playSong@Lib:MusicPlayer", "none", songUrl)]\
[H: execLink(audioByte,0,"all")]\
Dropbox URLs
\
@@ -19360,7 +19360,7 @@ playStream(uri, cycleCount, volume, start, stop)\
Parameter\
\
uri - The uri/url of the file. For example, http://www.mywebsite/mysong.mp3 or file:/C:/mysong.mp3uri - The uri/url of the file. For example, https://www.mywebsite/mysong.mp3 or file:/C:/mysong.mp3cycleCount - The number of times the audio should play. If set to 0, the file is cached but not played; if set to -1, the file is played continuously. Defaults to 1.volume - The volume the audio is to be played at. Can range from 0 to 1. Defaults to 1.start - The time offset in seconds where audio should start playing, or restart from when repeating. Defaults to 0.[playStream(macro.args)]To play the song, the GM can then use execLink:\
\ -[H: songUrl = "http://erinmcnamee.com.hostbaby.com/files/07_No_Sorrow__Banish_Misfortune.mp3"]\
+[H: songUrl = "https://erinmcnamee.com.hostbaby.com/files/07_No_Sorrow__Banish_Misfortune.mp3"]\
[H: audioByte = macroLinkText("playSong@Lib:MusicPlayer", "none", songUrl)]\
[H: execLink(audioByte,0,"all")]\
Alternatively, the GM can use execFunction:\
\
-[H: songUrl = json.append("[]","http://erinmcnamee.com.hostbaby.com/files/07_No_Sorrow__Banish_Misfortune.mp3")]\
+[H: songUrl = json.append("[]","https://erinmcnamee.com.hostbaby.com/files/07_No_Sorrow__Banish_Misfortune.mp3")]\
[H: execFunction("playStream", songUrl, 0, "all")\
Dropbox URLs
\
After creating the dropbox share link you have to replace www.dropbox.com with dl.dropboxusercontent.com. That provides a direct link that playStream can use. Thanks to Full Bleed on the forums for the tip.\