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

How to save a result of a roll

Hello!  I want to make a macros to determine treasure reward. The question is how to save a result of a roll, compare it with several numbers and then do an action after the comparison (like, roll other dices or print zero)? 
1562482961
Pat S.
Forum Champion
Sheet Author
Not possible to have it function like that, not even sure if the API (pro subscription feature) could do all that. You will to have to make a macro to do your first roll then manually compare it to what you want it to. After that you will have to manually make the rolls with the info from the previous roll.
1562489301
Gen Kitty
Forum Champion
Powercards can do that sort of thing but, as Pat says, that requires the Creator of the game to have a Pro subscription.
1562508531
GiGs
Pro
Sheet Author
API Scripter
Pat S. said: Not possible to have it function like that, not even sure if the API (pro subscription feature) could do all that. Just for clarification, the API can do all that. But thats a Pro subscription feature, and you'd likely need a custom script written. But, as Pat says, you can't do it with a basic macro.
1562530618
The Aaron
Roll20 Production Team
API Scripter
Pat S. said: ... not even sure if the API (pro subscription feature) could do all that. For the record, it is possible with the API. The only saving of values you can do without the API is in the Turn Order, and it's pretty limited.  If you have a token selected, you can store a value under its name in the tracker.  Assuming you had a token named "Treasure" selected, you could roll something: [[1d6 &{tracker}]] You can then reference the value using the name: [[ &{tracker|Treasure}d100 ]] You can also adjust it: [[ 1d6 &{tracker:-} ]] [[ 1d6 &{tracker:+} ]] If you're crafty with math, you can probably create a macro that uses those features to build something interesting.  Might have to be across two macro button presses, and does require a token to be selected with a known name, but still interesting to know, I hope. =D
1562531624
Pat S.
Forum Champion
Sheet Author
That is why I said "Not even sure" as I was not sure. I knew the API could do each individually but did not know for sure if it could string it all together or not. I knew someone with better knowledge of the API would drop in and confirm it one way or other. 
Thank you very much! I'll think on buying the pro subscription, then. 
1562542429
The Aaron
Roll20 Production Team
API Scripter
If you do go Pro, I pretty much build the RecursiveTable script for exactly this sort of thing:&nbsp; <a href="https://app.roll20.net/forum/post/5954076/script-update-recursivetables-now-with-rollable-table-images-and-better-prefixing-rules-for-roll-templates" rel="nofollow">https://app.roll20.net/forum/post/5954076/script-update-recursivetables-now-with-rollable-table-images-and-better-prefixing-rules-for-roll-templates</a>