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

Pink Box Macro to output a text without using another macro

Dear community, I would like to make a pink box macro that output some text in a NPC-template, WITHOUT creating another macro and using only text. Usually one can use the macro [ability check](~something) to call "repeating actions" or other macros on the character sheet, but is it possible to make some text clickable, and when clicked then it will make following output: @{selected|wtype}&{template:npcaction} {{name=@{selected|npc_name}}} {{rname=Counterspell}} {{description=*Ability:* [[1d20+@{selected|intelligence_mod}[SPELL]]]}}
1608156800
Jordan C.
Pro
API Scripter
I tried tinkering but I can't seem to find a combination of escapes or other method of getting it to work. I'd be curious to know why a macro isn't an option since that's essentially it's entire purpose but if there's a reason it can't be I, or others, might be able to help find a different solution. There's also a bunch of macro masters that might be able to solve this. 
I am trying to make "Monster template" which can be duplicated, but I would prefer not having multiple macros for 1 token action (at the moment I need 1 macro for the macro, and then another macro create to make the "pink box to call from".
1608158101
Jordan C.
Pro
API Scripter
If I am understanding correctly (forgive me if I'm not) this should do what your asking for: One Macro: One Token Action: Clicking the action results in a pink button in chat which when clicked gives the macro result:
I see what you did, well done. :-) I believe the same can be obtained by creating 2 abitlies on the character sheet, calling the macro from the sheet rather the Collection tab. I don't think it's possible, but I would love just having 1 macro with "all the coding" in it without using API.
1608164268
Jordan C.
Pro
API Scripter
I could be wrong, but I believe this comes down to the colon in the "template:npcaction" section. I had this exact problem when trying to turn a handout URL into a chat that formatted with templates. I have tried a bunch of different escapes for it with no luck, but I believe this is the same obstacle for your scenario.
1608165173
Jordan C.
Pro
API Scripter
So wait, this is the closest I have gotten, the only caveat is it loses formatting for the die roll: [Button](!@{selected|wtype}
#&{template:npcaction} {{name=@{selected|npc_name}}} {{rname=Counterspell}} {{description=*Ability:* [[ [[1d20+@{selected|intelligence_mod}[SPELL] ]] ]] }}) There is an additional "#" in front of "&" with allows the colon to be read correctly. So I go to here: Less than ideal, so I added extra brackets which gets us here (Loss of formatting for red text on fails and green text on crit successes):
1608175094

Edited 1608175442
Oosh
Sheet Author
API Scripter
You should be able to fix that by escaping the squackets, to stop it from trying to process the roll when it creates the button: [Button](!@{selected|wtype}
#&{template:npcaction} {{name=@{selected|npc_name}}} {{rname=Counterspell}} {{description=*Ability:* [[1d20+@{selected|intelligence_mod}[SPELL] ]] }}) Interesting... changing the syntax at the start, you can get a working button with no styling on it: [Button](`#@{selected|wtype} &{template:npcaction} {{name=@{selected|npc_name}}} {{rname=Counterspell}} {{description=*Ability:* [[1d20+@{selected|intelligence_mod}[SPELL] ]]}})
Very good Jordan C and Oosh. Now, here's a curveball: This is the basic spell template for Counterspell: @{selected|wtype}&{template:spell} {{level=abjuration 3}} {{name=Counterspell}} {{castingtime=1 reaction, which you take when you see a creature within 60 feet of you casting a spell}} {{range=60 feet}} {{target=A creature in the process of casting a spell}} 0 {{s=1}} 0 {{material=}} {{duration=Instantaneous}} {{description=You attempt to interrupt a creature in the process of casting a spell. If the creature is casting a spell of 3rd level or lower, its spell fails and has no effect. If it is casting a spell of 4th level or higher, make an ability check using your spellcasting ability. The DC equals 10 + the spell’s level. On a success, the creature’s spell fails and has no effect. At Higher Levels. When you cast this spell using a spell slot of 4th level or higher, the interrupted spell has no effect if its level is less than or equal to the level of the spell slot you used.}} {{athigherlevels=}} 0 {{innate=}} 0 @{selected|charname_output} I want to target some text in the description, let's say the "make an ability check" should become the pink box. When the macros above is put into the macro it breaks the (template:spell) and it breaks the macro itself. I have tried replacing with more ]] but without success.
1608200287

Edited 1608200612
Oosh
Sheet Author
API Scripter
Yep, you're in the middle of a template there. The }} braces in the button command end the description box you just pasted it into. You then overwrite it with the {{description=}} property that's inside the button command - that's why the actual spell description has vanished. Those braces will all need to be escaped with } or } so they don't interfere with the spell template being put together. You can escape pretty much any HTML in a button command - it doesn't matter if it isn't parsed the first time (even Abilities and Attributes, which you normally don't escape) since none of it is relevant until the button is clicked. The exceptions would be when you're using a roll result or Query to direct the command to the right macro. So yeah - I'd blanket replace-all the { and } , don't even bother avoiding the Attributes.
Oosh, the wizard of macros! I succeeded with changing the { and }, here is the final code: @{selected|wtype}&{template:spell} {{level=abjuration 3}} {{name=Counterspell}} {{castingtime=1 reaction, which you take when you see a creature within 60 feet of you casting a spell}} {{range=60 feet}} {{target=A creature in the process of casting a spell}} 0 {{s=1}} 0 {{material=}} {{duration=Instantaneous}} {{description=You attempt to interrupt a creature in the process of casting a spell. If the creature is casting a spell of 3rd level or lower, its spell fails and has no effect. If it is casting a spell of 4th level or higher, make an [ability check](!@{selected|wtype}}
#&{template:npcaction}} {{name=@{selected|npc_name}}} {{rname=Counterspell}} {{description=*Ability:* [[1d20+@{selected|intelligence_mod}[SPELL] ]] }}) using your spellcasting ability. The DC equals 10 + the spell’s level. On a success, the creature’s spell fails and has no effect. At Higher Levels. When you cast this spell using a spell slot of 4th level or higher, the interrupted spell has no effect if its level is less than or equal to the level of the spell slot you used.}} {{athigherlevels=}} 0 {{innate=}} 0 @{selected|charname_output} I have tested the macro on multiple NPCs and one error continuesly occur. It doesn't matter, whether the NPC sheet is set to 'Never whisper rolls' or 'Always whisper rolls', when I click the pink box it will not follow the selected tokens whisper-preferences and always be visible for everyone in chat. Can you fix this?
1608208429
Jordan C.
Pro
API Scripter
Rasmus said: Oosh, the wizard of macros! I succeeded with changing the { and }, here is the final code: @{selected|wtype}&{template:spell} {{level=abjuration 3}} {{name=Counterspell}} {{castingtime=1 reaction, which you take when you see a creature within 60 feet of you casting a spell}} {{range=60 feet}} {{target=A creature in the process of casting a spell}} 0 {{s=1}} 0 {{material=}} {{duration=Instantaneous}} {{description=You attempt to interrupt a creature in the process of casting a spell. If the creature is casting a spell of 3rd level or lower, its spell fails and has no effect. If it is casting a spell of 4th level or higher, make an [ability check](!@{selected|wtype}}
#&{template:npcaction}} {{name=@{selected|npc_name}}} {{rname=Counterspell}} {{description=*Ability:* [[1d20+@{selected|intelligence_mod}[SPELL] ]] }}) using your spellcasting ability. The DC equals 10 + the spell’s level. On a success, the creature’s spell fails and has no effect. At Higher Levels. When you cast this spell using a spell slot of 4th level or higher, the interrupted spell has no effect if its level is less than or equal to the level of the spell slot you used.}} {{athigherlevels=}} 0 {{innate=}} 0 @{selected|charname_output} I have tested the macro on multiple NPCs and one error continuesly occur. It doesn't matter, whether the NPC sheet is set to 'Never whisper rolls' or 'Always whisper rolls', when I click the pink box it will not follow the selected tokens whisper-preferences and always be visible for everyone in chat. Can you fix this? Sorry thats on my, the whisper type needs to go after the "
": @{selected|wtype}&{template:spell} {{level=abjuration 3}} {{name=Counterspell}} {{castingtime=1 reaction, which you take when you see a creature within 60 feet of you casting a spell}} {{range=60 feet}} {{target=A creature in the process of casting a spell}} 0 {{s=1}} 0 {{material=}} {{duration=Instantaneous}} {{description=You attempt to interrupt a creature in the process of casting a spell. If the creature is casting a spell of 3rd level or lower, its spell fails and has no effect. If it is casting a spell of 4th level or higher, make an [ability check](!
@{selected|wtype}#&{template:npcaction}} {{name=@{selected|npc_name}}} {{rname=Counterspell}} {{description=*Ability:* [[1d20+@{selected|intelligence_mod}[SPELL] ]] }}) using your spellcasting ability. The DC equals 10 + the spell’s level. On a success, the creature’s spell fails and has no effect. At Higher Levels. When you cast this spell using a spell slot of 4th level or higher, the interrupted spell has no effect if its level is less than or equal to the level of the spell slot you used.}} {{athigherlevels=}} 0 {{innate=}} 0 @{selected|charname_output} I don't know how to keep the whisper type and lose the button formatting like the example below but that is a huge discovery Oosh!! Nice find: Interesting... changing the syntax at the start, you can get a working button with no styling on it: [Button](`#@{selected|wtype} &{template:npcaction} {{name=@{selected|npc_name}}} {{rname=Counterspell}} {{description=*Ability:* [[1d20+@{selected|intelligence_mod}[SPELL] ]]}})