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 .
×

Query into Ability Command Button

&nbsp; &nbsp; I'm trying to set up an ability which queries for a specific ability button, so if needed I can post the text of the ability if I need to remember the specific rules text. Rn I have it written as /me rolls a [[1d20+[[?{Accuracy}+0d6k1]]+5]] to ?{Tech|Fragment Signal, [Fragment Signal](~#Fragment-Signal)|Jam Cockpit, [Jam Cockpit](~#Jam-Cockpit)} Not sure what I've got wrong, it keeps turning up&nbsp; &nbsp;rolls a&nbsp; <span class="inlinerollresult showtip tipsy-n-right" original-title=" Rolling 1d20+0+5 = ( 19 )+0+5" style="box-sizing: content-box; background-color: rgb(254, 246, 142); border: 2px solid rgb(254, 246, 142); padding: 0px 3px; font-weight: 700; cursor: help; font-size: 1.1em; color: rgb(101, 62, 16); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-style: italic; text-align: center;">24 &nbsp;to [Fragment Signal](~-LqUKiDSDzgvTjwkFpVp
1589335371

Edited 1589337139
GiGs
Pro
Sheet Author
API Scripter
Is your purpose here to print the roll, and a button after the roll? It looks like the syntax for your button is not correct. You never use ~ and # together like that. Is the button meant to call a macro or a character ability? And if it's a character ability, is the above code being called from &nbsp;a character ability, or a universal macro? All of these can affect the syntax needed.
1589337120
GiGs
Pro
Sheet Author
API Scripter
Note: if the button launches a character ability, you must always supply the character name. thats because once the button is in chat, it doesnt have a character attached, so you need to tell roll20 what character to get the ability from. But to use a character name, you have to use the | symbol (eg. [Jam Cockpit](~Frodo|Jam-Cockpit)). But you cant use a | in a query without it breaking the query. You have to use a substitution character for the | - and that is &amp;#124; . So for that the code would become: /me rolls a [[1d20+[[?{Accuracy}+0d6k1]]+5]] to ?{Tech|Fragment Signal,[Fragment Signal](~Frodo&amp;#124;Fragment-Signal)|Jam Cockpit, [Jam Cockpit](~Frodo&amp;#124;Jam-Cockpit)} On the other hand, if the buttons are launching macros from your macro collection, you need to use a different substitution character. That would look like this: /me rolls a [[1d20+[[?{Accuracy}+0d6k1]]+5]] to &nbsp; ?{Tech|Fragment Signal,[Fragment Signal](!&amp;#13;#Fragment-Signal)|Jam Cockpit, [Jam Cockpit](!&amp;#13;#Jam-Cockpit)}
1589358363
Oosh
Sheet Author
API Scripter
I think the second one from GiGs is what you want, it looks like you're referencing your own macro collection. As a side note, are you aware that [[1d20+ [[?{Accuracy}+0d6k1]] +5]] The bold bit will just resolve to whatever you input for ?{Accuracy}, 0d6 will always be 0. No idea what rules you're playing but I'm assuming if you have accuracy 3, then you roll 3d6 and keep the highest roll? If so then I think you wanted: [[1d20+ [[?{Accuracy}d6k1]] +5]]
1589358788
GiGs
Pro
Sheet Author
API Scripter
Well spotted. Also, does k1 work? Should it be kh1?
1589360471
Oosh
Sheet Author
API Scripter
Yep, seems to default to kh. I was also unaware of this.