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
This post has been closed. You can still view previous posts, but you can't post any new replies.

[API] The ability to send HTML anchor tags that link to api commands

October 07 (10 years ago)
The Aaron
Pro
API Scripter
In the past, people have created fairly complicated user interfaces by adding complicated journal pages in combination with macros on a token to adjust those journal pages dynamically on the fly. This solved the issue of providing a dynamic interface, but was quite cumbersome (not to mention expensive from an API synchronization standpoint).

A fantastic solution to this would be to add the ability to send anchor links to the chat that activate API commands:
sendchat('' '/direct <a href="!apicommand @{target|token_id} [[1d20+3]]">Some Command</a>');
This would allow script writers to create interfaces in the chat for performing various actions, or interacting with some sort of internal system (such as configuring a script, or purchasing things at an in-game store, etc).

(This combine with the /direct for whispers suggestion would be awesome!)
January 11 (10 years ago)
Riley D.
Roll20 Team
This is now on Dev. You can do it basically exactly how you suggested. When you're not using /direct, use Markdown like so:

[Some Command](!apicommand ...)
January 12 (10 years ago)
The Aaron
Pro
API Scripter
Awesome!!
January 12 (10 years ago)
vÍnce
Pro
Sheet Author
Yay! I've got more votes... I mean, I can't wait to see this implemented in Aaron's scripts. :-)
January 12 (10 years ago)
The Aaron
Pro
API Scripter
1st part of the year is pretty busy, might have to give me a few days... =D
January 25 (10 years ago)
Can someone explain anchor links in this context? I'm assuming it to mean something you can click on to cause a script to run, thus if there's multiple links allowing the clicker to chose from these actions... But I can't really imagine how that would work.

Does that have anything to do with allowing prompts like ?{Question|default answer} to be used in api or in interaction with api?
January 25 (10 years ago)
The Aaron
Pro
API Scripter
It's the idea that you would present a better user interface in the chat by having buttons that trigger things you might otherwise need to type a comnand for. I can think of lots of really great complicated uses I hope to put them to, but an easy example would be toggling config options via the help for a script. Currently, my TurnMarker script's help tells you if announce rounds is on or off, ditto for announce players, ditto for announce player names. There are commands for changing that, something like !tm toggle-round-announce. With the API buttons:
  • The help could have a button next to each setting that you can click to change it.
  • The turn announce could have a button that runs !eot to end the turn.
  • The round count could be clickable to reset the round counter.
There's lots of other uses.
  • Spell output could have a button to apply effects to a target.
  • Effects notices on your turn could have a save button on them.
  • You could write an entire text based chose your own adventure like Zork and have each exit or option be a button!
Sky's the limit. :)
March 10 (10 years ago)
Riley D.
Roll20 Team
This is live in the Update of Holding today!
March 10 (10 years ago)
The Aaron
Pro
API Scripter
And it's AWESOME!!!! =D