json.rolls

From RPTools Wiki
Revision as of 11:37, 26 March 2017 by Bubblobill (talk | contribs) (Created page with "This function takes 2 or 3 parameters and returns a json array json.rolls(roll, dim1, dim2) => returns a json array with the rolls performed e.g. {json.rolls("3d6", 6),2} =>...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function takes 2 or 3 parameters and returns a json array json.rolls(roll, dim1, dim2) => returns a json array with the rolls performed e.g. {json.rolls("3d6", 6),2} => [ 11, 7, 15, 8, 10, 13 ]

The three parameter version returns a two dimensional array e.g. {json.rolls("3d6", 6, 4),2} => [ [ 11, 13, 11, 13 ], [ 8, 11, 17, 10 ], [ 8, 11, 14, 11 ], [ 6, 8, 13, 6 ], [ 6, 11, 8, 10 ], [ 10, 7, 17, 11 ] ]