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

Chat buttons to macros

So with the latest update I can make chat buttons to "API ! commands"?, but is it possible to make a chat button to a macro I have created? Example: [Attack](#attack_1) where #attack_1 is a macro with /r 1d20+?{mod|0
1427367621
Ziechael
Forum Champion
Sheet Author
API Scripter
No, i'm afraid that buttons only work for triggering API commands. (wasn't 100% but just tested your theory and it failed to do anything of use...)
Thats a shame, it would have been a great way of reducing command button spam, and present the right options for a given situation.
You know since you are are a mentor, you could create a simple API command that atakes the marco name as a parameter. When that API is called, it basically just uses sendChat() to call the macro. Something like the following on("chat:message", function(msg) { var msgTxt = msg.content; var cmd = msgTxt.split(/\s+/); var lcmd = cmd[0]; log(cmd); if(lcmd=="!apimacro"){ var mycmd = msg.content.replace("!apimacro ",''); sendChat(msg.who,mycmd); //sendChat(msg.who,"#test"); } }); Then in the chat window you could the following. [Attack](!apimacro #attack_1)
no xp with api. my mentor status is only for support and curiosity. But thanks for the script, will see if I can get it working. Been stalking the forums a lot, and I must say that its a very nice community. Thanks Jeff B.
No problem. Note that that script is very "RAW". It needs some error checking.