clearRolls: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Created page with "{{MacroFunction |name=clearRolls |trusted=false |version=1.5.2 |description= Clears the internal array that keeps track of the individual dice rolls for the current macro. |u...")
 
m (Text replacement - "<source" to "<syntaxhighlight")
 
(5 intermediate revisions by 3 users not shown)
Line 7: Line 7:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
clearRolls()
clearRolls()
</source>
</syntaxhighlight>
'''Parameters'''
'''Parameters'''
{{param|none|Takes no parameters.}}
{{param|none|Takes no parameters.}}
Line 16: Line 16:
Clear the saved rolls after second time.
Clear the saved rolls after second time.


<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
Roll 3d6: [e: 3D6]<br>
Roll 3d6: [e: 3D6]<br>
Get New Rolls: [r: getNewRolls()]<br>
Get New Rolls: [r: getNewRolls()]<br>
Line 27: Line 27:
Get New Rolls: [r: getNewRolls()]<br>
Get New Rolls: [r: getNewRolls()]<br>
Get Rolled: [r: getRolled()]<br>
Get Rolled: [r: getRolled()]<br>
</source>
</syntaxhighlight>


'''Output:'''
'''Output:'''
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>


Roll 3d6: « 3D6 = 12 »
Roll 3d6: « 3D6 = 12 »
Line 42: Line 42:
Get New Rolls: [2,2,4]
Get New Rolls: [2,2,4]
Get Rolled: [2,2,4]
Get Rolled: [2,2,4]
</source>
</syntaxhighlight>


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


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

Latest revision as of 23:59, 14 March 2023

clearRolls() Function

Introduced in version 1.5.2
Clears the internal array that keeps track of the individual dice rolls for the current macro.

Usage

clearRolls()

Parameters

  • none - Takes no parameters.

Example

Clear the saved rolls after second time.
Roll 3d6: [e: 3D6]<br>
Get New Rolls: [r: getNewRolls()]<br>
Get Rolled: [r: getRolled()]<br>
Roll 3d6 minimum 2: [e: 3D6L2]<br>
Get New Rolls: [r: getNewRolls()]<br>
Get Rolled: [r: getRolled()]<br>
-- Clear Rolls --[h: clearRolls()]<br>
Roll 3d6: [e: 3D6]<br>
Get New Rolls: [r: getNewRolls()]<br>
Get Rolled: [r: getRolled()]<br>

Output:

Roll 3d6: « 3D6 = 12 »
Get New Rolls: [5,5,2]
Get Rolled: [5,5,2]
Roll 3d6 minimum 2: « 3D6L2 = 17 »
Get New Rolls: [5,6,6]
Get Rolled: [5,5,2,5,6,6]
-- Clear Rolls --
Roll 3d6: « 3D6 = 8 »
Get New Rolls: [2,2,4]
Get Rolled: [2,2,4]

See Also