Help with chat commands inside a macro... (updated)

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
darkeness66
Giant
Posts: 124
Joined: Wed Feb 07, 2007 8:55 pm
Location: Fremont, OH

Help with chat commands inside a macro... (updated)

Post by darkeness66 »

Edit: Added the proper BBC codes so you can actually read what I wrote!

I have been tweaking some of my macros and wanted to use the emote (/me) command, but I can't figure out a way and after reading the wiki I am not sure that this is even possible.

Here is some older code I was playing with...

Code: Select all

[h: token= getName()]

[h: ind = getMacroButtonIndex()]
[h: props = getMacroProps(ind)]
[h: SPELL_NAME = getStrProp(props, "label")]
[h:isUsed = if(getStrProp(props, "color") == "gray", 1, 0)]

[r, if(isUsed), code: {[macro("Used Spell@Lib:Darke"):"token ="+token] }; {

[r: token] casts a spell... [gm, s: SPELL_NAME]<br>

<!--- enter spell stats here --->

<!--- This next command creates a link to the spell description page --->
<a href="http://www.d20pfsrd.com/magic/all-spells/f/feather-fall">[gm, s: "Spell Description"]</a> <br>

[h: setMacroProps(ind,"color=gray")]
     
}]
The issue is this line:

Code: Select all

[r: token] casts a spell... [gm, s: SPELL_NAME]<br>
. it would be much cooler to have it as an emote. the chat command would be

Code: Select all

/me casts a spell...
My first thought was to use the eval function, but that will not handle the emotes. All I get are errors no matter what I try.

I have tried putting the emote command in a separate macro called chat and use the macro functions. If you clcik the chat macro you get the result you want. Calling the macro via evalMacro prints out the contents of "chat" to the chat box. execMacro gives the same error as the eval function.

[r: evalMacro(" [macro("chat@this"): ""] ") ]
[r: execMacro(" [macro("chat@this"): ""] ") ]

Suggestions welcome.

Post Reply

Return to “Macros”