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

Return 1 or 10

I'm wondering if there's a clever math expression that works in pure macro language that handles this. The situation is ammunition usage. The macro asks for ?{Number of targets|1|2|3|4|5}. If the user fires at 1 target (a single shot), the expression I'm looking for would return 1. If there are 2–5 targets (a burst), the expression returns 10. Note that ?{Number of targets} is needed elsewhere in the macro, so it can't be ?{Number of targets|1,1|2,10|3,10...}. Anyone got a sneaky way to return these values?
1491321864

Edited 1491322519
Never mind, I found what I was looking for on the  Useful Macros page, which I hadn't looked at before because I thought that page was just a forum post I couldn't find. The expression I was looking for is: [[ { { ?{Number of targets|1|2|3|4|5}, 0 }>2 } * 9 + 1 ]]