Skip to content

Instantly share code, notes, and snippets.

@fossilx
Created February 17, 2010 18:03
Show Gist options
  • Save fossilx/306861 to your computer and use it in GitHub Desktop.
Save fossilx/306861 to your computer and use it in GitHub Desktop.
[h:RerollTriggerValue=15]
<b>Reroll check:</b>
[h:bLoop=1]
[h:nCounter=0]
[WHILE(bLoop == 1), CODE:
{
[h:nCounter=nCounter+1]
[h:d20roll=1d20]
<br><b>-- Attempt [r:nCounter]</b>:
[if(d20roll>=RerollTriggerValue), CODE:
{
[h:bLoop=0]
You rolled a <span style="color: green; font-weight: bold;">[r:d20roll]</span>! YEY
};
{
You rolled a
<span style="color: red; font-weight: bold;">[r:d20roll]</span>,
which is less than:
<span style="color: red; font-weight: bold;">[r:RerollTriggerValue]</span>,
re-rolling!
}
]
}]
<br><b> --&gt; Results:</b> It took you [r:nCounter] rolls to get a value of <b>[e:d20roll]!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment