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

Need Help for Macro to put Charakters stats in the chat /w to gm

1618216074

Edited 1618217340
Hi, I want to make a Macro to get simple information from stats to the chosen Token. My problem is that if there is no text in the field, there will be a error. For Example, the note by CMD ilike to have the text +4 to trip, but if there is no note there comes the error. Wolf funktion, normal Charakter not. The same is at Attribute, Example a Ghost has no Strenght, so there is the error.. So I need a text that says show if there is anything, if not no... Can you give me an Advice who I can write this? Thanks a lot , Volker P.S. Maybe you know also a nice way to show^^. /w gm &{template:default} {{name=@{Selected|Token_Name}}} {{RK=[[@{Selected|ac}]]}} {{Touch=[[@{Selected|ac_touch}]]}} {{Flatfooded=[[@{Selected|ac_flatfooted}]]}} {{KMV=[[@{Selected|cmd_mod}]]}}  {{Initiative Bonus=[[@{Selected|initiative}]]}}  {{Zauberresistenz=[[@{Selected|sr}]]}}  {{Bewegung=[[@{Selected|speed}]]}} {{Stärke=[[@{Selected|strength}]]}} {{Geschicklichkeit=[[@{Selected|dexterity}]]}} {{Konstitution= [[@{Selected|constitution}]]}} {{Intelligenz=[[@{Selected|intelligence}]]}} {{Weisheit=[[@{Selected|wisdom}]]}} {{Charisma=[[@{Selected|charisma}]]}} Plus I used:    {{KMV vs. =[[@{Selected|cmd_notes}]]}}
Supressing error messages on the Wiki Alternatively, there's a difference between having no Strength score, and having a Strength score of "-".
1618221580
Ziechael
Forum Champion
Sheet Author
API Scripter
You can prefix numerical attribute calls with a 0 and wrap them in inlines to protect against null errors, adding &{noerror} to the macro also prevents chat messages for missing attributes: /w gm &{template:default} {{name=@{Selected|Token_Name}}} {{RK=[[ 0 @{Selected|ac}]]}} {{Touch=[[ 0 @{Selected|ac_touch}]]}} {{Flatfooded=[[ 0 @{Selected|ac_flatfooted}]]}} {{KMV=[[ 0 @{Selected|cmd_mod}]]}}  {{Initiative Bonus=[[ 0 @{Selected|initiative}]]}}  {{Zauberresistenz=[[ 0 @{Selected|sr}]]}}  {{Bewegung=[[ 0 @{Selected|speed}]]}} {{Stärke=[[ 0 @{Selected|strength}]]}} {{Geschicklichkeit=[[ 0 @{Selected|dexterity}]]}} {{Konstitution= [[ 0 @{Selected|constitution}]]}} {{Intelligenz=[[ 0 @{Selected|intelligence}]]}} {{Weisheit=[[ 0 @{Selected|wisdom}]]}} {{Charisma=[[ 0 @{Selected|charisma}]] &{noerror} }}
Ziechael said: You can prefix numerical attribute calls with a 0 and wrap them in inlines to protect against null errors, adding &{noerror} to the macro also prevents chat messages for missing attributes: /w gm &{template:default} {{name=@{Selected|Token_Name}}} {{RK=[[ 0 @{Selected|ac}]]}} {{Touch=[[ 0 @{Selected|ac_touch}]]}} {{Flatfooded=[[ 0 @{Selected|ac_flatfooted}]]}} {{KMV=[[ 0 @{Selected|cmd_mod}]]}}  {{Initiative Bonus=[[ 0 @{Selected|initiative}]]}}  {{Zauberresistenz=[[ 0 @{Selected|sr}]]}}  {{Bewegung=[[ 0 @{Selected|speed}]]}} {{Stärke=[[ 0 @{Selected|strength}]]}} {{Geschicklichkeit=[[ 0 @{Selected|dexterity}]]}} {{Konstitution= [[ 0 @{Selected|constitution}]]}} {{Intelligenz=[[ 0 @{Selected|intelligence}]]}} {{Weisheit=[[ 0 @{Selected|wisdom}]]}} {{Charisma=[[ 0 @{Selected|charisma}]] &{noerror} }} Perfect, thats works perfectly. Thank so much...^^ Best wishes Volker