ROLZ

Multiple Rolls & Other Commands

Explode and add up
To roll a number of dice, and re-roll every die that comes up with the maximum value, add everything together, use the I code:
  • Example:
Multiple rolls at once
To roll for multiple things (e.g. an attack and a damage roll), you can chain together dice codes by semicolons.
  • Example:
A number of rolls
If you want to repeat the same roll for a number of times, use the repeat command. If you also want the sum of the rolls, use sum instead of repeat.
  • Examples: or:
The median of a series
  • Example:
Rolling until a value is met
  • rolls a d20 until the result is 1
  • rolls a d20 until the result is at least 10
  • rolls a d20 until the result is 10 or lower
Please note that rolls will stop trying after 1000 attempts.
Comments after the roll
You can add comments to your roll by appending a pound sign # followed by some text to your code, like this:
Custom attributes
Another way to define custom rules for a single roll command is using attributes. The following attributes are currently supported:
  • reroll : ignore one or more results and roll again
  • reroll multiple : ignore one or more results and roll again, adding 3 dice
  • reroll X times : ignore one or more results and roll each again up to X times with rmax=X
  • fractions : round to whole numbers , round down to whole numbers , round up to whole numbers
  • round up : round up all results below this number
  • explode : specify one or more results that cause the die to be rolled again and the result added up
  • explode on equal digits : you can make a die result explode if all digits are the same, using the digits code:
  • explode with rx and/or rmax : you can combine explode with rx or rmax in the same way as the reroll attribute, for example
  • to cause the max result of the die to explode without having to specify what it is, use the explode=max shorthand
  • count : count the occurrences of specific die results
  • conditionally multiply entire roll: specify that the outcome of this roll be multiplied by a factor if one or more dice results come up, e.g., null entire result if one d6 comes up 1:
  • conditional roll : specify that another roll be performed, and the result added, if a certain result comes up, e.g. roll an additional d8+1 for any d6 that comes up 6:
  • conditionally multiply next roll : specify that the outcome of the following roll be multiplied by a factor if one or more dice results come up. Use this with the embedded roll feature where multiple rolls can be combined into one chat line. (e.g., apply critical effect in the D20 system:
  • conditionally append to next roll : If the character after the x is a math operator (+ - / *) the code following it will be appended to the next dice roll if the condition is triggered. For example:
  • conditionally cancel further rolls : you can cancel rolls following in the same line of text (or within the same wiki page) if certain criteria in the previous roll have been met. For example, the following cancels the damage roll if the D20 came up 1 to 10: .
You can combine attributes with another, and also use macros (see below) to invoke them. It doesn't matter if an attribute comes before or after the actual dice code, as long as they are separated by a space.
Macros and !name values
Use !name in a dice code to read a named value. Rolz can read personal macros, character-sheet fields, lookup lists, and command-local values through this syntax.
Personal macros are saved with your account. Use them for rolls or constants that you type often.
  • List your macros:
  • Define a macro:
  • Use a macro:
  • Add to a macro result:
  • Delete a macro:
A personal macro inserts its dice code into your roll. For example, !attack can roll dice if the macro contains d20+5.
Rolz checks these places when it resolves !name:
  • a value set earlier in this command with var("name", value)
  • a personal macro saved on your account
  • a built-in roll reference, such as !_1 or !_total
  • a field or const on the current wiki page, when the roll comes from a wiki page
  • a lookup list with the same name
  • a page.field value from a specific wiki page
  • a field or const on your current character page
  • a field or const on the dicebar page
  • a field or const on the room start page
  • a matching field or const on another room wiki page
If Rolz finds nothing, the value is 0 and the roll gets a not found tag.
Hiding intermediate results
Put hide followed by a space before a semicolon-separated roll to omit that result from the visible result list. For example:
The hidden roll still gets a !_N index and contributes to !_total. Rolz keeps the hidden value in the message data. If all results are hidden, chat shows hidden.
Built-in roll references
The following names are built in to Rolz:
  • !_N where N is the number of the roll in this command, starting with 1. Example:
  • !_total is the sum of the rolls made so far in this command. Example:
  • !last is the result of your last roll before this command.
Temporary values use the same name space. If you set var("_1", 7), then !_1 is 7 after that setter runs. The next command uses the normal !_1 roll reference again.
Variables with var()
Use var("name") as a readable form of !name. For example, var("DEX") reads your DEX field if your character page defines DEX. var("!DEX") also works.
Use var("name", value) to set a value. It returns the new value. If name resolves to a wiki field or const, Rolz writes the new value back to that wiki page. The roll shows an orange write tag with the source page.
If name resolves to a personal macro, built-in roll reference, or lookup list, Rolz does not overwrite it. The new value only exists for the current command. Undefined names also create command-local values.
  • Read a character field:
  • Roll once and reuse the number:
  • Use it in a conditional roll:
A command-local value disappears after the command. A later setter does not change an earlier !name in the same command.
Dice Functions
Dice codes can call functions. Function arguments can be numbers, dice rolls, or full expressions.
  • Minimum or maximum:
  • Absolute value:
  • Round fractions:
  • Clamp a value into a range:
  • Test whether a value is inside an inclusive range:
  • Conditional result:
The if(condition, true result, false result) function only rolls the branch that is actually used. For example, in , only the d6 is rolled.