Macro to alter /emit

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
User avatar
Posts: 544
Joined: Mon Jun 28, 2010 12:12 pm
Location: I'm the worm...

Macro to alter /emit

Post by JonathanTheBlack »

I'm trying to create a macro to alter the properties of /emit, and use an input box/dialog to enter the text, but is there a way to use a larger text box other than just one line?

User avatar
Posts: 444
Joined: Sun Jun 15, 2008 2:40 pm
Location: Montréal, QC

Re: Macro to alter /emit

Post by biodude »

Not without using a different approach.
If you use a dialog for input, with a textarea as part of an HTML form, then you can have multi-line input. There are a few examples in the user creations forum. The biggest difference is that dialog doe not interrupt macro execution (unlike the Wiki: input() function), and you have to have a processing macro to which the html form is submitted, that does something with the input. Different model, but you can accomplish much the same thing.

Keep in mind that /emit and other "slash commands" are tricky to use in macros: they have to be the very first thing in a macro, and that macro can not be called by another macro (so the slash command must be the first thing in a macro chain). Otherwise, they won't work.
Unless, you want to 'fake' the emit function, which shouldn't be too hard and probably safer and even more powerful overall.
"The trouble with communicating is believing you have achieved it"
[ d20 StatBlock Importer ] [ Batch Edit Macros ] [ Canned Speech UI ] [ Lib: Math ]

User avatar
Posts: 381
Joined: Fri Dec 18, 2009 2:33 am
Location: San Diego

Re: Macro to alter /emit

Post by Raoden »

biodude wrote:Unless, you want to 'fake' the emit function, which shouldn't be too hard and probably safer and even more powerful overall.

And you can see an example of how to do it if you look at the code for Rumble's Speak For Me tool.
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G. K. Chesterton

Wonderful HTML/CSS reference * Color Manager * Token Manager 2.0

Post Reply

Return to “Macros”