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 .
×
Create a free account

Help with script

1677629531

Edited 1677629664
Hi, I am new to this, but I don't know if a macro will cut it. But I am looking for a script to roll several rolls for me, then read the results, and reroll those rolls, if the results are not higher than I need. How would you do that? For more examples, I have already made a macro to roll the dice, however, I don't know how to read the results, and keep it rolling if I don't like them. The roll is 4d6sdk3, but I have the macro roll it 6 times, so it looks like this: /r 4d6sdk3 /r 4d6sdk3 /r 4d6sdk3 /r 4d6sdk3 /r 4d6sdk3 /r 4d6sdk3 How would I read the results, and if all results are not over 14, redo the macro essentially?
1677635179

Edited 1677635267
Gauss
Forum Champion
So to confirm, you want to redo the macro if all 6 rolls are not 15+ each? 
1677635287
timmaugh
Pro
API Scripter
How about starting just with a template? &{template:default}{{name=Rolling Proof}}{{Roll 1=[[4d6sdk3]]}} {{Roll 2=[[4d6sdk3]]}} {{Roll 3=[[4d6sdk3]]}} {{Roll 4=[[4d6sdk3]]}} {{Roll 5=[[4d6sdk3]]}} {{Roll 6=[[4d6sdk3]]}} That won't even require a script. It will let you see the results, then choose whether to reroll (click the button again). If you want something else... something like Yahtzee where you only roll the ones that don't meet your threshold, metascripts can help with that. You can even have a reading of the values compared in a conditional for whether they all surpass that threshold (as in, "Success" or "Failure"). Can you explain a bit more of what you're looking for in terms of mechanics of when/why you would reroll? That will help us figure out a solution to what you're looking for.
1677635740
Pat
Pro
API Scripter
Have to say from the premise, you could get by with 14+1d4... it'd get you the 15-18 range it appears you're looking for... 
timmaugh said: How about starting just with a template? &{template:default}{{name=Rolling Proof}}{{Roll 1=[[4d6sdk3]]}} {{Roll 2=[[4d6sdk3]]}} {{Roll 3=[[4d6sdk3]]}} {{Roll 4=[[4d6sdk3]]}} {{Roll 5=[[4d6sdk3]]}} {{Roll 6=[[4d6sdk3]]}} That won't even require a script. It will let you see the results, then choose whether to reroll (click the button again). If you want something else... something like Yahtzee where you only roll the ones that don't meet your threshold, metascripts can help with that. You can even have a reading of the values compared in a conditional for whether they all surpass that threshold (as in, "Success" or "Failure"). Can you explain a bit more of what you're looking for in terms of mechanics of when/why you would reroll? That will help us figure out a solution to what you're looking for. Hi, that template looks very interesting, but how do you use that in a macro? Do you just make the macro, and then use it? So the reason why I want that, is the GM is allowing me rerolls for the stat array, and I want to make a script that rerolls, till I get several stats to where I want, that is also why I cannot use the 14+1d4, because, I need to roll the 4d6k3 to allow for a stat reroll.
1677636267
Gauss
Forum Champion
Short of an API script you will need to reroll them manually. Use the template Timmaugh gave. Just put the thing in a macro, as is. 
Gauss said: Short of an API script you will need to reroll them manually. Use the template Timmaugh gave. Just put the thing in a macro, as is.  I just did that, and it works wonders! It is amazing, thank you!
@timmaugh if possible, is there a way to do what I am thinking of? Thanks to you I rolled a stat array of.  But for future purposes, and the act of can it be done. Is it possible to read the results from the rolls, and essentially stop only when all 6 rolls, are over 16 or something?