getRolled: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Created page with "{{MacroFunction |name=getRolled |trusted=false |version=1.5.2 |description= Returns an array of all the raw, i.e. unmodified, dice rolls that have occurred within the current...")
 
m (Text replacement - "<source" to "<syntaxhighlight")
 
(6 intermediate revisions by 3 users not shown)
Line 4: Line 4:
|version=1.5.2
|version=1.5.2
|description=
|description=
Returns an array of all the raw, i.e. unmodified, dice rolls that have occurred within the current macro context.
Returns a [[JSON Array]] of all the raw, i.e. unmodified, dice rolls that have occurred within the current macro context.


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
getRolled()
getRolled()
</source>
</syntaxhighlight>
'''Parameters'''
'''Parameters'''
{{param|none|Takes no parameters.}}
{{param|none|Takes no parameters.}}
Line 16: Line 16:
Roll some dice and observe the unmodified rolls.
Roll some dice and observe the unmodified rolls.


<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
Roll 1d10: [e: 1D10+2]<br>
Roll 1d10: [e: 1D10+2]<br>
Get Rolled: [r: getRolled()]<br>
Get Rolled: [r: getRolled()]<br>
Roll 3d6 minimum 2: [e: 3D6L2]<br>
Roll 3d6 minimum 2: [e: 3D6L2]<br>
Get Rolled: [r: getRolled()]
Get Rolled: [r: getRolled()]
</source>
</syntaxhighlight>


'''Output:'''
'''Output:'''
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
Roll 1d10: « 1D10+2 = 9 + 2 = 11 »
Roll 1d10: « 1D10+2 = 9 + 2 = 11 »
Get Rolled: [9]
Get Rolled: [9]
Roll 3d6 minimum 2: « 3D6L2 = 13 »
Roll 3d6 minimum 2: « 3D6L2 = 13 »
Get Rolled: [9,6,5,1]
Get Rolled: [9,6,5,1]
</source>
</syntaxhighlight>


|also=
|also=
[[getNewRolls]][[clearRolls]]
{{func|clearRolls}} {{func|getNewRolls}}


}}
}}
[[Category:Dice Function]]
[[Category:Dice Function]]

Latest revision as of 23:59, 14 March 2023

getRolled() Function

Introduced in version 1.5.2
Returns a JSON Array of all the raw, i.e. unmodified, dice rolls that have occurred within the current macro context.

Usage

getRolled()

Parameters

  • none - Takes no parameters.

Example

Roll some dice and observe the unmodified rolls.
Roll 1d10: [e: 1D10+2]<br>
Get Rolled: [r: getRolled()]<br>
Roll 3d6 minimum 2: [e: 3D6L2]<br>
Get Rolled: [r: getRolled()]

Output:

Roll 1d10: « 1D10+2 = 9 + 2 = 11 »
Get Rolled: [9]
Roll 3d6 minimum 2: « 3D6L2 = 13 »
Get Rolled: [9,6,5,1]

See Also