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

Generic macro to roll npc various attacks

Hello, i'm trying to make a global macro to roll npc attacks: if i want to make a global macro to roll the first npc attack it would be something like this %{selected|repeating_npcaction_$0_npc_action} Now, what if i want to have all of them in a drop down menu? is it even possible? i've tryed this but it won't work (i assume because of order of ops and characters) i tryed to sub chars with html but it wont work, any ideas? ?{Attack|Attack1, %{selected|repeating_npcaction_$0_npc_action}}
1547401009
GiGs
Pro
Sheet Author
API Scripter
unfortunatly if you want to make a dropdown containing macros, you have to copy the full text of each macro into the dropdown, and then you can error check to find out which html replacements you need to do. A much easier alternative is to have a macro that whispers a chat button menu to you.
1547403091

Edited 1547404150
i didn't even realize that this %{selected|repeating_npcaction_$0_npc_action} was a macro, what text should i replace this with to make it work in a dropdown? If it's not clear, the point of this is to click on a token and use this macro to view all it's actions in a dropdown instead of opening the sheet also, for some more troubleshooting, i'm using this code now: ?{Attack|@{selected|repeating_npcaction_$0_name}, %{selected|repeating_npcaction_$0_npc_action}} wich is a drop down with 1 item but it's just for testing pourpouse: the firs variable (the one with @) resolves fine and gives me the name of the first npc action in the drop down, the second part is the problem if i replace the | (the one in the % part) with html code i get the error "TypeError: l is undefined" Replacing the % just outputs text Replacing the $ does nothing It seems to me that the problem is that the dropdown thinks that the | is a new element in the list but i don't know how to solve that
1547406264
GiGs
Pro
Sheet Author
API Scripter
This %{selected|repeating_npcaction_$0_npc_action} is a macro - it is a pointer to the text that is in the attribute  repeating_npcaction_$0_npc_action on your character sheet. You need to extract that text and plug it into the dropdown you are trying to create. I can't really help you tehre, because html replacements are a pain. As I mentioned, you are better off using a chat menu, and you will be able to use this  repeating_npcaction_$0_npc_action without having to extract the text.