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

Macro acts differently when called via chat button v when called via 'test macro'

1598731761

Edited 1598731786
I am using macros and !token--mod to apply status markers and place informational text into the chat. I did not make these, but found them on the forums on Roll20. Something odd is happening. When I activate the macro via the buttons in chat made by the master macro 'Conditions' it doesn't seem to use the first line of the called macro 'y-Condition-Blessed' and so the text otherwise generated by the command '@{selected|token_name} is Blessed!' is not generated. But when I use the Test Macro button in the called macro 'y-Condition-Blessed' then it does, producing the text in my example of 'Corumin Belfer is Blessed!'. (The token doesn't have the blessed mark because in the screenshot I had run the y-Condition-Blessed' macro twice, once via chat button, once via Test Macro and the second run had toggled the status marker off again. I searched and could not find why this is happening. I would like to use the chat buttons, but have the text about which token was affected included in the chat if possible.
1598735355
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You need the html code for a return 
 in between the ! and the #. Right now, the macro expands and your first line has a ! in front of it, making it an invisible API command. Alternatively, you can just put a blank line at the beginning of each child macro. Because of html substitutions, your base macro will become difficult to work with, though. The HTML will parse on a close and save, turning  !
# into  ! 
 # I would strongly, strongly suggest writing  Chat Menus  using  Macro Character Sheets . The syntax is much simpler, and you need no html entities. Those two posts will explain these benefits and more.
Thank you!!
keithcurtis said: You need the html code for a return 
 in between the ! and the #. Right now, the macro expands and your first line has a ! in front of it, making it an invisible API command. Alternatively, you can just put a blank line at the beginning of each child macro. Because of html substitutions, your base macro will become difficult to work with, though. The HTML will parse on a close and save, turning  !
# into  ! 
 # I would strongly, strongly suggest writing  Chat Menus  using  Macro Character Sheets . The syntax is much simpler, and you need no html entities. Those two posts will explain these benefits and more. Just wanted to say how much I appreciate you sharing this trick with me - porting macros between games is now a breeze! Thank you!