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

Can't get this Macro to work, can you help me out?

1525199907

Edited 1525200278
It should ask what attribute level to roll at, ask what type of roll, and then if you select advantage/disadvantage ask you what number. It's borked. It won't show the character subs, but I believe they are correct. /gr ?{Level     |0, ?{Roll Type         |Standard, 1d20!!         |Advantage, 2d20!!kh1         |Disadvantage, 2d20!!kl1         }     |1, ?{Roll Type         |Standard, 1d20!!+1d4!!         |Advantage, 1d20!!+[[?{Advantage             |0}+1]]d4!!kh1         |Disadvantage, 1d20!!+[[?{Disadvantage             |0}+1]]d4!!kl1         }         |2, ?{Roll Type         |Standard, 1d20!!+1d6!!         |Advantage, 1d20!!+[[?{Advantage             |0}+1]]d6!!kh1         |Disadvantage, 1d20!!+[[?{Disadvantage             |0}+1]]d6!!kl1         }     |3, ?{Roll Type         |Standard, 1d20!!+1d8!!         |Advantage, 1d20!!+[[?{Advantage             |0}+1]]d8!!kh1         |Disadvantage, 1d20!!+[[?{Disadvantage             |0}+1]]d8!!kl1         }     |4, ?{Roll Type         |Standard, 1d20!!+1d10!!         |Advantage, 1d20!!+[[?{Advantage             |0}+1]]d10!!kh1         |Disadvantage, 1d20!!+[[?{Disadvantage             |0}+1]]d10!!kl1         }     |5, ?{Roll Type         |Standard, 1d20!!+2d6!!         |Advantage, 1d20!!+[[?{Advantage             |0}+2]]d6!!kh2         |Disadvantage, 1d20!!+[[?{Disadvantage             |0}+2]]d6!!kl2         }     |6, ?{Roll Type         |Standard, 1d20!!+2d8!!         |Advantage, 1d20!!+[[?{Advantage             |0}+2]]d8!!kh2         |Disadvantage, 1d20!!+[[?{Disadvantage             |0}+2]]d8!!kl2         }     |7, ?{Roll Type         |Standard, 1d20!!+2d10!!         |Advantage, 1d20!!+[[?{Advantage             |0}+2]]d10!!kh2         |Disadvantage, 1d20!!+[[?{Disadvantage             |0}+2]]d10!!kl2         }     |8, ?{Roll Type         |Standard, 1d20!!+3d8!!         |Advantage, 1d20!!+[[?{Advantage             |0}+3]]d8!!kh3         |Disadvantage, 1d20!!+[[?{Disadvantage             |0}+3]]d6!!kl3         }     |9, ?{Roll Type         |Standard, 1d20!!+3d10!!         |Advantage, 1d20!!+[[?{Advantage             |0}+3]]d10!!kh3         |Disadvantage, 1d20!!+[[?{Disadvantage             |0}+3]]d10!!kl3         }     |10, ?{Roll Type         |Standard, 1d20!!+4d8!!         |Advantage, 1d20!!+[[?{Advantage             |0}+4]]d8!!kh4         |Disadvantage, 1d20!!+[[?{Disadvantage             |0}+4]]d6!!kl4         } }
1525201332
GiGs
Pro
Sheet Author
API Scripter
That looks like a html replacement issue. You need to replace certain characters (" } ",  " | ")  as described here . The trick is identifying which  ones to replace.  I try to avoid them so hopefully someone with more experience in them will come along to help shortly. As an alternative, you could look into creating API buttons, for each of the levels. Your roll structure is weird. Just out of curiousity, are you using the terms advantage and disadvantage in two different ways? Like here:  |4, ?{Roll Type         |Standard, 1d20!!+1d10!!         |Advantage, 1d20!!+[[?{Advantage             |0}+1]]d10!!kh1         |Disadvantage, 1d20!!+[[?{Disadvantage             |0}+1]]d10!!kl1 If the user is selecting Advantage, why is there also a separate prompt for advantage too?
1525201723
GiGs
Pro
Sheet Author
API Scripter
Looking at the picture below your code, I see oyu've done a bunch of html replacements. it looks like you have gone a bit overboard, to be honest. You only need to replace } , | , and , characters, and use & amp; to achieve further levels of nesting (this might be where the issue lies - since your code is nested multiple times).
1525202660

Edited 1525202758
Your roll structure is weird. Just out of curiousity, are you using the terms advantage and disadvantage in two different ways? It's from Open Legend. Attributes grant extra die, in that case 4 is 1d20!!+1d10!!. Adv 1 means roll 1d20!!+2d10!!kh1, Adv 2 means roll 1d20!!+3d10!!kh1  - so the roll structure is pick your attribute level to tell it what extra dice to add, say if you want to roll regular or with advantage or disadvantage, and then how much advantage or disadvantage, make sense? Is there an easier way to do it? use & amp; to achieve further levels of nesting I still don't understand this... can you show me an example?
1525203248

Edited 1525208802
GiGs
Pro
Sheet Author
API Scripter
I don't understand it either, I have just seen other people use it. Hopefully someone who knows more will be along soon! (note, I put a space between the & and amp; to avoid the forums processing it into a  &  ) I think if you have a second level of nesting, you need to replace the & in the html entities with & amp; , and repeat for extra nesting. But I haven't done it, so don't quote me on that!
I think if you have a second level of nesting, you need to replace the & in the html entities with & amp; , and repeat for extra nesting. But I haven't done it, so don't quote me on that! That was 100% the problem. I went back and read the documentation 3 times and finally saw what it wanted me to do. Got it sorted! Thank you for the help!
1525204484
The Aaron
Pro
API Scripter
I'm no expert on nested Roll Queries, but but the basic idea is that for each level you go deeper, you must escape one more level.  It goes basically like this: Level 1 (no escape): ?{Question | Answer 1, value1 | Answer 2, value2 } Level 2 (1 escape): ?{Question | Answer 1, value1 | Answer 2, value2 } Level 3 (2 escapes): ?{Question | Answer 1, value1 | Answer 2, value2 } Level 4 (3 escapes): ?{Question | Answer 1, value1 | Answer 2, value2 } ... Then, as each level gets evaluated and replaced by answering it's question, the act of substitution strips away one layer of escaping, until the last one is evaluated and substituted and the expression is completed. Hopefully that helps.