{ "name": "TokenMod", "script": "TokenMod.js", "version": "0.8.57", "description": "TokenMod provides an interface to setting almost all settable properties of a token. \r\r## Commands\r\r```!token-mod <--help|--ignore-selected|--config|--on|--off|--flip|--set> [ ...] ... [ --ids [ ...]]```\r\rThis command takes a list of modifications and applies them to the selected tokens (or tokens specified with --ids by a GM or Player depending on configuration). Note that each --option can be specified multiple times and in any order.\r\r**Note:** If you are using multiple `@{target|token_id}` calls in a macro, and need to adjust fewer than the supplied number of token ids, simply select the same token several times. The duplicates will be removed.\r\r**Note:** Anywhere you use `|`, you can use `#` instead. Sometimes this make macros easier.\r\r* `--help` -- Displays this help in game.\r* `--ignore-selected` -- Prevents modifications to the selected tokens (only modifies tokens passed with `--ids`).\r* `--config` -- Sets Config options.\r* `--on` -- Turns on any of the specified parameters (See `Booleans` below).\r* `--off` -- Turns off any of the specified parameters (See `Booleans` below).\r* `--flip` -- Flips the value of any of the specified parameters (See `Booleans` below).\r* `--set` -- Each parameter is treated as a key and value, divided by a `|` character. Sets the key to the value. If the value has spaces, you must enclose it ' or . See below for specific value handling logic.\r* `--order` -- changes the ordering of tokens. Specify one of `tofront`, `front`, `f`, `top` to bring something to the front or `toback`, `back`, `b`, `bottom` to push it to the back.\r* `--ids` -- Each parameter is a Token ID, usually supplied with something like `@{target|Target 1|token_id}`. By default, only a GM can use this argument. You can enable players to use it as well with `--config players-can-ids|on`.\r\r___\r## Specification\r\r`--ids` takes token ids to operate on, separated by spaces.\r\r```!token-mod --ids -Jbz-mlHr1UXlfWnGaLh -JbjeTZycgyo0JqtFj-r -JbjYq5lqfXyPE89CJVs --on showname showplayers_name```\r\rUsually, you will want to specify these with the `@{target}` syntax:\r\r```!token-mod --ids @{target|1|token_id} @{target|2|token_id} @{target|3|token_id} --on showname showplayers_name```\r\r## Booleans\r\rThe _--on_, _--off_ and _--flip_ options only work on properties of a token that are either true or false, checkboxes. Specified properties will only be changed once, priority is given to arguments to _--on_ first, then _--off_ and finally to _--flip_.\r\r```!token-mod --on showname light_hassight --off isdrawing --flip flipv fliph```\r\r#### Available Boolean Properties:\r\r`showname`\r`showplayers_name`\r`showplayers_bar1`\r`showplayers_bar2`\r`showplayers_bar3`\r`showplayers_aura1`\r`showplayers_aura2`\r`playersedit_name`\r`playersedit_bar1`\r`playersedit_bar2`\r`playersedit_bar3`\r`playersedit_aura1`\r`playersedit_aura2`\r`light_otherplayers`\r`light_hassight`\r`isdrawing`\r`flipv`\r`fliph`\r`aura1_square`\r`aura2_square`\r\rAny of the booleans can be set with the `--set` command by passing a true or false as the value.\r\r```!token-mod --set showname|yes isdrawing|no```\r\r## Set Syntax Guide\r\r`--set` takes key value pairs, separated by `|` characters.\r\r```!token-mod --set key|value key|value key|value```\r\r**Note:** You can use inline rolls wherever you like:\r\r```!token-mod --set bar[[1d3]]_value|X statusmarkers|blue:[[1d9]]|green:[[1d9]]```\r\r**Note:** You can use + or - before any number to make an adjustment to the current value:\r\r```!token-mod --set bar1_value|-3 statusmarkers|blue:+1|green:-1```\r\r**Note:** You can preface a + or - with a = to explicitly set the number to a negative or positive value:\r\r```!token-mod --set bar1_value|=+3 light_radius|=-10```\r\rThere are several types of keys with special value formats:\r\r### Numbers\r\rNumber values can be any floating point number (though most fields will drop the fractional part).\r\r#### Available Numbers Properties:\r\r`left`\r`top`\r`width`\r`height`\r\rIt's probably a good idea not to set the location of a token off screen or the width or height to 0.\r\r```!token-mod --set top|0 left|0 width|50 height|50```\r\r### Numbers or Blank\r\rJust like the Numbers fields, except you can set them to blank as well.\r\r#### Available Numbers or Blank Properties:\r\r`light_radius`\r`light_dimradius`\r`light_multiplier`\r`aura1_radius`\r`aura2_radius`\r\rHere is setting a standard DnD 5e torch, turning off aura1 and setting aura2 to 30. Note that the `|` is still required for setting a blank value, such as aura1_radius below.\r\r```!token-mod --set light_radius|40 light_dimradius|20 aura1_radius| aura2_radius|30```\r\r### Degrees\r\rAny positive or negative number.\r\r#### Available Degrees Properties:\r\r`rotation`\r\rRotating a token by 180 degrees.\r\r```!token-mod --set rotation|180```\r\r### Circle Segment\r\rAny positive or negative number between 0 and 360.\r\r#### Available Circle Segment Properties:\r\r`light_angle`\r`light_losangle`\r\rSetting line of sight angle to 90 degrees.\r\r```!token-mod --set light_losangle|90```\r\r### Color\r\rColors can be any hex number color (with or without preceding #), or the word transparent.\r\r#### Available Color Properties:\r\r`tint_color`\r`aura1_color`\r`aura2_color`\r\rTurning off the tint and setting aura1 to a reddish color.\r\r```!token-mod --set tint_color|transparent aura1_color|ff3366```\r\r### Text\r\rThese can be pretty much anything. If your value has spaces in it, you need to enclose it in ' or .\r\r#### Available Text Properties:\r\r`name`\r`bar1_value`\r`bar2_value`\r`bar3_value`\r`bar1_max`\r`bar2_max`\r`bar3_max`\r`bar1`\r`bar2`\r`bar3`\r`bar1_reset`\r`bar2_reset`\r`bar3_reset`\r\rSetting the name to Sir Thomas and bar1 to 23.\r\r```!token-mod --set name|\"Sir Thomas\" bar1_value|23```\r\r`bar1`, `bar2` and `bar3` are special. Any value set on them will be set in both the `_value` and `_max` fields for that bar. This is most useful for setting hit points.\r\r```!token-mod --set bar1|[[3d6+8]]```\r\r`bar1_reset`, `bar2_reset` and `bar3_reset` are special. Any value set on them will be ignored, instead they well set the `_value` field for that bar to whatever the matching `_max` field is set to. This is most useful for resetting hit points or resource counts like spells. (The `|` is currently still required.)\r\r```!token-mod --set bar1_reset| bar3_reset|```\r\r### Layer\r\rThere is only one Layer property. It can be one of 4 values, listed below.\r\r#### Available Layer Property:\r\r`layer`\r\r#### Available Layer Values:\r\r`gmlayer`\r`objects`\r`map`\r`walls`\r\rMoving something to the gmlayer.\r\r```!token-mod --set layer|gmlayer```\r\r### Status\r\rThere is only one Status property. Status has a somewhat complicated syntax to support the most possible flexibility.\r\r#### Available Status Property:\r\r`statusmarkers`\r\rStatus is the only property that supports multiple values, all separated by `|` as seen below.\r\r```!token-mod --set statusmarkers|blue|red|green|padlock|broken-shield```\r\rYou can optionally preface each status with a + to remind you it is being added. This command is identical:\r\r```!token-mod --set statusmarkers|+blue|+red|+green|+padlock|+broken-shield```\r\rEach value can be followed by a colon and a number between 0 and 9. (The number following the dead status is ignored because it is special.)\r\r```!token-mod --set statusmarkers|blue:0|red:3|green|padlock:2|broken-shield:7```\r\rThe numbers following a status can be prefaced with a + or -, which causes their value to be applied to the current value. Here's an example showing blue getting incremented by 2, and padlock getting decremented by 1. Values will be bounded between 0 and 9.\r\r```!token-mod --set statusmarkers|blue:+2|padlock:-1```\r\rYou can optionally preface each status with a ? to modify the way + and - on status numbers work. With ? on the front of the status, only selected tokens that have that status will be modified. Additionally, if the status reaches 0, it will be removed. Here's an example showing blue getting decremented by 1. If it reaches 0, it will be removed and no status will be added if it is missing.\r\r```!token-mod --set statusmarkers|?blue:-1```\r\rBy default, status markers will be added, retaining whichever status markers are already present. You can override this behavior by prefacing a value with a - to cause the status to be removed. Below will remove the blue and padlock status.\r\r```!token-mod --set statusmarkers|-blue|-padlock```\r\rSometimes it is convenient to have a way to add a status if it is not there, but remove it if it is. This allows marking tokens with markers and clearing them with the same command. You can preface a status with ! to toggle it's state on and off. Here is an example that will add or remove the Rook piece from a token.\r\r```!token-mod --set statusmarkers|!white-tower```\r\rSometimes, you might want to clear all status marker as part of setting a new status marker. You can do this by prefacing a status marker with a =. Note that this affects all status markers before as well, so you will want to do this only on the first status marker. Below all status markers are removed and the dead marker is set. (If you want to remove all status markers, just specify the same marker twice with a = and then a -.)\r\r```!token-mod --set statusmarkers|=dead```\r\r#### Available Status Markers:\r\r`red`\r`blue`\r`green`\r`brown`\r`purple`\r`pink`\r`yellow`\r`dead`\r`skull`\r`sleepy`\r`half-heart`\r`half-haze`\r`interdiction`\r`snail`\r`lightning-helix`\r`spanner`\r`chained-heart`\r`chemical-bolt`\r`death-zone`\r`drink-me`\r`edge-crack`\r`ninja-mask`\r`stopwatch`\r`fishing-net`\r`overdrive`\r`strong`\r`fist`\r`padlock`\r`three-leaves`\r`fluffy-wing`\r`pummeled`\r`tread`\r`arrowed`\r`aura`\r`back-pain`\r`black-flag`\r`bleeding-eye`\r`bolt-shield`\r`broken-heart`\r`cobweb`\r`broken-shield`\r`flying-flag`\r`radioactive`\r`trophy`\r`broken-skull`\r`frozen-orb`\r`rolling-bomb`\r`white-tower`\r`grab`\r`screaming`\r`grenade`\r`sentry-gun`\r`all-for-one`\r`angel-outfit`\r`archery-target`\r\rAll of these operations can be combine in a single statusmarkers command.\r\r```!token-mod --set statusmarkers|blue:3|-dead|red:3```\r\r### Character ID\r\rYou can use the `@{|character_id}` syntax to specify a character_id directly or use the name of a character (quoted if it contains spaces) or just the shortest part of the name that is unique ('Sir Maximus Strongbow' could just be 'max'.). Not case sensitive: Max = max = MaX = MAX\r\r#### Available Character ID Properties:\r\r`represents`\r\rHere is setting the represents to the character Bob.\r\r```!token-mod --set represents|@{Bob|character_id}```\r\rNote that setting the represents will clear the links for the bars, so you will probably want to set those again.\r\r### Attribute Name\r\rThese are resolved from the represented character id. If the token doesn't represent a character, these will be ignored. If the Attribute Name specified doesn't exist for the represented character, the link is unchanged. You can clear a link by passing a blank Attribute Name.\r\rAvailable Attribute Name Properties:\r\r`bar1_link`\r`bar2_link`\r`bar3_link`\r\rHere is setting the represents to the character Bob and setting bar1 to be the npc hit points attribute.\r\r```!token-mod --set represents|@{Bob|character_id} bar1_link|npc_HP```\r\rHere is clearing the link for bar3:\r\r```!token-mod --set bar3_link|```\r\r### Configuration\r\r* `--config` takes option value pairs, separated by `|` characters.\r\r```!token-mod --config option|value option|value```\r\rThere is currently one configuration option:\r\r* `players-can-ids` -- Determines if players can use `--ids`. Specifying a value which is true allows players to use `--ids`. Omitting a value flips the current setting.", "authors": "The Aaron", "roll20userid": "104025", "patreon": "https://www.patreon.com/shdwjk", "useroptions": [ { "name": "Players can use --ids", "type": "checkbox", "description": "Select this option to allow players to use the `--ids` parameter to specify tokens they don't control to be modified.", "value": "playersCanIDs" } ], "dependencies": [], "modifies": { "state.TokenMod": "read,write", "attribute.characterid": "read", "attribute.current": "read", "attribute.id": "read", "attribute.max": "read", "attribute.name": "read", "attribute.type": "read", "character.archived": "read", "character.name": "read", "graphic.*": "read,write" }, "conflicts": [], "previousversions": [ "0.8.19", "0.8.20", "0.8.21", "0.8.22", "0.8.23", "0.8.24", "0.8.25", "0.8.26", "0.8.27", "0.8.29", "0.8.30", "0.8.31", "0.8.34", "0.8.35", "0.8.36", "0.8.37", "0.8.38", "0.8.39", "0.8.40", "0.8.41", "0.8.42", "0.8.43", "0.8.44", "0.8.45", "0.8.46", "0.8.47", "0.8.48", "0.8.50", "0.8.51", "0.8.52", "0.8.54", "0.8.55", "0.8.56" ] }