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

Question about switch statements.

Can I use a switch statement in a token macro? Trying to make a macro that automatically rolls three eye rays. Looks like this. switch ([[1d6]]){ case 0: %{Mindwitness|1} case 1: %{Mindwitness|2} case 2: %{Mindwitness|3} case 3: %{Mindwitness|4} case 4: %{Mindwitness|5} case 5: %{Mindwitness|6} }
1586911512
GiGs
Pro
Sheet Author
API Scripter
No, you cant do any kind of conditional or branching effects in a macro. You need to use the API and custom scripts for that kind of thing. Maybe the Power cards API can do it? there's a thread for that script.
1586937299
Ziechael
Forum Champion
Sheet Author
API Scripter
Rollable tables are always my go to for eye rays: /em the beholder blasts the party with [[ 1t[eyeray] ]], [[ 1t[eyeray] ]] and [[ 1t[eyeray] ]]... good luck suckers!