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 .
×
D&D 2024 has arrived! Pre-Order the new core rulebooks now.
Create a free account

API Command Button in Chat

1426442374

Edited 1426442411
In the newest update there was this item: API: API Command Buttons in Text Chat You can also take advantage of the new text chat formatting (in both your API-generated messages and those generated by macros and abilities) to create "API command buttons" in the chat. Here's an example of what that looks like: To do so using Markdown formatting: [Attack Roll](!attackroll) Where the part in the brackets will show up in the button, and part in the parentheses is the command to be executed. You can include anything in a normal roll (macros, abilities, queries, etc.), but keep in mind that the command itself will be executed by the player who clicks on it -- so for example don't include @{Character|AC} if everyone who can see the message can't access that Character. In that case, include the actual value as it existed when you sent the command by filling it in yourself before you send the chat message. These buttons work in general messages, whispers, etc. Note that if you use /direct to send a message, we won't do any Markdown parsing on it, so you need to include your own <a> tags. Here's an example of that: <a href="!attackroll">Attack Roll</a> I am very new to doing much with API scripts, mostly my experience is inserting them into my games, tweaking them a little here and there for what I need. When I read this, I thought it would be very interesting to, instead of simply saying to a player, "Hey, roll 5d10 dice..." To be able to say "Make a Perception Check" with the "Perception Check" being the button to click and it rolls the dice. However, when I attempt this, with the chat command below, when the button created is pressed, it takes the person clicking it out of roll20, to a page that does not exist. Chat command used: [Perception Check](/roll 5d10>7) Has anyone tinkered with this, and perhaps give me some pointers on what I am doing wrong, if this is possible to do, and the best commands to use to do it? Thank you :)
It's for doing API commands, not dice rolls. API commands start with an exclamation mark and trigger a script.
1426443413
The Aaron
Pro
API Scripter
The problem you're running into is that they are designed for api commands (!foo, !bar), not chat commands (/roll /em ). There may be some hackery you could do to get it to work, but it would be unsupported.
It does say that it can be used with Macros, do you think I could create a macro that would utilize this API button?
1426444395
The Aaron
Pro
API Scripter
It means that you can creat macros that present api buttons: /em considers lighting options... [Torch light](!torch 60 30 on) [Darkvision](!torch 60 0 off)