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

Macro Help: Returning a result based on the number rolled

Hi, I'm pretty new to roll20, especially the macro system. I use faserip (classic marvel), and you often roll based on your rank, and return a green, yellow or red result eg 46-80 green, 81-96 yellow, 97-100 red. Is it possible to use a single roll to this?
[[1d100cs>46cs<96cf>81]] Sort of... this will show green if between 46 and 80, blue if 81 to 96, red if 97 to 100. Can't do yellow without the API.
1433224155

Edited 1433224212
Hrm nevermind, apparently multiple cs operators don't play well together as I would have liked. It shows anything less than 80 as green.
You can overlap, though: [[1d100cf>81cs<96]] will give you green for <81, red for >96, and blue for 81..96. You can distinguish the 1..45 from 46..80 by making it into a success roll: [[1d100cf>81cs<96<45]] will have the coloring above, and will be 1 for <=45 and 0 for >=46.
1433247322

Edited 1433247586
Try this: [[1d100cf<45cs<80cf>97]] This will return a Blue highlight for 1-45, Green for 46-80, Uncolored (Yellowish) for 81-95, and Red for 96-100 This will allow you to distinguish between all 4 of your roll types easily.
Thank you all very much. I've assumed I can change the numbers as needed without screwing up the macro - I will end up making one for each skill rank. The blue for yellow stand in doesn't bother me. Chell: I only get a return of [object object] using that macro. Manveti: Thanks, it works well and looks good but often I will need the actual number returned as well. Does mean I'm likely to need the API tricks?
Wow, that's interesting... [[1d100cf<45cs<80cf>97]] ... returning [object Object] is definitely a bug.
1433298739
Diana P
Pro
Sheet Author
Chell's roll should work if you re-order it so that both the cf's are next to each other ie: [[d100cf<45cf>97cs<80]] Not sure why that should matter but *shrug*.
Chell's solution works if you move the two "cf" specifiers together: [[1d100cf<45cf>97cs<80]].
Moving cf<45 to the right of cs<80 actually works. [[1d100cs<80cf<45cf>97]] 1-45 shows up w/blue border 46 to 80 shows up w/green border 81-96 shows up as all yellow 97-100 shows up w/red border
Double ninja'd... lol. Glad to see we're all thinking alike, heh.
1433298885
Diana P
Pro
Sheet Author
Hehe. Great minds think alike? :)
That is fantastic :D Works a charm. Thank you so much.
1433374848

Edited 1433381375
Here's my end result of a table with that wonderful macro altered for each rank in case others who might stumble on this thread want it. Rank Macro Shift 0 [[1d100cs<95cf<66cf>100]] Feeble [[1d100cs<91cf<61cf>100]] Poor [1d100cs<86cf<56cf>100]] Typical [[1d100cs<81cf<51cf>98]] Good [[1d100cs<76cf<46cf>98]] Excellent [[1d100cs<71cf<41cf>95]] Remarkable [[1d100cs<66cf<36cf>95]] Incredible [[1d100cs<61cf<31cf>91]] Amazing [[1d100cs<56cf<26cf>91]] Monstrous [[1d100cs<51cf<21cf>86]] Unearthly [[1d100cs<46cf<16cf>86]] Shift X [[1d100cs<41cf<11cf>81]] Shift Y [[1d100cs<41cf<7cf>81]] Shift Z [[1d100cs<36cf<4cf>76]] I am so happy with it, it will make resolution of rolls so much faster.
glad it works for what you need.... and sorry about the poor ordering of operations... it's really odd that it even matters what order they are in...