count (roll option): Difference between revisions
Jump to navigation
Jump to search
(→Usage) |
m (Typographical tweaks) |
||
Line 12: | Line 12: | ||
</source> | </source> | ||
The ''[[roll.count]]'' variable will take on values from 0 to (number of loops - 1). The optional separator (default ", ") is printed between each iteration. | The ''[[roll.count]]'' variable will take on values from {{code|0}} to ({{code|number of loops - 1}}). The optional separator (default {{code|","}}) is printed between each iteration. Some examples of other useful seperators: ''nothing'' {{code|""}}, ''space'' {{code|" "}} and ''break'' {{code|"<br>"}}. | ||
Some examples of other useful seperators: nothing {{code|""}}, space {{code|" "}} and break {{code|"<br>"}} | |||
====Example==== | ====Example==== | ||
Line 21: | Line 20: | ||
</source> | </source> | ||
This will iterate the | This will iterate the {{code|Damage {{=}} Damage + 1d12}} operation 3 times, separating the result of each iteration with the default separator (a comma). An optional second argument to {{code|COUNT()}} allows the setting of a different separator. | ||
[[Category:Roll Option]] | [[Category:Roll Option]] | ||
[[Category:Looping Roll Option]] | [[Category:Looping Roll Option]] |
Revision as of 07:38, 4 October 2012
This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.
COUNT Option
Introduced: Version 1.3.b41
The COUNT option executes a statement for a specified number of times, storing the number of the current iteration in a variable called roll.count.
Usage
[COUNT(num): body]
[COUNT(num, separator): body]
The roll.count variable will take on values from 0
to (number of loops - 1
). The optional separator (default ","
) is printed between each iteration. Some examples of other useful seperators: nothing ""
, space " "
and break "<br>"
.
Example
[h:numHits=3]
[COUNT(numHits): Damage = Damage + 1d12]
This will iterate the Damage = Damage + 1d12
operation 3 times, separating the result of each iteration with the default separator (a comma). An optional second argument to COUNT()
allows the setting of a different separator.