Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
May your rolls be chill this holiday season!
Create a free account

counting No. of 1s and compare to number of 6s, if greater than show me text

1634592014

Edited 1634593257
Dear all, I'm trying to design a macro that can do the following: rolling 6d6 (or any other number of d6), count successes for any equal or greater than 4, roll additional dice for each 6 --> and this part is easy              /r {?{Dice|0}d6!}>4  however I would like to add the following: if the numer of 1s are greater than the number of 6s I've got, then show the text "Critical Failure". examples: I roll 6d6 and I got     6  2  2  4  1  1 + reroll for the 6 and I got 5 --> 3 successes (6,4,5), however as I have two 1s and only one 6 I'd like to see "Critical Failure"  *EDIT* I'm aware of this too /me gets [[{?{Dice|0}d6sd!}>4]] Successes!
1634592665
The Aaron
Roll20 Production Team
API Scripter
There isn't a way to do that without access to the API, a Pro subscriber perk.
1634593287

Edited 1634593296
Hi Aaron, I'm a Pro subscriber indeed
1634601191
Kraynic
Pro
Sheet Author
Kelios said: Hi Aaron, I'm a Pro subscriber indeed Your tag says Plus.  Do you have a different account that is Pro?
1634639802

Edited 1634639820
Our GM has it for the campaign indeed. Does she need to raise the question from her account? 
1634642510
Kraynic
Pro
Sheet Author
Nope, just making sure, since sometimes people think Plus and Pro are the same thing. You (and/or she) might want to check out ScriptCards.  There is a pretty active thread for that script in the api forum, so you can look at what people have done with it so far.  It wouldn't surprise me if that sort of roll is already possible with that script.
1634648815
David M.
Pro
API Scripter
Here's a scriptcard that I think has the logic you are looking for. I made the assumption that the bonus dice for rolling sixes also trigger additional dice. You can change the output formatting as you see fit ( reference ). !scriptcards {{ --#title|Die Rolling Example --=numDice|?{How many d6's?|6} --#leftsub|Rolling [$numDice]d6 --:INITIAL VARIABLE DECLARATION| --=numSuccess|0 --=numOnes|0 --&baseRollStr| --&bonusRollStr| --:ROLL BASE DICE| --=i|0 --:CreateRollsLoop| --=i|[$i]+1 --=Roll[$i]|1d6 --&baseRollStr|+[$Roll[$i.Raw]] --?[$i.Total] -lt [$numDice.Total]|CreateRollsLoop --:BASE ROLL OUTPUT| --+Base Rolls| --+|[&baseRollStr] --:CHECKING ROLLS| --=i|0 --:CheckRollsLoop| --=i|[$i]+1 --?[$Roll[$i.Raw]] -eq 6|>AddDie --?[$Roll[$i.Raw]] -ge 4|>AddSuccess --?[$Roll[$i.Raw]] -eq 1|>AddOnes --?[$i.Total] -lt [$numDice.Total]|CheckRollsLoop --:FINAL RESULT OUTPUT| --+Bonus Rolls| --?X[&bonusRollStr] -eq X|[ --=zero|0 --+|[$zero] --]|[ --+|[&bonusRollStr] --]| --+Number of Ones|[$numOnes] --+Number of Successes|[$numSuccess] --:CHECK FOR CRITICAL FAILURE| --?[$numOnes] -gt [$numSuccess]|>CritFail --X| --:FUNCTIONS| --:AddDie| --=numDice|[$numDice] + 1 --=Roll[$numDice.Raw]|1d6 --&bonusRollStr|+[$Roll[$numDice.Raw]] --<| --:AddSuccess| --=numSuccess|[$numSuccess] + 1 --<| --:AddOnes| --=numOnes|[$numOnes] + 1 --<| --:CritFail| --+|[b][#990000]Critical Failure![/#][/b] --<| }} Example output:
perfect!