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

Applying a macro to text chat

1557151582

Edited 1557151635
Is there some way to apply a macro to any given text that you put into the chatbox?  For example, if I wrote: #oneliner "Never should have come here" The result would be something like: Ahnuld raises his axe and says in a whiny voice "Never should have come here" before swinging it down for 5 damage. What my personal end goal would be is a macro #OOC I can enter that applies a highlight or some kind of text effect to more easily distinguish between a player talking in and out of character.
1557153174
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You could use a query. The code for #one-liner would be: Ahnuld raises his axe and says in a whiny voice "?{One-liner|Never should have come here}" before swinging it down for 5 damage. When you run the macro, it will prompt you for the quip and insert it accordingly, but default to "Never should have come here".
1557154162

Edited 1557154211
Hm, it works but I'm not a big fan of making a one-step process into two steps, particularly if one of those steps involves a teeny tiny text box to type in.  Is there no way to directly reference the text box itself in the macro?
1557154864

Edited 1557155271
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
This would be in essence passing a variable to a macro, and is not strictly possible. You could use a rollable table (which would incidentally give you highlighting of the variable result), but no control over what is said. The two step process actually results in only one extra key press (a return) to trigger; you still type the macro name and the quip. As for the size of the edit box, there are workarounds for that . Finally, for the text formatting, check out chat commands  on the wiki for emotes or out-of-character commands. /em takes out a pencil and brandishes it threateningly. keithcurtis' character takes out a pencil and brandishes it threateningly. /ooc I could really use another coffee right now. keithcurtis:  I could really use another Red Bull right now.
Unfortunately those still have issues, /ooc gives no easy visible distinction between in and out of character and while /em *does* give a visible distinction, you'd have to actually read the line to tell if it's being used as a character action or someone saying they need to use the bathroom.  I guess I'll have to settle for the text box, since Roll20 doesn't seem to support what I'm trying to get.
1557164784
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You could also use markup *italics* and **bold**, if that helps any. There are scripts that could handle the formatting, such as powercards, but that would require a subscription.
1557170059
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
For the /ooc, it works best if you set your speaking as to your character, then when you use /ooc the avatar next to the message is different.
1557177979
The Aaron
Roll20 Production Team
API Scripter
You could make something that stands out with the default Roll Template, but not without some extra closing bits: &{template:default}{{name= I could really use another coffee right now. }} Any of this is trivial with the API, but that requires a game whose creator is an active Pro subscriber.