ScriptCards 2.7.31 Queued for One Click A new update for ScriptCards is queued for OneClick and just waiting on Roll20 to update the mod library. Here is a summary of the changes since 2.7.29a: New function group : "roll". one subfunction for now: setrollhighlight, which will set the highlight color for a roll variable. The syntax is: --~|roll;setrollhighlight;Roll Var Name;identifier Where roll var name is the case sensitive name of the roll variable and identifier is one of: none, crit, fumble, both Code standardization and cleanup , slight performance improvements When using --!t you can prefix the property names with t- or T- and they will be mapped to the right values. This requires no code changes and is simply for convenience. Added a log message if you try to set imgsrc to a marketplace image, as this isn't supported by Roll20 thru the API Bug fix for --!ot : when the property value has a | in it. Like values with a :, the value should be in double quotes. When setting the sides property through --!ot:, each side image will be checked for Roll20 validity (requires a ?... at the end) Added the ability to create graphic objects (tokens, maps, etc.) with --!ot:. The syntax for this is: --!ot:ReturnTID|Property1=Value1|Property2=Value2;... If a property value contains (or could contain) a colon (:) character, enclose it in double quotes ("). Numeric values will be checked for validity and assigned 0 if the passed value is not convertable to a number (ie, left=HELLO will result in left=0). Boolean values will be converted from "true", "yes", "on", or "1" to true and will otherwise be false. A handful of graphic properties, if not specified will have defaults: subtype = token layer = objects pageid = current player ribbon page left = 200 top = 200 width = 70 height = 70 Example: copy a token and place it 1 square to the right of the selected token (does not copy ALL properties, just the ones specified): !script {{ --&sourceTID|@{selected|token_id} --#sourcetoken|[&sourceTID] --!ot:NewTID|name:"[*S:t-name] Copy"|left:[=[*S:t-left]+70]|top:[*S:t-top]|width:[*S:t-width]|height:[*S:t-height]|imgsrc:"[*S:t-imgsrc]"|tooltip:"[*S:t-tooltip]"|bar1_value:"[*S:t-bar1_value]"|bar1_value:"[*S:t-bar1_value]"| bar1_max:"[*S:t-bar1_max]"| bar2_value:"[*S:t-bar2_value]"| bar2_max:"[*S:t-bar2_max]"| bar3_value:"[*S:t-bar3_value]"| bar3_max:"[*S:t-bar3_max]"|bar1_link:[*S:t-bar1_link]|bar2_link:[*S:t-bar2_link]|bar3_link:[*S:t-bar3_link]|represents:[*S:t-represents]|controlledby:[*S:t-controlledby]|showname:1|statusmarkers:[*S:t-statusmarkers] --+TID|[&NewTID] }} Added the "object" function class , which right now has one subfunction and one operation for that subfunction - the deletion of tokens: --~|object;token;delete;tokenid1;tokenid2;... If used, a log entry will be written to the console stating the player that deleted to token and the token id. Added initial testing for "Beacon" character sheets by modifying the [*...] code to allow nested name references. For example, the Candela Obscura character sheet defines an attribute named "role" which looks like this internally: {"name":"role","current": {"role":{"description":"","name":"Face"}, "specialty":{"description":"","name":"Magician"} }, "max":"","_id":"-O4tZZXLjeIL3uex_74R","_type":"attribute","_characterid":"-O4tZTQ4Cyb5rBB5M0Wj"} So "role" contains two entities: role and specialty. Each of these contains two items: description and name. To access the name of the role, you would use [*S:role->role->name], while to access the name of the specialty, you would use [*S:role->specialty->name]. This will return "Face" and "Magician" respectively. This can be used in any [*...] reference, so you can use it in a --+ line, etc. Here is an example of a script that will display the role and specialty of the selected token: !script {{ --#sourcetoken|[@SC_SelectedTokens(0)] --+Role|[*S:role->role->name] --+Specialty|[*S:role->specialty->name] }} If the field(s) you are specifying don't exist, you will likely get either "undefined" (if the base attribute doesn't exist) or "Object.object" (if one of t he fields doesn't exist). Ex: [*S:role->focus->name] will return "Object.object" if the "focus" field doesn't exist in the "role" attribute, while [*S:superpower->name] will return "undefined" if the "superpower" attribute doesn't exist. Updated the code that separates tags from content to allow for | characters to be used by escaping them with a double backslash (\\). Any \\| sequence will be replaced with a | character. Added two new conditional operators : -match and -imatch, which accept Regex as the right side of a comparison. Use \\| to escape the | character in the regex. The -match operator is case sensitive, while -imatch is case insensitive. A few examples: --?"[&name]" -match "(Medusa\\|Fred\\|Pixie)"|+Yes|+No Will be true if the [&name] variable has "Medusa", "Fred" or "Pixie" in it (case sensitive) --?"[&name]" -imatch "^(Medusa\\|Fred\\|Pixie)"|+Yes|+No Will be true if the [&name] variable starts with "Medusa", "Fred" or "Pixie" (case insensitive) --?"[&name]" -imatch "^a.*n$"|+Yes|+No Will be true if the [&name] variable starts with "a" and ends with "n" (case insensitive) (ex: Ancient Red Dragon, Aragorn, etc.) --?[$Roll.Raw] -match "^[1-2]$"|+Yes|+No Will be true if the roll is a 1 or a 2 (won't match 12, or 20, etc because the 1 or 2 has to be the first AND last character) Regex values should be enclosed in quotes. If you want to actually look for a literal | in your regex, use \\\| (the first \ is included in the regex to escape the |, which will be the result of \\|)