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

Non rolling macro

Hello everyone. First time poster here. I am new to this whole macro thing.  We play Star Trek Adventures. We are are looking to have a macro work as thus: From the token bar you click the macro and it will present a drop down menu for you to choose you attribute, then it will have a second drop down to choose your discipline. the Macro should then ask how many dice you want to roll (2-5d20)  Then it should roll and compare your roll vs the target number of your discipline an attribute added up.  I have been struggling to get the drop down menus to add up and then compare themselves vs each d20 rolled, looking for a success or failure.  Any help would be appreciated. Task Roll ?{D20|  2d20, = [[2d20]]  | 3d20, = [[3d20]]  | 4d20, = [[4d20]] | 5d20, = [[5d20]]  | }< DISCIPLINE ?{Choose Your Discipline?| Command, [[@{command}  ]]  | Security, = [[@{security} ]] | Science, = [[@{science} ]] | Conn, = [[@{conn} ]] |  Engineering, = [[@{engineering} ]] | Medicine, = [[@{medicine} ]] | } + [ATTRIBUTE ?{Choose Your Attribute?| Control, = [[@{control} ]]  | Fitness, = [[@{fitness} ]] | Presence, = [[@{presence} ]] | Daring, = [[@{Daring} ]] | Insight, = [[@{insight} ]] | Reason, = [[@{reason} ]] | } ]]
Attributes cannot be referenced by themselves. You have to call them via token_id, Character_name or ID or by Selected. If you placed the the @{reason} in the chat and sent it, it would give you an error TypeError: Cannot read property 'substring' of undefined. Instead try @{selected|attribute name} (example  @{selected|reason}) Additionally this is not formatted correctly: [ATTRIBUTE ?{Choose Your Attribute?| Control, = [[@{control} ]]  | Fitness, = [[@{fitness} ]] | Presence, = [[@{presence} ]] | Daring, = [[@{Daring} ]] | Insight, = [[@{insight} ]] | Reason, = [[@{reason} ]] | It should start as ATTRIBUTE  ?{Choose Your Attribute?| Control, = [[@{selected|control} ]]  | Fitness, = [[@{selected|fitness} ]] | Presence, = [[@{selected|presence} ]] | Daring, = [[@{selected|Daring} ]] | Insight, = [[@{selected|insight} ]] | Reason, = [[@{selected|reason} ]]} | 
1588644482

Edited 1588644898
Thank you for the response. I was using this from the ability bar. I thought that would make it work without needing the @{selected} I made that correction, but I still cannot get the two stats to add together. it keps giving me the answer of  DISCIPLINE  1  } + {ATTRIBUTE =  10   And that's not correct. 
unfortunately no, the selected needs to be added. You can use this as a reference&nbsp;<a href="https://roll20.zendesk.com/hc/en-us/articles/360037256794#Macros-Examples" rel="nofollow">https://roll20.zendesk.com/hc/en-us/articles/360037256794#Macros-Examples</a>
I have been referencing that. But for some reason the stats will not add together. it is frustrating to follow what the wiki says an not get the expected results.&nbsp;
?{D20|2d20, = [[2d20]]|3d20, = [[3d20]] |4d20, = [[4d20]]|5d20, = [[5d20]]}&lt; DISCIPLINE [[?{Choose Your Discipline?|Command, @{selected|command}|Security, @{selected|security}|Science, @{selected|science}|Conn, = @{selected|conn}|Engineering, @{selected|engineering}|Medicine, @{selected|medicine}} + ATTRIBUTE ?{Choose Your Attribute?|Control, @{selected|control}|Fitness, @{selected|fitness}|Presence, @{selected|presence}|Daring, @{selected|Daring}|Insight, @{selected|insight}|Reason, @{selected|reason}}]] Try that see if it will work. The problem is inline rolls cannot show text and to get two queries to add from attributes you have to hide them in an inline roll.
1588687384

Edited 1588689737
Thank you&nbsp; for helping. I truly appreciate it. I took the code and tinkered with it. It is close. It will do the drop downs correctly, and roll the correct number of dice, and display it all in the chat window. That's a plus. What it is not doing is comparing each die rolled vs the sum of the discipline and attribute, and then displaying that reult. It is close. I'm sure it is something as simple as a comma or something not being in the correct place.&nbsp; Here is what I got [[?{Choose Your Attribute?|Control, @{control}|Fitness, @{fitness}|Presence, @{presence}|Daring, @{Daring}|Insight, @{insight}|Reason, @{reason}}+?{Choose Your Discipline?|Command, @{command}|Security, @{security}|Science, @{science}|Conn, = @{conn}|Engineering, @{engineering}|Medicine, @{medicine} }]]vs[[?{D20|2d20, [[2d20]]|3d20, = [[3d20]] |4d20, = [[4d20]]|5d20, = [[5d20]] | } ]] Thanks again for the help . :-)
No problem. So I did some more research on this issue. I hate to say it but what you are trying to do with that macro really isn't possible&nbsp; without creating an api script.&nbsp; I did some forum searching and found these links. These links have some things created by others that maybe useful for you I would check them out. One of them has roll query but requires an api script. The is also one other api script that might be of use.&nbsp; Hopefully this will help some. <a href="https://app.roll20.net/forum/post/4342309/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/4342309/slug%7D</a> <a href="https://app.roll20.net/forum/post/7166689/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/7166689/slug%7D</a> <a href="https://app.roll20.net/forum/post/4779864/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/4779864/slug%7D</a> <a href="https://app.roll20.net/forum/post/5230986/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/5230986/slug%7D</a> <a href="https://app.roll20.net/forum/post/5322992/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/5322992/slug%7D</a> <a href="https://app.roll20.net/forum/post/4322067/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/4322067/slug%7D</a>