getNewRolls: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page GetNewRolls to getNewRolls: Converting page titles to lowercase)
m (Text replacement - "source>" to "syntaxhighlight>")
Line 9: Line 9:
<source lang="mtmacro" line>
<source lang="mtmacro" line>
getNewRolls()
getNewRolls()
</source>
</syntaxhighlight>
'''Parameters'''
'''Parameters'''
{{param|none|Takes no parameters.}}
{{param|none|Takes no parameters.}}
Line 22: Line 22:
Roll 3d6 minimum 2: [e: 3D6L2]<br>
Roll 3d6 minimum 2: [e: 3D6L2]<br>
Get New Rolls: [r: getNewRolls()]<br>
Get New Rolls: [r: getNewRolls()]<br>
Get Rolled: [r: getRolled()]</source>
Get Rolled: [r: getRolled()]</syntaxhighlight>


'''Output:'''
'''Output:'''
Line 32: Line 32:
  Get New Rolls: [5,3,1]
  Get New Rolls: [5,3,1]
  Get Rolled: [3,5,3,1]
  Get Rolled: [3,5,3,1]
</source>
</syntaxhighlight>


Remember that it returns all the new die rolls since the last time it was called.
Remember that it returns all the new die rolls since the last time it was called.
Line 41: Line 41:
Roll 3: [e: 3d6]<br>
Roll 3: [e: 3d6]<br>
[r: getNewRolls()]
[r: getNewRolls()]
</source>
</syntaxhighlight>
'''Output'''
'''Output'''
<source lang="mtmacro" line>
<source lang="mtmacro" line>
Line 49: Line 49:
Roll 3: « 3d6 = 6 »
Roll 3: « 3d6 = 6 »
[5,6,6,3,2,1]
[5,6,6,3,2,1]
</source>
</syntaxhighlight>


|also=
|also=

Revision as of 18:38, 14 March 2023

getNewRolls() Function

Introduced in version 1.5.2
Returns an array of all the raw, i.e. unmodified, dice rolls since the last call to getNewRolls().

Usage

<source lang="mtmacro" line> getNewRolls() </syntaxhighlight> Parameters

  • none - Takes no parameters.

Example

Make some dice rolls and show the individual rolls at each step.

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

Output: <source lang="mtmacro" line>

Roll 1d10: « 1D10+2 = 3 + 2 = 5 »
Get New Rolls: [3]
Get Rolled: [3]
Roll 3d6 minimum 2: « 3D6L2 = 10 »
Get New Rolls: [5,3,1]
Get Rolled: [3,5,3,1]

</syntaxhighlight>

Remember that it returns all the new die rolls since the last time it was called. <source lang="mtmacro" line> Roll 1: [e: 3d6]
[r: getNewRolls()]
Roll 2: [e: 3d6]
Roll 3: [e: 3d6]
[r: getNewRolls()] </syntaxhighlight> Output <source lang="mtmacro" line> Roll 1: « 3d6 = 16 » [5,6,5] Roll 2: « 3d6 = 17 » Roll 3: « 3d6 = 6 » [5,6,6,3,2,1]

</syntaxhighlight>

See Also