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

Drop-down spell casting macro.

1482382035

Edited 1482382730
So, I'm controlling two characters in the same game, (1xSorcerer and 1xWarlock) as you can imagine, my macro bar is already quite full and opening and closing my character sheet each round chews time. I have a drop down attribute macro, but I'd like one for spellcasting, just to initiate the command, not the entire spell. How can I go about this? I'm not very intuitive with the language the macro's use and the community seems a good place to start. Please don't refer me to anything that uses the API, I only have the free account for now.
1482382987
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
If you're calling sheet generated abilities (aka roll buttons) you can't use roll queries as you can't modify the macros to use html replacements for advanced roll queries unless you remake every ability. I'd recommend using ability command buttons to make a menu that is whispered to you to select what you want to do by a button click in the chat pane. advanced roll query wiki:&nbsp;<a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a> ability command button wiki:&nbsp;<a href="https://wiki.roll20.net/Macros#Ability_Command_Buttons" rel="nofollow">https://wiki.roll20.net/Macros#Ability_Command_Buttons</a>
I'm reading through it all and it reads like Dutch to me. Can I ask you to post a small example?
1483588856

Edited 1483588886
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Sure, it'll be tomorrow night tho, as I'm just heading to bed. That is if one of the other inveterate forum checker addicts doesn't get to it first.
If ok can I also get a copy of this info, been reading the other and got one to work, I just need a nest inside a nest. it has 4 drop downs and se\/eral items inside of it.&nbsp;
oh and one part Daniel H, make the macros token actions, that way you ha\/e to click the token that it is to.
1483663849
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ok, so now that I'm at home and on my computer here's a brief example of nesting drop-down queries and chat command buttons. Let's get the hard one out of the way first; roll query example: ?{top level query| Option 1, Does thing x + ?{2nd level query&amp;#124; 2nd level option 1&amp;#44;@{selected|attack-1} [[1d8 + @{selected|STR}]]&amp;#124; 2nd level option 2&amp;#44;@{selected|attack-2} [[1d10 + @{selected|STR}]] &amp;#125; | Option 2, Does thing y + ?{2nd level query2&amp;#124; 2nd level 2 option 1&amp;#44;2nd level 2 value1&amp;#124; 2nd level 2 option 2&amp;#44;2nd level 2 value2&amp;#125; } You need to replace the three problem characters; bars (|), commas (,), and end curly braces (}) with their html code &amp;124;, &amp;#44;, and &amp;#125;. The reason you need to replace these is because the query ends at the first end curly brace it sees, separates between an option name and its value at each comma it sees, and separates between choices at each bar it sees. The exception to needing to replace these characters is attribute and ability calls * . NEVER replace these characters if they are part of an attribute or ability call because of the&nbsp; order of operations * &nbsp;that the dice roller/chat parser uses. First abilities and attributes are expanded up to 99 levels deep, then roll queries are executed to 99 levels of nesting. This means that by the time the roll query exectues, those attribute/ability calls are no longer @{keyword|attributeName} or %{keyword|abilityname}, they are whatever text is contained within the ability/attribute. The further down you nest, the more you need to escape the problem characters (generally by replacing the & in the html code with &amp;amp;, this is also how you get the forums to properly display html code). *Note on ability calls:&nbsp; note that many abilities, especially sheet generated ones, have these characters inside them so generally don't put an ability call in a roll query unless it's something basic you created *Note on order of operations: &nbsp;There is currently an error in the wiki. The wiki states that attribute/ability calls and roll queries are recursed through simultaneously. This is not in fact the case; attributes/abilities are recursed through up to 99 times and then roll queries are recursed through up to 99 times. Now for ability command buttons. These are really simple and will take about 1/8th as much to explain. So, normally when you call an ability, like a sheet roll button that you want to access via token button, you would simply put %{CharacterName|ability name}, %{selected|ability name}, or %{target|ability name}&nbsp;in a new ability on your character's attributes/abilities tab or perhaps in a global macro. To make an ability command button, you simply modify that syntax a little and merge it with a mardown link type syntax: [Button Label](~CharacterName|ability name) And that's it. I don't know which sheet you are using, but if you are using the 5e OGL sheet, you might find&nbsp; this thread useful for creating a spellbook macro for each character. If you are using the 5e shaped sheet, it has pregenerated spellbooks available (see that sheet's documentation for more info). If you are using the community sheet, you'll have to make your own. Hope that helps, Scott
I wish there were upvotes for all the great advice I have been reading on here. Great job helping everyone out Scott!
1483730145
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I should note that my "never replace characters in calls" was a little extreme. There is one exception; if you nest a command button in a query, you will need to html replace characters in the button address section. and thanks Professor.
1484281439

Edited 1484282627
Thanks. My response is a little delayed, sorry about that. i haven't had much time to review it and try and get it to work as of yet. Greatly appreciated though. ::EDIT:: What I'm going for is to turn this section in to what you were talking about when you said; "I'd recommend using ability command buttons to make a menu that is whispered to you to select what you want to do by a button click in the chat pane.".
1484282656
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Np, post back with any questions you've got